summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorPete Batard <pete@akeo.ie>2013-03-04 21:52:27 +0000
committerPete Batard <pete@akeo.ie>2013-03-05 20:41:36 +0000
commita0beff7d985eeee014d51b725e32533cc216a579 (patch)
tree9f19264d4ecaf5e4b356c0adb11425aaa3c40624 /examples
parentbaf714f5e0f22b968cea0e747c23eeced44f602e (diff)
downloadlibusb-a0beff7d985eeee014d51b725e32533cc216a579.tar.gz
Samples: Reinstate interface requests when querying WCID devices
* Reverts commit 939a4782b28c36dfddb68585c4b027a4d5494a5b. * Closes #96
Diffstat (limited to 'examples')
-rw-r--r--examples/xusb.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/examples/xusb.c b/examples/xusb.c
index 1aa3363..463cc2f 100644
--- a/examples/xusb.c
+++ b/examples/xusb.c
@@ -688,11 +688,12 @@ static void read_ms_winsub_feature_descriptors(libusb_device_handle *handle, uin
void* le_type_punning_IS_fine;
struct {
const char* desc;
+ uint8_t recipient;
uint16_t index;
uint16_t header_size;
} os_fd[2] = {
- {"Extended Compat ID", 0x0004, 0x10},
- {"Extended Properties", 0x0005, 0x0A}
+ {"Extended Compat ID", LIBUSB_RECIPIENT_DEVICE, 0x0004, 0x10},
+ {"Extended Properties", LIBUSB_RECIPIENT_INTERFACE, 0x0005, 0x0A}
};
if (iface_number < 0) return;
@@ -701,7 +702,7 @@ static void read_ms_winsub_feature_descriptors(libusb_device_handle *handle, uin
printf("\nReading %s OS Feature Descriptor (wIndex = 0x%04d):\n", os_fd[i].desc, os_fd[i].index);
// Read the header part
- r = libusb_control_transfer(handle, (uint8_t)(LIBUSB_ENDPOINT_IN|LIBUSB_REQUEST_TYPE_VENDOR|LIBUSB_RECIPIENT_DEVICE),
+ r = libusb_control_transfer(handle, (uint8_t)(LIBUSB_ENDPOINT_IN|LIBUSB_REQUEST_TYPE_VENDOR|os_fd[i].recipient),
bRequest, (uint16_t)(((iface_number)<< 8)|0x00), os_fd[i].index, os_desc, os_fd[i].header_size, 1000);
if (r < os_fd[i].header_size) {
perr(" Failed: %s", (r<0)?libusb_error_name((enum libusb_error)r):"header size is too small");
@@ -714,7 +715,7 @@ static void read_ms_winsub_feature_descriptors(libusb_device_handle *handle, uin
}
// Read the full feature descriptor
- r = libusb_control_transfer(handle, (uint8_t)(LIBUSB_ENDPOINT_IN|LIBUSB_REQUEST_TYPE_VENDOR|LIBUSB_RECIPIENT_DEVICE),
+ r = libusb_control_transfer(handle, (uint8_t)(LIBUSB_ENDPOINT_IN|LIBUSB_REQUEST_TYPE_VENDOR|os_fd[i].recipient),
bRequest, (uint16_t)(((iface_number)<< 8)|0x00), os_fd[i].index, os_desc, (uint16_t)length, 1000);
if (r < 0) {
perr(" Failed: %s", libusb_error_name((enum libusb_error)r));