esp_alox/main/ota_update.h
2025-08-10 15:17:22 +02:00

26 lines
504 B
C

#ifndef OTA_UPDATE_H
#define OTA_UPDATE_H
#include "esp_err.h"
#include <stdint.h>
#include <sys/types.h>
#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