Use GET_REPORT request for device to host transfer.
This commit is contained in:
parent
f05e7b7a9b
commit
fb8d593cfe
|
@ -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,
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue