X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Flib%2FAdapterCommunication.cpp;h=0fee28b50c3a187c7d05268c162b0ba5dc0a7e32;hb=88c43521c98366880d9ea218aa476f278607b322;hp=d3eecf45ea7f1045ef466ba38e1291f71f0186ca;hpb=b9eea66dd7e19a4baf9e89f4fd6b3c2f281ba7a7;p=deb_libcec.git diff --git a/src/lib/AdapterCommunication.cpp b/src/lib/AdapterCommunication.cpp index d3eecf4..0fee28b 100644 --- a/src/lib/AdapterCommunication.cpp +++ b/src/lib/AdapterCommunication.cpp @@ -85,6 +85,7 @@ CCECAdapterMessage::CCECAdapterMessage(const cec_command &command) CCECAdapterMessage &CCECAdapterMessage::operator =(const CCECAdapterMessage &msg) { packet = msg.packet; + state = msg.state; return *this; } @@ -93,10 +94,10 @@ void CCECAdapterMessage::push_escaped(int16_t byte) if (byte >= MSGESC && byte != MSGSTART) { push_back(MSGESC); - push_back(byte - ESCOFFSET); + push_back((uint8_t) (byte - ESCOFFSET)); } else - push_back(byte); + push_back((uint8_t) byte); } CAdapterCommunication::CAdapterCommunication(CLibCEC *controller) : @@ -260,7 +261,7 @@ bool CAdapterCommunication::Read(CCECAdapterMessage &msg, uint32_t iTimeout) uint8_t buf = 0; if (!m_inBuffer.Pop(buf)) { - if (!m_rcvCondition.Wait(&m_mutex, iTarget - iNow)) + if (!m_rcvCondition.Wait(&m_mutex, (uint32_t) (iTarget - iNow))) return false; }