Function esp_idf_sys::esp_https_ota_begin

source ยท
pub unsafe extern "C" fn esp_https_ota_begin(
    ota_config: *const esp_https_ota_config_t,
    handle: *mut esp_https_ota_handle_t,
) -> esp_err_t
Expand description

@brief Start HTTPS OTA Firmware upgrade

This function initializes ESP HTTPS OTA context and establishes HTTPS connection. This function must be invoked first. If this function returns successfully, then esp_https_ota_perform should be called to continue with the OTA process and there should be a call to esp_https_ota_finish on completion of OTA operation or on failure in subsequent operations. This API supports URL redirection, but if CA cert of URLs differ then it should be appended to cert_pem member of http_config, which is a part of ota_config. In case of error, this API explicitly sets handle to NULL.

@param[in] ota_config pointer to esp_https_ota_config_t structure @param[out] handle pointer to an allocated data of type esp_https_ota_handle_t which will be initialised in this function

@note This API is blocking, so setting is_async member of http_config structure will result in an error.

@return

  • ESP_OK: HTTPS OTA Firmware upgrade context initialised and HTTPS connection established
  • ESP_FAIL: For generic failure.
  • ESP_ERR_INVALID_ARG: Invalid argument (missing/incorrect config, certificate, etc.)
  • For other return codes, refer documentation in app_update component and esp_http_client component in esp-idf.