Example #1
0
 /// <inheritdoc />
 public void StopReading()
 {
     _serialPoller.Stop();
     IsEnable = false;
     SerialPort.Disable();
     SerialPort.ClearReadBuffer();
 }
Example #2
0
        /// <summary>
        /// Dispose of this instance.
        /// </summary>
        public void Dispose()
        {
            //foreach (var observer in _observers)
            //{
            //    observer?.OnCompleted();
            //}
            //_observers.Clear();

            _serialPoller?.Dispose();
            if (IsEnable)
            {
                IsEnable = false;
                SerialPort.Disable();
            }
        }