diff --git a/src/Arduino_ESP32_OTA.h b/src/Arduino_ESP32_OTA.h index 3a4c473..01475f6 100644 --- a/src/Arduino_ESP32_OTA.h +++ b/src/Arduino_ESP32_OTA.h @@ -97,9 +97,22 @@ class Arduino_ESP32_OTA // call progressDownload, until it returns OtaDownloadCompleted // returns the value in content-length http header int startDownload(const char * ota_url); - OTADownloadState progressDownload(); + + // This function is used to make the download progress. + // it returns 0, if the download is in progress + // it returns 1, if the download is completed + // it returns <0 if an error occurred, following Error enum values + int progressDownload(); + + // this function is used to get the progress of the download + // it returns a positive value when the download is progressing correctly + // it returns a negative value on error following Error enum values int downloadProgress(); + // this function is used to get the size of the download + // 0 if no download is in progress + size_t downloadSize(); + virtual void write_byte_to_flash(uint8_t data); Arduino_ESP32_OTA::Error verify(); Arduino_ESP32_OTA::Error update(); @@ -123,6 +136,9 @@ class Arduino_ESP32_OTA uint32_t downloadedSize; uint32_t writtenBytes; + // If an error occurred during download it is reported in this field + Error error; + // LZSS decoder LZSSDecoder decoder;