Skip to content

Commit

Permalink
[TESTING] Close ctrl device after init for piped mode
Browse files Browse the repository at this point in the history
Fixes volume keys when using patched hidapi, see
duncanthrax#3 (comment)
  • Loading branch information
SpiritCroc committed Apr 7, 2019
1 parent ed8ab80 commit d5223ab
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/hid.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ int rv_open_device() {
return -1;
}

void rv_close_ctrl_device() {
rv_printf(RV_LOG_NORMAL, "close");
hid_close(ctrl_handle);
}

int rv_wait_for_ctrl_device() {
unsigned char buffer[] = { 0x04, 0x00, 0x00, 0x00 };
int res;
Expand Down
2 changes: 2 additions & 0 deletions src/roccat-vulcan.c
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,8 @@ int main(int argc, char* argv[])
return RV_FAILURE;
};

rv_close_ctrl_device();

return rv_fx_piped(file_name);
}
else if (fx_mode == FX_MODE_TEST_LOOP) {
Expand Down
1 change: 1 addition & 0 deletions src/roccat-vulcan.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ int rv_get_ctrl_report(unsigned char report_id);
int rv_set_ctrl_report(unsigned char report_id, int mode, int byteopt);
int rv_send_led_map(rv_rgb_map *map);
int rv_send_init(int type, int opt);
void rv_close_ctrl_device();

// Logging I/O functions (output.c)
void rv_print_buffer(unsigned char *buffer, int len);
Expand Down

0 comments on commit d5223ab

Please sign in to comment.