esp_https_ota: Added esp_https_ota_get_image_size() to retrieve total size of OTA update

Signed-off-by: Shubham Kulkarni <shubham.kulkarni@espressif.com>

Closes: https://github.com/espressif/esp-idf/pull/6880
This commit is contained in:
0xFEEDC0DE64
2021-04-15 17:24:17 +02:00
committed by Shubham Kulkarni
parent 74f9ce437f
commit c73a17cc27
2 changed files with 31 additions and 0 deletions

View File

@@ -201,6 +201,21 @@ esp_err_t esp_https_ota_get_img_desc(esp_https_ota_handle_t https_ota_handle, es
*/
int esp_https_ota_get_image_len_read(esp_https_ota_handle_t https_ota_handle);
/**
* @brief This function returns OTA image total size.
*
* @note This API should be called after esp_https_ota_begin() has been already called.
* This can be used to create some sort of progress indication
* (in combination with esp_https_ota_get_image_len_read())
*
* @param[in] https_ota_handle pointer to esp_https_ota_handle_t structure
*
* @return
* - -1 On failure or chunked encoding
* - total bytes of image
*/
int esp_https_ota_get_image_size(esp_https_ota_handle_t https_ota_handle);
#ifdef __cplusplus
}
#endif