13 #include <asm/byteorder.h> 17 #define VIVE_CONTROLLER_BUTTON_REPORT_ID 0x01 19 #define VIVE_CONTROLLER_USB_BUTTON_TRIGGER (1 << 0) 20 #define VIVE_CONTROLLER_USB_BUTTON_GRIP (1 << 2) 21 #define VIVE_CONTROLLER_USB_BUTTON_MENU (1 << 12) 22 #define VIVE_CONTROLLER_USB_BUTTON_SYSTEM (1 << 13) 23 #define VIVE_CONTROLLER_USB_BUTTON_THUMB (1 << 18) 24 #define VIVE_CONTROLLER_USB_BUTTON_TOUCH (1 << 20) 50 #define VIVE_IMU_RANGE_MODES_REPORT_ID 0x01 60 #define VIVE_MAINBOARD_STATUS_REPORT_ID 0x03 78 #define VIVE_HEADSET_POWER_REPORT_ID 0x04 80 #define VIVE_HEADSET_POWER_REPORT_TYPE 0x2978 93 #define VIVE_HEADSET_MAINBOARD_DEVICE_INFO_REPORT_ID 0x04 95 #define VIVE_HEADSET_MAINBOARD_DEVICE_INFO_REPORT_TYPE 0x2987 109 #define VIVE_FIRMWARE_VERSION_REPORT_ID 0x05 128 #define VIVE_CONFIG_START_REPORT_ID 0x10 136 #define VIVE_CONFIG_READ_REPORT_ID 0x11 145 #define VIVE_IMU_REPORT_ID 0x20 161 #define VIVE_CONTROLLER_LIGHTHOUSE_PULSE_REPORT_ID 0x21 177 #define VIVE_CONTROLLER_REPORT1_ID 0x23 179 #define VIVE_CONTROLLER_BATTERY_CHARGING 0x80 180 #define VIVE_CONTROLLER_BATTERY_CHARGE_MASK 0x7f 182 #define VIVE_CONTROLLER_BUTTON_TRIGGER 0x01 183 #define VIVE_CONTROLLER_BUTTON_TOUCH 0x02 184 #define VIVE_CONTROLLER_BUTTON_THUMB 0x04 185 #define VIVE_CONTROLLER_BUTTON_SYSTEM 0x08 186 #define VIVE_CONTROLLER_BUTTON_GRIP 0x10 187 #define VIVE_CONTROLLER_BUTTON_MENU 0x20 203 #define VIVE_CONTROLLER_REPORT2_ID 0x24 211 #define VIVE_HEADSET_LIGHTHOUSE_PULSE_REPORT_ID 0x25 226 #define VIVE_CONTROLLER_DISCONNECT_REPORT_ID 0x26 228 #define VIVE_CONTROLLER_COMMAND_REPORT_ID 0xff 230 #define VIVE_CONTROLLER_HAPTIC_PULSE_COMMAND 0x8f 243 #define VIVE_CONTROLLER_POWEROFF_COMMAND 0x9f const struct vive_headset_power_report power_off_report
Definition: vive_protocol.h:254
uint8_t command
Definition: vive_protocol.h:248
uint16_t reserved1
Definition: vive_protocol.h:213
uint8_t id
Definition: vive_protocol.h:157
uint8_t reserved3
Definition: vive_protocol.h:72
uint16_t lens_separation
Definition: vive_protocol.h:67
uint8_t id
Definition: vive_protocol.h:64
int vive_read_firmware(struct os_hid_device *hid_dev, uint32_t *firmware_version, uint8_t *hardware_revision, uint8_t *hardware_version_micro, uint8_t *hardware_version_minor, uint8_t *hardware_version_major)
Definition: vive_protocol.c:208
uint8_t gyro_range
Definition: vive_protocol.h:210
Definition: vive_protocol.h:163
uint8_t hardware_version_micro
Definition: vive_protocol.h:118
Definition: vive_protocol.h:111
uint8_t len
Definition: vive_protocol.h:101
uint16_t reserved1
Definition: vive_protocol.h:68
Definition: vive_protocol.h:205
uint16_t unknown
Definition: vive_protocol.h:65
uint8_t fpga_version_major
Definition: vive_protocol.h:124
uint8_t hardware_version_minor
Definition: vive_protocol.h:119
int vive_get_imu_range_report(struct os_hid_device *hid_dev, double *gyro_range, double *acc_range)
Definition: vive_protocol.c:150
Definition: vive_protocol.h:245
uint32_t time
Definition: vive_protocol.h:151
Definition: vive_protocol.h:170
uint8_t command
Definition: vive_protocol.h:235
uint8_t timestamp_hi
Definition: vive_protocol.h:191
uint8_t hardware_version_major
Definition: vive_protocol.h:216
uint32_t timestamp
Definition: vive_protocol.h:167
uint8_t zero
Definition: vive_protocol.h:237
uint8_t id
Definition: vive_protocol.h:172
Definition: vive_protocol.h:130
Definition: vive_protocol.h:52
uint8_t accel_range
Definition: vive_protocol.h:56
uint8_t proximity_change
Definition: vive_protocol.h:71
uint8_t id
Definition: vive_protocol.h:132
uint8_t reserved[13]
Definition: vive_protocol.h:221
Definition: vive_protocol.h:97
uint8_t hardware_revision
Definition: vive_protocol.h:121
uint8_t unused[63]
Definition: vive_protocol.h:210
uint8_t reserved2[3]
Definition: vive_protocol.h:215
uint8_t id
Definition: vive_protocol.h:247
uint32_t firmware_version
Definition: vive_protocol.h:210
Definition: vive_protocol.h:138
Definition: vive_protocol.h:197
uint8_t id
Definition: vive_protocol.h:234
uint32_t unknown1
Definition: vive_protocol.h:115
uint16_t id
Definition: vive_protocol.h:165
uint32_t timestamp
Definition: vive_protocol.h:211
uint8_t id
Definition: vive_protocol.h:140
uint8_t id
Definition: vive_protocol.h:54
Definition: vive_protocol.h:82
char * vive_read_config(struct os_hid_device *hid_dev)
Definition: vive_protocol.c:70
Definition: vive_protocol.h:147
uint8_t len
Definition: vive_protocol.h:86
uint8_t string1[16]
Definition: vive_protocol.h:212
uint8_t fpga_version_minor
Definition: vive_protocol.h:123
uint16_t repeat_count
Definition: vive_protocol.h:240
Definition: vive_protocol.h:213
uint8_t unknown[61]
Definition: vive_protocol.h:212
uint16_t pulse_high
Definition: vive_protocol.h:238
uint8_t timestamp_lo
Definition: vive_protocol.h:193
uint8_t id
Definition: vive_protocol.h:113
Definition: vive_protocol.h:232
uint8_t len
Definition: vive_protocol.h:141
Definition: vive_protocol.h:220
uint8_t string2[16]
Definition: vive_protocol.h:213
uint8_t len
Definition: vive_protocol.h:249
uint8_t hardware_version_micro
Definition: vive_protocol.h:214
uint16_t type
Definition: vive_protocol.h:85
uint8_t unknown2
Definition: vive_protocol.h:89
uint8_t id
Definition: vive_protocol.h:99
uint8_t reserved
Definition: vive_protocol.h:174
uint16_t duration
Definition: vive_protocol.h:166
uint16_t gyro[3]
Definition: vive_protocol.h:210
uint16_t edid_pid
Definition: vive_protocol.h:103
uint16_t ipd
Definition: vive_protocol.h:74
Representing a single hid interface on a device.
Definition: os_hid.h:26
uint16_t pulse_low
Definition: vive_protocol.h:239
uint8_t button
Definition: vive_protocol.h:69
uint32_t firmware_version
Definition: vive_protocol.h:114
struct vive_imu_sample sample[3]
Definition: vive_protocol.h:210
const struct vive_headset_power_report power_on_report
Definition: vive_protocol.h:253
struct vive_controller_lighthouse_pulse pulse[7]
Definition: vive_protocol.h:210
uint16_t duration
Definition: vive_protocol.h:210
uint8_t magic[4]
Definition: vive_protocol.h:212
uint8_t len
Definition: vive_protocol.h:66
uint16_t type
Definition: vive_protocol.h:100
uint8_t id
Definition: vive_protocol.h:199
uint32_t display_firmware_version
Definition: vive_protocol.h:105
uint8_t hardware_version_minor
Definition: vive_protocol.h:215
uint8_t gyro_range
Definition: vive_protocol.h:55
Definition: vive_protocol.h:189
uint8_t len
Definition: vive_protocol.h:236
uint8_t id
Definition: vive_protocol.h:207
Definition: vive_protocol.h:155
uint8_t seq
Definition: vive_protocol.h:152
uint8_t payload[62]
Definition: vive_protocol.h:211
uint16_t proximity
Definition: vive_protocol.h:73
uint16_t acc[3]
Definition: vive_protocol.h:209
uint8_t hardware_version_major
Definition: vive_protocol.h:120
struct vive_controller_message message
Definition: vive_protocol.h:210
uint8_t hardware_revision
Definition: vive_protocol.h:217
Wrapper around OS native hid functions.
uint8_t len
Definition: vive_protocol.h:192
uint16_t edid_vid
Definition: vive_protocol.h:102
uint8_t id
Definition: vive_protocol.h:84
uint32_t unknown2
Definition: vive_protocol.h:122
Definition: vive_protocol.h:62
uint8_t reserved4[46]
Definition: vive_protocol.h:220