File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed
Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -223,6 +223,7 @@ void ArduinoIoTCloudTCP::update()
223223 State next_state = _state;
224224 switch (_state)
225225 {
226+ case State::ConfigPhy: next_state = handle_ConfigPhy (); break ;
226227 case State::ConnectPhy: next_state = handle_ConnectPhy (); break ;
227228 case State::SyncTime: next_state = handle_SyncTime (); break ;
228229 case State::ConnectMqttBroker: next_state = handle_ConnectMqttBroker (); break ;
@@ -256,6 +257,16 @@ void ArduinoIoTCloudTCP::printDebugInfo()
256257 * PRIVATE MEMBER FUNCTIONS
257258 ******************************************************************************/
258259
260+ ArduinoIoTCloudTCP::State ArduinoIoTCloudTCP::handle_ConfigPhy ()
261+ {
262+ if (_configurator == nullptr || _configurator->poll () == NetworkConfiguratorStates::CONFIGURED)
263+ {
264+ return State::ConnectPhy;
265+ }
266+
267+ return State::ConfigPhy;
268+ }
269+
259270ArduinoIoTCloudTCP::State ArduinoIoTCloudTCP::handle_ConnectPhy ()
260271{
261272 if (_connection->check () == NetworkConnectionState::CONNECTED)
Original file line number Diff line number Diff line change @@ -109,6 +109,7 @@ class ArduinoIoTCloudTCP: public ArduinoIoTCloudClass
109109
110110 enum class State
111111 {
112+ ConfigPhy,
112113 ConnectPhy,
113114 SyncTime,
114115 ConnectMqttBroker,
@@ -160,6 +161,7 @@ class ArduinoIoTCloudTCP: public ArduinoIoTCloudClass
160161 inline String getTopic_dataout () { return ( getThingId ().length () == 0 ) ? String (" " ) : String (" /a/t/" + getThingId () + " /e/o" ); }
161162 inline String getTopic_datain () { return ( getThingId ().length () == 0 ) ? String (" " ) : String (" /a/t/" + getThingId () + " /e/i" ); }
162163
164+ State handle_ConfigPhy ();
163165 State handle_ConnectPhy ();
164166 State handle_SyncTime ();
165167 State handle_ConnectMqttBroker ();
You can’t perform that action at this time.
0 commit comments