cec: receive and send full cec_commands, not CCECAdapterMessages in CAdapterCommunica...
[deb_libcec.git] / src / lib / CECProcessor.h
index e4f0a6b1b07077dee86159a24fb1d3355e1dceae..133a70b1b00ac12cbca3443aab17a73d5818d70a 100644 (file)
@@ -2,7 +2,7 @@
 /*
  * This file is part of the libCEC(R) library.
  *
- * libCEC(R) is Copyright (C) 2011 Pulse-Eight Limited.  All rights reserved.
+ * libCEC(R) is Copyright (C) 2011-2012 Pulse-Eight Limited.  All rights reserved.
  * libCEC(R) is an original work, containing original code.
  *
  * libCEC(R) is a trademark of Pulse-Eight Limited.
 
 #include <string>
 #include <cectypes.h>
-#include "AdapterCommunication.h"
-#include "platform/os.h"
-
-class CSerialPort;
+#include "platform/threads/threads.h"
+#include "platform/util/buffer.h"
 
 namespace CEC
 {
   class CLibCEC;
-  class CAdapterCommunication;
+  class IAdapterCommunication;
   class CCECBusDevice;
 
   class CCECProcessor : public PLATFORM::CThread
@@ -114,21 +112,16 @@ namespace CEC
       const char *ToString(const cec_vendor_id vendor);
 
       virtual bool Transmit(const cec_command &data);
-      virtual bool Transmit(CCECAdapterMessage *output);
       virtual void TransmitAbort(cec_logical_address address, cec_opcode opcode, cec_abort_reason reason = CEC_ABORT_REASON_UNRECOGNIZED_OPCODE);
 
-      virtual void SetCurrentButton(cec_user_control_code iButtonCode);
-      virtual void AddCommand(const cec_command &command);
-      virtual void AddKey(cec_keypress &key);
-      virtual void AddKey(void);
-      virtual void AddLog(cec_log_level level, const CStdString &strMessage);
-
       virtual bool ChangeDeviceType(cec_device_type from, cec_device_type to);
       virtual bool FindLogicalAddresses(void);
       virtual bool SetAckMask(uint16_t iMask);
 
       virtual bool StartBootloader(void);
       virtual bool PingAdapter(void);
+      virtual void HandlePoll(cec_logical_address initiator, cec_logical_address destination);
+      virtual bool HandleReceiveFailed(cec_logical_address initiator);
 
       CCECBusDevice *  m_busDevices[16];
       PLATFORM::CMutex m_transmitMutex;
@@ -148,22 +141,18 @@ namespace CEC
       bool FindLogicalAddressAudioSystem(void);
 
       void LogOutput(const cec_command &data);
-      bool WaitForTransmitSucceeded(CCECAdapterMessage *message);
-      bool ParseMessage(const CCECAdapterMessage &msg);
       void ParseCommand(cec_command &command);
 
       bool                                m_bStarted;
       bool                                m_bInitialised;
       uint8_t                             m_iHDMIPort;
       cec_logical_address                 m_iBaseDevice;
-      cec_command                         m_currentframe;
       cec_logical_addresses               m_logicalAddresses;
-      cec_logical_address                 m_lastInitiator;
       std::string                         m_strDeviceName;
       cec_device_type_list                m_types;
       PLATFORM::CMutex                    m_mutex;
       PLATFORM::CCondition                m_startCondition;
-      CAdapterCommunication*              m_communication;
+      IAdapterCommunication *             m_communication;
       CLibCEC*                            m_controller;
       bool                                m_bMonitor;
       PLATFORM::SyncedBuffer<cec_command> m_commandBuffer;