+ /*!
+ * @brief Clear all input bytes.
+ * @param iTimeout Timeout when anything was received.
+ */
+ void ClearInputBytes(uint32_t iTimeout = CEC_CLEAR_INPUT_DEFAULT_WAIT);
+
+ /*!
+ * @brief Change the current CEC line timeout.
+ * @param iTimeout The new timeout.
+ * @return True when acked by the controller, false otherwise.
+ */
+ bool SetLineTimeout(uint8_t iTimeout);
+
+ /*!
+ * @brief Send a command to the controller and wait for an ack.
+ * @param msgCode The command to send.
+ * @param params The parameters to the command.
+ * @param bIsRetry True when this command is being retried, false otherwise.
+ * @return The message. Delete when done with it.
+ */
+ CCECAdapterMessage *SendCommand(cec_adapter_messagecode msgCode, CCECAdapterMessage ¶ms, bool bIsRetry = false);
+
+ /*!
+ * @brief Change the "initialised" status.
+ * @param bSetTo The new value.
+ */
+ void SetInitialised(bool bSetTo = true);
+
+ /*!
+ * @return True when initialised, false otherwise.
+ */
+ bool IsInitialised(void);
+
+ /*!
+ * @brief Pings the adapter, checks the firmware version and sets controlled mode.
+ * @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 = CEC_DEFAULT_CONNECT_TIMEOUT);
+
+ /*!
+ * @brief Handle a poll message inside the adapter message (checks if one is present).
+ * @param msg The adapter message to parse.
+ * @return True when the message resulted in a CEC error, false otherwise.
+ */
+ bool HandlePoll(const CCECAdapterMessage &msg);
+
+ /*!
+ * @brief Read data from the device.
+ * @param iTimeout The read timeout to use.
+ * @param iSize The maximum read size.
+ * @return True when something was read, false otherwise.
+ */
+ bool ReadFromDevice(uint32_t iTimeout, size_t iSize = 256);
+
+ /*!
+ * @brief Writes a message to the serial port.
+ * @param message The message to write.
+ * @return True when written, false otherwise.
+ */
+ bool WriteToDevice(CCECAdapterMessage *message);
+
+ /*!
+ * @brief Called before sending a CEC command over the line, so we know we're expecting an ack.
+ * @param dest The destination of the CEC command.
+ */
+ void MarkAsWaiting(const cec_logical_address dest);
+
+ /*!
+ * @brief Clear and reset the message queue.
+ */
+ void ResetMessageQueue(void);
+
+ PLATFORM::ISocket * m_port; /**< the com port connection */
+ PLATFORM::CMutex m_mutex; /**< mutex for changes in this class */
+ uint8_t m_iLineTimeout; /**< the current line timeout on the CEC line */
+ cec_logical_address m_lastPollDestination; /**< the destination of the last poll message that was received */
+ bool m_bInitialised; /**< true when the connection is initialised, false otherwise */
+ bool m_bWaitingForAck[15]; /**< array in which we store from which devices we're expecting acks */
+ 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;