From: Lars Op den Kamp Date: Thu, 10 Nov 2011 17:30:00 +0000 (+0100) Subject: cec: handle CEC_OPCODE_STANDBY X-Git-Tag: upstream/2.2.0~1^2~79 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=4d6b44335f86b1c668576ccacc2c75d0691255cb;p=deb_libcec.git cec: handle CEC_OPCODE_STANDBY --- diff --git a/src/lib/implementations/CECCommandHandler.cpp b/src/lib/implementations/CECCommandHandler.cpp index c92908c..bc345a4 100644 --- a/src/lib/implementations/CECCommandHandler.cpp +++ b/src/lib/implementations/CECCommandHandler.cpp @@ -63,6 +63,7 @@ bool CCECCommandHandler::HandleCommand(const cec_command &command) break; case CEC_OPCODE_SET_MENU_LANGUAGE: HandleSetMenuLanguage(command); + /* pass to listeners */ m_busDevice->GetProcessor()->AddCommand(command); break; case CEC_OPCODE_GIVE_PHYSICAL_ADDRESS: @@ -109,6 +110,7 @@ bool CCECCommandHandler::HandleCommand(const cec_command &command) break; default: UnhandledCommand(command); + /* pass to listeners */ m_busDevice->GetProcessor()->AddCommand(command); bHandled = false; break; @@ -121,6 +123,7 @@ bool CCECCommandHandler::HandleCommand(const cec_command &command) { case CEC_OPCODE_SET_MENU_LANGUAGE: HandleSetMenuLanguage(command); + /* pass to listeners */ m_busDevice->GetProcessor()->AddCommand(command); break; case CEC_OPCODE_REQUEST_ACTIVE_SOURCE: @@ -128,11 +131,9 @@ bool CCECCommandHandler::HandleCommand(const cec_command &command) break; case CEC_OPCODE_SET_STREAM_PATH: HandleSetStreamPath(command); - m_busDevice->GetProcessor()->AddCommand(command); break; case CEC_OPCODE_ROUTING_CHANGE: HandleRoutingChange(command); - m_busDevice->GetProcessor()->AddCommand(command); break; case CEC_OPCODE_DEVICE_VENDOR_ID: HandleDeviceVendorId(command); @@ -140,8 +141,14 @@ bool CCECCommandHandler::HandleCommand(const cec_command &command) case CEC_OPCODE_VENDOR_COMMAND_WITH_ID: HandleDeviceVendorCommandWithId(command); break; + case CEC_OPCODE_STANDBY: + HandleStandby(command); + /* pass to listeners */ + m_busDevice->GetProcessor()->AddCommand(command); + break; default: UnhandledCommand(command); + /* pass to listeners */ m_busDevice->GetProcessor()->AddCommand(command); bHandled = false; break; @@ -337,6 +344,14 @@ bool CCECCommandHandler::HandleSetSystemAudioModeRequest(const cec_command &comm return true; } +bool CCECCommandHandler::HandleStandby(const cec_command &command) +{ + CCECBusDevice *device = GetDevice(command.initiator); + if (device) + device->SetPowerStatus(CEC_POWER_STATUS_STANDBY); + return true; +} + bool CCECCommandHandler::HandleGiveSystemAudioModeStatus(const cec_command &command) { CCECBusDevice *device = GetDevice(command.destination); diff --git a/src/lib/implementations/CECCommandHandler.h b/src/lib/implementations/CECCommandHandler.h index 7cf3b84..934dfc5 100644 --- a/src/lib/implementations/CECCommandHandler.h +++ b/src/lib/implementations/CECCommandHandler.h @@ -68,6 +68,7 @@ namespace CEC virtual bool HandleSetMenuLanguage(const cec_command &command); virtual bool HandleSetStreamPath(const cec_command &command); virtual bool HandleSetSystemAudioModeRequest(const cec_command &command); + virtual bool HandleStandby(const cec_command &command); virtual bool HandleGiveSystemAudioModeStatus(const cec_command &command); virtual bool HandleUserControlPressed(const cec_command &command); virtual bool HandleUserControlRelease(const cec_command &command);