- bool Write(CCECAdapterMessage *data);
- bool Read(CCECAdapterMessage &msg, uint32_t iTimeout = 1000);
- bool ParseMessage(const CCECAdapterMessage &msg);
- void SendMessageToAdapter(CCECAdapterMessage *msg);
- void WriteNextCommand(void);
- void AddData(uint8_t *data, size_t iLen);
+ /*!
+ * @brief Clear all input bytes.
+ * @param iTimeout Timeout when anything was received.
+ */
+ void ClearInputBytes(uint32_t iTimeout = 1000);
+
+ /*!
+ * @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 = 10000);
+
+ /*!
+ * @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.
+ */