Skip to content

Commit

Permalink
fixup! Improving ESP32 ota to be inline with new IoTCloud implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
andreagilardoni committed May 23, 2024
1 parent d153911 commit 862cd25
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion src/Arduino_ESP32_OTA.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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;

Expand Down

0 comments on commit 862cd25

Please sign in to comment.