cec: fixed - clear any previous input when opening a connection to the adapter. bugzi...
authorLars Op den Kamp <lars@opdenkamp.eu>
Tue, 22 Nov 2011 19:16:01 +0000 (20:16 +0100)
committerLars Op den Kamp <lars@opdenkamp.eu>
Tue, 22 Nov 2011 19:16:38 +0000 (20:16 +0100)
src/lib/AdapterCommunication.cpp

index e772d351cbd265fdf6a1a9d4b764edebd0f28e5e..74ea9e3f33826363d4ab34e6caf50ff99a0ae2d9 100644 (file)
@@ -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())
   {