From 4e7a172e6dc79f56fa6600fbe75985f5eb0b9d29 Mon Sep 17 00:00:00 2001 From: Lars Op den Kamp Date: Wed, 3 Oct 2012 16:32:52 +0200 Subject: [PATCH] log the exact data for failed transmissions, not the opcode --- src/lib/CECProcessor.cpp | 2 +- .../Pulse-Eight/USBCECAdapterMessageQueue.cpp | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/lib/CECProcessor.cpp b/src/lib/CECProcessor.cpp index 409b30b..4ae1efe 100644 --- a/src/lib/CECProcessor.cpp +++ b/src/lib/CECProcessor.cpp @@ -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; } diff --git a/src/lib/adapter/Pulse-Eight/USBCECAdapterMessageQueue.cpp b/src/lib/adapter/Pulse-Eight/USBCECAdapterMessageQueue.cpp index a751952..a4924b8 100644 --- a/src/lib/adapter/Pulse-Eight/USBCECAdapterMessageQueue.cpp +++ b/src/lib/adapter/Pulse-Eight/USBCECAdapterMessageQueue.cpp @@ -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; } -- 2.34.1