예제 #1
0
        public static bool IsDetected(int vendorId, int productId)
        {
            var  device = new HIDDevice(vendorId, productId, false);
            bool ret    = device.Found;

            device.Dispose();

            return(ret);
        }
예제 #2
0
        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");
                }
            }
        }
예제 #3
0
		public static bool IsDetected(int vendorId, int productId)
		{
			var device = new HIDDevice(vendorId, productId, false);
			bool ret = device.Found;

			device.Dispose();

			return ret;
		}