From: Lars Op den Kamp Date: Wed, 25 Jan 2012 10:07:44 +0000 (+0100) Subject: cec: fixed - MSGCODE_START_BOOTLOADER doesn't respond with MSGCODE_COMMAND_ACCEPTED X-Git-Tag: upstream/2.2.0~1^2~39^2~16 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=71c4a2f532f422c80337ff11de69d1fa6f3910bd;p=deb_libcec.git cec: fixed - MSGCODE_START_BOOTLOADER doesn't respond with MSGCODE_COMMAND_ACCEPTED --- diff --git a/src/lib/adapter/AdapterCommunication.cpp b/src/lib/adapter/AdapterCommunication.cpp index 821a4f2..44b24e1 100644 --- a/src/lib/adapter/AdapterCommunication.cpp +++ b/src/lib/adapter/AdapterCommunication.cpp @@ -151,7 +151,7 @@ bool CAdapterCommunication::Write(CCECAdapterMessage *data) { m_processor->AddLog(CEC_LOG_ERROR, "command was not sent"); } - if (WaitForTransmitSucceeded(data)) + if (data->expectControllerAck && WaitForTransmitSucceeded(data)) { if (data->isTransmission) data->state = ADAPTER_MESSAGE_STATE_SENT_ACKED; @@ -239,6 +239,7 @@ bool CAdapterCommunication::StartBootloader(void) output->PushEscaped(MSGCODE_START_BOOTLOADER); output->PushBack(MSGEND); output->isTransmission = false; + output->expectControllerAck = false; if ((bReturn = Write(output)) == false) m_processor->AddLog(CEC_LOG_ERROR, "could not start the bootloader"); diff --git a/src/lib/adapter/AdapterMessage.h b/src/lib/adapter/AdapterMessage.h index 26acd90..784ed2a 100644 --- a/src/lib/adapter/AdapterMessage.h +++ b/src/lib/adapter/AdapterMessage.h @@ -255,13 +255,14 @@ namespace CEC void Clear(void) { - state = ADAPTER_MESSAGE_STATE_UNKNOWN; - transmit_timeout = 0; + state = ADAPTER_MESSAGE_STATE_UNKNOWN; + transmit_timeout = 0; packet.Clear(); - maxTries = CEC_DEFAULT_TRANSMIT_RETRIES + 1; - tries = 0; - reply = MSGCODE_NOTHING; - isTransmission = true; + maxTries = CEC_DEFAULT_TRANSMIT_RETRIES + 1; + tries = 0; + reply = MSGCODE_NOTHING; + isTransmission = true; + expectControllerAck = true; } void Shift(uint8_t iShiftBy) @@ -354,6 +355,7 @@ namespace CEC cec_adapter_message_state state; int32_t transmit_timeout; bool isTransmission; + bool expectControllerAck; PLATFORM::CMutex mutex; PLATFORM::CCondition condition; };