{
if (command.parameters.size >= 2)
{
- int streamaddr = ((uint16_t)command.parameters[0] << 8) | ((uint16_t)command.parameters[1]);
+ uint16_t streamaddr = ((uint16_t)command.parameters[0] << 8) | ((uint16_t)command.parameters[1]);
CStdString strLog;
strLog.Format(">> %i sets stream path to physical address %04x", command.initiator, streamaddr);
m_busDevice->AddLog(CEC_LOG_DEBUG, strLog.c_str());
if (command.parameters[0] <= CEC_USER_CONTROL_CODE_MAX)
{
CStdString strLog;
- strLog.Format("key pressed: %1x", command.parameters[0]);
+ strLog.Format("key pressed: %x", command.parameters[0]);
m_busDevice->AddLog(CEC_LOG_DEBUG, strLog.c_str());
+ if (command.parameters[0] == CEC_USER_CONTROL_CODE_POWER ||
+ command.parameters[0] == CEC_USER_CONTROL_CODE_POWER_ON_FUNCTION)
+ {
+ CCECBusDevice *device = GetDevice(command.destination);
+ if (device)
+ device->SetPowerStatus(CEC_POWER_STATUS_ON);
+ }
+
m_busDevice->GetProcessor()->SetCurrentButton((cec_user_control_code) command.parameters[0]);
}
}
unsigned int iReturn(0);
cec_logical_addresses addresses = m_busDevice->GetProcessor()->GetLogicalAddresses();
- for (unsigned int iPtr = 0; iPtr < 16; iPtr++)
+ for (uint8_t iPtr = 0; iPtr < 16; iPtr++)
{
if (addresses[iPtr])
{
device->SetVendorId(iVendorId, command.parameters.size > 3 ? command.parameters[3] : 0);
}
+const char *CCECCommandHandler::ToString(const cec_version version)
+{
+ switch (version)
+ {
+ case CEC_VERSION_1_2:
+ return "1.2";
+ case CEC_VERSION_1_2A:
+ return "1.2a";
+ case CEC_VERSION_1_3:
+ return "1.3";
+ case CEC_VERSION_1_3A:
+ return "1.3a";
+ default:
+ return "unknown";
+ }
+}
+
+const char *CCECCommandHandler::ToString(const cec_power_status status)
+{
+ switch (status)
+ {
+ case CEC_POWER_STATUS_ON:
+ return "on";
+ case CEC_POWER_STATUS_STANDBY:
+ return "standby";
+ case CEC_POWER_STATUS_IN_TRANSITION_ON_TO_STANDBY:
+ return "in transition from on to standby";
+ case CEC_POWER_STATUS_IN_TRANSITION_STANDBY_TO_ON:
+ return "in transition from standby to on";
+ default:
+ return "unknown";
+ }
+}
+
const char *CCECCommandHandler::ToString(const cec_logical_address address)
{
switch(address)