From 3da0aa2d828fa12946a8ffe1d8bf5b12bb627854 Mon Sep 17 00:00:00 2001 From: "nilesh.kale" Date: Mon, 5 Feb 2024 12:34:14 +0530 Subject: [PATCH] fix(esp_https_ota): fix incorrectly reference of API esp_https_ota_get_img_desc() esp_https_ota_get_img_desc() is incorrectly referred to as esp_https_ota_read_img_desc() in some error messages.So, this MR updates related references Closes https://github.com/espressif/esp-idf/issues/13065 --- components/esp_https_ota/src/esp_https_ota.c | 8 ++++---- .../advanced_https_ota/main/advanced_https_ota_example.c | 2 +- .../system/ota/advanced_https_ota/pytest_advanced_ota.py | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/components/esp_https_ota/src/esp_https_ota.c b/components/esp_https_ota/src/esp_https_ota.c index 2449a659cd..92f70e440f 100644 --- a/components/esp_https_ota/src/esp_https_ota.c +++ b/components/esp_https_ota/src/esp_https_ota.c @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2017-2023 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2017-2024 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -451,11 +451,11 @@ esp_err_t esp_https_ota_get_img_desc(esp_https_ota_handle_t https_ota_handle, es esp_https_ota_t *handle = (esp_https_ota_t *)https_ota_handle; if (handle == NULL || new_app_info == NULL) { - ESP_LOGE(TAG, "esp_https_ota_read_img_desc: Invalid argument"); + ESP_LOGE(TAG, "esp_https_ota_get_img_desc: Invalid argument"); return ESP_ERR_INVALID_ARG; } if (handle->state < ESP_HTTPS_OTA_BEGIN) { - ESP_LOGE(TAG, "esp_https_ota_read_img_desc: Invalid state"); + ESP_LOGE(TAG, "esp_https_ota_get_img_desc: Invalid state"); return ESP_ERR_INVALID_STATE; } if (read_header(handle) != ESP_OK) { @@ -508,7 +508,7 @@ esp_err_t esp_https_ota_perform(esp_https_ota_handle_t https_ota_handle) return err; } handle->state = ESP_HTTPS_OTA_IN_PROGRESS; - /* In case `esp_https_ota_read_img_desc` was invoked first, + /* In case `esp_https_ota_get_img_desc` was invoked first, then the image data read there should be written to OTA partition */ int binary_file_len = 0; diff --git a/examples/system/ota/advanced_https_ota/main/advanced_https_ota_example.c b/examples/system/ota/advanced_https_ota/main/advanced_https_ota_example.c index 6cdb884551..14054486b2 100644 --- a/examples/system/ota/advanced_https_ota/main/advanced_https_ota_example.c +++ b/examples/system/ota/advanced_https_ota/main/advanced_https_ota_example.c @@ -168,7 +168,7 @@ void advanced_ota_example_task(void *pvParameter) esp_app_desc_t app_desc; err = esp_https_ota_get_img_desc(https_ota_handle, &app_desc); if (err != ESP_OK) { - ESP_LOGE(TAG, "esp_https_ota_read_img_desc failed"); + ESP_LOGE(TAG, "esp_https_ota_get_img_desc failed"); goto ota_end; } err = validate_image_header(&app_desc); diff --git a/examples/system/ota/advanced_https_ota/pytest_advanced_ota.py b/examples/system/ota/advanced_https_ota/pytest_advanced_ota.py index 073cd9a7a1..d25ca408e4 100644 --- a/examples/system/ota/advanced_https_ota/pytest_advanced_ota.py +++ b/examples/system/ota/advanced_https_ota/pytest_advanced_ota.py @@ -225,7 +225,7 @@ def test_examples_protocol_advanced_https_ota_example_truncated_header(dut: Dut) dut.expect('Starting Advanced OTA example', timeout=30) print('writing to device: {}'.format('https://' + host_ip + ':' + str(server_port) + '/' + truncated_bin_name)) dut.write('https://' + host_ip + ':' + str(server_port) + '/' + truncated_bin_name) - dut.expect('advanced_https_ota_example: esp_https_ota_read_img_desc failed', timeout=30) + dut.expect('advanced_https_ota_example: esp_https_ota_get_img_desc failed', timeout=30) try: os.remove(binary_file) except OSError: