From: Lars Op den Kamp Date: Wed, 25 Jan 2012 18:43:41 +0000 (+0100) Subject: cec: don't request the firmware version when the adapter didn't respond to a ping X-Git-Tag: upstream/2.2.0~1^2~39^2~4 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=c3c2d822d2e5f385e9a23682e553c1c7bf1f23f3;p=deb_libcec.git cec: don't request the firmware version when the adapter didn't respond to a ping --- diff --git a/src/lib/CECProcessor.cpp b/src/lib/CECProcessor.cpp index a8c4a5d..7ece12a 100644 --- a/src/lib/CECProcessor.cpp +++ b/src/lib/CECProcessor.cpp @@ -153,11 +153,14 @@ bool CCECProcessor::OpenConnection(const char *strPort, uint16_t iBaudRate, uint if ((bReturn = m_communication->PingAdapter()) == false) CLibCEC::AddLog(CEC_LOG_ERROR, "the adapter does not respond correctly"); - uint16_t iFirmwareVersion = m_communication->GetFirmwareVersion(); - if ((bReturn = (iFirmwareVersion != CEC_FW_VERSION_UNKNOWN)) == false) - m_controller->AddLog(CEC_LOG_ERROR, "the adapter is running an unknown firmware version"); + if (bReturn) + { + uint16_t iFirmwareVersion = m_communication->GetFirmwareVersion(); + if ((bReturn = (iFirmwareVersion != CEC_FW_VERSION_UNKNOWN)) == false) + m_controller->AddLog(CEC_LOG_ERROR, "the adapter is running an unknown firmware version"); - CLibCEC::AddLog(CEC_LOG_NOTICE, "CEC Adapter firmware version: %d", iFirmwareVersion); + CLibCEC::AddLog(CEC_LOG_NOTICE, "CEC Adapter firmware version: %d", iFirmwareVersion); + } return bReturn; }