8 years, 7 months ago.

Saving configuration to NVRAM

Hi,

Looking at the saveConfig() and resetConfig() in the example, program. How does the libmDot know to just read the previously saved config instead of resetting to factory defaults and allowing the stored configuration to be used? There doesn't appear to be a loadConfg() unless this is done when the library is first called.

Thanks

Andrew

Question relating to:

Library for LoRa communication using MultiTech MDOT. Lora, mdot, multitech

1 Answer

8 years, 7 months ago.

Hi Andrew, The library loads configuration as part of the initialization process that happens when you call mDot::getInstance() and the object is instantiated. If the config file exists in NVM at that point (e.g. mDot::saveConfig() had been called sometime before), it is loaded, otherwise factory default configuration is used.

Cheers, Mike

Accepted Answer

So, further questio, how would I actually know that the configuration has been loaded successfully or factory defaults have been set and I need to set them myself using the setNetworkName and setNetworkPassphrase?

Thanks

Andrew

posted by Andrew Lindsay 27 Aug 2015

You can query the library to see what current configuration is.

std::string getNetworkName(); std::string getNetworkPassphrase(); uint8_t getJoinMode(); uint8_t getFrequencySubBand(); uint8_t getFrequencyBand();

etc, etc, etc

posted by Mike Fiore 27 Aug 2015