diff --git a/CHANGELOG.md b/CHANGELOG.md index 4094786..e326a10 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Sphinx documentation. - Unit tests for testing `SetTimeout()`. +### Fixed +- Serial port state is set to `CLOSED` on initialization. + ## [v2.0.1] - 2017-11-27 ### Fixed diff --git a/src/SerialPort.cpp b/src/SerialPort.cpp index c80a831..9bf0aca 100644 --- a/src/SerialPort.cpp +++ b/src/SerialPort.cpp @@ -31,6 +31,7 @@ namespace CppLinuxSerial { baudRate_ = defaultBaudRate_; readBufferSize_B_ = defaultReadBufferSize_B_; readBuffer_.reserve(readBufferSize_B_); + state_ = State::CLOSED; } SerialPort::SerialPort(const std::string& device, BaudRate baudRate) :