log the exact data for failed transmissions, not the opcode
authorLars Op den Kamp <lars@opdenkamp.eu>
Wed, 3 Oct 2012 14:32:52 +0000 (16:32 +0200)
committerLars Op den Kamp <lars@opdenkamp.eu>
Wed, 3 Oct 2012 14:36:34 +0000 (16:36 +0200)
src/lib/CECProcessor.cpp
src/lib/adapter/Pulse-Eight/USBCECAdapterMessageQueue.cpp

index 409b30b1cdde68d6f4ff79304a9fecc32a7d1316..4ae1efeef343291b51425dab8a1f9ceb8585dbc4 100644 (file)
@@ -438,7 +438,7 @@ bool CCECProcessor::Transmit(const cec_command &data, bool bIsReply)
   }
 
   return bIsReply ?
-      adapterState == ADAPTER_MESSAGE_STATE_SENT_ACKED || adapterState == ADAPTER_MESSAGE_STATE_SENT || adapterState == ADAPTER_MESSAGE_STATE_WAITING_TO_BE_SENT :
+      adapterState != ADAPTER_MESSAGE_STATE_ERROR :
       adapterState == ADAPTER_MESSAGE_STATE_SENT_ACKED;
 }
 
index a75195270fece7715618244f0e39f18c7ceb8aeb..a4924b8960c4fa8ad1b75af672cb9cabc7446eb7 100644 (file)
@@ -337,7 +337,12 @@ void CCECAdapterMessageQueue::CheckTimedOutMessages(void)
     {
       timedOut.push_back(it->first);
       if (!it->second->m_bSucceeded)
-        m_com->m_callback->GetLib()->AddLog(CEC_LOG_DEBUG, "command '%s' was not acked by the controller", CCECAdapterMessage::ToString(it->second->m_message->Message()));
+      {
+        if (it->second->m_message->IsTranmission())
+          m_com->m_callback->GetLib()->AddLog(CEC_LOG_DEBUG, "transmission '%s' was not acked by the controller", it->second->m_message->ToString().c_str());
+        else
+          m_com->m_callback->GetLib()->AddLog(CEC_LOG_DEBUG, "command '%s' was not acked by the controller", CCECAdapterMessage::ToString(it->second->m_message->Message()));
+      }
       delete it->second->m_message;
       delete it->second;
     }
@@ -436,7 +441,10 @@ bool CCECAdapterMessageQueue::Write(CCECAdapterMessage *msg)
   {
     if (!entry->Wait(msg->transmit_timeout <= 5 ? CEC_DEFAULT_TRANSMIT_WAIT : msg->transmit_timeout))
     {
-      m_com->m_callback->GetLib()->AddLog(CEC_LOG_DEBUG, "command '%s' was not acked by the controller", CCECAdapterMessage::ToString(msg->Message()));
+      if (msg->IsTranmission())
+        m_com->m_callback->GetLib()->AddLog(CEC_LOG_DEBUG, "transmission '%s' was not acked by the controller", msg->ToString().c_str());
+      else
+        m_com->m_callback->GetLib()->AddLog(CEC_LOG_DEBUG, "command '%s' was not acked by the controller", CCECAdapterMessage::ToString(msg->Message()));
       msg->state = ADAPTER_MESSAGE_STATE_SENT_NOT_ACKED;
       bReturn = false;
     }