cec: add GetDeviceCecVersion()/cec_get_device_cec_version() to the interface. mostly...
[deb_libcec.git] / src / lib / CECProcessor.h
index 24d1e31e0778e489688eb0c90642d2768fead7da..5362bfceaedca0362c20f492e8559f28f61a3801 100644 (file)
@@ -33,6 +33,7 @@
 
 #include <string>
 #include <cectypes.h>
+#include "AdapterCommunication.h"
 #include "platform/threads.h"
 #include "util/buffer.h"
 #include "util/StdString.h"
@@ -56,10 +57,11 @@ namespace CEC
 
       virtual bool SetActiveView(void);
       virtual bool SetInactiveView(void);
-      virtual bool Transmit(const cec_command &data, bool bWaitForAck = true);
+      virtual bool Transmit(const cec_command &data);
       virtual bool SetLogicalAddress(cec_logical_address iLogicalAddress);
       virtual bool SetPhysicalAddress(uint16_t iPhysicalAddress);
       virtual bool SwitchMonitoring(bool bEnable);
+      virtual cec_version GetDeviceCecVersion(cec_logical_address iAddress);
 
       virtual cec_logical_address GetLogicalAddress(void) const { return m_iLogicalAddress; }
       virtual uint16_t GetPhysicalAddress(void) const;
@@ -70,24 +72,24 @@ namespace CEC
       virtual void AddKey(void);
       virtual void AddLog(cec_log_level level, const CStdString &strMessage);
 
-      virtual bool TransmitFormatted(const cec_adapter_message &data, bool bWaitForAck = true);
       virtual void TransmitAbort(cec_logical_address address, cec_opcode opcode, ECecAbortReason reason = CEC_ABORT_REASON_UNRECOGNIZED_OPCODE);
 
       CCECBusDevice *m_busDevices[16];
 
     private:
       void LogOutput(const cec_command &data);
-      bool WaitForAck(bool *bError, uint32_t iTimeout = 1000);
-      void ParseMessage(cec_adapter_message &msg, bool *bError, bool *bTransmitSucceeded, bool *bEom, bool bProcessMessages = true);
+      bool WaitForAck(bool *bError, uint8_t iLength, uint32_t iTimeout = 1000);
+      bool ParseMessage(CCECAdapterMessagePtr msg);
       void ParseCommand(cec_command &command);
 
-      cec_command                    m_currentframe;
-      cec_logical_address            m_iLogicalAddress;
-      CecBuffer<cec_adapter_message> m_frameBuffer;
-      std::string                    m_strDeviceName;
-      CMutex                         m_mutex;
-      CAdapterCommunication         *m_communication;
-      CLibCEC                       *m_controller;
-      bool                           m_bMonitor;
+      cec_command                      m_currentframe;
+      cec_logical_address              m_iLogicalAddress;
+      CecBuffer<CCECAdapterMessagePtr> m_frameBuffer;
+      std::string                      m_strDeviceName;
+      CMutex                           m_mutex;
+      CCondition                       m_startCondition;
+      CAdapterCommunication           *m_communication;
+      CLibCEC                         *m_controller;
+      bool                             m_bMonitor;
   };
 };