接前一篇文章:ESP-IDF OTA机制详解(2)
上一回继续对于乐鑫OTA官网例程的第一个函数esp_https_ota_begin进行讲解,讲解到了“3)is_server_verification_enabled函数”,本回继续往下进行讲解。
为了便于理解和回顾,再次贴出esp_https_ota_begin函数的代码,在C:\Espressif\frameworks\esp-idf-v5.2.1\components\esp_https_ota\src\esp_https_ota.c中,如下:
esp_err_t esp_https_ota_begin(const esp_https_ota_config_t *ota_config, esp_https_ota_handle_t *handle)
{
esp_https_ota_dispatch_event(ESP_HTTPS_OTA_START, NULL, 0);
esp_err_t err;
if (handle == NULL || ota_config == NULL || ota_config->http_config == NULL) {
ESP_LOGE(TAG, "esp_https_ota_begin: Invalid argument");
if (handle) {
*handle = N