MSGCODE_TRANSMIT_FAILED_TIMEOUT_LINE,
MSGCODE_FIRMWARE_VERSION,
MSGCODE_START_BOOTLOADER,
- MSGCODE_SET_POWERSTATE,
+ MSGCODE_GET_BUILDDATE,
MSGCODE_SET_CONTROLLED,
MSGCODE_GET_AUTO_ENABLED,
MSGCODE_SET_AUTO_ENABLED,
if (bReturn)
{
m_configuration.iFirmwareVersion = m_communication->GetFirmwareVersion();
+ uint32_t iBuildDate = m_communication->GetFirmwareBuildDate();
CLibCEC::AddLog(CEC_LOG_NOTICE, "connected to the CEC adapter. firmware version = %d, client version = %s", m_configuration.iFirmwareVersion, ToString((cec_client_version)m_configuration.clientVersion));
+ if (iBuildDate > 0)
+ {
+ time_t buildTime = (time_t)iBuildDate;
+ CLibCEC::AddLog(CEC_LOG_NOTICE, "Firmware build date: %s", asctime(localtime(&buildTime)));
+ }
+
}
if (m_configuration.bGetSettingsFromROM == 1)
*/
virtual uint16_t GetFirmwareVersion(void) = 0;
+ /*!
+ * @return The build date in seconds since epoch, or 0 when no (valid) reply was received.
+ */
+ virtual uint32_t GetFirmwareBuildDate(void) = 0;
+
/*!
* @return True when the control mode has been set, false otherwise.
*/
m_bSettingAutoEnabled(false),
m_settingCecVersion(CEC_VERSION_UNKNOWN),
m_iSettingLAMask(0),
- m_bNeedsWrite(false)
+ m_bNeedsWrite(false),
+ m_iBuildDate(0)
{
m_persistedConfiguration.Clear();
}
return false;
}
+uint32_t CUSBCECAdapterCommands::RequestBuildDate(void)
+{
+ 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;
+}
+
bool CUSBCECAdapterCommands::RequestSettingDefaultLogicalAddress(void)
{
CLibCEC::AddLog(CEC_LOG_DEBUG, "requesting default logical address setting");
*/
bool SetControlledMode(bool controlled);
+ /*!
+ * @brief Request the firmware build date from the device.
+ * @return The build date in seconds since epoch, or 0 when no (valid) reply was received.
+ */
+ uint32_t RequestBuildDate(void);
+
private:
/*!
* @brief Reads all settings from the eeprom.
uint16_t m_iSettingLAMask; /**< the value of the LA mask setting */
bool m_bNeedsWrite; /**< true when we sent changed settings to the adapter that have not been persisted */
libcec_configuration m_persistedConfiguration; /**< the configuration that is persisted in the eeprom */
+ uint32_t m_iBuildDate; /**< the build date of the firmware */
};
}
return m_commands->GetFirmwareVersion();
}
+uint32_t CUSBCECAdapterCommunication::GetFirmwareBuildDate(void)
+{
+ return m_commands->RequestBuildDate();
+}
+
bool CUSBCECAdapterCommunication::PersistConfiguration(libcec_configuration *configuration)
{
return m_port->IsOpen() ? m_commands->PersistConfiguration(configuration) : false;
bool SetAckMask(uint16_t iMask);
bool PingAdapter(void);
uint16_t GetFirmwareVersion(void);
+ uint32_t GetFirmwareBuildDate(void);
bool PersistConfiguration(libcec_configuration *configuration);
bool GetConfiguration(libcec_configuration *configuration);
CStdString GetPortName(void);
return "FRAME_EOM";
case MSGCODE_FRAME_ACK:
return "FRAME_ACK";
- case MSGCODE_SET_POWERSTATE:
- return "SET_POWERSTATE";
+ case MSGCODE_GET_BUILDDATE:
+ return "GET_BUILDDATE";
case MSGCODE_SET_CONTROLLED:
return "SET_CONTROLLED";
case MSGCODE_GET_AUTO_ENABLED:
return "SET_OSD_NAME";
case MSGCODE_WRITE_EEPROM:
return "WRITE_EEPROM";
+ default:
+ break;
}
return "unknown";