X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Flib%2Fimplementations%2FCECCommandHandler.cpp;h=8ec93eee09d22a9902bbc24f55dc776441d61d3d;hb=f4698390c3097cad836af0cdd8c959431333dca7;hp=d03ffd936ef23d8f091b8f6dc8ecb3f0f56a5f71;hpb=ece1582ec85912aebc8f87c0dca015ae62b29331;p=deb_libcec.git diff --git a/src/lib/implementations/CECCommandHandler.cpp b/src/lib/implementations/CECCommandHandler.cpp index d03ffd9..8ec93ee 100644 --- a/src/lib/implementations/CECCommandHandler.cpp +++ b/src/lib/implementations/CECCommandHandler.cpp @@ -716,6 +716,15 @@ void CCECCommandHandler::SetPhysicalAddress(cec_logical_address iAddress, uint16 } } +bool CCECCommandHandler::PowerOn(const cec_logical_address iInitiator, const cec_logical_address iDestination) +{ + if (iDestination == CECDEVICE_TV) + return TransmitImageViewOn(iInitiator, iDestination); + + return TransmitKeypress(iInitiator, iDestination, CEC_USER_CONTROL_CODE_POWER) && + TransmitKeyRelease(iInitiator, iDestination); +} + bool CCECCommandHandler::TransmitImageViewOn(const cec_logical_address iInitiator, const cec_logical_address iDestination) { cec_command command;