cec: send the physical address before sending the vendor id in the SL handler
authorLars Op den Kamp <lars@opdenkamp.eu>
Mon, 13 Feb 2012 12:05:00 +0000 (13:05 +0100)
committerLars Op den Kamp <lars@opdenkamp.eu>
Mon, 13 Feb 2012 12:05:08 +0000 (13:05 +0100)
src/lib/implementations/SLCommandHandler.cpp
src/lib/implementations/SLCommandHandler.h

index 7771b20b662b7d4a42552831f38a5983cc26071b..dbf9d0957921b21f6cfd5e77a5be2ecca1230a6a 100644 (file)
@@ -51,7 +51,8 @@ CSLCommandHandler::CSLCommandHandler(CCECBusDevice *busDevice) :
     CCECCommandHandler(busDevice),
     m_bSLEnabled(false),
     m_bPowerStateReset(false),
-    m_bActiveSourceSent(false)
+    m_bActiveSourceSent(false),
+    m_bVendorIdSent(false)
 {
   m_vendorId = CEC_VENDOR_LG;
   CCECBusDevice *primary = m_processor->GetPrimaryDevice();
@@ -83,9 +84,6 @@ bool CSLCommandHandler::InitHandler(void)
     /* start as 'in transition standby->on' */
     primary->SetPowerStatus(CEC_POWER_STATUS_IN_TRANSITION_STANDBY_TO_ON);
     primary->TransmitPowerState(CECDEVICE_TV);
-
-    /* reply with LGs vendor id */
-    primary->TransmitVendorID(CECDEVICE_BROADCAST, false);
   }
 
   return true;
@@ -93,6 +91,13 @@ bool CSLCommandHandler::InitHandler(void)
 
 bool CSLCommandHandler::ActivateSource(void)
 {
+  /* reply with LGs vendor id */
+  if (!m_bVendorIdSent)
+  {
+    m_bVendorIdSent = true;
+    m_processor->GetPrimaryDevice()->TransmitVendorID(CECDEVICE_BROADCAST, false);
+  }
+
   if (!m_bSLEnabled)
     return true;
 
index eaa21f16e9d04567effe44c3e6d81b2e9e514e43..fc4c5fddfd3cabcd6c6bc5c8ee682a85f011ca13 100644 (file)
@@ -71,5 +71,6 @@ namespace CEC
     bool               m_bPowerStateReset;
     bool               m_bActiveSourceSent;
     PLATFORM::CTimeout m_resetPowerState;
+    bool               m_bVendorIdSent;
   };
 };