feat(factory): support USB CDC alongside UART CLI

This commit is contained in:
chenjintao
2026-10-27 15:04:14 +08:00
parent 6116a67d5f
commit 002967b21f
13 changed files with 583 additions and 69 deletions
+9 -1
View File
@@ -613,12 +613,20 @@ void domain_runtime_restart(void);
*
* `read_bytes` returns bytes read (0 on timeout, <0 on error). A zero timeout
* polls once; negative timeouts are invalid and return <0. Used by the factory
* provisioning CLI.
* provisioning CLI. install幂等,安装锁最多等待100ms;至少一路可用即成功。
* 原有read/write_line操作UART0,CDC使用下方独立入口。
*/
esp_err_t domain_runtime_console_install(void);
int domain_runtime_console_read_bytes(uint8_t *buf, size_t len, int timeout_ms);
void domain_runtime_console_write_line(const char *line);
/** 独立USB Serial/JTAG CDC端点:read语义同UART,禁用/不可用返回负数。
* write为尽力发送(共250ms入队预算,超时可能已发送部分),不切换或广播到UART。
* 两路输入必须由同一个CLI任务消费,并各自维护行缓冲。驱动常驻,不随CLI stop卸载。
*/
int domain_runtime_console_read_cdc_bytes(uint8_t *buf, size_t len, int timeout_ms);
void domain_runtime_console_write_cdc_line(const char *line);
void domain_runtime_behavior_set_keep_awake(bool keep_awake);
esp_err_t domain_runtime_behavior_play_prompt(domain_wifi_prompt_id_t prompt);
esp_err_t domain_runtime_behavior_play_prompt_file(const char *path);