To show the config portal SSID in the callback, a global reference to the WiFiManager object was needed. To solve this, a pointer to the WiFiManager object is now passed to the callback. The feedback example is edited accordingly.

This commit is contained in:
Franklin van Velthuizen
2016-01-10 00:28:39 +01:00
parent ec40e32c3f
commit c77e9cbcc9
3 changed files with 7 additions and 11 deletions
+2 -2
View File
@@ -83,7 +83,7 @@ class WiFiManager
//sets a custom ip /gateway /subnet configuration
void setAPConfig(IPAddress ip, IPAddress gw, IPAddress sn);
//called when AP mode and config portal is started
void setAPCallback( void (*func)(void) );
void setAPCallback( void (*func)(WiFiManager*) );
//called when settings have been changed and connection was successful
void setSaveConfigCallback( void (*func)(void) );
@@ -138,7 +138,7 @@ class WiFiManager
boolean connect;
boolean _debug = true;
void (*_apcallback)(void) = NULL;
void (*_apcallback)(WiFiManager*) = NULL;
void (*_savecallback)(void) = NULL;
WiFiManagerParameter* _params[WIFI_MANAGER_MAX_PARAMS];