public static Attributes? Get(IntPtr handle) { var deviceAttributes = new Attributes(); deviceAttributes.Size = Marshal.SizeOf(deviceAttributes); if (HidD_GetAttributes(handle, ref deviceAttributes)) return deviceAttributes; else return null; }
internal HidDeviceAttributes(Attributes attributes) { VendorId = attributes.VendorID; ProductId = attributes.ProductID; Version = attributes.VersionNumber; VendorHexId = "0x" + attributes.VendorID.ToString("X4"); ProductHexId = "0x" + attributes.ProductID.ToString("X4"); }
static internal extern bool HidD_GetAttributes(IntPtr hidDeviceObject, ref Attributes attributes);