X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Flib%2FCECParser.h;h=ef39cfb581cba780dbff431d4931d62930500427;hb=8148859ed1d46a20c30a953db91ccbbd127c85e9;hp=6f0caa4ff3c03da3ea498d4a11a6ebdea36396cc;hpb=df7339c665f732faedee7c1d3cde816cc41e3302;p=deb_libcec.git diff --git a/src/lib/CECParser.h b/src/lib/CECParser.h index 6f0caa4..ef39cfb 100644 --- a/src/lib/CECParser.h +++ b/src/lib/CECParser.h @@ -52,18 +52,21 @@ namespace CEC virtual ~CCECParser(void); virtual bool Open(const char *strPort, int iTimeout = 10000); + virtual bool Close(int iTimeoutMs = 2000); virtual int FindDevices(std::vector &deviceList, const char *strDevicePath = NULL); virtual bool Ping(void); virtual bool StartBootloader(void); virtual bool PowerOffDevices(cec_logical_address address = CECDEVICE_BROADCAST); - virtual bool PowerOnDevices(cec_logical_address address = CECDEVICE_BROADCAST); + virtual bool PowerOnDevices(cec_logical_address address = CECDEVICE_TV); virtual bool StandbyDevices(cec_logical_address address = CECDEVICE_BROADCAST); virtual bool SetActiveView(void); 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 SetAckMask(cec_logical_address ackmask); + virtual bool SetLogicalAddress(cec_logical_address iLogicalAddress); + virtual bool SetAckMask(uint16_t iMask); virtual int GetMinVersion(void); virtual int GetLibVersion(void); //@} @@ -72,7 +75,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); @@ -84,6 +87,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); @@ -109,9 +113,11 @@ namespace CEC CecBuffer m_frameBuffer; CecBuffer m_logBuffer; CecBuffer m_keyBuffer; + CecBuffer m_commandBuffer; std::string m_strDeviceName; pthread_t m_thread; CMutex m_mutex; + CCondition m_exitCondition; bool m_bRunning; }; };