2026-03-14 08:12:17 +08:00

27 lines
1.8 KiB
Markdown
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.

## ADDED Requirements
### Requirement: Independent Twin-Port connection tracking
必须引入并运用 `TcpLogic_Start` 抽象接管双端口(5511, 5512) TCP 栈的心跳维持与发包等工作。不再直接向 CH32 WCHNET Socket 原口写入业务。
#### Scenario: Business TCP tasks initialize and start
- **WHEN** main 函数结束物理层网卡 ETH Setup 之后
- **THEN** 调用 `TcpLogic_Init` 并传入 UUID 开启内部监控服务,随后的状态流转由库自动接管。
### Requirement: Offset-based direct packetization
调用 `TcpLogic_BuildAndSendTemperatureFrame` 获取带偏移量的截断目标发送缓冲 `TcpTxBuffer_t`。由库在头部(`HeadOffset`)安全组装 TLV 等标头进而发送到 5512 端口发出。完全消除向以太网 Socket 递送前的高耗时大范围 Memcpy 拼包。
#### Scenario: Sub-frame sent efficiently after processed
- **WHEN** 触发的图像提取阶段完成后提交至 TCP 管理模块
- **THEN** 系统通过位运算写入帧头与校验位,在指定字节空间内原地打包并最终推入以太网发送缓冲区。
### Requirement: Remote Parameters updating via callbacks
必须注册实现监听由上位机下发的配置动作以及废料剔除等行为(基于 `ConfigUpdateCallback_t``DetectionResultCallback_t` 句柄),让这批回调充当系统动态控制信号输入源。
#### Scenario: Update Triggering config on the fly
- **WHEN** 通过 5511 端口收到控制主机的有效组包设置参数报文时
- **THEN** 主程序的事件机制会触发,自动更新 `Config2D_t` 结构体并通过 `Preprocess_Settings_Change` 影响处理流。
#### Scenario: NG defect removal trigger by Host
- **WHEN** 上台判别系统对某帧评估失败NG并发回报错标志包时
- **THEN** `OnHardwareReject` 回调函数被触发并让设定的 DO GPIO 电平翻转以排废。