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 windows wireless dongle setup #291

Merged
merged 1 commit into from
Sep 29, 2023
Merged
Show file tree
Hide file tree
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
9 changes: 6 additions & 3 deletions src/driver_vive.c
Original file line number Diff line number Diff line change
Expand Up @@ -218,14 +218,17 @@ 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};

static uint8_t vive_magic_rf_raw_mode_0[] = {
// Windows needs 64 size for the wireless dongle
static uint8_t vive_magic_rf_raw_mode_0[64] = {
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};
static uint8_t vive_magic_protocol_switch[] = {
// Windows needs 64 size for the wireless dongle
static uint8_t vive_magic_protocol_switch[64] = {
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};
static uint8_t vive_magic_protocol_super_magic[] = {VIVE_REPORT_COMMAND,
// 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,
Expand Down
4 changes: 3 additions & 1 deletion src/driver_vive.hidapi.h
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,10 @@ static survive_usb_device_t get_next_device(survive_usb_device_enumerator* d, su
return *d = head;
}

// On Windows the wireless dongle interface is -1
// That's why we check for <= 0
for (survive_usb_device_t c = (*d)->next; c; c = c->next) {
if (c->interface_number == 0) {
if (c->interface_number <= 0) {
return *d = c;
}
}
Expand Down
Loading