File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -240,6 +240,14 @@ void ArduinoIoTCloudTCP::update()
240240#if defined (ARDUINO_ARCH_SAMD) || defined (ARDUINO_ARCH_MBED)
241241 watchdog_reset ();
242242#endif
243+
244+ #if OTA_ENABLED
245+ if ((_ota.getState () != OTACloudProcessInterface::Resume &&
246+ _ota.getState () != OTACloudProcessInterface::OtaBegin) ||
247+ _mqttClient.connected ()) {
248+ _ota.update ();
249+ }
250+ #endif // OTA_ENABLED
243251}
244252
245253int ArduinoIoTCloudTCP::connected ()
@@ -325,8 +333,6 @@ ArduinoIoTCloudTCP::State ArduinoIoTCloudTCP::handle_Connected()
325333 _get_ota_confirmation ()) {
326334 _ota.approveOta ();
327335 }
328-
329- _ota.update ();
330336#endif // OTA_ENABLED
331337
332338 if ((!_otaClient.connected ()) && (!_mqttClient.connected () || !_thing.connected () || !_device.connected ()))
You can’t perform that action at this time.
0 commit comments