From: Lars Op den Kamp Date: Wed, 3 Oct 2012 14:32:52 +0000 (+0200) Subject: log the exact data for failed transmissions, not the opcode X-Git-Tag: upstream/2.2.0~1^2~17^2^2~39 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=4e7a172e6dc79f56fa6600fbe75985f5eb0b9d29;p=deb_libcec.git log the exact data for failed transmissions, not the opcode --- 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; }