X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Flib%2Fadapter%2FAdapterCommunication.h;h=889c87b8716c98b3fe347f61c76ce7f5209438ef;hb=2fbffb2596a25784888e439918acb1698fd538c4;hp=160a0fd3c30c320f9d262e6b2725c48b61fc0673;hpb=64d46f80cc6f34f531ae26e8677f2f0b0c1f74bb;p=deb_libcec.git diff --git a/src/lib/adapter/AdapterCommunication.h b/src/lib/adapter/AdapterCommunication.h index 160a0fd..889c87b 100644 --- a/src/lib/adapter/AdapterCommunication.h +++ b/src/lib/adapter/AdapterCommunication.h @@ -36,6 +36,8 @@ namespace CEC { + class CLibCEC; + class IAdapterCommunicationCallback { public: @@ -62,6 +64,8 @@ namespace CEC * @return True when this is an error, false otherwise. */ virtual bool HandleReceiveFailed(cec_logical_address initiator) = 0; + + virtual CLibCEC *GetLib(void) const = 0; }; class IAdapterCommunication @@ -81,7 +85,7 @@ namespace CEC * @param bStartListening Start a listener thread when true. False to just open a connection, read the device info, and close the connection. * @return True when connected, false otherwise */ - virtual bool Open(uint32_t iTimeoutMs = 10000, bool bSkipChecks = false, bool bStartListening = true) = 0; + virtual bool Open(uint32_t iTimeoutMs = CEC_DEFAULT_CONNECT_TIMEOUT, bool bSkipChecks = false, bool bStartListening = true) = 0; /*! * @brief Close an open connection @@ -101,12 +105,11 @@ namespace CEC /*! * @brief Write a cec_command to the adapter * @param data The command to write - * @param iMaxTries The maximum number of tries - * @param iLineTimeout The line timeout for the first try - * @param iRetryLineTimeout The line timeout for each next try + * @param bRetry The command can be retried + * @param iLineTimeout The line timeout to be used * @return The last state of the transmitted command */ - virtual cec_adapter_message_state Write(const cec_command &data, uint8_t iMaxTries, uint8_t iLineTimeout = 3, uint8_t iRetryLineTimeout = 3) = 0; + virtual cec_adapter_message_state Write(const cec_command &data, bool &bRetry, uint8_t iLineTimeout = 3) = 0; /*! * @brief Change the current line timeout on the CEC bus @@ -127,6 +130,7 @@ namespace CEC * @return True when set, false otherwise. */ virtual bool SetAckMask(uint16_t iMask) = 0; + virtual uint16_t GetAckMask(void) = 0; /*! * @brief Check whether the CEC adapter responds @@ -139,6 +143,16 @@ namespace CEC */ virtual uint16_t GetFirmwareVersion(void) = 0; + /*! + * @return The build date in seconds since epoch, or 0 when no (valid) reply was received. + */ + virtual uint32_t GetFirmwareBuildDate(void) = 0; + + /*! + * @return True when this adapter is using the latest firmware build, or when the latest firmware build for this adapter type is unknown. False otherwise. + */ + virtual bool IsRunningLatestFirmware(void) = 0; + /*! * @return True when the control mode has been set, false otherwise. */ @@ -168,7 +182,6 @@ namespace CEC */ virtual uint16_t GetPhysicalAddress(void) = 0; - protected: IAdapterCommunicationCallback *m_callback; }; };