#pragma once // UDP bridge: carries the controller's ESP-NOW frames to a host that stands in for the radio, such as // led-simulator (settings "bridge": "host:port"). Down: dst_mac(6) + packet. Up: src_mac(6) + packet. // While it runs, nothing goes out over the air. #include #include #include #include "esp_err.h" typedef void (*bridge_rx_cb_t)(const uint8_t *src_mac, const uint8_t *data, int len); #define BRIDGE_DEFAULT_PORT 8766 // addr "host" or "host:port". Starts the receive task; frames arrive on cb. esp_err_t bridge_start(const char *addr, bridge_rx_cb_t cb); bool bridge_active(void); esp_err_t bridge_send(const uint8_t *dst_mac, const void *data, size_t len); // "host:port" while active, else NULL const char *bridge_addr(void);