bool CCECBusDevice::PowerOn(void)
{
- CStdString strLog;
- strLog.Format("<< powering on '%s' (%X)", GetLogicalAddressName(), m_iLogicalAddress);
- AddLog(CEC_LOG_DEBUG, strLog.c_str());
+ cec_power_status current = GetPowerStatus();
+ if (current != CEC_POWER_STATUS_ON &&
+ current != CEC_POWER_STATUS_IN_TRANSITION_STANDBY_TO_ON)
+ {
+ CStdString strLog;
+ strLog.Format("<< powering on '%s' (%X)", GetLogicalAddressName(), m_iLogicalAddress);
+ AddLog(CEC_LOG_DEBUG, strLog.c_str());
- cec_command command;
- cec_command::format(command, GetMyLogicalAddress(), m_iLogicalAddress, CEC_OPCODE_IMAGE_VIEW_ON);
+ SetPowerStatus(CEC_POWER_STATUS_IN_TRANSITION_STANDBY_TO_ON);
- return m_processor->Transmit(command);
+ cec_command command;
+ cec_command::format(command, GetMyLogicalAddress(), m_iLogicalAddress, CEC_OPCODE_IMAGE_VIEW_ON);
+
+ return m_processor->Transmit(command);
+ }
+
+ return true;
}
bool CCECBusDevice::Standby(void)
AddLog(CEC_LOG_DEBUG, strLog.c_str());
m_iStreamPath = iNewAddress;
+
+ if (iNewAddress > 0)
+ SetPowerStatus(CEC_POWER_STATUS_ON);
}
}
return false;
}
-bool CCECBusDevice::TransmitActiveView(void)
-{
- CStdString strLog;
- strLog.Format("<< %s (%X) -> broadcast (F): active view (%4x)", GetLogicalAddressName(), m_iLogicalAddress, m_iPhysicalAddress);
- AddLog(CEC_LOG_NOTICE, strLog);
-
- cec_command command;
- cec_command::format(command, m_iLogicalAddress, CECDEVICE_BROADCAST, CEC_OPCODE_ACTIVE_SOURCE);
- command.parameters.push_back((m_iPhysicalAddress >> 8) & 0xFF);
- command.parameters.push_back(m_iPhysicalAddress & 0xFF);
-
- return m_processor->Transmit(command);
-}
-
bool CCECBusDevice::TransmitCECVersion(cec_logical_address dest)
{
CStdString strLog;
return m_processor->Transmit(command);
}
-bool CCECBusDevice::TransmitDeckStatus(cec_logical_address dest)
-{
- // need to support opcodes play and deck control before doing anything with this
- CStdString strLog;
- strLog.Format("<< %s (%X) -> %s (%X): deck status feature abort", GetLogicalAddressName(), m_iLogicalAddress, CCECCommandHandler::ToString(dest), dest);
- AddLog(CEC_LOG_NOTICE, strLog);
-
- m_processor->TransmitAbort(dest, CEC_OPCODE_GIVE_DECK_STATUS);
- return false;
-}
-
bool CCECBusDevice::TransmitInactiveView(void)
{
CStdString strLog;