cec: send deck status 0x20 when an LG tv is found, so keypresses will be routed to...
[deb_libcec.git] / src / lib / devices / CECBusDevice.cpp
index c06a8b8e777c057eac616cdadfc3fe79cb9b2fe4..5cfca5914c10bb890b07cf0a2a7f0cce80c69b1b 100644 (file)
@@ -84,7 +84,15 @@ bool CCECBusDevice::HandleCommand(const cec_command &command)
   m_iLastActive = GetTimeMs();
   m_handler->HandleCommand(command);
   if (m_deviceStatus != CEC_DEVICE_STATUS_HANDLED_BY_LIBCEC)
+  {
+    if (m_deviceStatus != CEC_DEVICE_STATUS_PRESENT)
+    {
+      CStdString strLog;
+      strLog.Format("device %s (%x) status changed to present after command %s", GetLogicalAddressName(), (uint8_t)GetLogicalAddress(), ToString(command.opcode));
+      AddLog(CEC_LOG_DEBUG, strLog);
+    }
     m_deviceStatus = CEC_DEVICE_STATUS_PRESENT;
+  }
   m_condition.Signal();
   return true;
 }
@@ -595,6 +603,8 @@ void CCECBusDevice::SetVendorId(uint64_t iVendorId)
     }
   }
 
+  m_handler->InitHandler();
+
   CStdString strLog;
   strLog.Format("%s (%X): vendor = %s (%06x)", GetLogicalAddressName(), m_iLogicalAddress, ToString(m_vendor), m_vendor);
   m_processor->AddLog(CEC_LOG_DEBUG, strLog.c_str());