Commit 8808d3b6e49a73e16d4849f9829ebdc53c300fbd

Authored by Sibert Declercq
1 parent 61f77cb9

Added getState

include/CppLinuxSerial/SerialPort.hpp
@@ -173,6 +173,10 @@ namespace mn { @@ -173,6 +173,10 @@ namespace mn {
173 /// \throws CppLinuxSerial::Exception if state != OPEN. 173 /// \throws CppLinuxSerial::Exception if state != OPEN.
174 int32_t Available(); 174 int32_t Available();
175 175
  176 + /// \brief Use to get the state of the serial port
  177 + /// \returns The state of the serial port
  178 + State getState();
  179 +
176 private: 180 private:
177 181
178 /// \brief Configures the tty device as a serial port. 182 /// \brief Configures the tty device as a serial port.
src/SerialPort.cpp
@@ -638,6 +638,9 @@ namespace CppLinuxSerial { @@ -638,6 +638,9 @@ namespace CppLinuxSerial {
638 return ret; 638 return ret;
639 639
640 } 640 }
  641 + State SerialPort::getState() {
  642 + return state_;
  643 + }
641 644
642 } // namespace CppLinuxSerial 645 } // namespace CppLinuxSerial
643 } // namespace mn 646 } // namespace mn