From b042af3e8da917ff00255d247c221195f41fbd53 Mon Sep 17 00:00:00 2001 From: pennam Date: Fri, 11 Mar 2022 08:52:00 +0100 Subject: [PATCH] Make NINA FW OTA error available as OTA_ERROR property --- src/utility/ota/OTA-samd.cpp | 2 +- src/utility/ota/OTA.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/utility/ota/OTA-samd.cpp b/src/utility/ota/OTA-samd.cpp index f555415b..36dde769 100644 --- a/src/utility/ota/OTA-samd.cpp +++ b/src/utility/ota/OTA-samd.cpp @@ -52,7 +52,7 @@ int samd_onOTARequest(char const * ota_url) if (!WiFiStorage.downloadOTA(ota_url, &nina_ota_err_code)) { DEBUG_ERROR("ArduinoIoTCloudTCP::%s error download to nina: %d", __FUNCTION__, nina_ota_err_code); - return static_cast(OTAError::DownloadFailed); + return (NINAFW_OTA_ERROR_BASE - nina_ota_err_code); } /* Perform the reset to reboot to SxU. */ diff --git a/src/utility/ota/OTA.h b/src/utility/ota/OTA.h index 405f1843..f764e505 100644 --- a/src/utility/ota/OTA.h +++ b/src/utility/ota/OTA.h @@ -29,6 +29,7 @@ ******************************************************************************/ #define RP2040_OTA_ERROR_BASE (-100) +#define NINAFW_OTA_ERROR_BASE (-200) /****************************************************************************** * TYPEDEF