20#ifndef __RIFT_S_PROTOCOL__
21#define __RIFT_S_PROTOCOL__
27#define FEATURE_BUFFER_SIZE 256
29#define KEEPALIVE_INTERVAL_MS 1000
30#define CAMERA_REPORT_INTERVAL_MS 1000
32#define RIFT_S_BUTTON_A_X 0x01
33#define RIFT_S_BUTTON_B_Y 0x02
34#define RIFT_S_BUTTON_STICK 0x04
35#define RIFT_S_BUTTON_MENU_OCULUS 0x08
37#define RIFT_S_BUTTON_UNKNOWN 0x10
39#define RIFT_S_FINGER_A_X_STRONG 0x01
40#define RIFT_S_FINGER_B_Y_STRONG 0x02
41#define RIFT_S_FINGER_STICK_STRONG 0x04
42#define RIFT_S_FINGER_TRIGGER_STRONG 0x08
43#define RIFT_S_FINGER_A_X_WEAK 0x10
44#define RIFT_S_FINGER_B_Y_WEAK 0x20
45#define RIFT_S_FINGER_STICK_WEAK 0x40
46#define RIFT_S_FINGER_TRIGGER_WEAK 0x80
50 RIFT_S_CTRL_MASK08 = 0x08,
51 RIFT_S_CTRL_BUTTONS = 0x0c,
52 RIFT_S_CTRL_FINGERS = 0x0d,
53 RIFT_S_CTRL_MASK0e = 0x0e,
54 RIFT_S_CTRL_TRIGGRIP = 0x1b,
55 RIFT_S_CTRL_JOYSTICK = 0x22,
56 RIFT_S_CTRL_CAPSENSE = 0x27,
57 RIFT_S_CTRL_IMU = 0x91
58} rift_s_controller_block_id_t;
62 RIFT_S_DEVICE_TYPE_UNKNOWN = 0,
63 RIFT_S_DEVICE_LEFT_CONTROLLER = 0x13001101,
64 RIFT_S_DEVICE_RIGHT_CONTROLLER = 0x13011101,
73 uint16_t unknown_varying2;
148 uint8_t extra_bytes_len;
149 uint8_t extra_bytes[48];
165 uint16_t unknown_const1;
176 uint32_t frame_timestamp;
177 int16_t unknown_zero1;
179 int16_t unknown_zero2;
201 uint8_t radio_sync_flag;
203 uint16_t slam_frame_exposures[5];
204 uint8_t slam_frame_gains[5];
208 uint32_t unknown32[5];
215 uint16_t v_resolution;
216 uint16_t h_resolution;
218 uint8_t refresh_rate;
219 uint8_t unknown2[14];
229 float temperature_scale;
230 float temperature_offset;
239 uint8_t response_bytes[197];
247 uint8_t cmd_bytes[52];
253 uint32_t device_type;
259#define DEVICES_LIST_MAX_DEVICES 7
275rift_s_read_fw_proximity_threshold(
struct os_hid_device *hid,
int *proximity_threshold);
277rift_s_protocol_set_proximity_threshold(
struct os_hid_device *hid, uint16_t threshold);
281rift_s_set_screen_enable(
struct os_hid_device *hid,
bool enable);
296rift_s_read_firmware_block(
struct os_hid_device *handle, uint8_t block_id,
char **data_out,
int *len_out);
302rift_s_hexdump_buffer(
const char *label,
const unsigned char *buf,
int length);
304rift_s_snprintf_hexdump_buffer(
305 char *outbuf,
size_t outbufsize,
const char *label,
const unsigned char *buf,
int length);
Wrapper around OS native hid functions.
Definition: m_space.cpp:87
Representing a single hid interface on a device.
Definition: os_hid.h:29
Definition: rift_s_protocol.h:198
Definition: rift_s_protocol.h:102
Definition: rift_s_protocol.h:69
Definition: rift_s_protocol.h:95
Definition: rift_s_protocol.h:80
Definition: rift_s_protocol.h:113
Definition: rift_s_protocol.h:129
Definition: rift_s_protocol.h:88
Definition: rift_s_protocol.h:251
Definition: rift_s_protocol.h:262
Definition: rift_s_protocol.h:154
Definition: rift_s_protocol.h:244
Definition: rift_s_protocol.h:235
Definition: rift_s_protocol.h:163
Definition: rift_s_protocol.h:224
Definition: rift_s_protocol.h:213
Definition: rift_s_protocol.h:117
Common defines and enums for XRT.