summaryrefslogtreecommitdiff
path: root/hw/usb/hid-logitech-dj.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/usb/hid-logitech-dj.c')
-rw-r--r--hw/usb/hid-logitech-dj.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/hw/usb/hid-logitech-dj.c b/hw/usb/hid-logitech-dj.c
index caa0383bc9..6de5fa4ba1 100644
--- a/hw/usb/hid-logitech-dj.c
+++ b/hw/usb/hid-logitech-dj.c
@@ -400,6 +400,7 @@ static void hidpp_process_device_hidpp20(USBLtunifyState *s, HidppMsg *msg)
LHidDevice *hd = &s->devices[msg->device_index - 1];
Hidpp20Msg *func = (Hidpp20Msg *) msg;
uint8_t fn = func->func >> 4;
+ int r;
if (func->feat_index == 0) { /* IRoot */
if (fn == 1) { /* GetProtocolVersion */
@@ -411,7 +412,14 @@ static void hidpp_process_device_hidpp20(USBLtunifyState *s, HidppMsg *msg)
}
return;
}
- /* TODO: implement features and more functions */
+
+ r = hidpp20_feature_call(hd, func);
+ /* note: if r == 0, then the function is void and there is no output */
+ if (r > 0) {
+ hidpp_queue_output_report(s, msg);
+ } else if (r < 0) {
+ hidpp20_queue_error(s, func, -r);
+ }
}
@@ -622,6 +630,7 @@ static void hidpp_init_device(USBLtunifyState *s, int device_index, int devtype)
hd->report_interval = 8;
break;
}
+ hidpp20_init_features(hd);
hd->info.protocol_version = 0x0200; /* HID++ 2.0 */
hd->mode = LTUNIFY_MODE_HID;
hd->powered_on = true;