public static bool IsDetected(int vendorId, int productId) { var device = new HIDDevice(vendorId, productId, false); bool ret = device.Found; device.Dispose(); return(ret); }
private void _Init(int vendorId, int productId, bool throwNotFoundError) { var devices = HIDDevice.GetAllDevices(vendorId, productId); if (devices != null && devices.Count > 0) { _Init(devices[0].Path, throwNotFoundError); } else { if (throwNotFoundError) { throw new InvalidOperationException("Device not found"); } } }
public static bool IsDetected(int vendorId, int productId) { var device = new HIDDevice(vendorId, productId, false); bool ret = device.Found; device.Dispose(); return ret; }