Exemplo n.º 1
0
 /// <summary>
 ///     Attempts to instantiate an ELM327 connection object.
 /// </summary>
 private void Connect()
 {
     lock (_syncLock)
     {
         _port.Connect();
         // if the connection failed, close it
         if (_port.Status == OBDStatus.NotConnected)
         {
             // the ELM327 class will report its own errors
             Close();
         }
     }
 }
Exemplo n.º 2
0
        public void Start()
        {
            _managementPort.Connect();
            _managementPort.RegisterReceiveMessageEvent(_packetForwarder.ConfigureFromManagementSystem);
            _managementPort.StartReceiving();

            foreach (string clientPortAlias in _configuration.ClientPortAliases)
            {
                _clientPorts.Add(clientPortAlias, _clientPortFactory.GetPort(clientPortAlias));
                _clientPorts[clientPortAlias].Connect();
                _clientPorts[clientPortAlias].RegisterReceiveMessageEvent(_packetForwarder.ForwardPacket);
                _clientPorts[clientPortAlias].StartReceiving();
            }

            _packetForwarder.SetClientPorts(_clientPorts);

            ManualResetEvent allDone = new ManualResetEvent(false);

            allDone.WaitOne();
        }
Exemplo n.º 3
0
 public void ReadData()
 {
     _port.Connect();
 }