OSVR-Core
|
Implementation. More...
#include "GetSerialPortState.h"
#include <osvr/Util/MacroToolsC.h>
#include <osvr/Util/Finally.h>
#include <stdexcept>
Functions | |
SerialPortState | getSerialPortStateImpl (std::string const &port) |
SerialPortState | getSerialPortState (std::string const &port) |
Returns an enum value indicating the apparent state of the port. | |
std::string | normalizeSerialPort (std::string const &port) |
Normalizes the name of a serial port. More... | |
void | verifySerialPort (std::string const &port, std::string const &origPort) |
Verifies the accessibility of a serial port and throws a std::exception unless it is available. More... | |
std::string | normalizeAndVerifySerialPort (std::string const &port) |
Normalizes and verifies the accessibility of a serial port and throws a std::exception unless it is available. More... | |
Implementation.
|
inline |
std::string normalizeAndVerifySerialPort | ( | std::string const & | port | ) |
Normalizes and verifies the accessibility of a serial port and throws a std::exception unless it is available.
On Windows, this takes care of prefixing \.\, for instance.
port | The serial port name as supplied |
std::string normalizeSerialPort | ( | std::string const & | port | ) |
Normalizes the name of a serial port.
On Windows, this takes care of prefixing \.\, for instance.
port | The serial port name as supplied |
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.
port | The serial port name (already normalized) |
origPort | If specified (and non-empty), the port name pre-normalization, for use in exceptions. |
safety catch-all