cec: persist the configuration before closing the connection. only try to persist...
[deb_libcec.git] / src / lib / adapter / USBCECAdapterCommunication.cpp
index d2d4e6de8663c6e615938a68ed9f64b2e189383a..4e6189cee7aab847a54451082da7b2a4756598b7 100644 (file)
@@ -571,9 +571,12 @@ bool CUSBCECAdapterCommunication::SetAckMaskInternal(uint16_t iMask, bool bWrite
 
 bool CUSBCECAdapterCommunication::PersistConfiguration(libcec_configuration *configuration)
 {
+  if (m_iFirmwareVersion < 2)
+    return false;
+
   return SetAutoEnabled(true) &&
-      //SetDefaultLogicalAddress() TODO
-      //SetLogicalAddressMask() TODO
+      SetDefaultLogicalAddress(configuration->logicalAddresses.primary) &&
+      SetLogicalAddressMask(configuration->logicalAddresses.AckMask()) &&
       SetPhysicalAddress(configuration->iPhysicalAddress) &&
       SetCECVersion(CEC_VERSION_1_3A) &&
       SetOSDName(configuration->strDeviceName) &&