add shouldbreakafterconifg workaround to readme

This commit is contained in:
tablatronix
2020-01-22 10:51:27 -06:00
parent 0865a36a5e
commit cc4acba4ab
+8
View File
@@ -142,6 +142,14 @@ void configModeCallback (WiFiManager *myWiFiManager) {
##### Save settings
This gets called when custom parameters have been set **AND** a connection has been established. Use it to set a flag, so when all the configuration finishes, you can save the extra parameters somewhere.
IF YOU NEED TO SAVE PARAMETERS EVEN ON WIFI FAIL OR EMPTY, you must set `setBreakAfterConfig` to true, or else saveConfigCallback will not be called.
```C++
//if this is set, it will exit after config, even if connection is unsuccessful.
void setBreakAfterConfig(boolean shouldBreak);
```
See [AutoConnectWithFSParameters Example](https://github.com/tzapu/WiFiManager/tree/master/examples/AutoConnectWithFSParameters).
```cpp
wifiManager.setSaveConfigCallback(saveConfigCallback);