Ejemplo n.º 1
0
        private readonly PIEHid32Net.PIEDevice device;                   // Our RailDriver

        public RailDriver32()
        {
            try
            {
                foreach (PIEHid32Net.PIEDevice currentDevice in PIEHid32Net.PIEDevice.EnumeratePIE())
                {
                    if (currentDevice.HidUsagePage == 0xc && currentDevice.Pid == 210)
                    {
                        device = currentDevice;
                        device.SetupInterface();
                        device.suppressDuplicateReports = true;
                        break;
                    }
                }
            }
            catch (Exception error)
            {
                device = null;
                System.Diagnostics.Trace.WriteLine(error);
            }
        }
Ejemplo n.º 2
0
 public void HandlePIEHidError(PIEHid32Net.PIEDevice sourceDevices, int error)
 {
     Trace.TraceWarning("RailDriver Error: {0}", error);
 }
Ejemplo n.º 3
0
 public void HandlePIEHidData(byte[] data, PIEHid32Net.PIEDevice sourceDevice, int error)
 {
     OnDataRead?.Invoke(data, this);
 }