Split ESP-NOW into core/master/slave modules, block non-OTA UART traffic during updates, and hold the host serial port exclusively so dashboard polling cannot interleave with firmware uploads. Co-authored-by: Cursor <cursoragent@cursor.com>
26 lines
492 B
C
26 lines
492 B
C
#ifndef CMD_HANDLER_H
|
|
#define CMD_HANDLER_H
|
|
|
|
#include "esp_err.h"
|
|
#include "freertos/idf_additions.h"
|
|
|
|
typedef struct {
|
|
uint16_t msg_id;
|
|
uint8_t *payload;
|
|
size_t len;
|
|
} generic_msg_t;
|
|
|
|
typedef void (*msg_callback_t)(const uint8_t *data, size_t len);
|
|
|
|
typedef struct {
|
|
uint16_t msg_id;
|
|
msg_callback_t callback;
|
|
} msg_binding_t;
|
|
|
|
void init_cmdHandler(QueueHandle_t queue);
|
|
void vCmdDispatcherTask(void *param);
|
|
|
|
esp_err_t msg_register_handler(uint16_t id, msg_callback_t cb);
|
|
|
|
#endif
|