Monado OpenXR Runtime
vive_protocol.h File Reference

Vive USB HID reports. More...

#include <asm/byteorder.h>
#include <stdint.h>
#include "os/os_hid.h"
Include dependency graph for vive_protocol.h:

Go to the source code of this file.

Data Structures

struct  vive_controller_button_report
 
struct  vive_controller_touch_sample
 
struct  vive_controller_trigger_sample
 
struct  vive_controller_button_sample
 
struct  vive_controller_battery_sample
 
struct  vive_imu_range_modes_report
 
struct  vive_mainboard_status_report
 
struct  vive_headset_power_report
 
struct  vive_headset_mainboard_device_info_report
 
struct  vive_firmware_version_report
 
struct  vive_config_start_report
 
struct  vive_config_read_report
 
struct  vive_imu_sample
 
struct  vive_imu_report
 
struct  watchman_imu_sample
 
struct  watchman_touch_force
 
struct  vive_controller_lighthouse_pulse
 
struct  vive_controller_lighthouse_pulse_report
 
struct  vive_controller_message
 
struct  vive_controller_report1
 
struct  vive_controller_report2
 
struct  vive_headset_lighthouse_v2_pulse
 
struct  vive_headset_lighthouse_v2_pulse_report
 
struct  vive_headset_lighthouse_v2_pulse_raw_report
 
struct  vive_headset_lighthouse_pulse
 
struct  vive_headset_lighthouse_pulse_report
 
struct  vive_controller_haptic_pulse_report
 
struct  vive_controller_poweroff_report
 

Macros

#define VIVE_CONTROLLER_BUTTON_REPORT_ID   0x01
 
#define VIVE_CONTROLLER_USB_BUTTON_TRIGGER   (1 << 0)
 
#define VIVE_CONTROLLER_USB_BUTTON_GRIP   (1 << 2)
 
#define VIVE_CONTROLLER_USB_BUTTON_MENU   (1 << 12)
 
#define VIVE_CONTROLLER_USB_BUTTON_SYSTEM   (1 << 13)
 
#define VIVE_CONTROLLER_USB_BUTTON_THUMB   (1 << 18)
 
#define VIVE_CONTROLLER_USB_BUTTON_TOUCH   (1 << 20)
 
#define VIVE_IMU_RANGE_MODES_REPORT_ID   0x01
 
#define VIVE_MAINBOARD_STATUS_REPORT_ID   0x03
 
#define VIVE_HEADSET_POWER_REPORT_ID   0x04
 
#define VIVE_HEADSET_POWER_REPORT_TYPE   0x2978
 
#define VIVE_HEADSET_MAINBOARD_DEVICE_INFO_REPORT_ID   0x04
 
#define VIVE_HEADSET_MAINBOARD_DEVICE_INFO_REPORT_TYPE   0x2987
 
#define VIVE_FIRMWARE_VERSION_REPORT_ID   0x05
 
#define VIVE_CONFIG_START_REPORT_ID   0x10
 
#define VIVE_CONFIG_READ_REPORT_ID   0x11
 
#define VIVE_IMU_REPORT_ID   0x20
 
#define TYPE_FLAG_TOUCH_FORCE   161
 
#define VIVE_CONTROLLER_LIGHTHOUSE_PULSE_REPORT_ID   0x21
 
#define VIVE_CONTROLLER_REPORT1_ID   0x23
 
#define VIVE_CONTROLLER_BATTERY_CHARGING   0x80
 
#define VIVE_CONTROLLER_BATTERY_CHARGE_MASK   0x7f
 
#define VIVE_CONTROLLER_BUTTON_TRIGGER   0x01
 
#define VIVE_CONTROLLER_BUTTON_TOUCH   0x02
 
#define VIVE_CONTROLLER_BUTTON_THUMB   0x04
 
#define VIVE_CONTROLLER_BUTTON_SYSTEM   0x08
 
#define VIVE_CONTROLLER_BUTTON_GRIP   0x10
 
#define VIVE_CONTROLLER_BUTTON_MENU   0x20
 
#define VIVE_CONTROLLER_REPORT2_ID   0x24
 
#define VIVE_HEADSET_LIGHTHOUSE_PULSE_REPORT_ID   0x25
 
#define VIVE_HEADSET_LIGHTHOUSE_V2_PULSE_REPORT_ID   0x27
 
#define VIVE_HEADSET_LIGHTHOUSE_V2_PULSE_RAW_REPORT_ID   0x28
 
#define VIVE_CONTROLLER_DISCONNECT_REPORT_ID   0x26
 
#define VIVE_CONTROLLER_COMMAND_REPORT_ID   0xff
 
#define VIVE_CONTROLLER_HAPTIC_PULSE_COMMAND   0x8f
 
#define VIVE_CONTROLLER_POWEROFF_COMMAND   0x9f
 

Functions

struct vive_controller_button_report __attribute__ ((packed))
 
char * vive_read_config (struct os_hid_device *hid_dev)
 
int vive_get_imu_range_report (struct os_hid_device *hid_dev, double *gyro_range, double *acc_range)
 
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)
 

Variables

uint8_t id
 
uint8_t unknown1
 
uint16_t maybe_type
 
uint32_t sequence
 
uint32_t buttons
 
union {
   uint16_t   trigger
 
   uint16_t   battery_voltage
 
}; 
 
uint8_t battery
 
uint8_t unknown2
 
uint32_t hardware_id
 
uint16_t touch [2]
 
uint16_t unknown3
 
uint16_t trigger_hires
 
uint8_t unknown4 [24]
 
uint16_t trigger_raw
 
uint8_t unknown5 [8]
 
uint8_t maybe_bitfield
 
uint8_t unknown6
 
uint8_t gyro_range
 
uint8_t accel_range
 
uint8_t unknown [61]
 
uint8_t len
 
uint16_t lens_separation
 
uint16_t reserved1
 
uint8_t button
 
uint8_t audio_button
 
uint8_t reserved2 [2]
 
uint8_t proximity_change
 
uint8_t reserved3
 
uint16_t proximity
 
uint16_t ipd
 
uint8_t reserved4 [46]
 
uint16_t type
 
uint16_t edid_vid
 
uint16_t edid_pid
 
uint32_t display_firmware_version
 
uint32_t firmware_version
 
uint8_t string1 [16]
 
uint8_t string2 [16]
 
uint8_t hardware_version_micro
 
uint8_t hardware_version_minor
 
uint8_t hardware_version_major
 
uint8_t hardware_revision
 
uint8_t fpga_version_minor
 
uint8_t fpga_version_major
 
uint8_t reserved [13]
 
uint8_t unused [63]
 
uint8_t payload [62]
 
uint16_t acc [3]
 
uint16_t gyro [3]
 
uint32_t time
 
uint8_t seq
 
struct vive_imu_sample sample [3]
 
uint8_t timestamp_hi
 
uint8_t type_flag
 
uint8_t middle_finger_handle
 
uint8_t ring_finger_handle
 
uint8_t pinky_finger_handle
 
uint8_t index_finger_trigger
 
uint8_t squeeze_force
 
uint8_t trackpad_force
 
uint16_t duration
 
uint32_t timestamp
 
struct vive_controller_lighthouse_pulse pulse [7]
 
uint8_t timestamp_lo
 
struct vive_controller_message message
 
uint8_t sensor_id
 
uint32_t data
 
uint32_t mask
 
uint8_t command
 
uint8_t zero
 
uint16_t pulse_high
 
uint16_t pulse_low
 
uint16_t repeat_count
 
uint8_t magic [4]
 
const struct vive_headset_power_report power_on_report
 
const struct vive_headset_power_report power_off_report
 

Detailed Description