Commit e87d424d9db1d29ffd37e1d3b661e7c37710e4d1
Committed by
GitHub
Merge pull request #28 from SibertEnovates/master
Added getState
Showing
2 changed files
with
7 additions
and
0 deletions
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 |