Refactor ESP-NOW air protocol to nanopb protobuf.
Add esp_now_messages.proto with EspNowMessage types, encode/decode helpers, and Makefile targets to regenerate firmware and UART schemas together. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
#ifndef ESP_NOW_PROTO_H
|
||||
#define ESP_NOW_PROTO_H
|
||||
|
||||
#include "esp_err.h"
|
||||
#include "esp_now_messages.pb.h"
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#define ESPNOW_PB_MAX_SIZE 250
|
||||
|
||||
esp_err_t esp_now_proto_encode(const alox_EspNowMessage *msg, uint8_t *buf,
|
||||
size_t buf_size, size_t *out_len);
|
||||
|
||||
esp_err_t esp_now_proto_decode(const uint8_t *data, size_t len,
|
||||
alox_EspNowMessage *msg);
|
||||
|
||||
void esp_now_proto_setup_presence_encode(alox_EspNowSlavePresence *presence,
|
||||
const uint8_t mac[6]);
|
||||
|
||||
void esp_now_proto_setup_message_decode(alox_EspNowMessage *msg,
|
||||
uint8_t mac_out[6]);
|
||||
|
||||
const alox_EspNowSlavePresence *
|
||||
esp_now_proto_get_presence(const alox_EspNowMessage *msg);
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user