cec: read the persisted settings from the ROM, and update it in libcec_configuration...
[deb_libcec.git] / src / lib / adapter / USBCECAdapterCommunication.h
index c71453a4a4f0cf20a3827f0a4714a8d091e1160c..5db99606a96e89e885445d3138767c456f6383d6 100644 (file)
@@ -83,12 +83,39 @@ namespace CEC
     virtual bool PingAdapter(void);
     virtual uint16_t GetFirmwareVersion(void);
     virtual bool SetControlledMode(bool controlled);
-    virtual bool PersistConfiguration(libcec_configuration * UNUSED(configuration)) { return false; } // TODO
+    virtual bool PersistConfiguration(libcec_configuration *configuration);
+    virtual bool GetConfiguration(libcec_configuration *configuration);
     virtual CStdString GetPortName(void);
     virtual uint16_t GetPhysicalAddress(void) { return 0; }
 
     void *Process(void);
   private:
+    bool SendCommand(cec_adapter_messagecode msgCode, CCECAdapterMessage &params, bool bExpectAck = true, bool bIsTransmission = false, bool bSendDirectly = true);
+    cec_datapacket GetSetting(cec_adapter_messagecode msgCode);
+
+    bool SetSettingAutoEnabled(bool enabled);
+    bool GetSettingAutoEnabled(bool &enabled);
+
+    bool SetSettingDeviceType(cec_device_type type);
+    bool GetSettingDeviceType(cec_device_type &type);
+
+    bool SetSettingDefaultLogicalAddress(cec_logical_address address);
+    bool GetSettingDefaultLogicalAddress(cec_logical_address &address);
+
+    bool SetSettingLogicalAddressMask(uint16_t iMask);
+    bool GetSettingLogicalAddressMask(uint16_t &iMask);
+
+    bool SetSettingPhysicalAddress(uint16_t iPhysicalAddress);
+    bool GetSettingPhysicalAddress(uint16_t &iPhysicalAddress);
+
+    bool SetSettingCECVersion(cec_version version);
+    bool GetSettingCECVersion(cec_version &version);
+
+    bool SetSettingOSDName(const char *strOSDName);
+    bool GetSettingOSDName(CStdString &strOSDName);
+
+    bool WriteEEPROM(void);
+
     bool SetAckMaskInternal(uint16_t iMask, bool bWriteDirectly = false);
 
     bool CheckAdapter(uint32_t iTimeoutMs = 10000);