From 8c8727504a1ea26f97da15b3c682a1ec188c6e03 Mon Sep 17 00:00:00 2001 From: vhaudiquet Date: Wed, 27 Sep 2023 17:01:22 +0200 Subject: [PATCH] driver: g-wolves full wireless support --- drivers/g-wolves/g-wolves.c | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/drivers/g-wolves/g-wolves.c b/drivers/g-wolves/g-wolves.c index ed9959c..f41c8dd 100644 --- a/drivers/g-wolves/g-wolves.c +++ b/drivers/g-wolves/g-wolves.c @@ -2,23 +2,12 @@ static int send_command(libusb_device_handle* hand, uint8_t command, uint8_t size, void* report, bool wireless) { - if(wireless) - { - // If wireless, ask receiver for mouse command first - struct REPORT_WIRELESS w_report = {0}; - int res = send_command(hand, COMMAND_WIRELESS_MOUSE, REPORT_WIRELESS_MOUSE_SIZE, &w_report, false); - if(res <= 0) return res; - - if(!w_report.mouse_connected) - return -1; - } - report_header_t* head = report; head->report_size = size; head->command = command; if(wireless) head->wireless = 0x1; - + // Send command int res = libusb_control_transfer(hand, 0x21, // request type @@ -31,6 +20,10 @@ static int send_command(libusb_device_handle* hand, uint8_t command, uint8_t siz if(res <= 0) return res; + // Wait for mouse if necessary + if(wireless) + usleep(100000); + // Get response report res = libusb_control_transfer(hand, 0xa1, // request type