cec: added GetPortName() to CUSBCECAdapterCommunication
[deb_libcec.git] / src / lib / adapter / USBCECAdapterCommunication.cpp
index 3b32ebd3b259af9b312c4922e09843f741472949..7037c78eff960357f2842e3f8cd5a154dfcb61cb 100644 (file)
@@ -663,6 +663,7 @@ bool CUSBCECAdapterCommunication::ReadFromDevice(uint32_t iTimeout, size_t iSize
   if (iBytesRead < 0 || iBytesRead > 256)
   {
     CLibCEC::AddLog(CEC_LOG_ERROR, "error reading from serial port: %s", m_port->GetError().c_str());
+    StopThread(false);
     return false;
   }
   else if (iBytesRead > 0)
@@ -706,3 +707,10 @@ void CUSBCECAdapterCommunication::WriteNextCommand(void)
   if (m_outBuffer.Pop(msg))
     SendMessageToAdapter(msg);
 }
+
+CStdString CUSBCECAdapterCommunication::GetPortName(void)
+{
+  CStdString strName;
+  strName = m_port->GetName();
+  return strName;
+}