From: Lars Op den Kamp Date: Tue, 27 Mar 2012 13:26:11 +0000 (+0200) Subject: cec: added power on command for Samsung AVR devices. bugzid: 361 X-Git-Tag: upstream/2.2.0~1^2~31^2~45 X-Git-Url: https://git.piment-noir.org/?p=deb_libcec.git;a=commitdiff_plain;h=a2612289991e8ba17bd02534d68741f7c22b4ad3 cec: added power on command for Samsung AVR devices. bugzid: 361 --- diff --git a/src/lib/implementations/ANCommandHandler.cpp b/src/lib/implementations/ANCommandHandler.cpp index f8a8ade..cd60825 100644 --- a/src/lib/implementations/ANCommandHandler.cpp +++ b/src/lib/implementations/ANCommandHandler.cpp @@ -95,3 +95,15 @@ bool CANCommandHandler::HandleCommand(const cec_command &command) return bHandled; } + +bool CANCommandHandler::PowerOn(const cec_logical_address iInitiator, const cec_logical_address iDestination) +{ + if (iDestination == CECDEVICE_AUDIOSYSTEM) + { + /* Samsung AVR devices need to be woken up with key CEC_USER_CONTROL_CODE_POWER_ON_FUNCTION */ + return TransmitKeypress(iInitiator, iDestination, CEC_USER_CONTROL_CODE_POWER_ON_FUNCTION) && + TransmitKeyRelease(iInitiator, iDestination); + } + + return CCECCommandHandler::PowerOn(iInitiator, iDestination); +} diff --git a/src/lib/implementations/ANCommandHandler.h b/src/lib/implementations/ANCommandHandler.h index 23b9de9..d9437d1 100644 --- a/src/lib/implementations/ANCommandHandler.h +++ b/src/lib/implementations/ANCommandHandler.h @@ -44,5 +44,6 @@ namespace CEC virtual bool HandleCommand(const cec_command &command); protected: virtual bool HandleVendorRemoteButtonDown(const cec_command &command); + virtual bool PowerOn(const cec_logical_address iInitiator, const cec_logical_address iDestination); }; };