From db7becb5be98945b079fc727b289ccca3024eff8 Mon Sep 17 00:00:00 2001 From: Peter Wu Date: Wed, 19 Mar 2014 23:19:25 +0100 Subject: unifying: implemented pairing info info for receiver Undocumented, so it's guesswork based on https://git.lekensteyn.nl/ltunify/tree/registers.txt Signed-off-by: Peter Wu --- hw/usb/hid-logitech-dj.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'hw/usb') 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); -- cgit v1.2.1