esp_https_ota: Added error checking functionalities.

Current implimentation of esp_http_ota does not perform any error-checking in the data writing phase calls `esp_ota_get_next_update_partition()` irrespetive of the received state of the image. A few additional error checking mechanism have now been added inside the esp_https_ota which returns the control in case an invalid header is received and a wrapper to the function `esp_http_client_is_complete_data_received()` of `esp_http_client` has been added.
This commit is contained in:
Hrudaynath Dhabe
2019-08-15 21:10:00 +08:00
committed by Shubham Kulkarni
parent 012ff5775b
commit 2b44bc47df
4 changed files with 38 additions and 5 deletions

View File

@@ -142,6 +142,11 @@ void advanced_ota_example_task(void * pvParameter)
ESP_LOGD(TAG, "Image bytes read: %d", esp_https_ota_get_image_len_read(https_ota_handle));
}
if (esp_https_ota_is_complete_data_received(&https_ota_handle) != true) {
// the OTA image was not completely received and user can customise the response to this situation.
ESP_LOGE(TAG, "Complete data was not received.");
}
ota_end:
ota_finish_err = esp_https_ota_finish(https_ota_handle);
if ((err == ESP_OK) && (ota_finish_err == ESP_OK)) {