rpi: handle VC_CEC_LOGICAL_ADDR_LOST in the rpi communication class itself, don't...
[deb_libcec.git] / src / lib / adapter / RPi / RPiCECAdapterCommunication.h
index 530aec105b8a1923afd317891258c7b577443d24..c874451227ccd0ab503f3a735341995b91027765 100644 (file)
@@ -34,7 +34,7 @@
 #if defined(HAVE_RPI_API)
 
 #include "lib/adapter/AdapterCommunication.h"
-#include "lib/platform/threads/mutex.h"
+#include "lib/platform/threads/threads.h"
 
 extern "C" {
 #include <interface/vmcs_host/vc_cecservice.h>
@@ -44,9 +44,22 @@ extern "C" {
 namespace CEC
 {
   class CRPiCECAdapterMessageQueue;
+  class CRPiCECAdapterCommunication;
+
+  class CRPiCECAdapterFindNewLogicalAddress : public PLATFORM::CThread
+  {
+  public:
+    CRPiCECAdapterFindNewLogicalAddress(CRPiCECAdapterCommunication* communication, const cec_logical_address address);
+    void *Process(void);
+  private:
+    CRPiCECAdapterCommunication* m_communication;
+    cec_logical_address          m_address;
+  };
 
   class CRPiCECAdapterCommunication : public IAdapterCommunication
   {
+    friend class CRPiCECAdapterFindNewLogicalAddress;
+
   public:
     /*!
      * @brief Create a new USB-CEC communication handler.
@@ -78,6 +91,7 @@ namespace CEC
     bool SetControlledMode(bool UNUSED(controlled)) { return true; };
     cec_vendor_id GetVendorId(void) { return CEC_VENDOR_BROADCOM; }
     bool SupportsSourceLogicalAddress(const cec_logical_address address) { return address > CECDEVICE_TV && address < CECDEVICE_BROADCAST; }
+    cec_adapter_type GetAdapterType(void) { return ADAPTERTYPE_RPI; };
     ///}
 
     bool IsInitialised(void);
@@ -101,6 +115,7 @@ namespace CEC
     PLATFORM::CMutex            m_mutex;
     VCHI_INSTANCE_T             m_vchi_instance;
     VCHI_CONNECTION_T *         m_vchi_connection;
+    CRPiCECAdapterFindNewLogicalAddress* m_laLost;
   };
 };