Monado OpenXR Runtime
Macros | Functions | Variables
vive_protocol.c File Reference

Vive USB HID reports. More...

#include <stdio.h>
#include <zlib.h>
#include <math.h>
#include "math/m_api.h"
#include "vive_protocol.h"
#include "util/u_debug.h"
#include "util/u_misc.h"
#include "util/u_json.h"
Include dependency graph for vive_protocol.c:

Macros

#define VIVE_ERROR(...)
 

Functions

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

const struct vive_headset_power_report power_on_report
 
const struct vive_headset_power_report power_off_report
 

Detailed Description

Vive USB HID reports.

Author
Christoph Haag chris.nosp@m.toph.nosp@m..haag.nosp@m.@col.nosp@m.labor.nosp@m.a.co.nosp@m.m
Lubosz Sarnecki lubos.nosp@m.z.sa.nosp@m.rneck.nosp@m.i@co.nosp@m.llabo.nosp@m.ra.c.nosp@m.om

Macro Definition Documentation

◆ VIVE_ERROR

#define VIVE_ERROR (   ...)
Value:
do { \
fprintf(stderr, "%s - ", __func__); \
fprintf(stderr, __VA_ARGS__); \
fprintf(stderr, "\n"); \
} while (false)

Function Documentation

◆ vive_get_imu_range_report()

int vive_get_imu_range_report ( struct os_hid_device hid_dev,
double *  gyro_range,
double *  acc_range 
)

◆ vive_read_config()

char* vive_read_config ( struct os_hid_device hid_dev)

◆ vive_read_firmware()

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 
)

Variable Documentation

◆ power_off_report

const struct vive_headset_power_report power_off_report
Initial value:
= {
.type = __cpu_to_le16(VIVE_HEADSET_POWER_REPORT_TYPE),
.len = 56,
.unknown1 =
{
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x02,
0x00,
0x00,
},
.unknown2 = 0x7c,
}
#define VIVE_HEADSET_POWER_REPORT_ID
Definition: vive_protocol.h:78
#define VIVE_HEADSET_POWER_REPORT_TYPE
Definition: vive_protocol.h:80

◆ power_on_report

const struct vive_headset_power_report power_on_report
Initial value:
= {
.type = __cpu_to_le16(VIVE_HEADSET_POWER_REPORT_TYPE),
.len = 56,
.unknown1 =
{
0x01,
0x00,
0x00,
0x00,
0x00,
0x00,
0x02,
0x00,
0x01,
},
.unknown2 = 0x7a,
}
#define VIVE_HEADSET_POWER_REPORT_ID
Definition: vive_protocol.h:78
#define VIVE_HEADSET_POWER_REPORT_TYPE
Definition: vive_protocol.h:80