From: Lars Op den Kamp Date: Sat, 3 Mar 2012 14:09:55 +0000 (+0100) Subject: cec: default to firmware version 1 after 3 tries. some versions might not send this... X-Git-Tag: upstream/2.2.0~1^2~32^2~2 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=9aae458adfeebaaa1b1693d7e66aa374b22f55f0;p=deb_libcec.git cec: default to firmware version 1 after 3 tries. some versions might not send this info. --- diff --git a/src/lib/adapter/USBCECAdapterCommunication.cpp b/src/lib/adapter/USBCECAdapterCommunication.cpp index 2fe62fe..e51a861 100644 --- a/src/lib/adapter/USBCECAdapterCommunication.cpp +++ b/src/lib/adapter/USBCECAdapterCommunication.cpp @@ -97,13 +97,19 @@ bool CUSBCECAdapterCommunication::CheckAdapter(uint32_t iTimeoutMs /* = 10000 */ /* try to read the firmware version */ m_iFirmwareVersion = CEC_FW_VERSION_UNKNOWN; unsigned iFwVersionTry(0); - while (bPinged && iNow < iTarget && (m_iFirmwareVersion = GetFirmwareVersion()) == CEC_FW_VERSION_UNKNOWN) + while (bPinged && iNow < iTarget && (m_iFirmwareVersion = GetFirmwareVersion()) == CEC_FW_VERSION_UNKNOWN && iFwVersionTry < 3) { - CLibCEC::AddLog(CEC_LOG_ERROR, "the adapter did not respond with a correct firmware version (try %d)", ++iFwVersionTry); + CLibCEC::AddLog(CEC_LOG_WARNING, "the adapter did not respond with a correct firmware version (try %d)", ++iFwVersionTry); CEvent::Sleep(500); iNow = GetTimeMs(); } + if (m_iFirmwareVersion == CEC_FW_VERSION_UNKNOWN) + { + CLibCEC::AddLog(CEC_LOG_DEBUG, "defaulting to firmware version 1"); + m_iFirmwareVersion = 1; + } + if (m_iFirmwareVersion >= 2) { /* try to set controlled mode */