From 68391d4f314948ec3f808765593b6d60394132ec Mon Sep 17 00:00:00 2001 From: Lars Op den Kamp Date: Thu, 10 Nov 2011 18:30:00 +0100 Subject: [PATCH] cec: set the power status to 'on' when receiving CEC_USER_CONTROL_CODE_POWER --- src/lib/implementations/CECCommandHandler.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/lib/implementations/CECCommandHandler.cpp b/src/lib/implementations/CECCommandHandler.cpp index 2db0c72..c37f7a2 100644 --- a/src/lib/implementations/CECCommandHandler.cpp +++ b/src/lib/implementations/CECCommandHandler.cpp @@ -386,9 +386,17 @@ bool CCECCommandHandler::HandleUserControlPressed(const cec_command &command) 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]); } } -- 2.34.1