cec: stop replying to power status requests from LG when the power state is 'on'
[deb_libcec.git] / src / lib / implementations / SLCommandHandler.cpp
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;
+}