File tree Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -216,6 +216,7 @@ void ArduinoIoTCloudTCP::update()
216
216
switch (_state)
217
217
{
218
218
case State::ConfigPhy: next_state = handle_ConfigPhy (); break ;
219
+ case State::UpdatePhy: next_state = handle_UpdatePhy (); break ;
219
220
case State::Init: next_state = handle_Init (); break ;
220
221
case State::ConnectPhy: next_state = handle_ConnectPhy (); break ;
221
222
case State::SyncTime: next_state = handle_SyncTime (); break ;
@@ -240,7 +241,7 @@ void ArduinoIoTCloudTCP::update()
240
241
*/
241
242
#if NETWORK_CONFIGURATOR_ENABLED
242
243
if (_configurator != nullptr && _state > State::Init && _configurator->update () == NetworkConfiguratorStates::UPDATING_CONFIG){
243
- _state = State::ConfigPhy ;
244
+ _state = State::UpdatePhy ;
244
245
}
245
246
#endif
246
247
@@ -316,6 +317,19 @@ ArduinoIoTCloudTCP::State ArduinoIoTCloudTCP::handle_ConfigPhy()
316
317
#endif
317
318
}
318
319
320
+ ArduinoIoTCloudTCP::State ArduinoIoTCloudTCP::handle_UpdatePhy ()
321
+ {
322
+ #if NETWORK_CONFIGURATOR_ENABLED
323
+ if (_configurator->update () == NetworkConfiguratorStates::CONFIGURED) {
324
+ _configurator->disconnectAgent ();
325
+ return State::Disconnect;
326
+ }
327
+ return State::UpdatePhy;
328
+ #else
329
+ return State::Init;
330
+ #endif
331
+ }
332
+
319
333
ArduinoIoTCloudTCP::State ArduinoIoTCloudTCP::handle_Init ()
320
334
{
321
335
/* Setup broker TLS client */
Original file line number Diff line number Diff line change @@ -122,6 +122,7 @@ class ArduinoIoTCloudTCP: public ArduinoIoTCloudClass
122
122
enum class State
123
123
{
124
124
ConfigPhy,
125
+ UpdatePhy,
125
126
Init,
126
127
ConnectPhy,
127
128
SyncTime,
@@ -178,6 +179,7 @@ class ArduinoIoTCloudTCP: public ArduinoIoTCloudClass
178
179
inline String getTopic_datain () { return ( getThingId ().length () == 0 ) ? String (" " ) : String (" /a/t/" + getThingId () + " /e/i" ); }
179
180
180
181
State handle_ConfigPhy ();
182
+ State handle_UpdatePhy ();
181
183
State handle_Init ();
182
184
State handle_ConnectPhy ();
183
185
State handle_SyncTime ();
You can’t perform that action at this time.
0 commit comments