Controller B updates from A: link_peer (pairing over the wire, encrypted credential handoff, B status + commands), ESP-NOW receive/unicast, Updates page with two cards; shared header maintenance frames; docs + wiki
Firmware / build (push) Successful in 7m1s

This commit is contained in:
2026-09-27 20:26:44 +02:00
parent 8338e4e300
commit 3e86ca3733
20 changed files with 884 additions and 50 deletions
+12 -1
View File
@@ -1,10 +1,14 @@
/*
* ESP-NOW Link Module (Controller A side, transmit only)
* ESP-NOW Link Module (Controller A side)
*
* Second transport for the A -> B link: every frame the UART manager builds
* is also broadcast over ESP-NOW, so B keeps receiving if the wire is lost.
* B dedupes on packet_id, so both paths may be live at once.
*
* Since 2026-09-27 the radio also listens: B unicasts STATUS frames back and
* A unicasts SECURE frames to B (LinkPeer). Frames received are handed to the
* handler set with setReceiveHandler(); sendTo() unicasts to one MAC.
*
* Radio policy: the Wi-Fi radio stays in STA mode permanently (the WiFi
* manager's "off" only stops scanning). A transmits on ESPNOW_CHANNEL unless
* associated to an access point, in which case the AP's channel is used and
@@ -34,4 +38,11 @@ bool isReady();
uint32_t sentCount();
uint32_t failCount();
/** Frames received from any sender (runs in the Wi-Fi task - copy and return). */
typedef void (*receive_handler_t)(const uint8_t mac[6], const uint8_t* frame, size_t len);
void setReceiveHandler(receive_handler_t handler);
/** Unicast one complete frame to a MAC (peer added on first use, unencrypted). */
bool sendTo(const uint8_t mac[6], const uint8_t* frame, size_t len);
} // namespace EspNowLink