Files
led-driver/main/usb_cfg.h
T
jimmyandClaude Opus 5.5 762ec338bc feat: JSON API on the USB serial port for led-tool
One request per line on USB-Serial-JTAG (@api {"id","method","path","body"}),
one @api envelope back; @reboot restarts. Requests run on the httpd task
through the same dispatcher as the WebSocket, so the checks match the web UI
and never race an HTTP handler. Replies go out in chunks under a lock that log
output shares, so a reply over the TX buffer size isn't dropped and log lines
can't land inside one. The primary console moves to USB-Serial-JTAG.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 22:34:36 +13:00

25 lines
574 B
C

/*
* SPDX-License-Identifier: Apache-2.0
*/
#pragma once
#include "esp_err.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief Serve the JSON API on the USB serial port (USB-Serial-JTAG), for led-tool.
*
* One request per line, one reply per line; every other line on the port is log output:
* @api {"id": n, "method": "GET" or "POST", "path": "/api/...", "body": ..., "host": optional}
* -> @api {"id": n, "status": 200, "body": "<JSON text>"}
* @reboot -> @ok, then the device restarts
*/
esp_err_t usb_cfg_start(void);
#ifdef __cplusplus
}
#endif