Files
smart-home-control-system/scripts/demo.txt
T
sambu b96d5690aa feat(M2): 实现核心/存储/网络/应用四层并端到端跑通
- 28 个源文件落地:core(device/sensor/scene/schedule/system)、hal(gpio/i2c/uart/sim)、
  protocol(crc/frame)、storage(config/logger/storage)、net(json/http_request/http_server/router)、
  web(内嵌单页界面)、app(menu/cli/commands/replay/web_app)、common(新增 bitops.c)
- 全文件在 -std=c17 -Wall -Wextra -Wpedantic -Werror 下零告警

跨模块缺陷修复(集成阶段发现):
1. HAL I2C 字节序与业务层不一致(模拟后端小端 / sensor.c 按大端解析),
   导致 16 路采样全部被判「传感器故障」、温度显示 125.0℃;统一为大端后
   读数恢复 20.4℃ / 50.0%RH,报警等级「正常」
2. 采样路数固定 16 路导致同一探头重复 16 条;改为「传感器设备台数(至少 1 路)」,
   system_tick 与 CLI sensors 命令保持一致
3. 补齐 app.h 中缺失的 app_run_web()(新增 src/app/web_app.c),并给监听套接字
   设 1 秒接收超时,使服务主循环得以周期性推进 system_tick
4. 收敛接口约束:schedule.h 只读矩阵接口去 const(C17 -Wpedantic 不允许
   非 const → const 的二维数组隐式转换);system_save/system_render_dashboard
   形参同步去 const;网页 JS 由整段字面量改为分段字面量 + 首次拼装(ISO C99
   强制支持的 4095 字节单字面量下限);HTTP 响应体缓冲 4KB → 16KB

验证:debug/release/asan 三预设零告警构建通过;ctest 3/3;scripts/acceptance.sh
A1~A7 全通过;HTTP 17 条路由实测(首页 2107B / CSS 2313B / JS 6740B / 设备列表 8 台 /
传感器 / 日志 / 报表 / 配置读写 / 协议帧 CRC 校验 / 自检 / 404 兜底);回放脚本 23/23 命令成功
2026-09-14 20:17:49 +08:00

28 lines
613 B
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 智能家居控制系统 —— 无人值守演示脚本(回放用)
# '#' 开头为注释;空行忽略。运行:./build/debug/smart_home --replay scripts/demo.txt
help
list
list 灯
power 1 on
dim 1 70
power 3 off
# 注:离线设备会被拒绝——#8 阳台灯为离线,power 8 on 返回 SHS_ERR_STATE,
# 该负例由 scripts/acceptance.sh 与单元测试断言,回放脚本只走正常路径
scene 回家
sensors
ac 2 24
scene 睡眠
schedule set 0 7 1
schedule set 0 9 2
schedule set 0 18 3
schedule set 0 23 4
schedule show
report
frame 1 2 1
frame 1 1 0
log 10
save
list
selftest
quit