diff USBLib/Communication/LibUsbDotNet.cs @ 38:a9c4fed19e99

USBLib: fixes in USBIO driver and LibUsbDotNet compatibility code
author Ivo Smits <Ivo@UCIS.nl>
date Thu, 25 Apr 2013 23:31:52 +0200
parents 6fcedb1030bf
children 3424fa5a12c9
line wrap: on
line diff
--- a/USBLib/Communication/LibUsbDotNet.cs	Sun Apr 21 19:41:19 2013 +0200
+++ b/USBLib/Communication/LibUsbDotNet.cs	Thu Apr 25 23:31:52 2013 +0200
@@ -110,7 +110,7 @@
 				int iConfigs = Info.Descriptor.ConfigurationCount;
 				for (int iConfig = 0; iConfig < iConfigs; iConfig++) {
 					int iBytesTransmitted;
-					if (!GetDescriptor((byte)UsbDescriptorType.Configuration, 0, 0, cfgBuffer, cfgBuffer.Length, out iBytesTransmitted))
+					if (!GetDescriptor((byte)UsbDescriptorType.Configuration, (byte)iConfig, 0, cfgBuffer, cfgBuffer.Length, out iBytesTransmitted))
 						throw new Exception("Could not read configuration descriptor");
 					if (iBytesTransmitted < UsbConfigDescriptor.Size || cfgBuffer[1] != (byte)UsbDescriptorType.Configuration)
 						throw new Exception("GetDeviceConfigs: USB config descriptor is invalid.");