/// <summary>
 /// Stop this controller
 /// </summary>
 /// <returns></returns>
 public bool Stop() {
     if (_dispatcher == null)
         return true;
     _dispatcher.OnInterrupt -= Dispatcher_OnInterrupt;
     _dispatcher.Dispose();
     _dispatcher = null;
     return NativeStop();
     }
 /// <summary>
 /// Start this controller
 /// </summary>
 /// <returns></returns>
 public bool Start() {
     if (_dispatcher != null) {
         return true;
         }
     _dispatcher = new NativeEventDispatcher("Community_Hardware_UsbHost_Driver", 0);
     _dispatcher.OnInterrupt += Dispatcher_OnInterrupt;
     return NativeStart();
     }
Beispiel #3
0
 public SerialPort(string portName, int baudRate, Parity parity, int dataBits, StopBits stopBits)
 {
     m_portName = portName;
     m_config = new Configuration(portName, baudRate, parity, dataBits, stopBits);
     m_fDisposed = false;
     m_fOpened = false;
     m_evtErrorEvent = new NativeEventDispatcher("SerialPortErrorEvent", (ulong)m_config.PortIndex);
     m_evtDataEvent = new NativeEventDispatcher("SerialPortDataEvent", (ulong)m_config.PortIndex);
 }
 /// <summary>
 /// Dispose native resources
 /// </summary>
 public void Dispose() {
     if (_dispatcher == null)
         return;
     _dispatcher.OnInterrupt -= Dispatcher_OnInterrupt;
     _dispatcher.Dispose();
     _dispatcher = null;
     Uninitialize();
     }
 /// <summary>
 /// Initialize a new <see cref="QuadratureEncoder"/>
 /// </summary>
 public QuadratureEncoder(QuadratureEncoderChannel channel, CountMode mode) {
     //Do not use HardwareProvider to keep the feature independant :
     //no HardwareProvider.HwProvider.GetQuadratureEncoderChannelCount(); 
     //no HardwareProvider.HwProvider.GetQuadratureEncoderPinsForChannel(...); 
     //-> if a solution doesn't need this feature, no stub is required
     _channel = channel;
     _mode = mode;
     GetQuadratureEncoderPinsForChannel(channel, out _pin_A, out _pin_B);
     Initialize();
     _dispatcher = new NativeEventDispatcher("Community_QuadratureEncoder_Driver", 0);
     _dispatcher.OnInterrupt += Dispatcher_OnInterrupt;
     }
 /// <summary>
 /// Dispose native resources
 /// </summary>
 public void Dispose() {
     _dispatcher.OnInterrupt -= Dispatcher_OnInterrupt;
     _dispatcher.Dispose();
     _dispatcher = null;
     }
 /// <summary>
 /// Initialize a new <see cref="QuadratureEncoder"/>
 /// </summary>
 public QuadratureEncoder() {
     _dispatcher = new NativeEventDispatcher("QuadratureEncoder_Driver", 0);
     _dispatcher.OnInterrupt += Dispatcher_OnInterrupt;
     }
 public static void EnableReceiveInterrupt()
 {
     m_evtDataEvent = new NativeEventDispatcher("Angelos_PacketReceivedEvent", 0);
     m_evtDataEvent.OnInterrupt += m_evtDataEvent_OnInterrupt;
 }