diff options
Diffstat (limited to 'hw/usb/hid-logitech-dj.c')
-rw-r--r-- | hw/usb/hid-logitech-dj.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/hw/usb/hid-logitech-dj.c b/hw/usb/hid-logitech-dj.c index 646b63745e..fa5c96933b 100644 --- a/hw/usb/hid-logitech-dj.c +++ b/hw/usb/hid-logitech-dj.c @@ -260,6 +260,24 @@ static bool hidpp_process_receiver_report(USBLtunifyState *s, HidppMsg *msg) memcpy(parms + 2, hd->info.name, parms[1]); } hidpp_queue_output_report(s, msg); + } else if (parms[0] == 2 || parms[0] == 3) { + /* undocumented, presumably receiver commands */ + LHidReceiver *rcvr = &s->receiver; + + ml->report_id = HIDPP_LONG; + memset(parms + 1, 0, sizeof(ml->value) - 1); + if (parms[0] == 2) { + // ?? + } else if (parms[0] == 3) { + parms[1] = (uint8_t) rcvr->info.serial; + parms[2] = (uint8_t) (rcvr->info.serial >> 8); + parms[3] = (uint8_t) (rcvr->info.serial >> 16); + parms[4] = (uint8_t) (rcvr->info.serial >> 24); + //parms[5] ?? + parms[6] = MAX_DEVICES; /* guessed */ + //parms[7] ?? + } + hidpp_queue_output_report(s, msg); } else { /* invalid command or unavailable device */ hidpp_queue_error(s, msg, HIDPP_ERR_INVALID_VALUE); |