cec: added a hook in libcec for physical address autodetection
[deb_libcec.git] / src / lib / AdapterCommunication.cpp
index 1aaf3c8573c4efac9784650b28f939006036177b..74ea9e3f33826363d4ab34e6caf50ff99a0ae2d9 100644 (file)
@@ -64,7 +64,7 @@ CCECAdapterMessage::CCECAdapterMessage(const cec_command &command)
   if (command.opcode_set == 1)
   {
     push_back(MSGSTART);
-    push_escaped(command.parameters.empty() ? (uint8_t)MSGCODE_TRANSMIT_EOM : (uint8_t)MSGCODE_TRANSMIT);
+    push_escaped(command.parameters.IsEmpty() ? (uint8_t)MSGCODE_TRANSMIT_EOM : (uint8_t)MSGCODE_TRANSMIT);
     push_back((uint8_t) command.opcode);
     push_back(MSGEND);
 
@@ -282,7 +282,7 @@ bool CAdapterCommunication::Open(const char *strPort, uint16_t iBaudRate /* = 38
 
   //clear any input bytes
   uint8_t buff[1024];
-  m_port->Read(buff, sizeof(buff), 500);
+  while (m_port->Read(buff, sizeof(buff), 500) > 0) {}
 
   if (CreateThread())
   {