feat: port the remaining v1 API to the v2 controller

Profiles seed presets, a default zone and a palette, and clone with their
own copies; deleting a profile removes what it owned. Zones get the v1
list shape, set-current, current, clone and content-fragment. Devices are
keyed by MAC with v1 validation and identify. Patterns: definitions, OTA
file and manifest, upload, driver, and send over ESP-NOW (the led-driver
pattern sources are embedded in the firmware). Pixel outputs get v1
validation and a DDP/Art-Net/sACN test pattern. Sequences, palettes and
settings follow v1 replies and validation, and /ws forwards browser
messages to the drivers.

The resource handlers move out of api.c into res_*.c, patterns.c and
outputs.c. cJSON now allocates from PSRAM: the store had grown enough to
starve internal RAM and abort the mic at boot. /status reports
free_internal.

The Wi-Fi AP and led-tool routes are left out.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
jimmyandClaude Opus 5.5 committed 2026-11-03 09:58:17 +13:00
1 parent 4b42391a46
commit 57182188ba
30 files changed
+2846 -425

No files matched your search

+10
View File
@@ -1,5 +1,9 @@
#pragma once
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include "cJSON.h"
#include "esp_err.h"
#include "esp_http_server.h"
@@ -15,3 +19,9 @@
//
// mac=all means every ESP-NOW device in the devices collection. One request runs at a time.
esp_err_t drv_ota_register(httpd_handle_t server);
// Send one file the same way from C (macs as above). With commit, drivers that wrote it switch to it
// and reset. Returns the per-driver results (caller owns), or NULL with *err: ESP_ERR_INVALID_STATE
// when an update is running, ESP_ERR_NOT_FOUND with no drivers, ESP_ERR_INVALID_ARG for a bad list,
// ESP_ERR_INVALID_SIZE for a file over 64 KB.
cJSON *drv_ota_send(const char *macs, const char *path, const uint8_t *data, size_t len, bool commit, esp_err_t *err);