only request the build date once
authorLars Op den Kamp <lars@opdenkamp.eu>
Tue, 24 Apr 2012 23:06:40 +0000 (01:06 +0200)
committerLars Op den Kamp <lars@opdenkamp.eu>
Tue, 24 Apr 2012 23:06:40 +0000 (01:06 +0200)
src/lib/adapter/USBCECAdapterCommands.cpp

index 326abe17c07ff7c9081179a7b802739f91ac77ff..5989bc9f49667db231ad704be123114b9b3272e3 100644 (file)
@@ -123,12 +123,15 @@ bool CUSBCECAdapterCommands::RequestSettingCECVersion(void)
 
 uint32_t CUSBCECAdapterCommands::RequestBuildDate(void)
 {
-  CLibCEC::AddLog(CEC_LOG_DEBUG, "requesting firmware build date");
+  if (m_iBuildDate == 0)
+  {
+    CLibCEC::AddLog(CEC_LOG_DEBUG, "requesting firmware build date");
 
-  cec_datapacket response = RequestSetting(MSGCODE_GET_BUILDDATE);
-  if (response.size == 4)
-    return (uint32_t)response[0] << 24 | (uint32_t)response[1] << 16 | (uint32_t)response[2] << 8 | (uint32_t)response[3];
-  return 0;
+    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)