mirror of
https://github.com/alexhopeoconnor/WiFiManager.git
synced 2026-10-15 15:41:21 +10:00
feat(callback): add config portal timeout callback for handle config portal timeout (#1497)
This commit is contained in:
@@ -786,6 +786,12 @@ boolean WiFiManager::startConfigPortal(char const *apName, char const *apPasswo
|
||||
#endif
|
||||
shutdownConfigPortal();
|
||||
result = abort ? portalAbortResult : portalTimeoutResult; // false, false
|
||||
if (_configportaltimeoutcallback != NULL) {
|
||||
#ifdef WM_DEBUG_LEVEL
|
||||
DEBUG_WM(DEBUG_VERBOSE,F("[CB] config portal timeout callback"));
|
||||
#endif
|
||||
_configportaltimeoutcallback(); // @CALLBACK
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -830,6 +836,12 @@ boolean WiFiManager::process(){
|
||||
#endif
|
||||
webPortalActive = false;
|
||||
shutdownConfigPortal();
|
||||
if (_configportaltimeoutcallback != NULL) {
|
||||
#ifdef WM_DEBUG_LEVEL
|
||||
DEBUG_WM(DEBUG_VERBOSE,F("[CB] config portal timeout callback"));
|
||||
#endif
|
||||
_configportaltimeoutcallback(); // @CALLBACK
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -2788,6 +2800,15 @@ void WiFiManager::setPreOtaUpdateCallback( std::function<void()> func ) {
|
||||
_preotaupdatecallback = func;
|
||||
}
|
||||
|
||||
/**
|
||||
* setConfigPortalTimeoutCallback, set a callback to config portal is timeout
|
||||
* @access public
|
||||
* @param {[type]} void (*func)(void)
|
||||
*/
|
||||
void WiFiManager::setConfigPortalTimeoutCallback( std::function<void()> func ) {
|
||||
_configportaltimeoutcallback = func;
|
||||
}
|
||||
|
||||
/**
|
||||
* set custom head html
|
||||
* custom element will be added to head, eg. new meta,style,script tag etc.
|
||||
|
||||
Reference in New Issue
Block a user