diff --git a/src/WiFiStorage.h b/src/WiFiStorage.h index 249ed1c8..54f744a0 100644 --- a/src/WiFiStorage.h +++ b/src/WiFiStorage.h @@ -58,8 +58,12 @@ class WiFiStorageClass WiFiDrv::downloadFile(url, strlen(url), filename, strlen(filename)); return true; } - static bool downloadOTA(const char * url) { - return (WiFiDrv::downloadOTA(url, strlen(url)) == 0); + static bool downloadOTA(const char * url, uint8_t * res_ota_download = NULL) { + uint8_t const res = WiFiDrv::downloadOTA(url, strlen(url)); + if (res_ota_download) + *res_ota_download = res; + bool const success = (res == 0); + return success; } @@ -78,8 +82,8 @@ class WiFiStorageClass static bool download(String url, String filename) { return download(url.c_str(), filename.c_str()); } - static bool download(String url) { - return downloadOTA(url.c_str()); + static bool download(String url, uint8_t * res_ota_download = NULL) { + return downloadOTA(url.c_str(), res_ota_download); } };