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>
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
#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
|
||||
Reference in New Issue
Block a user