File tree Expand file tree Collapse file tree 4 files changed +12
-5
lines changed Expand file tree Collapse file tree 4 files changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -71,6 +71,7 @@ void setup() {
71
71
NetworkConf.resetStoredConfiguration ();
72
72
}
73
73
NetworkConf.startBLEIfConnectionFails (true );
74
+ NetworkConf.updateNetworkOptions ();
74
75
NetworkConf.begin ();
75
76
ProvisioningSystem.begin ();
76
77
Original file line number Diff line number Diff line change @@ -113,7 +113,7 @@ void setup() {
113
113
#if defined(ARDUINO_UNOR4_WIFI)
114
114
WiFi.end ();
115
115
#endif
116
- clearStoredCredentials ();
116
+
117
117
#if defined(ARDUINO_SAMD_MKRWIFI1010) || defined(ARDUINO_SAMD_NANO_33_IOT) || defined(ARDUINO_PORTENTA_H7_M7)
118
118
pinMode (RESETCRED_BUTTON, INPUT_PULLDOWN);
119
119
#else
@@ -130,6 +130,7 @@ clearStoredCredentials();
130
130
}
131
131
132
132
NetworkConf.setCheckStoredCred (false );
133
+ NetworkConf.updateNetworkOptions ();
133
134
NetworkConf.begin ();
134
135
ClaimingHandler.begin (&secureElement, &uhwid, clearStoredCredentials);
135
136
Original file line number Diff line number Diff line change @@ -59,7 +59,6 @@ bool NetworkConfigurator::begin() {
59
59
DEBUG_ERROR (" NetworkConfigurator::%s Error registering \" network settings\" callback to AgentManager" , __FUNCTION__);
60
60
}
61
61
62
- updateNetworkOptions (); // TODO MOVE
63
62
if (!_agentManager->begin (SERVICE_ID_FOR_AGENTMANAGER)) {
64
63
DEBUG_ERROR (" NetworkConfigurator::%s Failed to initialize the AgentsConfiguratorManager" , __FUNCTION__);
65
64
}
@@ -408,8 +407,12 @@ NetworkConfiguratorStates NetworkConfigurator::handleReadStorage() {
408
407
}
409
408
_kvstore.end ();
410
409
#else
411
- nextState = NetworkConfiguratorStates::CONFIGURED; // Fix when implement the check if the provided connectionhandler is already configured
410
+ nextState = NetworkConfiguratorStates::CONFIGURED;
412
411
#endif
412
+
413
+ if (nextState == NetworkConfiguratorStates::WAITING_FOR_CONFIG && _lastOptionUpdate == 0 ) {
414
+ updateNetworkOptions ();
415
+ }
413
416
return nextState;
414
417
}
415
418
@@ -425,6 +428,9 @@ NetworkConfiguratorStates NetworkConfigurator::handleTestStoredConfig() {
425
428
if (_startBLEIfConnectionFails) {
426
429
_agentManager->enableBLEAgent (true );
427
430
}
431
+ if (_lastOptionUpdate == 0 ) {
432
+ updateNetworkOptions ();
433
+ }
428
434
nextState = NetworkConfiguratorStates::WAITING_FOR_CONFIG;
429
435
}
430
436
return nextState;
Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ class NetworkConfigurator {
35
35
};
36
36
bool resetStoredConfiguration ();
37
37
bool end ();
38
-
38
+ bool updateNetworkOptions ();
39
39
private:
40
40
NetworkConfiguratorStates _state = NetworkConfiguratorStates::END;
41
41
AgentsConfiguratorManager *_agentManager;
@@ -74,7 +74,6 @@ class NetworkConfigurator {
74
74
String decodeConnectionErrorMessage (NetworkConnectionState err, int *errorCode);
75
75
ConnectionResult connectToNetwork (StatusMessage *err);
76
76
ConnectionResult disconnectFromNetwork ();
77
- bool updateNetworkOptions ();
78
77
bool sendStatus (StatusMessage msg);
79
78
void printNetworkSettings ();
80
79
#ifdef BOARD_HAS_WIFI
You can’t perform that action at this time.
0 commit comments