cec: fix the command buffer
[deb_libcec.git] / src / lib / CECParser.h
index f257fe1c02b967fd8add0760a49dbf812bb5cae8..1eca99c5e7fe3f4af940bea2a417862d0dbfc292 100644 (file)
@@ -62,6 +62,7 @@ namespace CEC
       virtual bool SetInactiveView(void);
       virtual bool GetNextLogMessage(cec_log_message *message);
       virtual bool GetNextKeypress(cec_keypress *key);
+      virtual bool GetNextCommand(cec_command *command);
       virtual bool Transmit(const cec_frame &data, bool bWaitForAck = true, int64_t iTimeout = (int64_t) 5000);
       virtual bool SetLogicalAddress(cec_logical_address iLogicalAddress);
       virtual bool SetAckMask(uint16_t iMask);
@@ -73,7 +74,7 @@ namespace CEC
       bool Process(void);
     protected:
       virtual bool TransmitFormatted(const cec_frame &data, bool bWaitForAck = true, int64_t iTimeout = (int64_t) 2000);
-      virtual void TransmitAbort(cec_logical_address address, ECecOpcode opcode, ECecAbortReason reason = CEC_ABORT_REASON_UNRECOGNIZED_OPCODE);
+      virtual void TransmitAbort(cec_logical_address address, cec_opcode opcode, ECecAbortReason reason = CEC_ABORT_REASON_UNRECOGNIZED_OPCODE);
       virtual void ReportCECVersion(cec_logical_address address = CECDEVICE_TV);
       virtual void ReportPowerState(cec_logical_address address = CECDEVICE_TV, bool bOn = true);
       virtual void ReportMenuState(cec_logical_address address = CECDEVICE_TV, bool bActive = true);
@@ -85,6 +86,7 @@ namespace CEC
 
     private:
       void AddKey(void);
+      void AddCommand(cec_logical_address source, cec_logical_address destination, cec_opcode opcode, cec_frame *parameters);
       void AddLog(cec_log_level level, const std::string &strMessage);
       bool WaitForAck(int64_t iTimeout = (int64_t) 1000);
       bool ReadFromDevice(int iTimeout);
@@ -110,6 +112,7 @@ namespace CEC
       CecBuffer<cec_frame>       m_frameBuffer;
       CecBuffer<cec_log_message> m_logBuffer;
       CecBuffer<cec_keypress>    m_keyBuffer;
+      CecBuffer<cec_command>     m_commandBuffer;
       std::string                m_strDeviceName;
       pthread_t                  m_thread;
       CMutex                     m_mutex;