cec: unload libCEC when the lib version is invalid
[deb_libcec.git] / src / lib / AdapterCommunication.cpp
index 5541bf56a5381febe2a64264b897099fff2d1cc6..93648742825ce3f089013615d119afae827bf114 100644 (file)
@@ -43,7 +43,6 @@ using namespace CEC;
 CCECAdapterMessage::CCECAdapterMessage(const cec_command &command)
 {
   clear();
-  maxTries = command.retries + 1;
 
   //set ack polarity to high when transmitting to the broadcast address
   //set ack polarity low when transmitting to any other address
@@ -303,6 +302,9 @@ bool CAdapterCommunication::Open(const char *strPort, uint16_t iBaudRate /* = 38
     m_processor->AddLog(CEC_LOG_DEBUG, "could not create a communication thread");
   }
 
+  //TODO implement the timeout. use the variable for now to silence the compiler warning
+  iTimeoutMs = 0;
+
   return false;
 }
 
@@ -328,6 +330,10 @@ void *CAdapterCommunication::Process(void)
     WriteNextCommand();
   }
 
+  CCECAdapterMessage *msg;
+  if (m_outBuffer.Pop(msg))
+    msg->condition.Broadcast();
+
   return NULL;
 }