| 
      
      
      From: Dan E. <Dan...@ne...> - 2006-08-13 13:04:23
      
     | 
| I've spotted what to me seems a pretty major difference between libusb and libusb-win32. In the call to set_configuration, libusb takes the actual configuration value, i.e. the value specified in the configuration descriptor, whereas libusb-win32 takes the index value + 1. This means that if you have a quirky device which has one configuration called configuration 2, then with libusb you would use set_configuration(2) to set it, whereas on libusb-win32 you would use set_configuration(1). This is a bit troublesome. We have been hit by this since a device we are using makes the same error in reverse, it returns the config descriptor by value instead of index, so when windows initially asks for the 0th config descriptor, unless there is a bogus descriptor in the device called configuration 0 (which of course doesn't make sense since config 0 is the unconfigured state), the device returns an error. A workaround is to provide 2 config descriptors, one bogus one called 0 and the real one called 1. This is fine on linux since you can select config 1 by calling set_configuration(1), but on windows you have to call set_configuration(2). If someone decided not to have incrementing configuration values you'd be sunk with libusb-win32 at the moment. Anyway, for the moment I'm just happy that I've worked out what's going on and that I can select my configuration using 2. Dan |