/* * SPDX-License-Identifier: Apache-2.0 * * Messages from led-controller over ESP-NOW: envelopes (0x4C CMD / GROUP_CMD, v2 and v3 binary), v1 JSON * objects, and the group list. They are applied as the MicroPython driver applies them (controller_messages.py). */ #pragma once #include #include #include "cJSON.h" /** @brief Load the saved group list. Call once, after NVS is up. */ void ctrl_init(void); /** @brief Handle one controller message from mac. Runs in the ESP-NOW link task. */ void ctrl_handle(const uint8_t mac[6], const uint8_t *data, size_t len); /** @brief This driver's ANNOUNCE packet (boot hello, with its settings) into out. Returns its length. */ size_t ctrl_build_announce(uint8_t *out, size_t cap); /** @brief The group ids this driver is in, as a new JSON array. The caller frees it. */ cJSON *ctrl_groups_json(void);