Function esp_idf_sys::esp_https_ota

source ·
pub unsafe extern "C" fn esp_https_ota(
    ota_config: *const esp_https_ota_config_t,
) -> esp_err_t
Expand description

@brief HTTPS OTA Firmware upgrade.

This function allocates HTTPS OTA Firmware upgrade context, establishes HTTPS connection, reads image data from HTTP stream and writes it to OTA partition and finishes HTTPS OTA Firmware upgrade operation. This API supports URL redirection, but if CA cert of URLs differ then it should be appended to cert_pem member of ota_config->http_config.

@param[in] ota_config pointer to esp_https_ota_config_t structure.

@note This API handles the entire OTA operation, so if this API is being used then no other APIs from esp_https_ota component should be called. If more information and control is needed during the HTTPS OTA process, then one can use esp_https_ota_begin and subsequent APIs. If this API returns successfully, esp_restart() must be called to boot from the new firmware image.

@return

  • ESP_OK: OTA data updated, next reboot will use specified partition.
  • ESP_FAIL: For generic failure.
  • ESP_ERR_INVALID_ARG: Invalid argument
  • ESP_ERR_OTA_VALIDATE_FAILED: Invalid app image
  • ESP_ERR_NO_MEM: Cannot allocate memory for OTA operation.
  • ESP_ERR_FLASH_OP_TIMEOUT or ESP_ERR_FLASH_OP_FAIL: Flash write failed.
  • For other return codes, refer OTA documentation in esp-idf’s app_update component.