- CAdapterCommunication(CCECProcessor *processor, const char *strPort, uint16_t iBaudRate = 38400);
- virtual ~CAdapterCommunication();
+ /*!
+ * @brief Open a connection to the CEC adapter
+ * @param iTimeoutMs Connection timeout in ms
+ * @return True when connected, false otherwise
+ */
+ virtual bool Open(uint32_t iTimeoutMs = 10000) = 0;
+
+ /*!
+ * @brief Close an open connection
+ */
+ virtual void Close(void) = 0;
+
+ /*!
+ * @return True when the connection is open, false otherwise
+ */
+ virtual bool IsOpen(void) = 0;
+
+ /*!
+ * @return The last error message, or an empty string if there was none
+ */
+ virtual CStdString GetError(void) const = 0;
+
+ /*!
+ * @brief Reads one cec_command from the adapter
+ * @param command The command that will be read (output)
+ * @param iTimeout The read timeout
+ * @return True when a command has been read, false otherwise.
+ */
+ virtual bool Read(cec_command &command, uint32_t iTimeout) = 0;