Esempio n. 1
1
		void Button_Click_1(object sender, RoutedEventArgs e)
		{
			UsbDevice = new UsbLibrary.UsbHidPort();
			UsbDevice.VendorId = 0xC251;
			UsbDevice.ProductId = 0x1303;
			UsbDevice.CheckDevicePresent();

			UsbDevice.SpecifiedDevice.DataRecieved += new UsbLibrary.DataRecievedEventHandler(SpecifiedDevice_DataRecieved);
		}
Esempio n. 2
0
		public bool Open()
		{
			UsbHidPort = new UsbHidPort()
			{
				VendorId = 0xC251,
				ProductId = 0x1303
			};
			UsbHidPort.CheckDevicePresent();
			if (UsbHidPort.SpecifiedDevice == null)
				return false;
			UsbHidPort.SpecifiedDevice.DataRecieved += new DataRecievedEventHandler(OnDataRecieved);
			UsbHidPort.SpecifiedDevice.OnDeviceRemoved += new EventHandler(UsbHidPort_OnDeviceRemoved);
			return true;
		}