CUSBCECAdapterCommands::CUSBCECAdapterCommands(CUSBCECAdapterCommunication *comm) :
m_comm(comm),
m_bSettingsRetrieved(false),
CUSBCECAdapterCommands::CUSBCECAdapterCommands(CUSBCECAdapterCommunication *comm) :
m_comm(comm),
m_bSettingsRetrieved(false),
cec_datapacket response = RequestSetting(MSGCODE_FIRMWARE_VERSION);
if (response.size == 2)
m_persistedConfiguration.iFirmwareVersion = (response[0] << 8 | response[1]);
else
{
cec_datapacket response = RequestSetting(MSGCODE_FIRMWARE_VERSION);
if (response.size == 2)
m_persistedConfiguration.iFirmwareVersion = (response[0] << 8 | response[1]);
else
{
- CLibCEC::AddLog(CEC_LOG_WARNING, "the adapter did not respond with a correct firmware version (try %d)", iFwVersionTry);
+ LIB_CEC->AddLog(CEC_LOG_WARNING, "the adapter did not respond with a correct firmware version (try %d)", iFwVersionTry);
cec_datapacket response = RequestSetting(MSGCODE_GET_AUTO_ENABLED);
if (response.size == 1)
{
m_bSettingAutoEnabled = response[0] == 1;
cec_datapacket response = RequestSetting(MSGCODE_GET_AUTO_ENABLED);
if (response.size == 1)
{
m_bSettingAutoEnabled = response[0] == 1;
- CLibCEC::AddLog(CEC_LOG_DEBUG, "using persisted autonomous mode setting: '%s'", m_bSettingAutoEnabled ? "enabled" : "disabled");
+ LIB_CEC->AddLog(CEC_LOG_DEBUG, "using persisted autonomous mode setting: '%s'", m_bSettingAutoEnabled ? "enabled" : "disabled");
cec_datapacket response = RequestSetting(MSGCODE_GET_HDMI_VERSION);
if (response.size == 1)
{
m_settingCecVersion = (cec_version)response[0];
cec_datapacket response = RequestSetting(MSGCODE_GET_HDMI_VERSION);
if (response.size == 1)
{
m_settingCecVersion = (cec_version)response[0];
- CLibCEC::AddLog(CEC_LOG_DEBUG, "using persisted CEC version setting: '%s'", CLibCEC::GetInstance()->ToString(m_settingCecVersion));
+ LIB_CEC->AddLog(CEC_LOG_DEBUG, "using persisted CEC version setting: '%s'", ToString(m_settingCecVersion));
cec_datapacket response = RequestSetting(MSGCODE_GET_DEFAULT_LOGICAL_ADDRESS);
if (response.size == 1)
{
m_persistedConfiguration.logicalAddresses.primary = (cec_logical_address)response[0];
cec_datapacket response = RequestSetting(MSGCODE_GET_DEFAULT_LOGICAL_ADDRESS);
if (response.size == 1)
{
m_persistedConfiguration.logicalAddresses.primary = (cec_logical_address)response[0];
- CLibCEC::AddLog(CEC_LOG_DEBUG, "using persisted logical address setting: '%s'", CLibCEC::GetInstance()->ToString(m_persistedConfiguration.logicalAddresses.primary));
+ LIB_CEC->AddLog(CEC_LOG_DEBUG, "using persisted logical address setting: '%s'", ToString(m_persistedConfiguration.logicalAddresses.primary));
m_persistedConfiguration.deviceTypes.Clear();
cec_datapacket response = RequestSetting(MSGCODE_GET_DEVICE_TYPE);
if (response.size == 1)
{
m_persistedConfiguration.deviceTypes.Add((cec_device_type)response[0]);
m_persistedConfiguration.deviceTypes.Clear();
cec_datapacket response = RequestSetting(MSGCODE_GET_DEVICE_TYPE);
if (response.size == 1)
{
m_persistedConfiguration.deviceTypes.Add((cec_device_type)response[0]);
- CLibCEC::AddLog(CEC_LOG_DEBUG, "using persisted device type setting: '%s'", CLibCEC::GetInstance()->ToString((cec_device_type)response[0]));
+ LIB_CEC->AddLog(CEC_LOG_DEBUG, "using persisted device type setting: '%s'", ToString((cec_device_type)response[0]));
cec_datapacket response = RequestSetting(MSGCODE_GET_LOGICAL_ADDRESS_MASK);
if (response.size == 2)
{
m_iSettingLAMask = ((uint16_t)response[0] << 8) | ((uint16_t)response[1]);
cec_datapacket response = RequestSetting(MSGCODE_GET_LOGICAL_ADDRESS_MASK);
if (response.size == 2)
{
m_iSettingLAMask = ((uint16_t)response[0] << 8) | ((uint16_t)response[1]);
- CLibCEC::AddLog(CEC_LOG_DEBUG, "using persisted logical address mask setting: '%x'", m_iSettingLAMask);
+ LIB_CEC->AddLog(CEC_LOG_DEBUG, "using persisted logical address mask setting: '%x'", m_iSettingLAMask);
memset(m_persistedConfiguration.strDeviceName, 0, 13);
cec_datapacket response = RequestSetting(MSGCODE_GET_OSD_NAME);
if (response.size == 0)
{
memset(m_persistedConfiguration.strDeviceName, 0, 13);
cec_datapacket response = RequestSetting(MSGCODE_GET_OSD_NAME);
if (response.size == 0)
{
buf[response.size] = 0;
snprintf(m_persistedConfiguration.strDeviceName, 13, "%s", buf);
buf[response.size] = 0;
snprintf(m_persistedConfiguration.strDeviceName, 13, "%s", buf);
cec_datapacket response = RequestSetting(MSGCODE_GET_PHYSICAL_ADDRESS);
if (response.size == 2)
{
m_persistedConfiguration.iPhysicalAddress = ((uint16_t)response[0] << 8) | ((uint16_t)response[1]);
cec_datapacket response = RequestSetting(MSGCODE_GET_PHYSICAL_ADDRESS);
if (response.size == 2)
{
m_persistedConfiguration.iPhysicalAddress = ((uint16_t)response[0] << 8) | ((uint16_t)response[1]);
- CLibCEC::AddLog(CEC_LOG_DEBUG, "using persisted physical address setting: '%4x'", m_persistedConfiguration.iPhysicalAddress);
+ LIB_CEC->AddLog(CEC_LOG_DEBUG, "using persisted physical address setting: '%4x'", m_persistedConfiguration.iPhysicalAddress);
/* check whether this value was changed */
if (m_persistedConfiguration.deviceTypes.types[0] == type)
{
/* check whether this value was changed */
if (m_persistedConfiguration.deviceTypes.types[0] == type)
{
- CLibCEC::AddLog(CEC_LOG_DEBUG, "setting the device type to %X (previous: %X)", (uint8_t)type, (uint8_t)m_persistedConfiguration.deviceTypes.types[0]);
+ LIB_CEC->AddLog(CEC_LOG_DEBUG, "setting the device type to %X (previous: %X)", (uint8_t)type, (uint8_t)m_persistedConfiguration.deviceTypes.types[0]);
/* check whether this value was changed */
if (m_persistedConfiguration.logicalAddresses.primary == address)
{
/* check whether this value was changed */
if (m_persistedConfiguration.logicalAddresses.primary == address)
{
- CLibCEC::AddLog(CEC_LOG_DEBUG, "setting the default logical address to %X (previous: %X)", (uint8_t)address, (uint8_t)m_persistedConfiguration.logicalAddresses.primary);
+ LIB_CEC->AddLog(CEC_LOG_DEBUG, "setting the default logical address to %X (previous: %X)", (uint8_t)address, (uint8_t)m_persistedConfiguration.logicalAddresses.primary);
- CLibCEC::AddLog(CEC_LOG_DEBUG, "setting the logical address mask to %2X (previous: %2X)", iMask, m_iSettingLAMask);
+ LIB_CEC->AddLog(CEC_LOG_DEBUG, "setting the logical address mask to %2X (previous: %2X)", iMask, m_iSettingLAMask);
/* check whether this value was changed */
if (m_persistedConfiguration.iPhysicalAddress == iPhysicalAddress)
{
/* check whether this value was changed */
if (m_persistedConfiguration.iPhysicalAddress == iPhysicalAddress)
{
- CLibCEC::AddLog(CEC_LOG_DEBUG, "setting the physical address to %04X (previous: %04X)", iPhysicalAddress, m_persistedConfiguration.iPhysicalAddress);
+ LIB_CEC->AddLog(CEC_LOG_DEBUG, "setting the physical address to %04X (previous: %04X)", iPhysicalAddress, m_persistedConfiguration.iPhysicalAddress);
- CLibCEC::AddLog(CEC_LOG_DEBUG, "CEC version setting unchanged (%s)", CLibCEC::GetInstance()->ToString(version));
+ LIB_CEC->AddLog(CEC_LOG_DEBUG, "CEC version setting unchanged (%s)", ToString(version));
- CLibCEC::AddLog(CEC_LOG_DEBUG, "setting the CEC version to %s (previous: %s)", CLibCEC::GetInstance()->ToString(version), CLibCEC::GetInstance()->ToString(m_settingCecVersion));
+ LIB_CEC->AddLog(CEC_LOG_DEBUG, "setting the CEC version to %s (previous: %s)", ToString(version), ToString(m_settingCecVersion));
/* check whether this value was changed */
if (!strcmp(m_persistedConfiguration.strDeviceName, strOSDName))
{
/* check whether this value was changed */
if (!strcmp(m_persistedConfiguration.strDeviceName, strOSDName))
{
- CLibCEC::AddLog(CEC_LOG_DEBUG, "setting the OSD name to %s (previous: %s)", strOSDName, m_persistedConfiguration.strDeviceName);
+ LIB_CEC->AddLog(CEC_LOG_DEBUG, "setting the OSD name to %s (previous: %s)", strOSDName, m_persistedConfiguration.strDeviceName);
CCECAdapterMessage params;
CCECAdapterMessage *message = m_comm->SendCommand(MSGCODE_WRITE_EEPROM, params);
CCECAdapterMessage params;
CCECAdapterMessage *message = m_comm->SendCommand(MSGCODE_WRITE_EEPROM, params);
- CLibCEC::AddLog(CEC_LOG_DEBUG, "%s - firmware version %d does not have any eeprom settings", __FUNCTION__, m_persistedConfiguration.iFirmwareVersion);
+ LIB_CEC->AddLog(CEC_LOG_DEBUG, "%s - firmware version %d does not have any eeprom settings", __FUNCTION__, m_persistedConfiguration.iFirmwareVersion);
CCECAdapterMessage params;
CCECAdapterMessage *message = m_comm->SendCommand(MSGCODE_PING, params);
CCECAdapterMessage params;
CCECAdapterMessage *message = m_comm->SendCommand(MSGCODE_PING, params);
CCECAdapterMessage params;
CCECAdapterMessage *message = m_comm->SendCommand(MSGCODE_START_BOOTLOADER, params);
CCECAdapterMessage params;
CCECAdapterMessage *message = m_comm->SendCommand(MSGCODE_START_BOOTLOADER, params);
CCECAdapterMessage params;
params.PushEscaped(iTimeout);
CCECAdapterMessage *message = m_comm->SendCommand(MSGCODE_TRANSMIT_IDLETIME, params);
CCECAdapterMessage params;
params.PushEscaped(iTimeout);
CCECAdapterMessage *message = m_comm->SendCommand(MSGCODE_TRANSMIT_IDLETIME, params);