8#include <esp_idf_version.h>
9#include <esp_ota_ops.h>
15#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 4, 2) || \
16 (ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 3, 3) && ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 4, 0))
17#define USE_OTA_BLOCK_ERASE_AHEAD
22#ifdef USE_OTA_PARTITIONS
24static constexpr size_t PARTITION_TABLE_BUFFER_SIZE = ESP_PARTITION_TABLE_MAX_LEN;
39#ifdef USE_OTA_PARTITIONS
50 PartitionTablePlan &plan);
67#ifdef USE_OTA_BLOCK_ERASE_AHEAD
70#ifdef USE_OTA_SIGNED_VERIFICATION_MULTI_KEY
73 bool verify_signed_image_(
const esp_partition_t *incoming);
77 esp_ota_handle_t update_handle_{0};
78 const esp_partition_t *partition_{
nullptr};
80#ifdef USE_OTA_BLOCK_ERASE_AHEAD
81 size_t erased_end_{0};
83 char expected_bin_md5_[32];
85#ifdef USE_OTA_PARTITIONS
89 uint8_t buf_[PARTITION_TABLE_BUFFER_SIZE];
90 size_t buf_written_{0};
91 size_t image_size_{0};
92 const esp_partition_t *partition_table_part_{
nullptr};
93 const esp_partition_t *bootloader_part_{
nullptr};
bool supports_compression()
OTAResponseTypes setup_bootloader_staging_()
void set_update_md5(const char *md5)
OTAResponseTypes finalize_bootloader_update_(esp_err_t ota_end_err)
OTAResponseTypes begin(size_t image_size, ota::OTAType ota_type=ota::OTA_TYPE_UPDATE_APP)
OTAResponseTypes prepare_bootloader_update_(size_t image_size)
OTAResponseTypes register_and_validate_bootloader_part_()
OTAResponseTypes write(uint8_t *data, size_t len)
OTAResponseTypes validate_new_partition_table_(uint32_t running_app_offset, size_t running_app_size, PartitionTablePlan &plan)
OTAResponseTypes update_partition_table()
bool is_app_or_bootloader_update_() const
OTAResponseTypes register_and_validate_partition_table_part_()
@ OTA_TYPE_UPDATE_BOOTLOADER
void get_running_app_position(uint32_t &offset, size_t &size)
std::unique_ptr< ArduinoLibreTinyOTABackend > make_ota_backend()
const esp_partition_t * copy_dest_part