cec: moved the timed ping to a separate thread. bugzid: 654
[deb_libcec.git] / src / lib / adapter / USBCECAdapterCommunication.h
index 73057043d8a0e169481db1e63ace9b8f95e66d04..4ca8e87e1810c794c088dc4a15a7c053422e129c 100644 (file)
@@ -45,6 +45,7 @@ namespace PLATFORM
 namespace CEC
 {
   class CCECProcessor;
+  class CAdapterPingThread;
 
   class CUSBCECAdapterCommunication : public IAdapterCommunication, private PLATFORM::CThread
   {
@@ -126,5 +127,20 @@ namespace CEC
     IAdapterCommunicationCallback *              m_callback;
     bool                                         m_bInitialised;
     bool                                         m_bWaitingForAck[15];
+    CAdapterPingThread *                         m_pingThread;
+  };
+
+  class CAdapterPingThread : public PLATFORM::CThread
+  {
+  public:
+    CAdapterPingThread(CUSBCECAdapterCommunication *com, uint32_t iTimeout) :
+        m_com(com),
+        m_timeout(iTimeout){}
+    virtual ~CAdapterPingThread(void) {}
+
+    virtual void* Process(void);
+  private:
+    CUSBCECAdapterCommunication *m_com;
+    PLATFORM::CTimeout           m_timeout;
   };
 };