cec: added GetDeviceMenuLanguage()/cec_get_device_menu_language()
[deb_libcec.git] / src / lib / CECProcessor.cpp
index 277009b83a9621de3a645d78ab195a7f9f03eb34..279c79ff5dbc9535ad038fa3facf31c65cb19e2f 100644 (file)
@@ -202,6 +202,17 @@ bool CCECProcessor::SwitchMonitoring(bool bEnable)
     return m_communication && m_communication->SetAckMask(0x1 << (uint8_t)m_iLogicalAddress);
 }
 
+cec_version CCECProcessor::GetDeviceCecVersion(cec_logical_address iAddress)
+{
+  return m_busDevices[iAddress]->GetCecVersion();
+}
+
+bool CCECProcessor::GetDeviceMenuLanguage(cec_logical_address iAddress, cec_menu_language *language)
+{
+  *language = m_busDevices[iAddress]->GetMenuLanguage();
+  return (strcmp(language->language, "???"));
+}
+
 bool CCECProcessor::Transmit(const cec_command &data)
 {
   bool bReturn(false);
@@ -223,17 +234,17 @@ bool CCECProcessor::Transmit(const cec_command &data)
         return bReturn;
       }
     }
-  }
 
-  if (data.ack_timeout > 0)
-  {
-    bool bError(false);
-    if ((bReturn = WaitForAck(&bError, output->size(), data.ack_timeout)) == false)
-      m_controller->AddLog(CEC_LOG_ERROR, "did not receive ack");
-  }
-  else
-  {
-    bReturn = true;
+    if (data.ack_timeout > 0)
+    {
+      bool bError(false);
+      if ((bReturn = WaitForAck(&bError, output->size(), data.ack_timeout)) == false)
+        m_controller->AddLog(CEC_LOG_ERROR, "did not receive ack");
+    }
+    else
+    {
+      bReturn = true;
+    }
   }
 
   return bReturn;