Skip to content

Commit d4d7940

Browse files
committed
Clear _ota_req flag after onOTARequest() is done
1 parent 737aea7 commit d4d7940

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/ArduinoIoTCloudTCP.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -514,12 +514,14 @@ ArduinoIoTCloudTCP::State ArduinoIoTCloudTCP::handle_Connected()
514514
if (_automatic_ota || (_get_ota_confirmation != nullptr && _get_ota_confirmation())) {
515515
/* Clear the error flag. */
516516
_ota_error = static_cast<int>(OTAError::None);
517+
/* Call member function to handle OTA request. */
518+
onOTARequest();
517519
/* Clear the request flag. */
518520
_ota_req = false;
519521
/* Transmit the cleared error and request flags to the cloud. */
520522
sendPropertiesToCloud();
521-
/* Call member function to handle OTA request. */
522-
onOTARequest();
523+
/* Reset the board to apply OTA update */
524+
systemReset();
523525
}
524526
}
525527
#endif /* OTA_ENABLED */

0 commit comments

Comments
 (0)