Set this global object from spiffs
Posted: Fri Mar 04, 2016 5:07 am
This is how I set this global object in the past.
I want to retrieve the IP address which is stored in spiffs and use it to declare this global object.
AppSettings contain the structure of spiffs.
Here is my init(),
The problem is during the declaration of the object code, AppSettings is not yet loaded. How should I declare the global object such that it is able to retrieve the value from AppSettings?
Code: Select all
MqttClient mqtt("192.168.1.8", 1883, msgRev);
I want to retrieve the IP address which is stored in spiffs and use it to declare this global object.
Code: Select all
MqttClient mqtt(AppSettings.MQTTUWL, 1883, msgRev);
AppSettings contain the structure of spiffs.
Here is my init(),
Code: Select all
void init()
{
spiffs_mount(); // Mount file system, in order to work with files
AppSettings.load();
//...
}
The problem is during the declaration of the object code, AppSettings is not yet loaded. How should I declare the global object such that it is able to retrieve the value from AppSettings?