Monado OpenXR Runtime
rift_s_protocol.c File Reference

Oculus Rift S USB protocol implementation. More...

#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "os/os_hid.h"
#include "os/os_time.h"
#include "xrt/xrt_defines.h"
#include "rift_s.h"
#include "rift_s_protocol.h"
Include dependency graph for rift_s_protocol.c:

Functions

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_snprintf_hexdump_buffer (char *outbuf, size_t outbufsize, const char *label, const unsigned char *buf, int length)
 
void rift_s_hexdump_buffer (const char *label, const unsigned char *buf, int length)
 
static int get_feature_report (struct os_hid_device *hid, uint8_t cmd, uint8_t *buf, int len)
 
static int read_one_fw_block (struct os_hid_device *dev, uint8_t block_id, uint32_t pos, uint8_t read_len, uint8_t *buf)
 
int rift_s_read_firmware_block (struct os_hid_device *dev, uint8_t block_id, char **data_out, int *len_out)
 
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)
 
static int rift_s_enable_camera (struct os_hid_device *hid, bool enable, bool radio_sync_bit)
 
int rift_s_set_screen_enable (struct os_hid_device *hid, bool enable)
 
int rift_s_read_panel_info (struct os_hid_device *hid, rift_s_panel_info_t *panel_info)
 
int rift_s_read_firmware_version (struct os_hid_device *hid)
 
int rift_s_read_imu_config_info (struct os_hid_device *hid, struct rift_s_imu_config_info_t *imu_config)
 
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_read_devices_list (struct os_hid_device *handle, rift_s_devices_list_t *dev_list)
 

Detailed Description

Oculus Rift S USB protocol implementation.

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