18#define VIVE_CONTROLLER_BUTTON_REPORT_ID 0x01
20#define VIVE_CONTROLLER_USB_BUTTON_TRIGGER (1 << 0)
21#define VIVE_CONTROLLER_USB_BUTTON_GRIP (1 << 2)
22#define VIVE_CONTROLLER_USB_BUTTON_MENU (1 << 12)
23#define VIVE_CONTROLLER_USB_BUTTON_SYSTEM (1 << 13)
24#define VIVE_CONTROLLER_USB_BUTTON_THUMB (1 << 18)
25#define VIVE_CONTROLLER_USB_BUTTON_TOUCH (1 << 20)
36 uint16_t battery_voltage;
43 uint16_t trigger_hires;
47 uint8_t maybe_bitfield;
49} __attribute__((packed));
54} __attribute__((packed));
59} __attribute__((packed));
64} __attribute__((packed));
69} __attribute__((packed));
71#define VIVE_IMU_RANGE_MODES_REPORT_ID 0x01
79} __attribute__((packed));
81#define VIVE_MAINBOARD_STATUS_REPORT_ID 0x03
88 uint16_t lens_separation;
93 uint8_t proximity_change;
97 uint8_t reserved4[46];
98} __attribute__((packed));
100#define VIVE_HEADSET_POWER_REPORT_ID 0x04
102#define VIVE_HEADSET_POWER_REPORT_TYPE 0x2978
110 uint8_t reserved1[32];
112 uint8_t reserved2[18];
113} __attribute__((packed));
115#define VIVE_HEADSET_MAINBOARD_DEVICE_INFO_REPORT_ID 0x04
117#define VIVE_HEADSET_MAINBOARD_DEVICE_INFO_REPORT_TYPE 0x2987
127 uint32_t display_firmware_version;
128 uint8_t unknown2[48];
129} __attribute__((packed));
131#define VIVE_FIRMWARE_VERSION_REPORT_ID 0x05
136 uint32_t firmware_version;
140 uint8_t hardware_version_micro;
141 uint8_t hardware_version_minor;
142 uint8_t hardware_version_major;
143 uint8_t hardware_revision;
145 uint8_t fpga_version_minor;
146 uint8_t fpga_version_major;
147 uint8_t reserved[13];
148} __attribute__((packed));
150#define VIVE_CONFIG_START_REPORT_ID 0x10
156} __attribute__((packed));
158#define VIVE_CONFIG_READ_REPORT_ID 0x11
165} __attribute__((packed));
167#define VIVE_IMU_REPORT_ID 0x20
175} __attribute__((packed));
181} __attribute__((packed));
192 uint8_t timestamp_hi;
195} __attribute__((packed));
198#define TYPE_FLAG_TOUCH_FORCE 161
206 uint8_t middle_finger_handle;
207 uint8_t ring_finger_handle;
208 uint8_t pinky_finger_handle;
209 uint8_t index_finger_trigger;
211 uint8_t squeeze_force;
212 uint8_t trackpad_force;
213} __attribute__((packed));
215#define VIVE_CONTROLLER_LIGHTHOUSE_PULSE_REPORT_ID 0x21
222} __attribute__((packed));
229} __attribute__((packed));
231#define VIVE_CONTROLLER_REPORT1_ID 0x23
233#define VIVE_CONTROLLER_BATTERY_CHARGING 0x80
234#define VIVE_CONTROLLER_BATTERY_CHARGE_MASK 0x7f
236#define VIVE_CONTROLLER_BUTTON_TRIGGER 0x01
237#define VIVE_CONTROLLER_BUTTON_TOUCH 0x02
238#define VIVE_CONTROLLER_BUTTON_THUMB 0x04
239#define VIVE_CONTROLLER_BUTTON_SYSTEM 0x08
240#define VIVE_CONTROLLER_BUTTON_GRIP 0x10
241#define VIVE_CONTROLLER_BUTTON_MENU 0x20
245 uint8_t timestamp_hi;
247 uint8_t timestamp_lo;
249} __attribute__((packed));
255} __attribute__((packed));
257#define VIVE_CONTROLLER_REPORT2_ID 0x24
263} __attribute__((packed));
265#define VIVE_HEADSET_LIGHTHOUSE_PULSE_REPORT_ID 0x25
273} __attribute__((packed));
275#define VIVE_HEADSET_LIGHTHOUSE_V2_PULSE_REPORT_ID 0x27
289} __attribute__((packed));
291#define VIVE_HEADSET_LIGHTHOUSE_V2_PULSE_RAW_REPORT_ID 0x28
296} __attribute__((packed));
303} __attribute__((packed));
309} __attribute__((packed));
311#define VIVE_CONTROLLER_DISCONNECT_REPORT_ID 0x26
313#define VIVE_CONTROLLER_COMMAND_REPORT_ID 0xff
315#define VIVE_CONTROLLER_HAPTIC_PULSE_COMMAND 0x8f
325 uint16_t repeat_count;
326} __attribute__((packed));
328#define VIVE_CONTROLLER_POWEROFF_COMMAND 0x9f
336} __attribute__((packed));
345vive_get_imu_range_report(
struct os_hid_device *hid_dev,
double *gyro_range,
double *acc_range);
349 uint32_t *firmware_version,
350 uint8_t *hardware_revision,
351 uint8_t *hardware_version_micro,
352 uint8_t *hardware_version_minor,
353 uint8_t *hardware_version_major);
Wrapper around OS native hid functions.
Representing a single hid interface on a device.
Definition: os_hid.h:29
Definition: vive_protocol.h:161
Definition: vive_protocol.h:153
Definition: vive_protocol.h:67
Definition: vive_protocol.h:318
Definition: vive_protocol.h:225
Definition: vive_protocol.h:218
Definition: vive_protocol.h:244
Definition: vive_protocol.h:331
Definition: vive_protocol.h:252
Definition: vive_protocol.h:260
Definition: vive_protocol.h:52
Definition: vive_protocol.h:57
Definition: vive_protocol.h:134
Definition: vive_protocol.h:306
Definition: vive_protocol.h:299
Definition: vive_protocol.h:294
Definition: vive_protocol.h:278
Definition: vive_protocol.h:268
Definition: vive_protocol.h:120
Definition: vive_protocol.h:105
Definition: vive_protocol.h:74
Definition: vive_protocol.h:178
Definition: vive_protocol.h:170
Definition: vive_protocol.h:84
Definition: vive_protocol.h:184
Definition: vive_protocol.h:200
Endian-specific byte order defines.