typedef enum libcec_parameter_type
{
- CEC_PARAMETER_TYPE_STRING
+ CEC_PARAMETER_TYPE_STRING,
+ CEC_PARAMETER_TYPE_UNKOWN
} libcec_parameter_type;
struct libcec_parameter
{
libcec_parameter_type paramType; /**< the type of this parameter */
void* paramData; /**< the value of this parameter */
+
+#ifdef __cplusplus
+ libcec_parameter(void)
+ {
+ paramType = CEC_PARAMETER_TYPE_UNKOWN;
+ paramData = NULL;
+ }
+
+ libcec_parameter(const char *strMessage)
+ {
+ paramType = CEC_PARAMETER_TYPE_STRING;
+ paramData = (void*)strMessage;
+ }
+
+ virtual ~libcec_parameter(void) {}
+#endif
};
struct libcec_configuration;
CLibCEC::AddLog(CEC_LOG_NOTICE, strLog);
}
+ if (!m_communication->IsRunningLatestFirmware())
+ {
+ const char *strUpgradeMessage = "The firmware of this adapter can be upgraded. Please visit http://blog.pulse-eight.com/ for more information.";
+ CLibCEC::AddLog(CEC_LOG_WARNING, strUpgradeMessage);
+ CLibCEC::Alert(CEC_ALERT_SERVICE_DEVICE, libcec_parameter(strUpgradeMessage));
+ }
+ else
+ {
+ CLibCEC::AddLog(CEC_LOG_DEBUG, "the adapter is using the latest (known) firmware version");
+ }
+
if (m_configuration.bGetSettingsFromROM == 1)
{
libcec_configuration config;
*/
virtual uint32_t GetFirmwareBuildDate(void) = 0;
+ /*!
+ * @return True when this adapter is using the latest firmware build, or when the latest firmware build for this adapter type is unknown. False otherwise.
+ */
+ virtual bool IsRunningLatestFirmware(void) = 0;
+
/*!
* @return True when the control mode has been set, false otherwise.
*/
#define CEC_ADAPTER_PING_TIMEOUT 15000
+// firmware version 2
+#define CEC_LATEST_ADAPTER_FW_VERSION 2
+// firmware date Thu Apr 26 20:14:49 2012 +0000
+#define CEC_LATEST_ADAPTER_FW_DATE 0x4F99ACB9
+
CUSBCECAdapterCommunication::CUSBCECAdapterCommunication(IAdapterCommunicationCallback *callback, const char *strPort, uint16_t iBaudRate /* = CEC_SERIAL_DEFAULT_BAUDRATE */) :
IAdapterCommunication(callback),
m_port(NULL),
return m_commands->RequestBuildDate();
}
+bool CUSBCECAdapterCommunication::IsRunningLatestFirmware(void)
+{
+ return GetFirmwareVersion() >= CEC_LATEST_ADAPTER_FW_VERSION &&
+ GetFirmwareBuildDate() >= CEC_LATEST_ADAPTER_FW_DATE;
+}
+
bool CUSBCECAdapterCommunication::PersistConfiguration(libcec_configuration *configuration)
{
return m_port->IsOpen() ? m_commands->PersistConfiguration(configuration) : false;
bool PingAdapter(void);
uint16_t GetFirmwareVersion(void);
uint32_t GetFirmwareBuildDate(void);
+ bool IsRunningLatestFirmware(void);
bool PersistConfiguration(libcec_configuration *configuration);
bool GetConfiguration(libcec_configuration *configuration);
CStdString GetPortName(void);