cec: added the firmware version to libcec_configuration (read-only). bumped server...
[deb_libcec.git] / src / lib / adapter / AdapterCommunication.h
index 9ee29518d3a7cdac3d345ef413bbb2d1a055f93c..400b32151e10fc8a51d4cb5c305cb3d9d0333b2b 100644 (file)
@@ -46,9 +46,12 @@ namespace CEC
     ADAPTER_MESSAGE_STATE_ERROR                 /**< an error occured */
   } cec_adapter_message_state;
 
-  struct IAdapterCommunicationCallback
+  class IAdapterCommunicationCallback
   {
   public:
+    IAdapterCommunicationCallback(void) {}
+    virtual ~IAdapterCommunicationCallback(void) {}
+
     /*!
      * @brief Callback method for IAdapterCommunication, called when a new cec_command is received
      * @param command The command that has been received
@@ -57,16 +60,20 @@ namespace CEC
     virtual bool OnCommandReceived(const cec_command &command) = 0;
   };
 
-  struct IAdapterCommunication
+  class IAdapterCommunication
   {
   public:
+    IAdapterCommunication(void) {}
+    virtual ~IAdapterCommunication(void) {}
+
     /*!
      * @brief Open a connection to the CEC adapter
      * @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.
      * @return True when connected, false otherwise
      */
-    virtual bool Open(IAdapterCommunicationCallback *cb, uint32_t iTimeoutMs = 10000) = 0;
+    virtual bool Open(IAdapterCommunicationCallback *cb, uint32_t iTimeoutMs = 10000, bool bSkipChecks = false) = 0;
 
     /*!
      * @brief Close an open connection
@@ -128,7 +135,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;
 
@@ -144,6 +151,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
      */