File tree 1 file changed +11
-11
lines changed
1 file changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -319,7 +319,17 @@ ArduinoIoTCloudTCP::State ArduinoIoTCloudTCP::handle_ConnectMqttBroker()
319
319
320
320
ArduinoIoTCloudTCP::State ArduinoIoTCloudTCP::handle_Connected ()
321
321
{
322
- if (!_mqttClient.connected () || !_thing.connected () || !_device.connected ())
322
+ #if OTA_ENABLED
323
+ if (_get_ota_confirmation != nullptr &&
324
+ _ota.getState () == OTACloudProcessInterface::State::OtaAvailable &&
325
+ _get_ota_confirmation ()) {
326
+ _ota.approveOta ();
327
+ }
328
+
329
+ _ota.update ();
330
+ #endif // OTA_ENABLED
331
+
332
+ if ((!_otaClient.connected ()) && (!_mqttClient.connected () || !_thing.connected () || !_device.connected ()))
323
333
{
324
334
return State::Disconnect;
325
335
}
@@ -338,16 +348,6 @@ ArduinoIoTCloudTCP::State ArduinoIoTCloudTCP::handle_Connected()
338
348
/* Call CloudDevice process to get configuration */
339
349
_device.update ();
340
350
341
- #if OTA_ENABLED
342
- if (_get_ota_confirmation != nullptr &&
343
- _ota.getState () == OTACloudProcessInterface::State::OtaAvailable &&
344
- _get_ota_confirmation ()) {
345
- _ota.approveOta ();
346
- }
347
-
348
- _ota.update ();
349
- #endif // OTA_ENABLED
350
-
351
351
352
352
if (_device.isAttached ()) {
353
353
/* Call CloudThing process to synchronize properties */
You can’t perform that action at this time.
0 commit comments