Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix sensor data loss on linux caused by 464dd97 (#294) #1

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 34 additions & 19 deletions src/driver_vive.c
Original file line number Diff line number Diff line change
Expand Up @@ -218,35 +218,50 @@ static uint8_t vive_magic_power_off[] = {
static uint8_t vive_magic_raw_mode_1[] = {VIVE_REPORT_CHANGE_MODE, 0x01, 0x00, 0x00, 0x00};
static uint8_t vive_request_version_info[] = {VIVE_REPORT_VERSION};

#ifdef __linux__
static uint8_t vive_magic_rf_raw_mode_0[] = {
#else
// Windows needs 64 size for the wireless dongle
static uint8_t vive_magic_rf_raw_mode_0[64] = {
#endif
VIVE_REPORT_COMMAND, VIVE_COMMAND_CHANGE_PROTOCOL, 0x6, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00};
static uint8_t vive_magic_rf_raw_mode_1[] = {
VIVE_REPORT_COMMAND, VIVE_COMMAND_CHANGE_PROTOCOL, 0x6, 0x01, 0x01, 0x00, 0x02, 0x00, 0x00};

#ifdef __linux__
static uint8_t vive_magic_protocol_switch[] = {
#else
// Windows needs 64 size for the wireless dongle
static uint8_t vive_magic_protocol_switch[64] = {
#endif
VIVE_REPORT_COMMAND, VIVE_COMMAND_CHANGE_PROTOCOL, 0x3, 0x00, 0x01, 0x00};
static uint8_t vive_request_pairing[] = {VIVE_REPORT_COMMAND, VIVE_COMMAND_PAIR, 0x03, 0x01, 0x10, 0x27};

#ifdef __linux__
static uint8_t vive_magic_protocol_super_magic[] = {
#else
// Windows needs 64 size for the wireless dongle
static uint8_t vive_magic_protocol_super_magic[64] = {VIVE_REPORT_COMMAND,
VIVE_COMMAND_CONFIGURE_RADIO,
0x10,
0xbe,
0x5b,
0x32,
0x54,
0x11,
0xcf,
0x83,
0x75,
0x53,
0x8a,
0x08,
0x6a,
0x53,
0x58,
0xd0,
0xb1};
static uint8_t vive_magic_protocol_super_magic[64] = {
#endif
VIVE_REPORT_COMMAND,
VIVE_COMMAND_CONFIGURE_RADIO,
0x10,
0xbe,
0x5b,
0x32,
0x54,
0x11,
0xcf,
0x83,
0x75,
0x53,
0x8a,
0x08,
0x6a,
0x53,
0x58,
0xd0,
0xb1};

#define MAGIC_CTOR(ison, buffer) \
{ .name = #buffer, .code = ison, .magic = buffer, .length = sizeof(buffer) }
Expand Down