summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Wu <peter@lekensteyn.nl>2014-03-19 23:19:25 +0100
committerPeter Wu <peter@lekensteyn.nl>2014-03-19 23:19:25 +0100
commitdb7becb5be98945b079fc727b289ccca3024eff8 (patch)
tree5460b4205d8ddc3c767973389649ae4137a458ea
parentf169eef99246893b01faf088629d79336f37e605 (diff)
downloadqemu-db7becb5be98945b079fc727b289ccca3024eff8.tar.gz
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 <peter@lekensteyn.nl>
-rw-r--r--hw/usb/hid-logitech-dj.c18
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);