[][src]Function esp_idf_bindgen::esp_ota_begin

pub unsafe extern "C" fn esp_ota_begin(
    partition: *const esp_partition_t,
    image_size: size_t,
    out_handle: *mut esp_ota_handle_t
) -> esp_err_t

@brief Commence an OTA update writing to the specified partition.

The specified partition is erased to the specified image size.

If image size is not yet known, pass OTA_SIZE_UNKNOWN which will cause the entire partition to be erased.

On success, this function allocates memory that remains in use until esp_ota_end() is called with the returned handle.

Note: If the rollback option is enabled and the running application has the ESP_OTA_IMG_PENDING_VERIFY state then it will lead to the ESP_ERR_OTA_ROLLBACK_INVALID_STATE error. Confirm the running app before to run download a new app, use esp_ota_mark_app_valid_cancel_rollback() function for it (this should be done as early as possible when you first download a new application).

@param partition Pointer to info for partition which will receive the OTA update. Required. @param image_size Size of new OTA app image. Partition will be erased in order to receive this size of image. If 0 or OTA_SIZE_UNKNOWN, the entire partition is erased. @param out_handle On success, returns a handle which should be used for subsequent esp_ota_write() and esp_ota_end() calls.

@return