cec: fixed missing firmware version and build date in cec-client -l / GetDeviceInform...
authorLars Op den Kamp <lars@opdenkamp.eu>
Sun, 10 Jun 2012 11:34:08 +0000 (13:34 +0200)
committerLars Op den Kamp <lars@opdenkamp.eu>
Sun, 10 Jun 2012 11:34:08 +0000 (13:34 +0200)
src/lib/adapter/USBCECAdapterCommands.h
src/lib/adapter/USBCECAdapterCommunication.cpp

index d961240fc13c3ca282c53a5c41545792505f004c..70feae9c70c1795e835b7390401cf12c4501921d 100644 (file)
@@ -106,6 +106,11 @@ namespace CEC
      */
     uint32_t RequestBuildDate(void);
 
+    /*!
+     * @return The persisted build date.
+     */
+    uint32_t GetPersistedBuildDate(void) const { return m_iBuildDate; };
+
   private:
     /*!
      * @brief Reads all settings from the eeprom.
index bc451676280cadf7388ca1d373cfa331127e0179..45be4a6c739855de665581bf2802c085d1365be7 100644 (file)
@@ -529,12 +529,12 @@ bool CUSBCECAdapterCommunication::PingAdapter(void)
 
 uint16_t CUSBCECAdapterCommunication::GetFirmwareVersion(void)
 {
-  return IsOpen() ? m_commands->GetFirmwareVersion() : CEC_FW_VERSION_UNKNOWN;
+  return m_commands ? m_commands->GetFirmwareVersion() : CEC_FW_VERSION_UNKNOWN;
 }
 
 uint32_t CUSBCECAdapterCommunication::GetFirmwareBuildDate(void)
 {
-  return IsOpen() ? m_commands->RequestBuildDate() : 0;
+  return IsOpen() ? m_commands->RequestBuildDate() : m_commands ? m_commands->GetPersistedBuildDate() : 0;
 }
 
 bool CUSBCECAdapterCommunication::IsRunningLatestFirmware(void)