cec-client: don't activate the source when starting
[deb_libcec.git] / src / lib / adapter / USBCECAdapterCommands.cpp
index c34713c9c7bb1518e737f76bd9eee2236abc5e75..5989bc9f49667db231ad704be123114b9b3272e3 100644 (file)
@@ -43,7 +43,8 @@ CUSBCECAdapterCommands::CUSBCECAdapterCommands(CUSBCECAdapterCommunication *comm
     m_bSettingAutoEnabled(false),
     m_settingCecVersion(CEC_VERSION_UNKNOWN),
     m_iSettingLAMask(0),
-    m_bNeedsWrite(false)
+    m_bNeedsWrite(false),
+    m_iBuildDate(0)
 {
   m_persistedConfiguration.Clear();
 }
@@ -120,6 +121,19 @@ bool CUSBCECAdapterCommands::RequestSettingCECVersion(void)
   return false;
 }
 
+uint32_t CUSBCECAdapterCommands::RequestBuildDate(void)
+{
+  if (m_iBuildDate == 0)
+  {
+    CLibCEC::AddLog(CEC_LOG_DEBUG, "requesting firmware build date");
+
+    cec_datapacket response = RequestSetting(MSGCODE_GET_BUILDDATE);
+    if (response.size == 4)
+      m_iBuildDate = (uint32_t)response[0] << 24 | (uint32_t)response[1] << 16 | (uint32_t)response[2] << 8 | (uint32_t)response[3];
+  }
+  return m_iBuildDate;
+}
+
 bool CUSBCECAdapterCommands::RequestSettingDefaultLogicalAddress(void)
 {
   CLibCEC::AddLog(CEC_LOG_DEBUG, "requesting default logical address setting");