Provided below are sample codes to send the setFeature command to Vive Tracker. Note that
you need to reference the correct API in your system to implement the USB setFeature
command.
Visual Studio:
buffer[0] = 0xB3;
buffer[1] = 0x03; // Length
buffer[2] = 0x03; // 1: PC, 2: Phone, 3: Accessory
buffer[3] = 0x01;
buffer[4] = 0x00;
if (!HidD_SetFeature(m_hDevice, buffer, sizeof(buffer))) {
AfxMessageBox(L"Error: Failed to set feature.");
}
JAVA:
// Take 0xB3 command for example
data1[0] = (byte) 179; //0xB3
data1[1] = 3; //Means there are 3 bytes follow
data1[2] = 3; //Host Type: ACCESSORY
data1[3] = 1; //Reserved
data1[4] = 1; //Reserved
int result = mDeviceConn.controlTransfer(0x21, 0x09, 0x0300, 2, data1, data1.length, 0);
Vive Tracker
HTC Corporation
Developer Guidelines
07/17/2017
Ver. 1.5
28
HTC Confidential and Proprietary