From 78f2b09bccf357971ee4592be4808080b0851181 Mon Sep 17 00:00:00 2001 From: pennam Date: Wed, 18 Oct 2023 15:33:38 +0200 Subject: [PATCH] UNO WiFi R4 OTA examples: fix download return value print --- libraries/OTAUpdate/examples/OTA/OTA.ino | 5 +++-- .../OTAUpdate/examples/WiFiFirmwareOTA/WiFiFirmwareOTA.ino | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/libraries/OTAUpdate/examples/OTA/OTA.ino b/libraries/OTAUpdate/examples/OTA/OTA.ino index 586026f8..758b0beb 100644 --- a/libraries/OTAUpdate/examples/OTA/OTA.ino +++ b/libraries/OTAUpdate/examples/OTA/OTA.ino @@ -67,9 +67,10 @@ void setup() { Serial.println((int)ret); return; } - if(ota.download(OTA_FILE_LOCATION, "/update.bin") <= 0) { + int ota_size = ota.download(OTA_FILE_LOCATION, "/update.bin"); + if(ota_size <= 0) { Serial.println("ota.download() error: "); - Serial.println((int)ret); + Serial.println(ota_size); return; } ret = ota.verify(); diff --git a/libraries/OTAUpdate/examples/WiFiFirmwareOTA/WiFiFirmwareOTA.ino b/libraries/OTAUpdate/examples/WiFiFirmwareOTA/WiFiFirmwareOTA.ino index 8bde1808..73a04fd9 100644 --- a/libraries/OTAUpdate/examples/WiFiFirmwareOTA/WiFiFirmwareOTA.ino +++ b/libraries/OTAUpdate/examples/WiFiFirmwareOTA/WiFiFirmwareOTA.ino @@ -77,9 +77,10 @@ void setup() { Serial.println((int)ret); return; } - if(ota.download(OTA_FILE_LOCATION) <= 0) { + int ota_size = ota.download(OTA_FILE_LOCATION); + if(ota_size <= 0) { Serial.println("ota.download() error: "); - Serial.println((int)ret); + Serial.println(ota_size); return; } ret = ota.verify();