From 417aca8307ad062750be0ff8df9765ee380ef543 Mon Sep 17 00:00:00 2001 From: Lars Op den Kamp Date: Tue, 22 Nov 2011 20:16:01 +0100 Subject: [PATCH] cec: fixed - clear any previous input when opening a connection to the adapter. bugzid: 54 --- src/lib/AdapterCommunication.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/AdapterCommunication.cpp b/src/lib/AdapterCommunication.cpp index e772d35..74ea9e3 100644 --- a/src/lib/AdapterCommunication.cpp +++ b/src/lib/AdapterCommunication.cpp @@ -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()) { -- 2.34.1