cec: stop replying to power status requests from LG when the power state is 'on'
authorLars Op den Kamp <lars@opdenkamp.eu>
Sun, 12 Feb 2012 14:42:03 +0000 (15:42 +0100)
committerLars Op den Kamp <lars@opdenkamp.eu>
Sun, 12 Feb 2012 14:42:03 +0000 (15:42 +0100)
src/lib/implementations/SLCommandHandler.cpp
src/lib/implementations/SLCommandHandler.h

index fef6a4a0e05a5973eff9b7dbf869faca8c76386c..7b67a154d860544c35f4b6483ab0a30d6ba8a6fd 100644 (file)
@@ -255,3 +255,16 @@ void CSLCommandHandler::SetDeckStatus(cec_deck_info deckStatus)
   if (device)
     ((CCECPlaybackDevice *)device)->SetDeckStatus(deckStatus);
 }
+
+
+bool CSLCommandHandler::HandleGiveDevicePowerStatus(const cec_command &command)
+{
+  if (m_processor->IsRunning() && m_busDevice->MyLogicalAddressContains(command.destination))
+  {
+    CCECBusDevice *device = GetDevice(command.destination);
+    if (device && device->GetPowerStatus(false) != CEC_POWER_STATUS_ON)
+      return device->TransmitPowerState(command.initiator);
+  }
+
+  return false;
+}
index 55f1beaeee6f960680ff13755b5a990a44eb4185..7ba78ae7417be749e7e960b253582884d3f3626b 100644 (file)
@@ -61,6 +61,7 @@ namespace CEC
     virtual void TransmitVendorCommand05(const cec_logical_address iSource, const cec_logical_address iDestination);
 
     virtual void SetDeckStatus(cec_deck_info deckStatus);
+    virtual bool HandleGiveDevicePowerStatus(const cec_command &command);
 
     bool    m_bSLEnabled;
     bool    m_bPowerStateReset;