m_iLogicalAddress(iLogicalAddress),
m_powerStatus(CEC_POWER_STATUS_UNKNOWN),
m_processor(processor),
+ m_bMenuActive(true),
m_iVendorClass(CEC_VENDOR_UNKNOWN),
m_iLastActive(0),
m_cecVersion(CEC_VERSION_1_3A)
cec_command::format(command, GetMyLogicalAddress(), m_iLogicalAddress, CEC_OPCODE_SET_OSD_STRING);
command.parameters.push_back((uint8_t)duration);
- for (unsigned int iPtr = 0; iPtr < strlen(strMessage); iPtr++)
+ unsigned int iLen = strlen(strMessage);
+ if (iLen > 13) iLen = 13;
+
+ for (unsigned int iPtr = 0; iPtr < iLen; iPtr++)
command.parameters.push_back(strMessage[iPtr]);
return m_processor->Transmit(command);
}
-bool CCECBusDevice::ReportCECVersion(cec_logical_address dest)
+bool CCECBusDevice::TransmitCECVersion(cec_logical_address dest)
{
AddLog(CEC_LOG_NOTICE, "<< reporting CEC version as 1.3a");
return m_processor->Transmit(command);
}
-bool CCECBusDevice::ReportDeckStatus(cec_logical_address dest)
+bool CCECBusDevice::TransmitDeckStatus(cec_logical_address dest)
{
// need to support opcodes play and deck control before doing anything with this
AddLog(CEC_LOG_NOTICE, "<< deck status requested, feature abort");
return false;
}
-bool CCECBusDevice::ReportMenuState(cec_logical_address dest, bool bActive /* = true */)
+bool CCECBusDevice::TransmitMenuState(cec_logical_address dest)
{
- if (bActive)
+ if (m_bMenuActive)
AddLog(CEC_LOG_NOTICE, "<< reporting menu state as active");
else
AddLog(CEC_LOG_NOTICE, "<< reporting menu state as inactive");
cec_command command;
cec_command::format(command, m_iLogicalAddress, dest, CEC_OPCODE_MENU_STATUS);
- command.parameters.push_back(bActive ? (uint8_t) CEC_MENU_STATE_ACTIVATED : (uint8_t) CEC_MENU_STATE_DEACTIVATED);
+ command.parameters.push_back(m_bMenuActive ? (uint8_t) CEC_MENU_STATE_ACTIVATED : (uint8_t) CEC_MENU_STATE_DEACTIVATED);
return m_processor->Transmit(command);
}
-bool CCECBusDevice::ReportOSDName(cec_logical_address dest)
+bool CCECBusDevice::TransmitOSDName(cec_logical_address dest)
{
CStdString strLog;
strLog.Format("<< reporting OSD name as %s", m_strDeviceName.c_str());
return m_processor->Transmit(command);
}
-bool CCECBusDevice::ReportPowerState(cec_logical_address dest)
+bool CCECBusDevice::TransmitPowerState(cec_logical_address dest)
{
- AddLog(CEC_LOG_NOTICE, "<< reporting \"On\" power status");
+ CStdString strLog;
+ strLog.Format("<< reporting power status '%d'", m_powerStatus);
+ AddLog(CEC_LOG_NOTICE, strLog);
cec_command command;
cec_command::format(command, m_iLogicalAddress, dest, CEC_OPCODE_REPORT_POWER_STATUS);
-// command.parameters.push_back(bOn ? (uint8_t) CEC_POWER_STATUS_ON : (uint8_t) CEC_POWER_STATUS_STANDBY);
- command.parameters.push_back((uint8_t) CEC_POWER_STATUS_ON);
+ command.parameters.push_back((uint8_t) m_powerStatus);
return m_processor->Transmit(command);
}
-bool CCECBusDevice::ReportVendorID(cec_logical_address dest)
+bool CCECBusDevice::TransmitVendorID(cec_logical_address dest)
{
AddLog(CEC_LOG_NOTICE, "<< vendor ID requested, feature abort");
m_processor->TransmitAbort(dest, CEC_OPCODE_GIVE_DEVICE_VENDOR_ID);
return false;
}
-bool CCECBusDevice::BroadcastActiveView(void)
+bool CCECBusDevice::TransmitActiveView(void)
{
AddLog(CEC_LOG_DEBUG, "<< setting active view");
return m_processor->Transmit(command);
}
-bool CCECBusDevice::BroadcastInactiveView(void)
+bool CCECBusDevice::TransmitInactiveView(void)
{
AddLog(CEC_LOG_DEBUG, "<< setting inactive view");
return m_processor->Transmit(command);
}
-bool CCECBusDevice::BroadcastPhysicalAddress(void)
+bool CCECBusDevice::TransmitPhysicalAddress(void)
{
CStdString strLog;
strLog.Format("<< reporting physical address as %04x", m_iPhysicalAddress);
return m_processor->Transmit(command);
}
-bool CCECBusDevice::BroadcastActiveSource(void)
+bool CCECBusDevice::TransmitActiveSource(void)
{
AddLog(CEC_LOG_NOTICE, "<< broadcasting active source");