diff options
Diffstat (limited to 'libs-host/hiddata.c')
-rw-r--r-- | libs-host/hiddata.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libs-host/hiddata.c b/libs-host/hiddata.c index 0f1915a..e4645b8 100644 --- a/libs-host/hiddata.c +++ b/libs-host/hiddata.c @@ -281,13 +281,13 @@ void usbhidCloseDevice(usbDevice_t *device) int usbhidSetReport(usbDevice_t *device, char *buffer, int len) { -int bytesSent; +int bytesSent, reportId = buffer[0]; if(!usesReportIDs){ buffer++; /* skip dummy report ID */ len--; } - bytesSent = usb_control_msg((void *)device, USB_TYPE_CLASS | USB_RECIP_DEVICE | USB_ENDPOINT_OUT, USBRQ_HID_SET_REPORT, USB_HID_REPORT_TYPE_FEATURE << 8 | (buffer[0] & 0xff), 0, buffer, len, 5000); + bytesSent = usb_control_msg((void *)device, USB_TYPE_CLASS | USB_RECIP_DEVICE | USB_ENDPOINT_OUT, USBRQ_HID_SET_REPORT, USB_HID_REPORT_TYPE_FEATURE << 8 | (reportId & 0xff), 0, buffer, len, 5000); if(bytesSent != len){ if(bytesSent < 0) fprintf(stderr, "Error sending message: %s\n", usb_strerror()); |