refactor: move the v2 controller to the repository root
The ESP-IDF project, docs, tools, tests and web UI move from v2/ to the root, and the Makefile, README, build scripts and test runner drop the v2/ prefix. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
71bd320661
commit
1c222771a5
66 files changed
+30
-31
No files matched your search
@@ -0,0 +1,28 @@
|
||||
#pragma once
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include "cJSON.h"
|
||||
|
||||
// Native binary (v2) driver envelope, byte-compatible with
|
||||
// src/util/binary_envelope.py. Presets and select entries go in separate
|
||||
// frames so each frame is 5 + blob <= ENV_FRAME_MAX (one ESP-NOW payload).
|
||||
#define ENV_FRAME_MAX 224 // + 4C 04 <group> wrapper must fit REL_FRAG_MAX
|
||||
#define ENV_BLOB_MAX (ENV_FRAME_MAX - 5)
|
||||
|
||||
typedef struct {
|
||||
uint8_t data[ENV_BLOB_MAX + 1]; // data[0] is the entry count
|
||||
size_t len;
|
||||
} env_blob_t;
|
||||
|
||||
void env_blob_init(env_blob_t *b);
|
||||
|
||||
// Append one preset (short keys p,c,d,b,a,n1..n6 or long pattern/colors/...); false if it does not fit
|
||||
bool env_add_preset(env_blob_t *b, const char *name, const cJSON *preset);
|
||||
// Append one select entry; step < 0 means none
|
||||
bool env_add_select(env_blob_t *b, const char *device, const char *preset, int step);
|
||||
|
||||
// Frame with either a presets blob or a select blob (the other empty);
|
||||
// brightness < 0 leaves device brightness unchanged. Returns frame length.
|
||||
size_t env_frame(uint8_t *out, int brightness, const env_blob_t *presets, const env_blob_t *select);
|
||||
Reference in new issue
Block a user