powerpods/main/ota_espnow.h
simon 9b7bda8551 Distribute master OTA images to slaves over ESP-NOW.
After UART OTA the master reads the staged partition in 4 KiB blocks (200 B ESP-NOW chunks), waits for per-slave block ACKs, and fixes the final partial block. Slaves reuse ota_uart; send pacing and logging improve reliability.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-19 01:00:56 +02:00

24 lines
884 B
C

#ifndef OTA_ESPNOW_H
#define OTA_ESPNOW_H
#include "esp_err.h"
#include "esp_now_messages.pb.h"
#include "esp_partition.h"
#include <stdint.h>
/** Master: read staged image from partition and push to all available slaves. */
esp_err_t ota_espnow_distribute(const esp_partition_t *partition, uint32_t size);
/** Master: handle slave → master OTA status / block ACK. */
void ota_espnow_master_on_status(const uint8_t slave_mac[6],
const alox_EspNowOtaStatus *status);
/** Slave: handle master → slave OTA commands. */
void ota_espnow_slave_on_start(const uint8_t master_mac[6],
const alox_EspNowOtaStart *start);
void ota_espnow_slave_on_payload(const uint8_t master_mac[6],
const alox_EspNowOtaPayload *payload);
void ota_espnow_slave_on_end(const uint8_t master_mac[6]);
#endif