bool operator==(const libcec_configuration &other) const
{
- return ( clientVersion == other.clientVersion &&
- !strncmp(strDeviceName, other.strDeviceName, 13) &&
- deviceTypes == other.deviceTypes &&
- bAutodetectAddress == other.bAutodetectAddress &&
- iPhysicalAddress == other.iPhysicalAddress &&
- baseDevice == other.baseDevice &&
- iHDMIPort == other.iHDMIPort &&
- tvVendor == other.tvVendor &&
- wakeDevices == other.wakeDevices &&
- powerOffDevices == other.powerOffDevices &&
- serverVersion == other.serverVersion &&
- bGetSettingsFromROM == other.bGetSettingsFromROM &&
- bUseTVMenuLanguage == other.bUseTVMenuLanguage &&
- bActivateSource == other.bActivateSource &&
- bPowerOffScreensaver == other.bPowerOffScreensaver &&
- bPowerOffOnStandby == other.bPowerOffOnStandby &&
- bSendInactiveSource == other.bSendInactiveSource &&
- /* libcec 1.5.3+ */
- (other.clientVersion < CEC_CLIENT_VERSION_1_5_3 || logicalAddresses == other.logicalAddresses) &&
- /* libcec 1.6.0+ */
- (other.clientVersion < CEC_CLIENT_VERSION_1_6_0 || iFirmwareVersion == other.iFirmwareVersion) &&
- (other.clientVersion < CEC_CLIENT_VERSION_1_6_0 || bPowerOffDevicesOnStandby == other.bPowerOffDevicesOnStandby) &&
- (other.clientVersion < CEC_CLIENT_VERSION_1_6_0 || bShutdownOnStandby == other.bShutdownOnStandby) &&
- /* libcec 1.6.2+ */
- (other.clientVersion < CEC_CLIENT_VERSION_1_6_2 || !strncmp(strDeviceLanguage, other.strDeviceLanguage, 3)) &&
- (other.clientVersion < CEC_CLIENT_VERSION_1_6_2 || iFirmwareBuildDate == other.iFirmwareBuildDate) &&
- /* libcec 1.6.3+ */
- (other.clientVersion < CEC_CLIENT_VERSION_1_6_3 || bMonitorOnly == other.bMonitorOnly) &&
- /* libcec 1.8.0+ */
- (other.clientVersion < CEC_CLIENT_VERSION_1_8_0 || cecVersion == other.cecVersion) &&
- /* libcec 1.8.2+ */
- (other.clientVersion < CEC_CLIENT_VERSION_1_8_2 || adapterType == other.adapterType));
+ return ( clientVersion == other.clientVersion &&
+ !strncmp(strDeviceName, other.strDeviceName, 13) &&
+ deviceTypes == other.deviceTypes &&
+ bAutodetectAddress == other.bAutodetectAddress &&
+ iPhysicalAddress == other.iPhysicalAddress &&
+ baseDevice == other.baseDevice &&
+ iHDMIPort == other.iHDMIPort &&
+ tvVendor == other.tvVendor &&
+ wakeDevices == other.wakeDevices &&
+ powerOffDevices == other.powerOffDevices &&
+ serverVersion == other.serverVersion &&
+ bGetSettingsFromROM == other.bGetSettingsFromROM &&
+ bUseTVMenuLanguage == other.bUseTVMenuLanguage &&
+ bActivateSource == other.bActivateSource &&
+ bPowerOffScreensaver == other.bPowerOffScreensaver &&
+ bPowerOffOnStandby == other.bPowerOffOnStandby &&
+ bSendInactiveSource == other.bSendInactiveSource &&
+ logicalAddresses == other.logicalAddresses &&
+ iFirmwareVersion == other.iFirmwareVersion &&
+ bPowerOffDevicesOnStandby == other.bPowerOffDevicesOnStandby &&
+ bShutdownOnStandby == other.bShutdownOnStandby &&
+ !strncmp(strDeviceLanguage, other.strDeviceLanguage, 3) &&
+ iFirmwareBuildDate == other.iFirmwareBuildDate &&
+ bMonitorOnly == other.bMonitorOnly &&
+ cecVersion == other.cecVersion &&
+ adapterType == other.adapterType);
}
bool operator!=(const libcec_configuration &other) const
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;
+ clientVersion = (uint32_t)CEC_CLIENT_VERSION_2_0_0;
+ serverVersion = (uint32_t)CEC_SERVER_VERSION_2_0_0;
bAutodetectAddress = 0;
bGetSettingsFromROM = CEC_DEFAULT_SETTING_GET_SETTINGS_FROM_ROM;
bUseTVMenuLanguage = CEC_DEFAULT_SETTING_USE_TV_MENU_LANGUAGE;
bool CCECClient::SendPowerOnDevices(const cec_logical_address address /* = CECDEVICE_TV */)
{
- // if the broadcast address if set as destination and the client version >=1.5.0, read the wakeDevices setting
- if (address == CECDEVICE_BROADCAST && m_configuration.clientVersion >= CEC_CLIENT_VERSION_1_5_0)
+ // if the broadcast address if set as destination, read the wakeDevices setting
+ if (address == CECDEVICE_BROADCAST)
{
CECDEVICEVEC devices;
m_processor->GetDevices()->GetWakeDevices(m_configuration, devices);
bool CCECClient::SendStandbyDevices(const cec_logical_address address /* = CECDEVICE_BROADCAST */)
{
- // if the broadcast address if set as destination and the client version >=1.5.0, read the standbyDevices setting
- if (address == CECDEVICE_BROADCAST && m_configuration.clientVersion >= CEC_CLIENT_VERSION_1_5_0)
+ // if the broadcast address if set as destination, read the standbyDevices setting
+ if (address == CECDEVICE_BROADCAST)
{
CECDEVICEVEC devices;
m_processor->GetDevices()->GetPowerOffDevices(m_configuration, devices);
// client version 1.5.0
snprintf(configuration.strDeviceName, 13, "%s", m_configuration.strDeviceName);
- configuration.deviceTypes = m_configuration.deviceTypes;
- configuration.bAutodetectAddress = m_configuration.bAutodetectAddress;
- configuration.iPhysicalAddress = m_configuration.iPhysicalAddress;
- configuration.baseDevice = m_configuration.baseDevice;
- configuration.iHDMIPort = m_configuration.iHDMIPort;
- configuration.clientVersion = m_configuration.clientVersion;
- configuration.serverVersion = m_configuration.serverVersion;
- configuration.tvVendor = m_configuration.tvVendor;
-
- configuration.bGetSettingsFromROM = m_configuration.bGetSettingsFromROM;
- configuration.bUseTVMenuLanguage = m_configuration.bUseTVMenuLanguage;
- configuration.bActivateSource = m_configuration.bActivateSource;
- configuration.wakeDevices = m_configuration.wakeDevices;
- configuration.powerOffDevices = m_configuration.powerOffDevices;
- configuration.bPowerOffScreensaver = m_configuration.bPowerOffScreensaver;
- configuration.bPowerOffOnStandby = m_configuration.bPowerOffOnStandby;
-
- // client version 1.5.1
- if (configuration.clientVersion >= CEC_CLIENT_VERSION_1_5_1)
- configuration.bSendInactiveSource = m_configuration.bSendInactiveSource;
-
- // client version 1.5.3
- if (configuration.clientVersion >= CEC_CLIENT_VERSION_1_5_3)
- configuration.logicalAddresses = m_configuration.logicalAddresses;
-
- // client version 1.6.0
- if (configuration.clientVersion >= CEC_CLIENT_VERSION_1_6_0)
- {
- configuration.iFirmwareVersion = m_configuration.iFirmwareVersion;
- configuration.bPowerOffDevicesOnStandby = m_configuration.bPowerOffDevicesOnStandby;
- 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;
- }
-
- // client version 1.6.3
- if (configuration.clientVersion >= CEC_CLIENT_VERSION_1_6_3)
- {
- configuration.bMonitorOnly = m_configuration.bMonitorOnly;
- }
-
- // client version 1.8.0
- if (configuration.clientVersion >= CEC_CLIENT_VERSION_1_8_0)
- configuration.cecVersion = m_configuration.cecVersion;
-
- // client version 1.8.2
- if (configuration.clientVersion >= CEC_CLIENT_VERSION_1_8_2)
- configuration.adapterType = m_configuration.adapterType;
+ configuration.deviceTypes = m_configuration.deviceTypes;
+ configuration.bAutodetectAddress = m_configuration.bAutodetectAddress;
+ configuration.iPhysicalAddress = m_configuration.iPhysicalAddress;
+ configuration.baseDevice = m_configuration.baseDevice;
+ configuration.iHDMIPort = m_configuration.iHDMIPort;
+ configuration.clientVersion = m_configuration.clientVersion;
+ configuration.serverVersion = m_configuration.serverVersion;
+ configuration.tvVendor = m_configuration.tvVendor;
+ configuration.bGetSettingsFromROM = m_configuration.bGetSettingsFromROM;
+ configuration.bUseTVMenuLanguage = m_configuration.bUseTVMenuLanguage;
+ configuration.bActivateSource = m_configuration.bActivateSource;
+ configuration.wakeDevices = m_configuration.wakeDevices;
+ configuration.powerOffDevices = m_configuration.powerOffDevices;
+ configuration.bPowerOffScreensaver = m_configuration.bPowerOffScreensaver;
+ configuration.bPowerOffOnStandby = m_configuration.bPowerOffOnStandby;
+ configuration.bSendInactiveSource = m_configuration.bSendInactiveSource;
+ configuration.logicalAddresses = m_configuration.logicalAddresses;
+ configuration.iFirmwareVersion = m_configuration.iFirmwareVersion;
+ configuration.bPowerOffDevicesOnStandby = m_configuration.bPowerOffDevicesOnStandby;
+ configuration.bShutdownOnStandby = m_configuration.bShutdownOnStandby;
+ memcpy(configuration.strDeviceLanguage, m_configuration.strDeviceLanguage, 3);
+ configuration.iFirmwareBuildDate = m_configuration.iFirmwareBuildDate;
+ configuration.bMonitorOnly = m_configuration.bMonitorOnly;
+ configuration.cecVersion = m_configuration.cecVersion;
+ configuration.adapterType = m_configuration.adapterType;
return true;
}
// just copy these
{
CLockObject lock(m_mutex);
- m_configuration.bUseTVMenuLanguage = configuration.bUseTVMenuLanguage;
- m_configuration.bActivateSource = configuration.bActivateSource;
- m_configuration.bGetSettingsFromROM = configuration.bGetSettingsFromROM;
- m_configuration.wakeDevices = configuration.wakeDevices;
- m_configuration.powerOffDevices = configuration.powerOffDevices;
- m_configuration.bPowerOffScreensaver = configuration.bPowerOffScreensaver;
- m_configuration.bPowerOffOnStandby = configuration.bPowerOffOnStandby;
-
- // client version 1.5.1
- if (configuration.clientVersion >= CEC_CLIENT_VERSION_1_5_1)
- m_configuration.bSendInactiveSource = configuration.bSendInactiveSource;
-
- // client version 1.6.0
- if (configuration.clientVersion >= CEC_CLIENT_VERSION_1_6_0)
- {
- m_configuration.bPowerOffDevicesOnStandby = configuration.bPowerOffDevicesOnStandby;
- m_configuration.bShutdownOnStandby = configuration.bShutdownOnStandby;
- }
-
- // client version 1.6.2
- if (configuration.clientVersion >= CEC_CLIENT_VERSION_1_6_2)
- {
- memcpy(m_configuration.strDeviceLanguage, configuration.strDeviceLanguage, 3);
- }
-
- // client version 1.6.3
- if (configuration.clientVersion >= CEC_CLIENT_VERSION_1_6_3)
- {
- m_configuration.bMonitorOnly = configuration.bMonitorOnly;
- }
-
- // client version 1.8.0
- if (configuration.clientVersion >= CEC_CLIENT_VERSION_1_8_0)
- m_configuration.cecVersion = configuration.cecVersion;
-
- // client version 1.8.2
- if (configuration.clientVersion >= CEC_CLIENT_VERSION_1_8_2)
- m_configuration.adapterType = configuration.adapterType;
-
- // ensure that there is at least 1 device type set
- if (m_configuration.deviceTypes.IsEmpty())
- m_configuration.deviceTypes.Add(CEC_DEVICE_TYPE_RECORDING_DEVICE);
+ m_configuration.bUseTVMenuLanguage = configuration.bUseTVMenuLanguage;
+ m_configuration.bActivateSource = configuration.bActivateSource;
+ m_configuration.bGetSettingsFromROM = configuration.bGetSettingsFromROM;
+ m_configuration.wakeDevices = configuration.wakeDevices;
+ m_configuration.powerOffDevices = configuration.powerOffDevices;
+ m_configuration.bPowerOffScreensaver = configuration.bPowerOffScreensaver;
+ m_configuration.bPowerOffOnStandby = configuration.bPowerOffOnStandby;
+ m_configuration.bSendInactiveSource = configuration.bSendInactiveSource;
+ m_configuration.bPowerOffDevicesOnStandby = configuration.bPowerOffDevicesOnStandby;
+ m_configuration.bShutdownOnStandby = configuration.bShutdownOnStandby;
+ memcpy(m_configuration.strDeviceLanguage, configuration.strDeviceLanguage, 3);
+ m_configuration.bMonitorOnly = configuration.bMonitorOnly;
+ m_configuration.cecVersion = configuration.cecVersion;
+ m_configuration.adapterType = configuration.adapterType;
+ m_configuration.deviceTypes.Add(CEC_DEVICE_TYPE_RECORDING_DEVICE);
}
bool bNeedReinit(false);
{
CLockObject lock(m_cbMutex);
if (m_configuration.callbacks &&
- m_configuration.clientVersion >= CEC_CLIENT_VERSION_1_5_0 &&
m_configuration.callbacks->CBCecConfigurationChanged &&
m_processor->CECInitialised())
m_configuration.callbacks->CBCecConfigurationChanged(m_configuration.callbackParam, config);
{
CLockObject lock(m_cbMutex);
if (m_configuration.callbacks &&
- m_configuration.clientVersion >= CEC_CLIENT_VERSION_1_7_1 &&
m_configuration.callbacks->CBCecSourceActivated)
m_configuration.callbacks->CBCecSourceActivated(m_configuration.callbackParam, logicalAddress, bActivated ? 1 : 0);
}
{
CLockObject lock(m_cbMutex);
if (m_configuration.callbacks &&
- m_configuration.clientVersion >= CEC_CLIENT_VERSION_1_6_0 &&
m_configuration.callbacks->CBCecAlert)
m_configuration.callbacks->CBCecAlert(m_configuration.callbackParam, type, param);
}
{
CLockObject lock(m_cbMutex);
if (m_configuration.callbacks &&
- m_configuration.clientVersion >= CEC_CLIENT_VERSION_1_6_2 &&
m_configuration.callbacks->CBCecMenuStateChanged)
return m_configuration.callbacks->CBCecMenuStateChanged(m_configuration.callbackParam, newState);
return 0;