# HG changeset patch # User Ivo Smits # Date 1381687385 -7200 # Node ID 99ed461509fe1a3cd4c1f9d1f496a1c69812a3f2 # Parent 309c705d7460564666ffc9a3ea62db651105036f Fixed data type for USB vendor and product IDs diff -r 309c705d7460 -r 99ed461509fe USBLib/Communication/IUsbDeviceRegistry.cs --- a/USBLib/Communication/IUsbDeviceRegistry.cs Sun Oct 13 18:43:45 2013 +0200 +++ b/USBLib/Communication/IUsbDeviceRegistry.cs Sun Oct 13 20:03:05 2013 +0200 @@ -7,8 +7,8 @@ namespace UCIS.USBLib.Communication { public interface IUsbDeviceRegistry { IDictionary DeviceProperties { get; } - Int32 Vid { get; } - Int32 Pid { get; } + UInt16 Vid { get; } + UInt16 Pid { get; } Byte InterfaceID { get; } String Name { get; } //Device product name (or null if not available) diff -r 309c705d7460 -r 99ed461509fe USBLib/Communication/LibUsb1/LibUsb1Registry.cs --- a/USBLib/Communication/LibUsb1/LibUsb1Registry.cs Sun Oct 13 18:43:45 2013 +0200 +++ b/USBLib/Communication/LibUsb1/LibUsb1Registry.cs Sun Oct 13 20:03:05 2013 +0200 @@ -39,8 +39,8 @@ return DeviceDescriptor.Value; } - public int Vid { get { return GetDeviceDescriptor().idVendor; } } - public int Pid { get { return GetDeviceDescriptor().idProduct; } } + public UInt16 Vid { get { return GetDeviceDescriptor().idVendor; } } + public UInt16 Pid { get { return GetDeviceDescriptor().idProduct; } } public byte InterfaceID { get { return 0; } } public string Name { diff -r 309c705d7460 -r 99ed461509fe USBLib/Communication/VBoxUSB.cs --- a/USBLib/Communication/VBoxUSB.cs Sun Oct 13 18:43:45 2013 +0200 +++ b/USBLib/Communication/VBoxUSB.cs Sun Oct 13 20:03:05 2013 +0200 @@ -272,8 +272,8 @@ DevicePath = interfacepath; } - public int Vid { get { return DeviceDescriptor.VendorID; } } - public int Pid { get { return DeviceDescriptor.ProductID; } } + public UInt16 Vid { get { return DeviceDescriptor.VendorID; } } + public UInt16 Pid { get { return DeviceDescriptor.ProductID; } } public byte InterfaceID { get { return 0; } } public string Name { get { return DeviceNode.GetPropertyString(CMRDP.DEVICEDESC); } } diff -r 309c705d7460 -r 99ed461509fe USBLib/Communication/WindowsUsbDeviceRegistry.cs --- a/USBLib/Communication/WindowsUsbDeviceRegistry.cs Sun Oct 13 18:43:45 2013 +0200 +++ b/USBLib/Communication/WindowsUsbDeviceRegistry.cs Sun Oct 13 20:03:05 2013 +0200 @@ -70,13 +70,13 @@ mInterfaceID = (Byte)mid; mIsDeviceIDParsed = true; } - public int Vid { + public UInt16 Vid { get { parseDeviceID(); return mVid; } } - public int Pid { + public UInt16 Pid { get { parseDeviceID(); return mPid; diff -r 309c705d7460 -r 99ed461509fe USBLib/Descriptor/UsbDescriptor.cs --- a/USBLib/Descriptor/UsbDescriptor.cs Sun Oct 13 18:43:45 2013 +0200 +++ b/USBLib/Descriptor/UsbDescriptor.cs Sun Oct 13 20:03:05 2013 +0200 @@ -59,10 +59,10 @@ public Byte DeviceClass { get { return bDeviceClass; } } public Byte DeviceSubClass { get { return bDeviceSubClass; } } public Byte DeviceProtocol { get { return bDeviceProtocol; } } - public short DeviceVersion { get { return UsbDescriptor.FromLittleEndian(bcdDevice); } } + public UInt16 DeviceVersion { get { return (UInt16)UsbDescriptor.FromLittleEndian(bcdDevice); } } public Byte MaxControlPacketSize { get { return bMaxControlPacketSize; } } - public short VendorID { get { return UsbDescriptor.FromLittleEndian(idVendor); } } - public short ProductID { get { return UsbDescriptor.FromLittleEndian(idProduct); } } + public UInt16 VendorID { get { return (UInt16)UsbDescriptor.FromLittleEndian(idVendor); } } + public UInt16 ProductID { get { return (UInt16)UsbDescriptor.FromLittleEndian(idProduct); } } public Byte ManufacturerStringID { get { return iManufacturer; } } public Byte ProductStringID { get { return iProduct; } } public Byte SerialNumberStringID { get { return iSerialNumber; } }