#define CEC_DEFAULT_SETTING_POWER_OFF_SCREENSAVER 1
#define CEC_DEFAULT_SETTING_POWER_OFF_ON_STANDBY 1
#define CEC_DEFAULT_SETTING_SEND_INACTIVE_SOURCE 1
+#define CEC_DEFAULT_SETTING_POWER_OFF_DEVICES_STANDBY 1
#define CEC_DEFAULT_TRANSMIT_RETRY_WAIT 500
#define CEC_DEFAULT_TRANSMIT_TIMEOUT 1000
ICECCallbacks * callbacks; /*!< the callback methods to use. set this to NULL when not using callbacks */
cec_logical_addresses logicalAddresses; /*!< the current logical addresses. read-only. added in 1.5.3 */
- uint16_t iFirmwareVersion; /*!< the firmware version of the adapter. in 1.6.0 */
+ 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 */
#ifdef __cplusplus
void Clear(void)
bSendInactiveSource = CEC_DEFAULT_SETTING_SEND_INACTIVE_SOURCE;
logicalAddresses.Clear();
iFirmwareVersion = 0;
+ bPowerOffDevicesOnStandby = CEC_DEFAULT_SETTING_POWER_OFF_DEVICES_STANDBY;
callbackParam = NULL;
callbacks = NULL;
VersionPre1_5 = 0,
Version1_5_0 = 0x1500,
Version1_5_1 = 0x1501,
- Version1_5_2 = 0x1502
+ Version1_5_2 = 0x1502,
+ Version1_5_3 = 0x1503,
+ Version1_6_0 = 0x1600
};
public enum class CecServerVersion
VersionPre1_5 = 0,
Version1_5_0 = 0x1500,
Version1_5_1 = 0x1501,
- Version1_5_2 = 0x1502
+ Version1_5_2 = 0x1502,
+ Version1_5_3 = 0x1503,
+ Version1_6_0 = 0x1600
};
public ref class CecAdapter
PowerOffScreensaver = CEC_DEFAULT_SETTING_POWER_OFF_SCREENSAVER == 1;
PowerOffOnStandby = CEC_DEFAULT_SETTING_POWER_OFF_ON_STANDBY == 1;
SendInactiveSource = CEC_DEFAULT_SETTING_SEND_INACTIVE_SOURCE == 1;
+ LogicalAddresses = gcnew CecLogicalAddresses();
+ FirmwareVersion = 1;
+ PowerOffDevicesOnStandby = CEC_DEFAULT_SETTING_POWER_OFF_DEVICES_STANDBY == 1;
}
void SetCallbacks(CecCallbackMethods ^callbacks)
PowerOffScreensaver = config.bPowerOffScreensaver == 1;
PowerOffOnStandby = config.bPowerOffOnStandby == 1;
- SendInactiveSource = config.bSendInactiveSource == 1;
+
+ if (ServerVersion >= CecServerVersion::Version1_5_1)
+ SendInactiveSource = config.bSendInactiveSource == 1;
+
+ if (ServerVersion >= CecServerVersion::Version1_5_3)
+ {
+ LogicalAddresses->Clear();
+ for (uint8_t iPtr = 0; iPtr <= 16; iPtr++)
+ if (config.logicalAddresses[iPtr])
+ LogicalAddresses->Set((CecLogicalAddress)iPtr);
+ }
+
+ if (ServerVersion >= CecServerVersion::Version1_6_0)
+ {
+ FirmwareVersion = config.iFirmwareVersion;
+ PowerOffDevicesOnStandby = config.bPowerOffDevicesOnStandby == 1;
+ }
}
property System::String ^ DeviceName;
property bool PowerOffScreensaver;
property bool PowerOffOnStandby;
property bool SendInactiveSource;
+ property CecLogicalAddresses ^LogicalAddresses;
+ property uint16_t FirmwareVersion;
+ property bool PowerOffDevicesOnStandby;
property CecCallbackMethods ^ Callbacks;
};
}
config.bPowerOffScreensaver = netConfig->PowerOffScreensaver ? 1 : 0;
config.bPowerOffOnStandby = netConfig->PowerOffOnStandby ? 1 : 0;
- config.bSendInactiveSource = netConfig->SendInactiveSource ? 1 : 0;
+
+ if (netConfig->ServerVersion >= CecServerVersion::Version1_5_1)
+ config.bSendInactiveSource = netConfig->SendInactiveSource ? 1 : 0;
+
+ if (netConfig->ServerVersion >= CecServerVersion::Version1_6_0)
+ config.bPowerOffDevicesOnStandby = netConfig->PowerOffDevicesOnStandby ? 1 : 0;
+
config.callbacks = &g_cecCallbacks;
}
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;
+
// ensure that there is at least 1 device type set
if (m_configuration.deviceTypes.IsEmpty())
m_configuration.deviceTypes.Add(CEC_DEVICE_TYPE_RECORDING_DEVICE);
configuration->logicalAddresses = m_configuration.logicalAddresses;
// client version 1.6.0
- if (configuration->clientVersion >= CEC_CLIENT_VERSION_1_5_3)
- configuration->logicalAddresses = m_configuration.logicalAddresses;
+ if (configuration->clientVersion >= CEC_CLIENT_VERSION_1_6_0)
+ {
+ configuration->iFirmwareVersion = m_configuration.iFirmwareVersion;
+ configuration->bPowerOffDevicesOnStandby = m_configuration.bPowerOffDevicesOnStandby;
+ }
return true;
}
m_callbacks(configuration->callbacks),
m_cbParam(configuration->callbackParam)
{
- configuration->serverVersion = CEC_SERVER_VERSION_1_5_3;
+ configuration->serverVersion = CEC_SERVER_VERSION_1_6_0;
m_cec = new CCECProcessor(this, configuration);
}