cec: hold a lock when changing the ackmask in CUSBCECAdapterCommunication::Open
[deb_libcec.git] / src / lib / adapter / USBCECAdapterCommunication.h
index cfe294480495033b71e96ddb4e580e552d57c226..0177f0850c7273fdf0e1b102e5324f48243c4d5b 100644 (file)
@@ -74,12 +74,13 @@ namespace CEC
 
     bool StartBootloader(void);
     bool SetAckMask(uint16_t iMask);
+    uint16_t GetAckMask(void);
     bool PingAdapter(void);
     uint16_t GetFirmwareVersion(void);
     uint32_t GetFirmwareBuildDate(void);
     bool IsRunningLatestFirmware(void);
-    bool PersistConfiguration(libcec_configuration *configuration);
-    bool GetConfiguration(libcec_configuration *configuration);
+    bool PersistConfiguration(const libcec_configuration &configuration);
+    bool GetConfiguration(libcec_configuration &configuration);
     CStdString GetPortName(void);
     uint16_t GetPhysicalAddress(void) { return 0; }
     bool SetControlledMode(bool controlled);
@@ -156,6 +157,11 @@ namespace CEC
      */
     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 */
@@ -165,6 +171,7 @@ namespace CEC
     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;
   };
 
   class CAdapterPingThread : public PLATFORM::CThread