CreateReport() public method

public CreateReport ( ) : HidLibrary.HidReport
return HidLibrary.HidReport
Exemplo n.º 1
0
        public int proveraPumpi()
        {
            System.Windows.Threading.DispatcherTimer T = new System.Windows.Threading.DispatcherTimer();
            T.Tick += new EventHandler(dispatcherTimer_Tick);
            T.Interval = new TimeSpan(0, 0, 0, 0, 100);
            T.Start();

                //_deviceList = HidDevices.Enumerate().ToArray() ;
                //duzina = _deviceList.GetLength(0);
                //if (_deviceList[duzina].Equals(HidDevices.Enumerate(0x1234)))
                //{
            try
            {
                _selectedDevice = HidDevices.Enumerate(0x1234, 0x0021).First();
                _selectedDevice.OpenDevice();
                _selectedDevice.MonitorDeviceEvents = true;
                _selectedDevice.Inserted += Device_Inserted;
                _selectedDevice.Removed += Device_Removed;

                gaga = _selectedDevice.CreateReport();

                //var device = _selectedDevice;

                //device.OpenDevice();
                //device.MonitorDeviceEvents = true;

                // device.ReadReport(ReadProcess);
                _selectedDevice.ReadReport(ReadProcess);

                return 1;
            }
            catch { return 0; };
        }