diff options
Diffstat (limited to 'src/MTS_IO_SerialConnection.cpp')
-rw-r--r-- | src/MTS_IO_SerialConnection.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/MTS_IO_SerialConnection.cpp b/src/MTS_IO_SerialConnection.cpp index 4a7923b..a9f3d6e 100644 --- a/src/MTS_IO_SerialConnection.cpp +++ b/src/MTS_IO_SerialConnection.cpp @@ -272,7 +272,8 @@ bool SerialConnection::doOpen(const int32_t& timeoutMillis) { #else m_iHandle = ::open(m_sPortName.c_str(), O_RDWR | O_NOCTTY ); if (m_iHandle == -1) { - printWarning("SERIAL| Failed to open port [%s] [%d]", m_sPortName.c_str(), errno); + printWarning("SERIAL| Failed to open port [%s] [%d]%s", m_sPortName.c_str(), errno, + errno == 13 ? " (Permission Denied)" : ""); if(!m_apLockFile.isNull()) { m_apLockFile->unlock(); } @@ -282,7 +283,8 @@ bool SerialConnection::doOpen(const int32_t& timeoutMillis) { int result = tcgetattr(m_iHandle, &m_stPrevOptions); if (result == -1) { - printWarning("SERIAL| Failed to get attributes on port [%s] [%d]", m_sPortName.c_str(), errno); + printWarning("SERIAL| Failed to get attributes on port [%s] [%d]%s", m_sPortName.c_str(), errno, + errno == 13 ? " (Permission Denied)" : ""); } termios options = m_stPrevOptions; @@ -413,7 +415,8 @@ bool SerialConnection::doOpen(const int32_t& timeoutMillis) { result = tcsetattr(m_iHandle, TCSANOW, &options); if (result == -1) { - printWarning("SERIAL| Failed to set configurations on port [%s] [%d]", m_sPortName.c_str(), errno); + printWarning("SERIAL| Failed to set configurations on port [%s] [%d]%s", m_sPortName.c_str(), errno, + errno == 13 ? " (Permission Denied)" : ""); goto CLEANUP; } result = tcflush(m_iHandle, TCIOFLUSH); |