cec: don't request the firmware version when the adapter didn't respond to a ping
[deb_libcec.git] / src / lib / CECProcessor.cpp
index 7a4e019d0b7fdfb2a48968f9ff185c54c82ce2f0..7ece12ae1412293297f3ba12859a5e38afab94a0 100644 (file)
@@ -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;
 }
@@ -988,26 +991,6 @@ uint16_t CCECProcessor::GetPhysicalAddress(void) const
   return false;
 }
 
-void CCECProcessor::SetCurrentButton(cec_user_control_code iButtonCode)
-{
-  m_controller->SetCurrentButton(iButtonCode);
-}
-
-void CCECProcessor::AddCommand(const cec_command &command)
-{
-  m_controller->AddCommand(command);
-}
-
-void CCECProcessor::AddKey(cec_keypress &key)
-{
-  m_controller->AddKey(key);
-}
-
-void CCECProcessor::AddKey(void)
-{
-  m_controller->AddKey();
-}
-
 bool CCECProcessor::SetAckMask(uint16_t iMask)
 {
   return m_communication->SetAckMask(iMask);