feat(callback): add config portal timeout callback for handle config portal timeout (#1497)

This commit is contained in:
Thiti Yamsung
2022-09-15 07:07:55 -05:00
committed by GitHub
parent 1b5d71bac7
commit c34770ec32
2 changed files with 25 additions and 0 deletions
+4
View File
@@ -276,6 +276,9 @@ class WiFiManager
//called just before doing OTA update
void setPreOtaUpdateCallback( std::function<void()> func );
//called when config portal is timeout
void setConfigPortalTimeoutCallback( 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
@@ -771,6 +774,7 @@ class WiFiManager
std::function<void()> _saveparamscallback;
std::function<void()> _resetcallback;
std::function<void()> _preotaupdatecallback;
std::function<void()> _configportaltimeoutcallback;
template <class T>
auto optionalIPFromString(T *obj, const char *s) -> decltype( obj->fromString(s) ) {