cec: added power on command for Samsung AVR devices. bugzid: 361
authorLars Op den Kamp <lars@opdenkamp.eu>
Tue, 27 Mar 2012 13:26:11 +0000 (15:26 +0200)
committerLars Op den Kamp <lars@opdenkamp.eu>
Tue, 27 Mar 2012 13:26:11 +0000 (15:26 +0200)
src/lib/implementations/ANCommandHandler.cpp
src/lib/implementations/ANCommandHandler.h

index f8a8ade3c421aa12d00f781b03978eb1706dc9ba..cd6082549b2f4c90644b83de98685f9fe7dfd866 100644 (file)
@@ -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);
+}
index 23b9de930b9434984def115a0f920ccd12220b7b..d9437d13a1e6529c364bf5f932e05bc32cfc44bd 100644 (file)
@@ -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);
   };
 };