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
@@ -133,7 +133,7 @@ boolean WiFiManager::startConfigPortal(char const *apName, char const *apPasswo
//notify we entered AP mode
if ( _apcallback != NULL) {
_apcallback();
_apcallback(this);
}
connect = false;
@@ -463,7 +463,7 @@ boolean WiFiManager::captivePortal() {
}
//start up config portal callback
void WiFiManager::setAPCallback( void (*func)(void) ) {
void WiFiManager::setAPCallback( void (*func)(WiFiManager* myWiFiManager) ) {
_apcallback = func;
}