Monado OpenXR Runtime
rift_s_protocol.h File Reference

Oculus Rift S USB protocol implementation interface. More...

#include <stdlib.h>
#include "os/os_hid.h"
#include "xrt/xrt_defines.h"
Include dependency graph for rift_s_protocol.h:

Go to the source code of this file.

Data Structures

struct  rift_s_controller_imu_block_t
 
struct  rift_s_controller_maskbyte_block_t
 
struct  rift_s_controller_triggrip_block_t
 
struct  rift_s_controller_joystick_block_t
 
struct  rift_s_controller_capsense_block_t
 
struct  rift_s_controller_raw_block_t
 
union  rift_s_controller_info_block_t
 
struct  rift_s_controller_report_t
 
struct  rift_s_hmd_imu_sample_t
 
struct  rift_s_hmd_report_t
 
struct  rift_s_camera_report_t
 
struct  rift_s_panel_info_t
 
struct  rift_s_imu_config_info_t
 
struct  rift_s_hmd_radio_response_t
 
struct  rift_s_hmd_radio_command_t
 
struct  rift_s_device_type_record_t
 
struct  rift_s_devices_list_t
 

Macros

#define FEATURE_BUFFER_SIZE   256
 
#define KEEPALIVE_INTERVAL_MS   1000
 
#define CAMERA_REPORT_INTERVAL_MS   1000
 
#define RIFT_S_BUTTON_A_X   0x01
 
#define RIFT_S_BUTTON_B_Y   0x02
 
#define RIFT_S_BUTTON_STICK   0x04
 
#define RIFT_S_BUTTON_MENU_OCULUS   0x08
 
#define RIFT_S_BUTTON_UNKNOWN   0x10
 
#define RIFT_S_FINGER_A_X_STRONG   0x01
 
#define RIFT_S_FINGER_B_Y_STRONG   0x02
 
#define RIFT_S_FINGER_STICK_STRONG   0x04
 
#define RIFT_S_FINGER_TRIGGER_STRONG   0x08
 
#define RIFT_S_FINGER_A_X_WEAK   0x10
 
#define RIFT_S_FINGER_B_Y_WEAK   0x20
 
#define RIFT_S_FINGER_STICK_WEAK   0x40
 
#define RIFT_S_FINGER_TRIGGER_WEAK   0x80
 
#define DEVICES_LIST_MAX_DEVICES   7
 

Enumerations

enum  rift_s_controller_block_id_t {
  RIFT_S_CTRL_MASK08 = 0x08 , RIFT_S_CTRL_BUTTONS = 0x0c , RIFT_S_CTRL_FINGERS = 0x0d , RIFT_S_CTRL_MASK0e = 0x0e ,
  RIFT_S_CTRL_TRIGGRIP = 0x1b , RIFT_S_CTRL_JOYSTICK = 0x22 , RIFT_S_CTRL_CAPSENSE = 0x27 , RIFT_S_CTRL_IMU = 0x91
}
 
enum  rift_s_device_type { RIFT_S_DEVICE_TYPE_UNKNOWN = 0 , RIFT_S_DEVICE_LEFT_CONTROLLER = 0x13001101 , RIFT_S_DEVICE_RIGHT_CONTROLLER = 0x13011101 }
 

Functions

int rift_s_read_firmware_version (struct os_hid_device *hid)
 
int rift_s_read_panel_info (struct os_hid_device *hid, rift_s_panel_info_t *panel_info)
 
int rift_s_read_imu_config_info (struct os_hid_device *hid, struct rift_s_imu_config_info_t *imu_config)
 
int rift_s_read_fw_proximity_threshold (struct os_hid_device *hid, int *proximity_threshold)
 
int rift_s_protocol_set_proximity_threshold (struct os_hid_device *hid, uint16_t threshold)
 
int rift_s_hmd_enable (struct os_hid_device *hid, bool enable)
 
int rift_s_set_screen_enable (struct os_hid_device *hid, bool enable)
 
void rift_s_send_keepalive (struct os_hid_device *hid)
 
void rift_s_protocol_camera_report_init (rift_s_camera_report_t *camera_report)
 
int rift_s_protocol_send_camera_report (struct os_hid_device *hid, rift_s_camera_report_t *camera_report)
 
bool rift_s_parse_hmd_report (rift_s_hmd_report_t *report, const unsigned char *buf, int size)
 
bool rift_s_parse_controller_report (rift_s_controller_report_t *report, const unsigned char *buf, int size)
 
int rift_s_read_firmware_block (struct os_hid_device *handle, uint8_t block_id, char **data_out, int *len_out)
 
int rift_s_read_devices_list (struct os_hid_device *handle, rift_s_devices_list_t *dev_list)
 
void rift_s_hexdump_buffer (const char *label, const unsigned char *buf, int length)
 
int rift_s_snprintf_hexdump_buffer (char *outbuf, size_t outbufsize, const char *label, const unsigned char *buf, int length)
 

Detailed Description

Oculus Rift S USB protocol implementation interface.

Functions for interpreting the USB protocol to the headset and Touch Controllers (via the headset's radio link)

Ported from OpenHMD

Author
Jan Schmidt jan@c.nosp@m.entr.nosp@m.icula.nosp@m.r.co.nosp@m.m