-->
Page 1 of 1

Set this global object from spiffs

PostPosted: Fri Mar 04, 2016 5:07 am
by helpme
This is how I set this global object in the past.

Code: Select allMqttClient 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 allMqttClient mqtt(AppSettings.MQTTUWL, 1883, msgRev);

AppSettings contain the structure of spiffs.

Here is my init(),

Code: Select allvoid 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?