Fix portal station hand-off ownership

This commit is contained in:
2026-09-08 22:26:19 +10:00
parent 5592fd12e1
commit 21607d41bd
5 changed files with 36 additions and 4 deletions
+6
View File
@@ -1082,6 +1082,12 @@ protected:
_configPortalStart = millis();
}
}
void wmTestSetWebPortalActive(bool active) {
webPortalActive = active;
if (active) {
_configPortalStart = millis();
}
}
void wmTestSetPortalConnectSuccess(const String& message, const String& stationIp, uint8_t status = WL_CONNECTED) {
_cpConnectState = wm_cp_connect_state_t::success;
_cpConnectMessage = message;
+5 -2
View File
@@ -385,7 +385,10 @@ bool WiFiManager::startStationCandidate(const WiFiManagerStationProfiles& candid
_begin();
_stationCandidate = candidate;
_stationCandidateActive = true;
_stationCandidateFromPortal = configPortalActive;
// A profile submitted from either portal surface is owned by the station
// controller. Do not let the legacy empty-SSID portal state machine mark
// it successful before the controller has a usable station address.
_stationCandidateFromPortal = configPortalActive || webPortalActive;
_stationAttemptMask = 0;
_stationPendingSlot = WM_NO_STATION_PROFILE;
_stationNextAttemptAt = 0;
@@ -506,7 +509,7 @@ void WiFiManager::queueStationProfile(uint8_t slot) {
}
void WiFiManager::completePortalStationAttempt(bool success, uint8_t status, const String& message) {
if (!_stationCandidateFromPortal && !configPortalActive) {
if (!_stationCandidateFromPortal && !configPortalActive && !webPortalActive) {
return;
}