MCPcopy Create free account
hub / github.com/OSVR/OSVR-Core / normalizeSerialPort

Function normalizeSerialPort

plugins/multiserver/GetSerialPortState.cpp:79–92  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

77}
78
79std::string normalizeSerialPort(std::string const &port) {
80 if (port.empty()) {
81 return port;
82 }
83#ifdef _WIN32
84 // Use the Win32 device namespace, if they aren't already.
85 // Have to double the backslashes because they're escape characters.
86 /// @todo device namespace only valid on WinNT-derived windows?
87 if (port.find('\\') == std::string::npos) {
88 return "\\\\.\\" + port;
89 }
90#endif
91 return port;
92}
93
94void verifySerialPort(std::string const &port, std::string const &origPort) {
95 std::string const *origPortPtr = origPort.empty() ? &port : &origPort;

Callers 1

Calls 2

emptyMethod · 0.45
findMethod · 0.45

Tested by

no test coverage detected