| 77 | } |
| 78 | |
| 79 | std::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 | |
| 94 | void verifySerialPort(std::string const &port, std::string const &origPort) { |
| 95 | std::string const *origPortPtr = origPort.empty() ? &port : &origPort; |
no test coverage detected