From: Marc Schink Date: Tue, 2 Jul 2013 19:52:23 +0000 (+0200) Subject: Use GET_REPORT request for device to host transfer. X-Git-Tag: libsigrok-0.2.1~39 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=fb8d593cfea094dd50d74873c8c00445eb0a040f;p=libsigrok.git Use GET_REPORT request for device to host transfer. --- diff --git a/hardware/ikalogic-scanalogic2/api.c b/hardware/ikalogic-scanalogic2/api.c index 91512082..4f1d09fb 100644 --- a/hardware/ikalogic-scanalogic2/api.c +++ b/hardware/ikalogic-scanalogic2/api.c @@ -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, diff --git a/hardware/ikalogic-scanalogic2/protocol.c b/hardware/ikalogic-scanalogic2/protocol.c index 4ed690b6..29e374bc 100644 --- a/hardware/ikalogic-scanalogic2/protocol.c +++ b/hardware/ikalogic-scanalogic2/protocol.c @@ -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); } diff --git a/hardware/ikalogic-scanalogic2/protocol.h b/hardware/ikalogic-scanalogic2/protocol.h index 1756ed96..adc38592 100644 --- a/hardware/ikalogic-scanalogic2/protocol.h +++ b/hardware/ikalogic-scanalogic2/protocol.h @@ -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