// Path: src/java/VRE.Vridge.API/VRE.Vridge.API.Client/src/main/java/com/riftcat/vridge/api/client/java/codes/ControllerStateRequestCodes.java
// public class ControllerStateRequestCodes {
//     public static int Disconnect = 255;
//     public static int SendFullState = 1;
//     public static int RecenterHead = 2;
// 
//     public static int Origin_Zero = 0;
// 
// }


import com.riftcat.vridge.api.client.java.codes.ControllerStateRequestCodes;
import com.riftcat.vridge.api.client.java.proto.ControllerStateRequest;
import com.riftcat.vridge.api.client.java.proto.ControllerStateResponse;
import com.riftcat.vridge.api.client.java.proto.HandType;
import com.riftcat.vridge.api.client.java.proto.VRController;
import com.riftcat.vridge.api.client.java.proto.VRControllerAxis_t;
import com.riftcat.vridge.api.client.java.proto.VRControllerState_t;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.LinkedList;
import java.util.List;
import java.util.concurrent.TimeoutException;

        ControllerStateRequest request = ControllerStateRequest.newBuilder()
                .setTaskType(ControllerStateRequestCodes.SendFullState)
                .setControllerState(controllerState)
                .build();

        sendMessage(request);
    }

    /** Recenter head tracking. Works the same as pressing recenter hotkey as configured in VRidge settings. */
    public void recenterHead() throws TimeoutException{
        ControllerStateRequest request = ControllerStateRequest
                .newBuilder()
                .setVersion(CurrentVersion)
                .setTaskType(ControllerStateRequestCodes.RecenterHead)
                .build();
        sendMessage(request);
    }

    /**
     * Disconnected from controller API and frees the API for other clients.
     */
    public void disconnect(){
        ControllerStateRequest disconnectRequest = ControllerStateRequest
                .newBuilder()
                .setVersion(CurrentVersion)
                .setTaskType(ControllerStateRequestCodes.Disconnect)
                .build();

        try{
// Path: src/java/VRE.Vridge.API/VRE.Vridge.API.Client/src/main/java/com/riftcat/vridge/api/client/java/codes/ControllerStateRequestCodes.java
// public class ControllerStateRequestCodes {
//     public static int Disconnect = 255;
//     public static int SendFullState = 1;
//     public static int RecenterHead = 2;
// 
//     public static int Origin_Zero = 0;
// 
// }


// Path: src/java/VRE.Vridge.API/VRE.Vridge.API.Client/src/main/java/com/riftcat/vridge/api/client/java/proxy/ControllerProxy.java
import com.riftcat.vridge.api.client.java.codes.ControllerStateRequestCodes;
import com.riftcat.vridge.api.client.java.proto.ControllerStateRequest;
import com.riftcat.vridge.api.client.java.proto.ControllerStateResponse;
import com.riftcat.vridge.api.client.java.proto.HandType;
import com.riftcat.vridge.api.client.java.proto.VRController;
import com.riftcat.vridge.api.client.java.proto.VRControllerAxis_t;
import com.riftcat.vridge.api.client.java.proto.VRControllerState_t;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.LinkedList;
import java.util.List;
import java.util.concurrent.TimeoutException;


        ControllerStateRequest request = ControllerStateRequest.newBuilder()
                .setTaskType(ControllerStateRequestCodes.SendFullState)
                .setControllerState(controllerState)
                .build();

        sendMessage(request);
    }

    /** Recenter head tracking. Works the same as pressing recenter hotkey as configured in VRidge settings. */
    public void recenterHead() throws TimeoutException{
        ControllerStateRequest request = ControllerStateRequest
                .newBuilder()
                .setVersion(CurrentVersion)
                .setTaskType(ControllerStateRequestCodes.RecenterHead)
                .build();
        sendMessage(request);
    }

    /**
     * Disconnected from controller API and frees the API for other clients.
     */
    public void disconnect(){
        ControllerStateRequest disconnectRequest = ControllerStateRequest
                .newBuilder()
                .setVersion(CurrentVersion)
                .setTaskType(ControllerStateRequestCodes.Disconnect)
                .build();

        try{
            sendMessage(disconnectRequest);