strLog.Format("<< powering on device with logical address %d", (int8_t)address);
m_controller->AddLog(CEC_LOG_DEBUG, strLog.c_str());
- return Transmit(cec_command::format(m_iLogicalAddress, address, CEC_OPCODE_IMAGE_VIEW_ON));
+ cec_command command;
+ cec_command::format(command, m_iLogicalAddress, address, CEC_OPCODE_IMAGE_VIEW_ON);
+
+ return Transmit(command);
}
bool CCECProcessor::StandbyDevices(cec_logical_address address /* = CECDEVICE_BROADCAST */)
strLog.Format("<< putting device with logical address %d in standby mode", (int8_t)address);
m_controller->AddLog(CEC_LOG_DEBUG, strLog.c_str());
- return Transmit(cec_command::format(m_iLogicalAddress, address, CEC_OPCODE_STANDBY));
+ cec_command command;
+ cec_command::format(command, m_iLogicalAddress, address, CEC_OPCODE_STANDBY);
+
+ return Transmit(command);
}
bool CCECProcessor::SetActiveView(void)
m_controller->AddLog(CEC_LOG_DEBUG, "<< setting active view");
- cec_command command = cec_command::format(m_iLogicalAddress, CECDEVICE_BROADCAST, CEC_OPCODE_ACTIVE_SOURCE);
+ cec_command command;
+ cec_command::format(command, m_iLogicalAddress, CECDEVICE_BROADCAST, CEC_OPCODE_ACTIVE_SOURCE);
command.parameters.push_back((m_physicaladdress >> 8) & 0xFF);
command.parameters.push_back(m_physicaladdress & 0xFF);
m_controller->AddLog(CEC_LOG_DEBUG, "<< setting inactive view");
- cec_command command = cec_command::format(m_iLogicalAddress, CECDEVICE_BROADCAST, CEC_OPCODE_INACTIVE_SOURCE);
+ cec_command command;
+ cec_command::format(command, m_iLogicalAddress, CECDEVICE_BROADCAST, CEC_OPCODE_INACTIVE_SOURCE);
command.parameters.push_back((m_physicaladdress >> 8) & 0xFF);
command.parameters.push_back(m_physicaladdress & 0xFF);
txStr.AppendFormat(" %02x", ((uint8_t)data.initiator << 4) + (uint8_t)data.destination);
txStr.AppendFormat(" %02x", (uint8_t)data.opcode);
- for (unsigned int iPtr = 0; iPtr < data.parameters.size; iPtr++)
+ for (uint8_t iPtr = 0; iPtr < data.parameters.size; iPtr++)
txStr.AppendFormat(" %02x", data.parameters[iPtr]);
m_controller->AddLog(CEC_LOG_DEBUG, txStr.c_str());
}
while (!bGotAck && now < target)
{
- bGotAck = WaitForAck(&bError, (uint64_t) (target - now));
+ bGotAck = WaitForAck(&bError, (uint32_t) (target - now));
now = GetTimeMs();
if (bError && now < target)
{
m_controller->AddLog(CEC_LOG_DEBUG, "<< transmitting abort message");
- cec_command command = cec_command::format(m_iLogicalAddress, address, CEC_OPCODE_FEATURE_ABORT);
+ cec_command command;
+ cec_command::format(command, m_iLogicalAddress, address, CEC_OPCODE_FEATURE_ABORT);
command.parameters.push_back((uint8_t)opcode);
command.parameters.push_back((uint8_t)reason);
{
m_controller->AddLog(CEC_LOG_NOTICE, "<< reporting CEC version as 1.3a");
- cec_command command = cec_command::format(m_iLogicalAddress, address, CEC_OPCODE_CEC_VERSION);
+ cec_command command;
+ cec_command::format(command, m_iLogicalAddress, address, CEC_OPCODE_CEC_VERSION);
command.parameters.push_back(CEC_VERSION_1_3A);
Transmit(command);
else
m_controller->AddLog(CEC_LOG_NOTICE, "<< reporting \"Off\" power status");
- cec_command command = cec_command::format(m_iLogicalAddress, address, CEC_OPCODE_REPORT_POWER_STATUS);
+ cec_command command;
+ cec_command::format(command, m_iLogicalAddress, address, CEC_OPCODE_REPORT_POWER_STATUS);
command.parameters.push_back(bOn ? (uint8_t) CEC_POWER_STATUS_ON : (uint8_t) CEC_POWER_STATUS_STANDBY);
Transmit(command);
else
m_controller->AddLog(CEC_LOG_NOTICE, "<< reporting menu state as inactive");
- cec_command command = cec_command::format(m_iLogicalAddress, address, CEC_OPCODE_MENU_STATUS);
+ cec_command command;
+ cec_command::format(command, m_iLogicalAddress, address, CEC_OPCODE_MENU_STATUS);
command.parameters.push_back(bActive ? (uint8_t) CEC_MENU_STATE_ACTIVATED : (uint8_t) CEC_MENU_STATE_DEACTIVATED);
Transmit(command);
strLog.Format("<< reporting OSD name as %s", osdname);
m_controller->AddLog(CEC_LOG_NOTICE, strLog.c_str());
- cec_command command = cec_command::format(m_iLogicalAddress, address, CEC_OPCODE_SET_OSD_NAME);
+ cec_command command;
+ cec_command::format(command, m_iLogicalAddress, address, CEC_OPCODE_SET_OSD_NAME);
for (unsigned int iPtr = 0; iPtr < strlen(osdname); iPtr++)
command.parameters.push_back(osdname[iPtr]);
strLog.Format("<< reporting physical address as %04x", m_physicaladdress);
m_controller->AddLog(CEC_LOG_NOTICE, strLog.c_str());
- cec_command command = cec_command::format(m_iLogicalAddress, CECDEVICE_BROADCAST, CEC_OPCODE_REPORT_PHYSICAL_ADDRESS);
+ cec_command command;
+ cec_command::format(command, m_iLogicalAddress, CECDEVICE_BROADCAST, CEC_OPCODE_REPORT_PHYSICAL_ADDRESS);
command.parameters.push_back((uint8_t) ((m_physicaladdress >> 8) & 0xFF));
command.parameters.push_back((uint8_t) (m_physicaladdress & 0xFF));
{
m_controller->AddLog(CEC_LOG_NOTICE, "<< broadcasting active source");
- cec_command command = cec_command::format(m_iLogicalAddress, CECDEVICE_BROADCAST, CEC_OPCODE_ACTIVE_SOURCE);
+ cec_command command;
+ cec_command::format(command, m_iLogicalAddress, CECDEVICE_BROADCAST, CEC_OPCODE_ACTIVE_SOURCE);
command.parameters.push_back((uint8_t) ((m_physicaladdress >> 8) & 0xFF));
command.parameters.push_back((uint8_t) (m_physicaladdress & 0xFF));
cec_adapter_message msg;
msg.clear();
- if (!m_communication->Read(msg, iTimeout > 0 ? iTargetTime - iNow : 1000))
+ if (!m_communication->Read(msg, iTimeout > 0 ? (int32_t)(iTargetTime - iNow) : 1000))
{
iNow = GetTimeMs();
continue;
if (command.parameters.size > 1)
{
dataStr += " data:";
- for (unsigned int iPtr = 0; iPtr < command.parameters.size; iPtr++)
- dataStr.AppendFormat(" %02x", command.parameters[iPtr]);
+ for (uint8_t iPtr = 0; iPtr < command.parameters.size; iPtr++)
+ dataStr.AppendFormat(" %02x", (unsigned int)command.parameters[iPtr]);
}
m_controller->AddLog(CEC_LOG_DEBUG, dataStr.c_str());