X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Flib%2FCECProcessor.cpp;h=23bf4c7459c9ed40964730b632304d0190ddcc2f;hb=fd5e333a85d5593873b287170f06c0af3166fce6;hp=571d02d0a184356b894d9c272d7c88de2872b9d7;hpb=82d1a9a150628b179d1ad501eb9a73feb3f6dd1d;p=deb_libcec.git diff --git a/src/lib/CECProcessor.cpp b/src/lib/CECProcessor.cpp index 571d02d..23bf4c7 100644 --- a/src/lib/CECProcessor.cpp +++ b/src/lib/CECProcessor.cpp @@ -674,7 +674,7 @@ bool CCECProcessor::Transmit(CCECAdapterMessage *output) bool bReturn(false); CLockObject lock(&m_mutex); { - while (output->needs_retry() && ++output->tries <= output->maxTries) + do { CLockObject msgLock(&output->mutex); if (!m_communication || !m_communication->Write(output)) @@ -696,7 +696,7 @@ bool CCECProcessor::Transmit(CCECAdapterMessage *output) } else bReturn = true; - } + }while (output->transmit_timeout > 0 && output->needs_retry() && ++output->tries <= output->maxTries); } return bReturn; @@ -752,18 +752,21 @@ bool CCECProcessor::WaitForTransmitSucceeded(CCECAdapterMessage *message) } if (bError) + { message->reply = msg.message(); + m_controller->AddLog(CEC_LOG_DEBUG, msg.ToString()); + } else { - m_controller->AddLog(CEC_LOG_DEBUG, msg.ToString()); - switch(msg.message()) { case MSGCODE_COMMAND_ACCEPTED: + m_controller->AddLog(CEC_LOG_DEBUG, msg.ToString()); if (iPacketsLeft > 0) iPacketsLeft--; break; case MSGCODE_TRANSMIT_SUCCEEDED: + m_controller->AddLog(CEC_LOG_DEBUG, msg.ToString()); bTransmitSucceeded = (iPacketsLeft == 0); bError = !bTransmitSucceeded; message->reply = MSGCODE_TRANSMIT_SUCCEEDED;