/// <inheritdoc /> public void StopReading() { _serialPoller.Stop(); IsEnable = false; SerialPort.Disable(); SerialPort.ClearReadBuffer(); }
/// <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(); } }