Use GET_REPORT request for device to host transfer.

This commit is contained in:
Marc Schink 2013-07-02 21:52:23 +02:00 committed by Uwe Hermann
parent f05e7b7a9b
commit fb8d593cfe
3 changed files with 3 additions and 2 deletions

View File

@ -161,7 +161,7 @@ static GSList *scan(GSList *options)
PACKET_LENGTH);
libusb_fill_control_setup(devc->xfer_buf_in,
USB_REQUEST_TYPE_IN, USB_HID_SET_REPORT,
USB_REQUEST_TYPE_IN, USB_HID_GET_REPORT,
USB_HID_REPORT_TYPE_FEATURE, USB_INTERFACE,
PACKET_LENGTH);
libusb_fill_control_setup(devc->xfer_buf_out,

View File

@ -752,7 +752,7 @@ SR_PRIV int sl2_get_device_info(struct sr_usb_dev_inst usb,
SR_PRIV int sl2_transfer_in(libusb_device_handle *dev_handle, uint8_t *data)
{
return libusb_control_transfer(dev_handle, USB_REQUEST_TYPE_IN,
USB_HID_SET_REPORT, USB_HID_REPORT_TYPE_FEATURE, USB_INTERFACE,
USB_HID_GET_REPORT, USB_HID_REPORT_TYPE_FEATURE, USB_INTERFACE,
(unsigned char *)data, PACKET_LENGTH, USB_TIMEOUT);
}

View File

@ -49,6 +49,7 @@
#define USB_REQUEST_TYPE_OUT (LIBUSB_REQUEST_TYPE_CLASS | \
LIBUSB_RECIPIENT_INTERFACE | LIBUSB_ENDPOINT_OUT)
#define USB_HID_GET_REPORT 0x01
#define USB_HID_SET_REPORT 0x09
#define USB_HID_REPORT_TYPE_FEATURE 0x300