feat: sequences v2, driver frame sync and submodule updates

- Sequences v2, bridges and sim-controller changes from the working tree.
- Records the led-driver, led-tool and led-simulator commits above.
- Includes dmx-driver/ and graphify-out/.

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
This commit is contained in:
jimmyandClaude Haiku 5.5 committed 2026-11-11 14:10:56 +13:00
1 parent 3f8f67823b
commit 50ca46fee6
657 files changed
+15818 -1107

No files matched your search

+32 -3
View File
@@ -5,6 +5,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "api_util.h"
#include "envelope.h"
#include "esp_log.h"
#include "esp_timer.h"
@@ -959,17 +960,32 @@ void engine_groups_push_all(int *total, int *sent, int *failed)
static void on_announce(const uint8_t mac[6], const uint8_t *pkt, int len)
{
char name[48] = "";
char *cfg = NULL; // the driver's settings as JSON
int cfg_len = 0;
if (pkt[0] == '{') {
cJSON *j = cJSON_ParseWithLength((const char *)pkt, len);
const cJSON *n = cJSON_GetObjectItem(j, "name");
if (cJSON_IsString(n)) {
snprintf(name, sizeof(name), "%s", n->valuestring);
}
const cJSON *c = cJSON_GetObjectItem(j, "cfg");
if (cJSON_IsObject(c)) {
cfg = cJSON_PrintUnformatted(c);
cfg_len = cfg ? (int)strlen(cfg) : 0;
}
cJSON_Delete(j);
} else if (len > 3 && pkt[2] > 0 && 3 + pkt[2] <= len) { // 4C 01 <len><name> ...
snprintf(name, sizeof(name), "%.*s", pkt[2] < sizeof(name) - 1 ? pkt[2] : (int)sizeof(name) - 1, pkt + 3);
int co = 3 + pkt[2] + 6; // after u16 num_leds, colour order, startup mode, brightness, type: [len][json]
if (co < len && pkt[co] > 0 && co + 1 + pkt[co] <= len) {
cfg = (char *)pkt + co + 1;
cfg_len = pkt[co];
}
}
if (!name[0]) {
if (pkt[0] == '{') {
free(cfg);
}
return;
}
char hex[13];
@@ -985,11 +1001,24 @@ static void on_announce(const uint8_t mac[6], const uint8_t *pkt, int len)
cJSON_AddStringToObject(rec, "type", "led");
cJSON_AddStringToObject(rec, "transport", "espnow");
cJSON_AddStringToObject(rec, "address", hex);
api_apply_driver_cfg(rec, cfg, cfg_len);
store_save("device");
ESP_LOGI(TAG, "new driver %s (%s)", name, hex);
} else if (!cJSON_IsString(old) || strcmp(old->valuestring, name) != 0) {
cJSON_ReplaceItemInObject(rec, "name", cJSON_CreateString(name));
store_save("device");
} else {
bool changed = false;
if (!cJSON_IsString(old) || strcmp(old->valuestring, name) != 0) {
cJSON_ReplaceItemInObject(rec, "name", cJSON_CreateString(name));
changed = true;
}
if (api_apply_driver_cfg(rec, cfg, cfg_len)) {
changed = true;
}
if (changed) {
store_save("device");
}
}
if (pkt[0] == '{') {
free(cfg);
}
send_groups(mac, name, false);
store_unlock();