feat: ping drivers and push groups from the devices modal
POST /devices/ping broadcasts an ESP-NOW PING_REQ, collects the drivers' PING_RSP for timeout_s and registers or renames the ones that answer. A reply also counts as the driver being heard, so group updates go to it again. POST /devices/groups sends every ESP-NOW driver its groups and reports the acks. The devices modal gets the Ping drivers and Update groups buttons from main, with per-driver ping dots. UI files are now served with Cache-Control: no-cache and the firmware build hash as ETag, so a browser picks up a new UI right after an update instead of a day later. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
e7f238aebc
commit
19fea0b0a1
10 files changed
+559
-29
No files matched your search
@@ -14,6 +14,7 @@
|
||||
// resync [4C][23][ver u16] (driver -> us)
|
||||
// echo [4C][24][beat_idx u16] (driver -> us, bench)
|
||||
// ota [4C][26][sess u16][op][code] + arg (driver -> us, see drv_ota.h)
|
||||
// ping [4C][06][ping_id u32][len][name] (driver -> us, reply to [4C][05][ping_id])
|
||||
#define REL_FRAG_MAX 238 // inner packet bytes per frame; 4C 03/04 wrappers plus an envelope fit in one
|
||||
#define REL_MAX_FRAGS 32
|
||||
|
||||
@@ -58,6 +59,11 @@ void rel_set_announce_cb(rel_announce_cb_t cb);
|
||||
// A driver's OTA status reply (0x26), called from the rel task
|
||||
typedef void (*rel_ota_status_cb_t)(const uint8_t mac[6], const uint8_t *pkt, int len);
|
||||
void rel_set_ota_status_cb(rel_ota_status_cb_t cb);
|
||||
|
||||
// A driver's PING_RSP ([4C][06][ping_id u32][name len][name]), called from the rel task. Drivers
|
||||
// answer a broadcast PING_REQ ([4C][05][ping_id u32]) after a random 50-500 ms.
|
||||
typedef void (*rel_ping_cb_t)(const uint8_t mac[6], const uint8_t *pkt, int len);
|
||||
void rel_set_ping_cb(rel_ping_cb_t cb);
|
||||
void rel_stats(rel_stats_t *out);
|
||||
|
||||
// Milliseconds since the driver last acked; -1 if never. fails = consecutive unacked messages
|
||||
|
||||
Reference in new issue
Block a user