cec: transmit a keypress and key release as power on command when the target device...
[deb_libcec.git] / src / lib / implementations / CECCommandHandler.cpp
index d03ffd936ef23d8f091b8f6dc8ecb3f0f56a5f71..8ec93eee09d22a9902bbc24f55dc776441d61d3d 100644 (file)
@@ -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;