cec: fixed - MSGCODE_START_BOOTLOADER doesn't respond with MSGCODE_COMMAND_ACCEPTED
authorLars Op den Kamp <lars@opdenkamp.eu>
Wed, 25 Jan 2012 10:07:44 +0000 (11:07 +0100)
committerLars Op den Kamp <lars@opdenkamp.eu>
Wed, 25 Jan 2012 10:07:44 +0000 (11:07 +0100)
src/lib/adapter/AdapterCommunication.cpp
src/lib/adapter/AdapterMessage.h

index 821a4f2aa276e919e3156d521b2114bd53b5248c..44b24e1a7c28e9672f3926fd21aea683355c5f73 100644 (file)
@@ -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");
index 26acd90d2f5d03e4079a98c52f5b01709f890704..784ed2a648af2db300b2df426c5998f11882f46a 100644 (file)
@@ -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;
   };