cec: handle bus scan from LG TVs
[deb_libcec.git] / src / lib / AdapterCommunication.cpp
index 440226b3e84eb9f12aa357cbf68f472ff4549dba..32ceeafc02e5835be628af9a2d8e140056c838b0 100644 (file)
@@ -215,8 +215,7 @@ CStdString CCECAdapterMessage::ToString(void) const
 bool CCECAdapterMessage::is_error(void) const
 {
   cec_adapter_messagecode code = message();
-  return (code == MSGCODE_TIMEOUT_ERROR ||
-    code == MSGCODE_HIGH_ERROR ||
+  return (code == MSGCODE_HIGH_ERROR ||
     code == MSGCODE_LOW_ERROR ||
     code == MSGCODE_RECEIVE_FAILED ||
     code == MSGCODE_COMMAND_REJECTED ||
@@ -373,7 +372,7 @@ void CAdapterCommunication::SendMessageToAdapter(CCECAdapterMessage *msg)
   else
   {
     m_controller->AddLog(CEC_LOG_DEBUG, "command sent");
-    CCondition::Sleep((uint32_t) msg->size() * 24 /*data*/ + 5 /*start bit (4.5 ms)*/ + 10);
+    CCondition::Sleep((uint32_t) msg->size() * 24 /*data*/ + 5 /*start bit (4.5 ms)*/);
     msg->state = ADAPTER_MESSAGE_STATE_SENT;
   }
   msg->condition.Signal();
@@ -414,7 +413,8 @@ bool CAdapterCommunication::Read(CCECAdapterMessage &msg, uint32_t iTimeout)
     }
     else if (buf == MSGSTART) //we found a msgstart before msgend, this is not right, remove
     {
-      m_controller->AddLog(CEC_LOG_ERROR, "received MSGSTART before MSGEND");
+      if (msg.size() > 0)
+        m_controller->AddLog(CEC_LOG_WARNING, "received MSGSTART before MSGEND, removing previous buffer contents");
       msg.clear();
       bGotStart = true;
     }