/// <summary>
        /// Begin reading from the modem's serial port and listen for location updates
        /// </summary>
        public void Start()
        {
            outputPort = serialProxy.Create(config.Positioning.SerialOutput, config.Positioning.SerialBaudRate);

            SendUpdateRequestSignal();
            workThread = threadProxy.Create(ProcessUpdates);
        }
 public QuectelModemPositioningService(IOverkillConfiguration _config, IPubSubService _pubSub, IThreadProxy _threadProxy, ISerialProxy _serialProxy)
 {
     config      = _config;
     pubSub      = _pubSub;
     threadProxy = _threadProxy;
     serialProxy = _serialProxy;
 }
        /// <summary>
        /// Connects to the remote host and starts the receiving thread
        /// </summary>
        public void Connect()
        {
            Console.WriteLine("Connecting to TCP interface...");
            try
            {
                tcpClient.Connect(host, port);
                tcpClient.ReceiveTimeout = 1000;
                tcpClient.SendTimeout    = 1000;
                networkStream            = tcpClient.GetStream();

                thread = threadProxy.Create(Run);
                thread.Start();
            } catch (Exception ex)
            {
                Console.WriteLine("Could not connect to vehicle. Retrying...");
                Task.Run(() =>
                {
                    Thread.Sleep(1000);
                    Connect();
                });
            }
        }
 public TcpConnectionInterface(IPubSubService _pubSub, IThreadProxy _threadProxy)
 {
     pubSub      = _pubSub;
     threadProxy = _threadProxy;
 }