From 2e98c1f8f71883805ba96e3691c692a568858ca9 Mon Sep 17 00:00:00 2001 From: Antonio Ospite Date: Thu, 10 May 2012 08:16:04 +0200 Subject: [PATCH] am7xxx: fix setting the USB configuration libusb_set_configuration() expects the bConfigurationValue of the configuration we wish to activate as the second parameter. The am7xxx devices we know have bConfigurationValue=2 for the first and only configuration available in the descriptor, use this value. While the libusb linux back-end looks forgiving on this one, without this change the WinUSB back-end will fail with an error like: C:\Documents and Settings\Administrator\Desktop\win>picoproj.exe -f image.jpg -F 1 -l 5 -W 800 -H 480 JPEG format scan_devices: am7xxx device found, index: 0, name: Acer C110 [timestamp] [threadID] facility level [function call] -------------------------------------------------------------------------------- [ 0.000000] [00000eb0] libusbx: warning [winusb_submit_control_transfer] cannot set configuration other than the default one [ 0.031250] [00000eb0] libusbx: warning [winusb_submit_control_transfer] cannot set configuration other than the default one [ 0.046875] [00000eb0] libusbx: error [winusb_submit_bulk_transfer] unable to match endpoint to an open interface - cancelling transfer read_data[281]: ret: -5 transferred: 0 (expected 24) am7xxx_get_info: No such file or directory --- src/am7xxx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/am7xxx.c b/src/am7xxx.c index 528c1b6..d22a417 100644 --- a/src/am7xxx.c +++ b/src/am7xxx.c @@ -542,7 +542,7 @@ static int scan_devices(am7xxx_context *ctx, scan_op op, goto out; } - libusb_set_configuration((*dev)->usb_device, 1); + libusb_set_configuration((*dev)->usb_device, 2); libusb_claim_interface((*dev)->usb_device, 0); goto out; } -- 2.1.4