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 @@ -118,6 +118,7 @@ class ArduinoIoTCloudTCP: public ArduinoIoTCloudClass
118118
119119 enum class State
120120 {
121+ ConfigPhy,
121122 ConnectPhy,
122123 SyncTime,
123124 ConnectMqttBroker,
@@ -169,6 +170,7 @@ class ArduinoIoTCloudTCP: public ArduinoIoTCloudClass
169170 inline String getTopic_dataout () { return ( getThingId ().length () == 0 ) ? String (" " ) : String (" /a/t/" + getThingId () + " /e/o" ); }
170171 inline String getTopic_datain () { return ( getThingId ().length () == 0 ) ? String (" " ) : String (" /a/t/" + getThingId () + " /e/i" ); }
171172
173+ State handle_ConfigPhy ();
172174 State handle_ConnectPhy ();
173175 State handle_SyncTime ();
174176 State handle_ConnectMqttBroker ();
You can’t perform that action at this time.
0 commit comments