#define CEC_FW_VERSION_UNKNOWN 0xFFFF
#define CEC_CONNECT_TRIES 3
-#define CEC_DEFAULT_SETTING_USE_TV_MENU_LANGUAGE 1
-#define CEC_DEFAULT_SETTING_ACTIVATE_SOURCE 1
-#define CEC_DEFAULT_SETTING_POWER_OFF_SHUTDOWN 1
-#define CEC_DEFAULT_SETTING_POWER_OFF_SCREENSAVER 1
-#define CEC_DEFAULT_SETTING_POWER_OFF_ON_STANDBY 1
-#define CEC_DEFAULT_SETTING_SHUTDOWN_ON_STANDBY 0
-#define CEC_DEFAULT_SETTING_SEND_INACTIVE_SOURCE 1
+#define CEC_DEFAULT_SETTING_USE_TV_MENU_LANGUAGE 1
+#define CEC_DEFAULT_SETTING_ACTIVATE_SOURCE 1
+#define CEC_DEFAULT_SETTING_POWER_OFF_SHUTDOWN 1
+#define CEC_DEFAULT_SETTING_POWER_OFF_SCREENSAVER 1
+#define CEC_DEFAULT_SETTING_POWER_OFF_ON_STANDBY 1
+#define CEC_DEFAULT_SETTING_SHUTDOWN_ON_STANDBY 0
+#define CEC_DEFAULT_SETTING_SEND_INACTIVE_SOURCE 1
#define CEC_DEFAULT_SETTING_POWER_OFF_DEVICES_STANDBY 1
-#define CEC_DEFAULT_DEVICE_LANGUAGE "eng"
+#define CEC_DEFAULT_DEVICE_LANGUAGE "eng"
+#define CEC_DEFAULT_FIRMWARE_BUILD_DATE 0
#define CEC_DEFAULT_TRANSMIT_RETRY_WAIT 500
#define CEC_DEFAULT_TRANSMIT_TIMEOUT 1000
uint16_t iFirmwareVersion; /*!< the firmware version of the adapter. added in 1.6.0 */
uint8_t bPowerOffDevicesOnStandby; /*!< put devices in standby when the PC/player is put in standby. added in 1.6.0 */
uint8_t bShutdownOnStandby; /*!< shutdown this PC when the TV is switched off. only used when bPowerOffOnStandby = 0. added in 1.6.0 */
- char strDeviceLanguage[3]; /*!< the menu language used by the client. 3 character ISO 639-2 country code. see http://http://www.loc.gov/standards/iso639-2/ */
+ char strDeviceLanguage[3]; /*!< the menu language used by the client. 3 character ISO 639-2 country code. see http://http://www.loc.gov/standards/iso639-2/ added in 1.6.2 */
+ uint32_t iFirmwareBuildDate; /*!< the build date of the firmware, in seconds since epoch. if not available, this value will be set to 0. added in 1.6.2 */
#ifdef __cplusplus
libcec_configuration(void) { Clear(); }
*/
void Clear(void)
{
+ iPhysicalAddress = 0;
+ baseDevice = (cec_logical_address)CEC_DEFAULT_BASE_DEVICE;
+ iHDMIPort = CEC_DEFAULT_HDMI_PORT;
+ tvVendor = (uint64_t)CEC_VENDOR_UNKNOWN;
+ clientVersion = (uint32_t)CEC_CLIENT_VERSION_PRE_1_5;
+ serverVersion = (uint32_t)CEC_SERVER_VERSION_PRE_1_5;
+ bAutodetectAddress = 1;
+ bGetSettingsFromROM = 0;
+ bUseTVMenuLanguage = CEC_DEFAULT_SETTING_USE_TV_MENU_LANGUAGE;
+ bActivateSource = CEC_DEFAULT_SETTING_ACTIVATE_SOURCE;
+ bPowerOffScreensaver = CEC_DEFAULT_SETTING_POWER_OFF_SCREENSAVER;
+ bPowerOffOnStandby = CEC_DEFAULT_SETTING_POWER_OFF_ON_STANDBY;
+ bShutdownOnStandby = CEC_DEFAULT_SETTING_SHUTDOWN_ON_STANDBY;
+ bSendInactiveSource = CEC_DEFAULT_SETTING_SEND_INACTIVE_SOURCE;
+ iFirmwareVersion = CEC_FW_VERSION_UNKNOWN;
+ bPowerOffDevicesOnStandby = CEC_DEFAULT_SETTING_POWER_OFF_DEVICES_STANDBY;
+ memcpy(strDeviceLanguage, CEC_DEFAULT_DEVICE_LANGUAGE, 3);
+ iFirmwareBuildDate = CEC_DEFAULT_FIRMWARE_BUILD_DATE;
+
memset(strDeviceName, 0, 13);
deviceTypes.clear();
- iPhysicalAddress = 0;
- baseDevice = (cec_logical_address)CEC_DEFAULT_BASE_DEVICE;
- iHDMIPort = CEC_DEFAULT_HDMI_PORT;
- tvVendor = (uint64_t)CEC_VENDOR_UNKNOWN;
- clientVersion = (uint32_t)CEC_CLIENT_VERSION_PRE_1_5;
- serverVersion = (uint32_t)CEC_SERVER_VERSION_PRE_1_5;
+ logicalAddresses.Clear();
wakeDevices.Clear();
powerOffDevices.Clear();
- bAutodetectAddress = 1;
- bGetSettingsFromROM = 0;
- bUseTVMenuLanguage = CEC_DEFAULT_SETTING_USE_TV_MENU_LANGUAGE;
- bActivateSource = CEC_DEFAULT_SETTING_ACTIVATE_SOURCE;
#if CEC_DEFAULT_SETTING_POWER_OFF_SHUTDOWN == 1
powerOffDevices.Set(CECDEVICE_BROADCAST);
#endif
#if CEC_DEFAULT_SETTING_ACTIVATE_SOURCE == 1
wakeDevices.Set(CECDEVICE_TV);
#endif
- bPowerOffScreensaver = CEC_DEFAULT_SETTING_POWER_OFF_SCREENSAVER;
- bPowerOffOnStandby = CEC_DEFAULT_SETTING_POWER_OFF_ON_STANDBY;
- bShutdownOnStandby = CEC_DEFAULT_SETTING_SHUTDOWN_ON_STANDBY;
- bSendInactiveSource = CEC_DEFAULT_SETTING_SEND_INACTIVE_SOURCE;
- logicalAddresses.Clear();
- iFirmwareVersion = CEC_FW_VERSION_UNKNOWN;
- bPowerOffDevicesOnStandby = CEC_DEFAULT_SETTING_POWER_OFF_DEVICES_STANDBY;
- memcpy(strDeviceLanguage, CEC_DEFAULT_DEVICE_LANGUAGE, 3);
- callbackParam = NULL;
- callbacks = NULL;
+ callbackParam = NULL;
+ callbacks = NULL;
}
#endif
} libcec_configuration;
if (bReturn)
{
m_configuration.iFirmwareVersion = m_communication->GetFirmwareVersion();
- uint32_t iBuildDate = m_communication->GetFirmwareBuildDate();
+ m_configuration.iFirmwareBuildDate = m_communication->GetFirmwareBuildDate();
CStdString strLog;
strLog.Format("connected to the CEC adapter. libCEC version = %s, client version = %s, firmware version = %d", ToString((cec_server_version)m_configuration.serverVersion), ToString((cec_client_version)m_configuration.clientVersion), m_configuration.iFirmwareVersion);
- if (iBuildDate > 0)
+ if (m_configuration.iFirmwareBuildDate > 0)
{
- time_t buildTime = (time_t)iBuildDate;
+ time_t buildTime = (time_t)m_configuration.iFirmwareBuildDate;
strLog.AppendFormat(", firmware build date: %s", asctime(gmtime(&buildTime)));
strLog = strLog.Left(strLog.length() - 1); // strip \n added by asctime
strLog.append(" +0000");
// client version 1.6.2
if (configuration->clientVersion >= CEC_CLIENT_VERSION_1_6_2)
{
- snprintf(m_configuration.strDeviceLanguage, 3, "%s", configuration->strDeviceLanguage);
+ memcpy(m_configuration.strDeviceLanguage, configuration->strDeviceLanguage, 3);
}
// ensure that there is at least 1 device type set
configuration->bShutdownOnStandby = m_configuration.bShutdownOnStandby;
}
+ // client version 1.6.2
+ if (configuration->clientVersion >= CEC_CLIENT_VERSION_1_6_2)
+ {
+ memcpy(configuration->strDeviceLanguage, m_configuration.strDeviceLanguage, 3);
+ configuration->iFirmwareBuildDate = m_configuration.iFirmwareBuildDate;
+ }
return true;
}