From 3be7d0f6d85b8e4adb868f2076d7bf855f1da229 Mon Sep 17 00:00:00 2001 From: Christian Starkjohann Date: Mon, 14 Jul 2008 10:47:24 +0000 Subject: - use control transfers to USB_RECIP_DEVICE instead of USB_RECIP_INTERFACE so that we need not claim the interface. --- libs-host/hiddata.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libs-host') diff --git a/libs-host/hiddata.c b/libs-host/hiddata.c index 5424405..54b8dbb 100644 --- a/libs-host/hiddata.c +++ b/libs-host/hiddata.c @@ -280,7 +280,7 @@ int bytesSent; buffer++; /* skip dummy report ID */ len--; } - bytesSent = usb_control_msg((void *)device, USB_TYPE_CLASS | USB_RECIP_INTERFACE | 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 | (buffer[0] & 0xff), 0, buffer, len, 5000); if(bytesSent != len){ if(bytesSent < 0) fprintf(stderr, "Error sending message: %s\n", usb_strerror()); @@ -299,7 +299,7 @@ int bytesReceived, maxLen = *len; buffer++; /* make room for dummy report ID */ maxLen--; } - bytesReceived = usb_control_msg((void *)device, USB_TYPE_CLASS | USB_RECIP_INTERFACE | USB_ENDPOINT_IN, USBRQ_HID_GET_REPORT, USB_HID_REPORT_TYPE_FEATURE << 8 | reportNumber, 0, buffer, maxLen, 5000); + bytesReceived = usb_control_msg((void *)device, USB_TYPE_CLASS | USB_RECIP_DEVICE | USB_ENDPOINT_IN, USBRQ_HID_GET_REPORT, USB_HID_REPORT_TYPE_FEATURE << 8 | reportNumber, 0, buffer, maxLen, 5000); if(bytesReceived < 0){ fprintf(stderr, "Error sending message: %s\n", usb_strerror()); return USBOPEN_ERR_IO; -- cgit v1.2.3