public static SUDDescriptor DescribeSUD(string DevicePath) { var hidHandle = OpenDeviceIO(DevicePath, NativeMethods.ACCESS_NONE); var deviceAttributes = default(NativeMethods.HIDD_ATTRIBUTES); deviceAttributes.Size = Marshal.SizeOf(deviceAttributes); NativeMethods.HidD_GetAttributes(hidHandle, ref deviceAttributes); string uuid = GetDeviceSerialNumber(hidHandle); CloseDeviceIO(ref hidHandle); SeneyeProductType type = SeneyeProductType.Ignore; if (deviceAttributes.VendorID == 9463) { if (deviceAttributes.ProductID == 0x2204) { type = SeneyeProductType.SUDv2e; } if (uuid == null || uuid.Length != 32) { type = SeneyeProductType.Ignore; } } return(new SUDDescriptor(DevicePath, deviceAttributes.ProductID, deviceAttributes.VendorID, uuid, type)); }
public SUDDescriptor(string Path, ushort PID, ushort VID, string UUID, SeneyeProductType ProductType) { this.Path = Path; this.PID = PID; this.VID = VID; this.UUID = UUID; this.ProductType = ProductType; }