Skip to content

Commit 2b84ac1

Browse files
committed
in read_storage state added a check if a peer is connected for configuration
1 parent 5f8c8ee commit 2b84ac1

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/Arduino_NetworkConfigurator.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -503,6 +503,10 @@ NetworkConfiguratorStates NetworkConfiguratorClass::handleReadStorage() {
503503

504504
if(credFound && _connectionHandler->updateSetting(_networkSetting)) {
505505
_connectionHandlerIstantiated = true;
506+
_configInProgress = _agentsManager->isConfigInProgress();
507+
if (_configInProgress) {
508+
return NetworkConfiguratorStates::UPDATING_CONFIG;
509+
}
506510
return NetworkConfiguratorStates::CONFIGURED;
507511
}
508512

@@ -583,7 +587,8 @@ NetworkConfiguratorStates NetworkConfiguratorClass::handleConfigured() {
583587
}
584588

585589
NetworkConfiguratorStates NetworkConfiguratorClass::handleUpdatingConfig() {
586-
if (_agentsManager->isConfigInProgress() == false) {
590+
_configInProgress = _agentsManager->isConfigInProgress();
591+
if (_configInProgress == false) {
587592
//If peer disconnects without updating the network settings, go to connecting state for check the connection
588593
sendStatus(StatusMessage::CONNECTING);
589594
return NetworkConfiguratorStates::CONNECTING;

0 commit comments

Comments
 (0)