Example #1
0
 private static HidDeviceAttributes GetDeviceAttributes(IntPtr hidHandle)
 {
     NativeMethods.HIDD_ATTRIBUTES attributes = default(NativeMethods.HIDD_ATTRIBUTES);
     attributes.Size = Marshal.SizeOf((object)attributes);
     NativeMethods.HidD_GetAttributes(hidHandle, ref attributes);
     return(new HidDeviceAttributes(attributes));
 }
 internal HidDeviceAttributes(NativeMethods.HIDD_ATTRIBUTES attributes)
 {
     VendorId     = attributes.VendorID;
     ProductId    = attributes.ProductID;
     Version      = attributes.VersionNumber;
     VendorHexId  = "0x" + attributes.VendorID.ToString("X4");
     ProductHexId = "0x" + attributes.ProductID.ToString("X4");
 }