cec: added the firmware version to cec-client's -l / --list-devices command. bugzid...
[deb_libcec.git] / src / lib / LibCEC.cpp
index aeb16e2a5b55abb90423c2f4220b3cac52f9feca..03962e2ce0907616cd2bbd0531bf5ffba9371e30 100644 (file)
@@ -614,9 +614,14 @@ void CLibCEC::RescanActiveDevices(void)
 
 bool CLibCEC::IsLibCECActiveSource(void)
 {
-  return m_cec ?
-      m_cec->m_busDevices[m_cec->GetActiveSource()]->GetStatus(false) == CEC_DEVICE_STATUS_HANDLED_BY_LIBCEC :
-      false;
+  bool bReturn(false);
+  if (m_cec)
+  {
+    cec_logical_address activeSource = m_cec->GetActiveSource();
+    if (activeSource != CECDEVICE_UNKNOWN)
+      bReturn = m_cec->m_busDevices[activeSource]->GetStatus(false) == CEC_DEVICE_STATUS_HANDLED_BY_LIBCEC;
+  }
+  return bReturn;
 }
 
 cec_device_type CLibCEC::GetType(cec_logical_address address)
@@ -700,3 +705,11 @@ uint16_t CLibCEC::GetMaskForType(cec_device_type type)
       return 0;
   }
 }
+
+bool CLibCEC::GetDeviceInformation(const char *strPort, libcec_configuration *config, uint32_t iTimeoutMs /* = 10000 */)
+{
+  if (m_cec->IsRunning())
+    return false;
+  
+  return m_cec->GetDeviceInformation(strPort, config, iTimeoutMs);
+}
\ No newline at end of file