cec: fixed - copy the class member values of the old handler when creating a new...
authorLars Op den Kamp <lars@opdenkamp.eu>
Tue, 26 Jun 2012 23:45:24 +0000 (01:45 +0200)
committerLars Op den Kamp <lars@opdenkamp.eu>
Tue, 26 Jun 2012 23:50:10 +0000 (01:50 +0200)
13 files changed:
src/lib/CECClient.cpp
src/lib/devices/CECBusDevice.cpp
src/lib/devices/CECBusDevice.h
src/lib/implementations/ANCommandHandler.cpp
src/lib/implementations/ANCommandHandler.h
src/lib/implementations/CECCommandHandler.cpp
src/lib/implementations/CECCommandHandler.h
src/lib/implementations/RLCommandHandler.cpp
src/lib/implementations/RLCommandHandler.h
src/lib/implementations/SLCommandHandler.cpp
src/lib/implementations/SLCommandHandler.h
src/lib/implementations/VLCommandHandler.cpp
src/lib/implementations/VLCommandHandler.h

index e4033604aaa91593ee60e48882f3f503a9fdd31b..b0d7e188da38fd98a138214b6f5cb79c59e34f3c 100644 (file)
@@ -125,7 +125,7 @@ bool CCECClient::OnRegister(void)
 
   // make the primary device the active source if the option is set
   if (m_configuration.bActivateSource == 1)
-    GetPrimaryDevice()->ActivateSource();
+    GetPrimaryDevice()->ActivateSource(500);
 
   return true;
 }
index f01d47ce8eff19e003fe06d369f3952a441d366a..91dd83538c90ee213310c22c93ed648548ea1861 100644 (file)
@@ -72,7 +72,8 @@ CCECBusDevice::CCECBusDevice(CCECProcessor *processor, cec_logical_address iLogi
   m_deviceStatus          (CEC_DEVICE_STATUS_UNKNOWN),
   m_iHandlerUseCount      (0),
   m_bAwaitingReceiveFailed(false),
-  m_bVendorIdRequested    (false)
+  m_bVendorIdRequested    (false),
+  m_waitForResponse       (new CWaitForResponse)
 {
   m_handler = new CCECCommandHandler(this);
 
@@ -87,6 +88,7 @@ CCECBusDevice::CCECBusDevice(CCECProcessor *processor, cec_logical_address iLogi
 CCECBusDevice::~CCECBusDevice(void)
 {
   DELETE_AND_NULL(m_handler);
+  DELETE_AND_NULL(m_waitForResponse);
 }
 
 bool CCECBusDevice::ReplaceHandler(bool bActivateSource /* = true */)
@@ -108,21 +110,27 @@ bool CCECBusDevice::ReplaceHandler(bool bActivateSource /* = true */)
       if (CCECCommandHandler::HasSpecificHandler(m_vendor))
       {
         LIB_CEC->AddLog(CEC_LOG_DEBUG, "replacing the command handler for device '%s' (%x)", GetLogicalAddressName(), GetLogicalAddress());
+
+        int32_t iTransmitTimeout     = m_handler->m_iTransmitTimeout;
+        int32_t iTransmitWait        = m_handler->m_iTransmitWait;
+        int8_t  iTransmitRetries     = m_handler->m_iTransmitRetries;
+        int64_t iActiveSourcePending = m_handler->m_iActiveSourcePending;
+
         DELETE_AND_NULL(m_handler);
 
         switch (m_vendor)
         {
         case CEC_VENDOR_SAMSUNG:
-          m_handler = new CANCommandHandler(this);
+          m_handler = new CANCommandHandler(this, iTransmitTimeout, iTransmitWait, iTransmitRetries, iActiveSourcePending);
           break;
         case CEC_VENDOR_LG:
-          m_handler = new CSLCommandHandler(this);
+          m_handler = new CSLCommandHandler(this, iTransmitTimeout, iTransmitWait, iTransmitRetries, iActiveSourcePending);
           break;
         case CEC_VENDOR_PANASONIC:
-          m_handler = new CVLCommandHandler(this);
+          m_handler = new CVLCommandHandler(this, iTransmitTimeout, iTransmitWait, iTransmitRetries, iActiveSourcePending);
           break;
         default:
-          m_handler = new CCECCommandHandler(this);
+          m_handler = new CCECCommandHandler(this, iTransmitTimeout, iTransmitWait, iTransmitRetries, iActiveSourcePending);
           break;
         }
 
@@ -231,7 +239,7 @@ void CCECBusDevice::SetUnsupportedFeature(cec_opcode opcode)
 
   // signal threads that are waiting for a reponse
   MarkBusy();
-  m_handler->SignalOpcode(cec_command::GetResponseOpcode(opcode));
+  SignalOpcode(cec_command::GetResponseOpcode(opcode));
   MarkReady();
 }
 
@@ -801,6 +809,7 @@ void CCECBusDevice::ResetDeviceStatus(void)
   m_iLastActive = 0;
   m_bVendorIdRequested = false;
   m_unsupportedFeatures.clear();
+  m_waitForResponse->Clear();
 
   if (m_deviceStatus != CEC_DEVICE_STATUS_UNKNOWN)
     LIB_CEC->AddLog(CEC_LOG_DEBUG, "%s (%X): device status changed into 'unknown'", GetLogicalAddressName(), m_iLogicalAddress);
@@ -890,12 +899,21 @@ bool CCECBusDevice::TransmitMenuState(const cec_logical_address dest)
   return bReturn;
 }
 
-bool CCECBusDevice::ActivateSource(void)
+bool CCECBusDevice::ActivateSource(uint64_t iDelay /* = 0 */)
 {
   MarkAsActiveSource();
-  LIB_CEC->AddLog(CEC_LOG_DEBUG, "activating source '%s'", ToString(m_iLogicalAddress));
   MarkBusy();
-  bool bReturn = m_handler->ActivateSource();
+  bool bReturn(true);
+  if (iDelay == 0)
+  {
+    LIB_CEC->AddLog(CEC_LOG_DEBUG, "sending active source message for '%s'", ToString(m_iLogicalAddress));
+    bReturn = m_handler->ActivateSource();
+  }
+  else
+  {
+    LIB_CEC->AddLog(CEC_LOG_DEBUG, "scheduling active source message for '%s'", ToString(m_iLogicalAddress));
+    m_handler->ScheduleActivateSource(iDelay);
+  }
   MarkReady();
   return bReturn;
 }
@@ -1282,3 +1300,13 @@ CCECClient *CCECBusDevice::GetClient(void)
 {
   return m_processor->GetClient(m_iLogicalAddress);
 }
+
+void CCECBusDevice::SignalOpcode(cec_opcode opcode)
+{
+  m_waitForResponse->Received(opcode);
+}
+
+bool CCECBusDevice::WaitForOpcode(cec_opcode opcode)
+{
+  return m_waitForResponse->Wait(opcode);
+}
index dcfbbbc4ab9f28b8c33b054e7bac3c082efeb000..89fb690088dea9054599fba9c2837485b29fc100 100644 (file)
@@ -33,6 +33,7 @@
 
 #include "../../../include/cectypes.h"
 #include <set>
+#include <map>
 #include "../platform/threads/mutex.h"
 #include "../platform/util/StdString.h"
 
@@ -47,6 +48,85 @@ namespace CEC
   class CCECTuner;
   class CCECTV;
 
+  class CResponse
+  {
+  public:
+    CResponse(cec_opcode opcode) :
+        m_opcode(opcode){}
+    ~CResponse(void)
+    {
+      Broadcast();
+    }
+
+    bool Wait(uint32_t iTimeout)
+    {
+      return m_event.Wait(iTimeout);
+    }
+
+    void Broadcast(void)
+    {
+      m_event.Broadcast();
+    }
+
+  private:
+    cec_opcode       m_opcode;
+    PLATFORM::CEvent m_event;
+  };
+
+  class CWaitForResponse
+  {
+  public:
+    CWaitForResponse(void) {}
+    ~CWaitForResponse(void)
+    {
+      Clear();
+    }
+
+    void Clear()
+    {
+      PLATFORM::CLockObject lock(m_mutex);
+      for (std::map<cec_opcode, CResponse*>::iterator it = m_waitingFor.begin(); it != m_waitingFor.end(); it++)
+        it->second->Broadcast();
+      m_waitingFor.clear();
+    }
+
+    bool Wait(cec_opcode opcode, uint32_t iTimeout = CEC_DEFAULT_TRANSMIT_WAIT)
+    {
+      CResponse *response = GetEvent(opcode);
+      return response ? response->Wait(iTimeout) : false;
+    }
+
+    void Received(cec_opcode opcode)
+    {
+      CResponse *response = GetEvent(opcode);
+      if (response)
+        response->Broadcast();
+    }
+
+  private:
+    CResponse *GetEvent(cec_opcode opcode)
+    {
+      CResponse *retVal(NULL);
+      {
+        PLATFORM::CLockObject lock(m_mutex);
+        std::map<cec_opcode, CResponse*>::iterator it = m_waitingFor.find(opcode);
+        if (it != m_waitingFor.end())
+        {
+          retVal = it->second;
+        }
+        else
+        {
+          retVal = new CResponse(opcode);
+          m_waitingFor[opcode] = retVal;
+        }
+        return retVal;
+      }
+    }
+
+    PLATFORM::CMutex                 m_mutex;
+    std::map<cec_opcode, CResponse*> m_waitingFor;
+  };
+
   class CCECBusDevice
   {
     friend class CCECProcessor;
@@ -136,7 +216,7 @@ namespace CEC
     virtual void                  SetMenuState(const cec_menu_state state);
     virtual bool                  TransmitMenuState(const cec_logical_address destination);
 
-    virtual bool                  ActivateSource(void);
+    virtual bool                  ActivateSource(uint64_t iDelay = 0);
     virtual bool                  IsActiveSource(void) const    { return m_bActiveSource; }
     virtual bool                  RequestActiveSource(bool bWaitForResponse = true);
     virtual void                  MarkAsActiveSource(void);
@@ -153,6 +233,8 @@ namespace CEC
     virtual bool                  TryLogicalAddress(void);
 
     CCECClient *                  GetClient(void);
+    void                          SignalOpcode(cec_opcode opcode);
+    bool                          WaitForOpcode(cec_opcode opcode);
 
            CCECAudioSystem *      AsAudioSystem(void);
     static CCECAudioSystem *      AsAudioSystem(CCECBusDevice *device);
@@ -196,5 +278,6 @@ namespace CEC
     unsigned              m_iHandlerUseCount;
     bool                  m_bAwaitingReceiveFailed;
     bool                  m_bVendorIdRequested;
+    CWaitForResponse     *m_waitForResponse;
   };
 };
index 554b637f783a7c56f89d5b1baeec23bcffb66ecf..8eccf88457b57750571d1ef5c6789105ae216da7 100644 (file)
@@ -41,8 +41,12 @@ using namespace CEC;
 #define LIB_CEC     m_busDevice->GetProcessor()->GetLib()
 #define ToString(p) LIB_CEC->ToString(p)
 
-CANCommandHandler::CANCommandHandler(CCECBusDevice *busDevice) :
-    CCECCommandHandler(busDevice)
+CANCommandHandler::CANCommandHandler(CCECBusDevice *busDevice,
+                                     int32_t iTransmitTimeout /* = CEC_DEFAULT_TRANSMIT_TIMEOUT */,
+                                     int32_t iTransmitWait /* = CEC_DEFAULT_TRANSMIT_WAIT */,
+                                     int8_t iTransmitRetries /* = CEC_DEFAULT_TRANSMIT_RETRIES */,
+                                     int64_t iActiveSourcePending /* = 0 */) :
+    CCECCommandHandler(busDevice, iTransmitTimeout, iTransmitWait, iTransmitRetries, iActiveSourcePending)
 {
   m_vendorId = CEC_VENDOR_SAMSUNG;
   m_bOPTSendDeckStatusUpdateOnActiveSource = false;
index 7a9d9e4836cdf270a1e07a8f19e22b9be81c8d22..3b08cbd04a8ae5839cc76f2d3ea7d8e6ed65554a 100644 (file)
@@ -38,7 +38,11 @@ namespace CEC
   class CANCommandHandler : public CCECCommandHandler
   {
   public:
-    CANCommandHandler(CCECBusDevice *busDevice);
+    CANCommandHandler(CCECBusDevice *busDevice,
+                      int32_t iTransmitTimeout = CEC_DEFAULT_TRANSMIT_TIMEOUT,
+                      int32_t iTransmitWait = CEC_DEFAULT_TRANSMIT_WAIT,
+                      int8_t iTransmitRetries = CEC_DEFAULT_TRANSMIT_RETRIES,
+                      int64_t iActiveSourcePending = 0);
     virtual ~CANCommandHandler(void) {};
 
     int HandleVendorRemoteButtonDown(const cec_command &command);
index 03165e9c2cf91ec613a4def5b4cd901f2dbcff5e..ffe78b839589f3ca6a3a2c16f1120c34219aadd9 100644 (file)
@@ -47,25 +47,23 @@ using namespace PLATFORM;
 #define LIB_CEC     m_busDevice->GetProcessor()->GetLib()
 #define ToString(p) CCECTypeUtils::ToString(p)
 
-CCECCommandHandler::CCECCommandHandler(CCECBusDevice *busDevice) :
+CCECCommandHandler::CCECCommandHandler(CCECBusDevice *busDevice,
+                                       int32_t iTransmitTimeout /* = CEC_DEFAULT_TRANSMIT_TIMEOUT */,
+                                       int32_t iTransmitWait /* = CEC_DEFAULT_TRANSMIT_WAIT */,
+                                       int8_t iTransmitRetries /* = CEC_DEFAULT_TRANSMIT_RETRIES */,
+                                       int64_t iActiveSourcePending /* = 0 */) :
     m_busDevice(busDevice),
     m_processor(m_busDevice->GetProcessor()),
-    m_iTransmitTimeout(CEC_DEFAULT_TRANSMIT_TIMEOUT),
-    m_iTransmitWait(CEC_DEFAULT_TRANSMIT_WAIT),
-    m_iTransmitRetries(CEC_DEFAULT_TRANSMIT_RETRIES),
+    m_iTransmitTimeout(iTransmitTimeout),
+    m_iTransmitWait(iTransmitWait),
+    m_iTransmitRetries(iTransmitRetries),
     m_bHandlerInited(false),
     m_bOPTSendDeckStatusUpdateOnActiveSource(false),
     m_vendorId(CEC_VENDOR_UNKNOWN),
-    m_waitForResponse(new CWaitForResponse),
-    m_iActiveSourcePending(0)
+    m_iActiveSourcePending(iActiveSourcePending)
 {
 }
 
-CCECCommandHandler::~CCECCommandHandler(void)
-{
-  DELETE_AND_NULL(m_waitForResponse);
-}
-
 bool CCECCommandHandler::HandleCommand(const cec_command &command)
 {
   if (command.opcode_set == 0)
@@ -195,7 +193,7 @@ bool CCECCommandHandler::HandleCommand(const cec_command &command)
   }
 
   if (iHandled == COMMAND_HANDLED)
-    m_waitForResponse->Received((command.opcode == CEC_OPCODE_FEATURE_ABORT && command.parameters.size > 0) ? (cec_opcode)command.parameters[0] : command.opcode);
+    m_busDevice->SignalOpcode((command.opcode == CEC_OPCODE_FEATURE_ABORT && command.parameters.size > 0) ? (cec_opcode)command.parameters[0] : command.opcode);
   else
     UnhandledCommand(command, (cec_abort_reason)iHandled);
 
@@ -1077,7 +1075,7 @@ bool CCECCommandHandler::Transmit(cec_command &command, bool bSuppressWait /* =
         LIB_CEC->AddLog(CEC_LOG_DEBUG, "command transmitted");
         if (bExpectResponse)
         {
-          bReturn = m_waitForResponse->Wait(expectedResponse);
+          bReturn = m_busDevice->WaitForOpcode(expectedResponse);
           LIB_CEC->AddLog(CEC_LOG_DEBUG, bReturn ? "expected response received (%X: %s)" : "expected response not received (%X: %s)", (int)expectedResponse, ToString(expectedResponse));
         }
       }
@@ -1150,7 +1148,8 @@ bool CCECCommandHandler::ActivateSource(bool bTransmitDelayedCommandsOnly /* = f
   return true;
 }
 
-void CCECCommandHandler::SignalOpcode(cec_opcode opcode)
+void CCECCommandHandler::ScheduleActivateSource(uint64_t iDelay)
 {
-  m_waitForResponse->Received(opcode);
+  CLockObject lock(m_mutex);
+  m_iActiveSourcePending = GetTimeMs() + iDelay;
 }
index b6be4e74d1fc87ce0d248bb05ee0237c190b7c7b..bc421287664e61036d0530ea748553311f5d717d 100644 (file)
@@ -33,7 +33,6 @@
 
 #include "../../../include/cectypes.h"
 #include <vector>
-#include <map>
 #include "../platform/threads/mutex.h"
 #include "../platform/util/StdString.h"
 
@@ -44,83 +43,17 @@ namespace CEC
   class CCECProcessor;
   class CCECBusDevice;
 
-  class CResponse
-  {
-  public:
-    CResponse(cec_opcode opcode) :
-        m_opcode(opcode){}
-    ~CResponse(void)
-    {
-      Broadcast();
-    }
-
-    bool Wait(uint32_t iTimeout)
-    {
-      return m_event.Wait(iTimeout);
-    }
-
-    void Broadcast(void)
-    {
-      m_event.Broadcast();
-    }
-
-  private:
-    cec_opcode       m_opcode;
-    PLATFORM::CEvent m_event;
-  };
-
-  class CWaitForResponse
-  {
-  public:
-    CWaitForResponse(void) {}
-    ~CWaitForResponse(void)
-    {
-      PLATFORM::CLockObject lock(m_mutex);
-      m_waitingFor.clear();
-    }
-
-    bool Wait(cec_opcode opcode, uint32_t iTimeout = CEC_DEFAULT_TRANSMIT_WAIT)
-    {
-      CResponse *response = GetEvent(opcode);
-      return response ? response->Wait(iTimeout) : false;
-    }
-
-    void Received(cec_opcode opcode)
-    {
-      CResponse *response = GetEvent(opcode);
-      if (response)
-        response->Broadcast();
-    }
-
-  private:
-    CResponse *GetEvent(cec_opcode opcode)
-    {
-      CResponse *retVal(NULL);
-      {
-        PLATFORM::CLockObject lock(m_mutex);
-        std::map<cec_opcode, CResponse*>::iterator it = m_waitingFor.find(opcode);
-        if (it != m_waitingFor.end())
-        {
-          retVal = it->second;
-        }
-        else
-        {
-          retVal = new CResponse(opcode);
-          m_waitingFor[opcode] = retVal;
-        }
-        return retVal;
-      }
-    }
-
-    PLATFORM::CMutex                 m_mutex;
-    std::map<cec_opcode, CResponse*> m_waitingFor;
-  };
-
   class CCECCommandHandler
   {
+    friend class CCECBusDevice;
+
   public:
-    CCECCommandHandler(CCECBusDevice *busDevice);
-    virtual ~CCECCommandHandler(void);
+    CCECCommandHandler(CCECBusDevice *busDevice,
+                       int32_t iTransmitTimeout = CEC_DEFAULT_TRANSMIT_TIMEOUT,
+                       int32_t iTransmitWait = CEC_DEFAULT_TRANSMIT_WAIT,
+                       int8_t iTransmitRetries = CEC_DEFAULT_TRANSMIT_RETRIES,
+                       int64_t iActiveSourcePending = 0);
+    virtual ~CCECCommandHandler(void) {};
 
     virtual bool HandleCommand(const cec_command &command);
     virtual cec_vendor_id GetVendorId(void) { return m_vendorId; };
@@ -161,7 +94,7 @@ namespace CEC
     virtual bool TransmitSetStreamPath(uint16_t iStreamPath);
     virtual bool SendDeckStatusUpdateOnActiveSource(void) const { return m_bOPTSendDeckStatusUpdateOnActiveSource; };
 
-    virtual void SignalOpcode(cec_opcode opcode);
+    virtual void ScheduleActivateSource(uint64_t iDelay);
 
     virtual bool SupportsDeviceType(const cec_device_type UNUSED(type)) const { return true; };
     virtual cec_device_type GetReplacementDeviceType(const cec_device_type type) const { return type; }
@@ -225,7 +158,6 @@ namespace CEC
     bool                                  m_bHandlerInited;
     bool                                  m_bOPTSendDeckStatusUpdateOnActiveSource;
     cec_vendor_id                         m_vendorId;
-    CWaitForResponse                     *m_waitForResponse;
     int64_t                               m_iActiveSourcePending;
     PLATFORM::CMutex                      m_mutex;
   };
index b913c322be41e4ab17fa2af264c02f6db0fe25a0..5653137616d304b11bcb0949fdc69b05cf0c5966 100644 (file)
 using namespace CEC;
 using namespace PLATFORM;
 
-CRLCommandHandler::CRLCommandHandler(CCECBusDevice *busDevice) :
-    CCECCommandHandler(busDevice)
+CRLCommandHandler::CRLCommandHandler(CCECBusDevice *busDevice,
+                                     int32_t iTransmitTimeout /* = CEC_DEFAULT_TRANSMIT_TIMEOUT */,
+                                     int32_t iTransmitWait /* = CEC_DEFAULT_TRANSMIT_WAIT */,
+                                     int8_t iTransmitRetries /* = CEC_DEFAULT_TRANSMIT_RETRIES */,
+                                     int64_t iActiveSourcePending /* = 0 */) :
+    CCECCommandHandler(busDevice, iTransmitTimeout, iTransmitWait, iTransmitRetries, iActiveSourcePending)
 {
   m_vendorId = CEC_VENDOR_TOSHIBA;
 }
index 9766827615de1cd4706e64b11d674633ca1e1545..ec9edd92b8553f3598113a86a10d5e1ac1295e44 100644 (file)
@@ -39,7 +39,11 @@ namespace CEC
   class CRLCommandHandler : public CCECCommandHandler
   {
   public:
-    CRLCommandHandler(CCECBusDevice *busDevice);
+    CRLCommandHandler(CCECBusDevice *busDevice,
+                      int32_t iTransmitTimeout = CEC_DEFAULT_TRANSMIT_TIMEOUT,
+                      int32_t iTransmitWait = CEC_DEFAULT_TRANSMIT_WAIT,
+                      int8_t iTransmitRetries = CEC_DEFAULT_TRANSMIT_RETRIES,
+                      int64_t iActiveSourcePending = 0);
     virtual ~CRLCommandHandler(void) {};
 
     bool InitHandler(void);
index 8ddac56c7fc372ead8136bbd296ba71a47e9f57f..222fc957f2445ba66d3d72f9a27abcab739773df 100644 (file)
@@ -56,8 +56,12 @@ using namespace PLATFORM;
 #define LIB_CEC     m_busDevice->GetProcessor()->GetLib()
 #define ToString(p) LIB_CEC->ToString(p)
 
-CSLCommandHandler::CSLCommandHandler(CCECBusDevice *busDevice) :
-    CCECCommandHandler(busDevice),
+CSLCommandHandler::CSLCommandHandler(CCECBusDevice *busDevice,
+                                     int32_t iTransmitTimeout /* = CEC_DEFAULT_TRANSMIT_TIMEOUT */,
+                                     int32_t iTransmitWait /* = CEC_DEFAULT_TRANSMIT_WAIT */,
+                                     int8_t iTransmitRetries /* = CEC_DEFAULT_TRANSMIT_RETRIES */,
+                                     int64_t iActiveSourcePending /* = 0 */) :
+    CCECCommandHandler(busDevice, iTransmitTimeout, iTransmitWait, iTransmitRetries, iActiveSourcePending),
     m_bSLEnabled(false),
     m_bActiveSourceSent(false)
 {
index a59a2f2e6ca2c15388ace32afd976b1783b067ce..8c6902db41f42f824c26110e405fd6a008e69ea6 100644 (file)
@@ -39,7 +39,11 @@ namespace CEC
   class CSLCommandHandler : public CCECCommandHandler
   {
   public:
-    CSLCommandHandler(CCECBusDevice *busDevice);
+    CSLCommandHandler(CCECBusDevice *busDevice,
+                      int32_t iTransmitTimeout = CEC_DEFAULT_TRANSMIT_TIMEOUT,
+                      int32_t iTransmitWait = CEC_DEFAULT_TRANSMIT_WAIT,
+                      int8_t iTransmitRetries = CEC_DEFAULT_TRANSMIT_RETRIES,
+                      int64_t iActiveSourcePending = 0);
     virtual ~CSLCommandHandler(void) {};
 
     bool InitHandler(void);
index d8d7f6c205ac52148a1ca8eada8b279130d1c4c4..97d06a278e77ce8a1e2dd102006c8645b0d8e37f 100644 (file)
@@ -52,8 +52,12 @@ using namespace PLATFORM;
 // wait this amount of ms before trying to switch sources after receiving the message from the TV that it's powered on
 #define SOURCE_SWITCH_DELAY_MS 1000
 
-CVLCommandHandler::CVLCommandHandler(CCECBusDevice *busDevice) :
-    CCECCommandHandler(busDevice),
+CVLCommandHandler::CVLCommandHandler(CCECBusDevice *busDevice,
+                                     int32_t iTransmitTimeout /* = CEC_DEFAULT_TRANSMIT_TIMEOUT */,
+                                     int32_t iTransmitWait /* = CEC_DEFAULT_TRANSMIT_WAIT */,
+                                     int8_t iTransmitRetries /* = CEC_DEFAULT_TRANSMIT_RETRIES */,
+                                     int64_t iActiveSourcePending /* = 0 */) :
+    CCECCommandHandler(busDevice, iTransmitTimeout, iTransmitWait, iTransmitRetries, iActiveSourcePending),
     m_iPowerUpEventReceived(0)
 {
   m_vendorId = CEC_VENDOR_PANASONIC;
index 6f417e8e14f415774804658ec9ca2fc016f8a25d..d1b25d2be0ee449822fb7c04b92bea76722fcd93 100644 (file)
@@ -38,7 +38,11 @@ namespace CEC
   class CVLCommandHandler : public CCECCommandHandler
   {
   public:
-    CVLCommandHandler(CCECBusDevice *busDevice);
+    CVLCommandHandler(CCECBusDevice *busDevice,
+                      int32_t iTransmitTimeout = CEC_DEFAULT_TRANSMIT_TIMEOUT,
+                      int32_t iTransmitWait = CEC_DEFAULT_TRANSMIT_WAIT,
+                      int8_t iTransmitRetries = CEC_DEFAULT_TRANSMIT_RETRIES,
+                      int64_t iActiveSourcePending = 0);
     virtual ~CVLCommandHandler(void) {};
 
     bool InitHandler(void);