add option to restart ESP when disconnected

This commit is contained in:
technyon
2022-06-30 20:25:37 +02:00
parent 2ef59fc0b6
commit d693e8a065
6 changed files with 47 additions and 0 deletions

View File

@@ -253,6 +253,9 @@ class WiFiManager
//called just before doing OTA update
void setPreOtaUpdateCallback( std::function<void()> func );
//called when WiFi has disconnected
void setDisconnectedCallback( std::function<void()> func );
//sets timeout before AP,webserver loop ends and exits even if there has been no setup.
//useful for devices that failed to connect at some point and got stuck in a webserver loop
//in seconds setConfigPortalTimeout is a new name for setTimeout, ! not used if setConfigPortalBlocking
@@ -720,6 +723,7 @@ class WiFiManager
std::function<void()> _saveparamscallback;
std::function<void()> _resetcallback;
std::function<void()> _preotaupdatecallback;
std::function<void()> _disconnectedcallback = nullptr;
template <class T>
auto optionalIPFromString(T *obj, const char *s) -> decltype( obj->fromString(s) ) {