cec: fixed - CUSBCECAdapterCommunication::SendCommand() accessed a message that was...
[deb_libcec.git] / src / lib / adapter / AdapterCommunication.h
index d78b11d0164d37e4cf66f1c13b353aa2bc62717b..98f55e61588911ad5c70c1f3da2b6cb1d188db27 100644 (file)
@@ -71,9 +71,10 @@ namespace CEC
      * @param cb The callback struct. if set to NULL, the Read() method has to be used to read commands. if set, OnCommandReceived() will be called for each command that was received
      * @param iTimeoutMs Connection timeout in ms
      * @param bSkipChecks Skips all initial checks of the adapter, and starts the reader/writer threads directly after connecting.
+     * @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(IAdapterCommunicationCallback *cb, uint32_t iTimeoutMs = 10000, bool bSkipChecks = false) = 0;
+    virtual bool Open(IAdapterCommunicationCallback *cb, uint32_t iTimeoutMs = 10000, bool bSkipChecks = false, bool bStartListening = true) = 0;
 
     /*!
      * @brief Close an open connection
@@ -135,7 +136,7 @@ namespace CEC
     virtual bool PingAdapter(void) = 0;
 
     /*!
-     * @return The firmware version of this CEC adapter.
+     * @return The firmware version of this CEC adapter, or 0 if it's unknown.
      */
     virtual uint16_t GetFirmwareVersion(void) = 0;
 
@@ -151,6 +152,13 @@ namespace CEC
      */
     virtual bool PersistConfiguration(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;
+
     /*!
      * @return The name of the port
      */