VIVE Tracker (3.0)
HTC Corporation
Developer Guidelines
V1.0
12/16/2020
23
HTC Confidential and Proprietary
Byte Index
Data
Remark
2
Pad X value
Pad X value, value from -32768 to 32767
BYTE 2 is LSB
3
4
Pad Y value
Pad Y value, value from -32768 to 32767
BYTE 4 is LSB
5
6
Trigger Raw
Trigger Raw, value from 0 to 65535
BYTE 6 is LSB
7
8
Battery Level
Battery Level, Reserved
BYTE 8 is LSB
9
Table: Data Format, Accessory to VIVE Tracker (3.0
)
Below are sample code to send the setFeature command to VIVE Tracker (3.0). However, you
need to reference your system to have the correct API to send the USB setFeature command.
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.");
}
// 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);