OSVR-Core
GetSerialPortState.h
Go to the documentation of this file.
1 
11 // Copyright 2015 Sensics, Inc.
12 //
13 // Licensed under the Apache License, Version 2.0 (the "License");
14 // you may not use this file except in compliance with the License.
15 // You may obtain a copy of the License at
16 //
17 // http://www.apache.org/licenses/LICENSE-2.0
18 //
19 // Unless required by applicable law or agreed to in writing, software
20 // distributed under the License is distributed on an "AS IS" BASIS,
21 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
22 // See the License for the specific language governing permissions and
23 // limitations under the License.
24 
25 #ifndef INCLUDED_GetSerialPortState_h_GUID_6A7FD323_CCB5_4093_45E3_9BA7A2943777
26 #define INCLUDED_GetSerialPortState_h_GUID_6A7FD323_CCB5_4093_45E3_9BA7A2943777
27 
28 // Internal Includes
29 // - none
30 
31 // Library/third-party includes
32 // - none
33 
34 // Standard includes
35 #include <string>
36 
43 };
45 
47 SerialPortState getSerialPortState(std::string const &port);
48 
55 std::string normalizeSerialPort(std::string const &port);
56 
63 void verifySerialPort(std::string const &port,
64  std::string const &origPort = std::string());
65 
73 std::string normalizeAndVerifySerialPort(std::string const &port);
74 
75 #endif // INCLUDED_GetSerialPortState_h_GUID_6A7FD323_CCB5_4093_45E3_9BA7A2943777
SerialPortState
Definition: GetSerialPortState.h:37
std::string normalizeAndVerifySerialPort(std::string const &port)
Normalizes and verifies the accessibility of a serial port and throws a std::exception unless it is a...
Definition: GetSerialPortState.cpp:116
SerialPortState getSerialPortState(std::string const &port)
Returns an enum value indicating the apparent state of the port.
Definition: GetSerialPortState.cpp:72
void verifySerialPort(std::string const &port, std::string const &origPort=std::string())
Verifies the accessibility of a serial port and throws a std::exception unless it is available...
Definition: GetSerialPortState.cpp:94
Something&#39;s wrong with the port name you gave.
Definition: GetSerialPortState.h:38
serial port requested is present, but busy (opened for exclusive use).
Definition: GetSerialPortState.h:40
serial port requested is missing.
Definition: GetSerialPortState.h:39
serial port requested is available and not opened for exclusive use.
Definition: GetSerialPortState.h:42
std::string normalizeSerialPort(std::string const &port)
Normalizes the name of a serial port.
Definition: GetSerialPortState.cpp:79