changeset 64:99ed461509fe

Fixed data type for USB vendor and product IDs
author Ivo Smits <Ivo@UCIS.nl>
date Sun, 13 Oct 2013 20:03:05 +0200
parents 309c705d7460
children abe0d55a2201
files USBLib/Communication/IUsbDeviceRegistry.cs USBLib/Communication/LibUsb1/LibUsb1Registry.cs USBLib/Communication/VBoxUSB.cs USBLib/Communication/WindowsUsbDeviceRegistry.cs USBLib/Descriptor/UsbDescriptor.cs
diffstat 5 files changed, 11 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- 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<String, Object> 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)
--- 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 {
--- 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); } }
--- 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;
--- 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; } }