X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Flib%2Fadapter%2FAdapterCommunication.h;h=11af5e7a3f14b4e7e5cc5e420a31b80cc1f6a3a8;hb=5f2f3609d7ee857ac7e5d03600fbd735e99c892f;hp=cbbc7ff89ed3dc43cbc349769712a76c8a3ded32;hpb=33dd87a962743d205ade8dc83693f23e94e36f03;p=deb_libcec.git diff --git a/src/lib/adapter/AdapterCommunication.h b/src/lib/adapter/AdapterCommunication.h index cbbc7ff..11af5e7 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 @@ -126,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 @@ -138,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. */ @@ -148,14 +163,14 @@ namespace CEC * @brief The configuration to store. * @return True when the configuration was persisted, false otherwise. */ - virtual bool PersistConfiguration(libcec_configuration *configuration) = 0; + virtual bool PersistConfiguration(const libcec_configuration &configuration) = 0; /*! * @brief Get the persisted configuration from the adapter (if supported) * @param configuration The updated configuration. * @return True when the configuration was updated, false otherwise. */ - virtual bool GetConfiguration(libcec_configuration *configuration) = 0; + virtual bool GetConfiguration(libcec_configuration &configuration) = 0; /*! * @return The name of the port @@ -167,7 +182,6 @@ namespace CEC */ virtual uint16_t GetPhysicalAddress(void) = 0; - protected: IAdapterCommunicationCallback *m_callback; }; };