#ifndef OTA_UPDATE_H #define OTA_UPDATE_H #include "esp_err.h" #include #include #define UPDATE_BUFFER_SIZE 4000 #define UPDATE_PAYLOAD_SIZE 200 #define UPDATE_MAX_SEQUENZES (UPDATE_BUFFER_SIZE / UPDATE_PAYLOAD_SIZE) void init_ota(); enum OTA_UPDATE_STATES { IDEL, START_REQUESTED, WAITING_FOR_PAYLOAD, WRITING_OTA_TO_PARTITION, }; int prepare_ota_update(); esp_err_t write_ota_update(uint32_t write_len, const uint8_t *payload); esp_err_t end_ota_update(); #endif