X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Flib%2FCECProcessor.cpp;h=659eae3ecf88376ef158bd01ef28ec13b89ce25d;hb=1fc16cfd0bc42166ca6a184d42ee50d393c95a34;hp=cb4fe8101e31adb144515dab7009830ea71f3c0c;hpb=71c4a2f532f422c80337ff11de69d1fa6f3910bd;p=deb_libcec.git diff --git a/src/lib/CECProcessor.cpp b/src/lib/CECProcessor.cpp index cb4fe81..659eae3 100644 --- a/src/lib/CECProcessor.cpp +++ b/src/lib/CECProcessor.cpp @@ -149,6 +149,18 @@ bool CCECProcessor::OpenConnection(const char *strPort, uint16_t iBaudRate, uint if ((bReturn = m_communication->Open(strPort, iBaudRate, iTimeoutMs)) == false) m_controller->AddLog(CEC_LOG_ERROR, "could not open a connection"); + /* try to ping the adapter */ + if ((bReturn = m_communication->PingAdapter()) == false) + m_controller->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"); + + CStdString strLog; + strLog.Format("CEC Adapter firmware version: %d", iFirmwareVersion); + m_controller->AddLog(CEC_LOG_NOTICE, strLog); + return bReturn; }