X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Flib%2Fadapter%2FUSBCECAdapterCommunication.h;h=7409e86d874b002b356a16a39cdea1b3931f2e70;hb=65108638b4d86198e03bc709a8a51a4658aef160;hp=b44a3ec9adb5300c9575d2aee1ce7c86bf2da2e7;hpb=b2f56d355ff33088445ad8a7f159c1d51d4d48dd;p=deb_libcec.git diff --git a/src/lib/adapter/USBCECAdapterCommunication.h b/src/lib/adapter/USBCECAdapterCommunication.h index b44a3ec..7409e86 100644 --- a/src/lib/adapter/USBCECAdapterCommunication.h +++ b/src/lib/adapter/USBCECAdapterCommunication.h @@ -61,12 +61,12 @@ namespace CEC * @param strPort The name of the com port to use. * @param iBaudRate The baudrate to use on the com port connection. */ - CUSBCECAdapterCommunication(IAdapterCommunicationCallback *callback, const char *strPort, uint16_t iBaudRate = 38400); + CUSBCECAdapterCommunication(IAdapterCommunicationCallback *callback, const char *strPort, uint16_t iBaudRate = CEC_SERIAL_DEFAULT_BAUDRATE); virtual ~CUSBCECAdapterCommunication(void); /** @name IAdapterCommunication implementation */ ///{ - bool Open(uint32_t iTimeoutMs = 10000, bool bSkipChecks = false, bool bStartListening = true); + bool Open(uint32_t iTimeoutMs = CEC_DEFAULT_CONNECT_TIMEOUT, bool bSkipChecks = false, bool bStartListening = true); void Close(void); bool IsOpen(void); CStdString GetError(void) const; @@ -74,11 +74,13 @@ namespace CEC bool StartBootloader(void); bool SetAckMask(uint16_t iMask); + uint16_t GetAckMask(void); bool PingAdapter(void); uint16_t GetFirmwareVersion(void); uint32_t GetFirmwareBuildDate(void); - bool PersistConfiguration(libcec_configuration *configuration); - bool GetConfiguration(libcec_configuration *configuration); + bool IsRunningLatestFirmware(void); + bool PersistConfiguration(const libcec_configuration &configuration); + bool GetConfiguration(libcec_configuration &configuration); CStdString GetPortName(void); uint16_t GetPhysicalAddress(void) { return 0; } bool SetControlledMode(bool controlled); @@ -91,7 +93,7 @@ namespace CEC * @brief Clear all input bytes. * @param iTimeout Timeout when anything was received. */ - void ClearInputBytes(uint32_t iTimeout = 1000); + void ClearInputBytes(uint32_t iTimeout = CEC_CLEAR_INPUT_DEFAULT_WAIT); /*! * @brief Change the current CEC line timeout. @@ -125,7 +127,7 @@ namespace CEC * @param iTimeoutMs The timeout after which this fails if no proper data was received. * @return True when the checks passed, false otherwise. */ - bool CheckAdapter(uint32_t iTimeoutMs = 10000); + bool CheckAdapter(uint32_t iTimeoutMs = CEC_DEFAULT_CONNECT_TIMEOUT); /*! * @brief Handle a poll message inside the adapter message (checks if one is present). @@ -164,6 +166,7 @@ namespace CEC CAdapterPingThread * m_pingThread; /**< ping thread, that pings the adapter every 15 seconds */ CUSBCECAdapterCommands * m_commands; /**< commands that can be sent to the adapter */ CCECAdapterMessageQueue * m_adapterMessageQueue; /**< the incoming and outgoing message queue */ + uint16_t m_iAckMask; }; class CAdapterPingThread : public PLATFORM::CThread