refactor(app): 去掉 App/protocol 层,104 迁入 App/iec60870/104_port

IEC 60870 是标准族(含 104/101),原 App/protocol/ 把它拆成
iec60870/(vendor 核心)+ iec104/(我方适配)两棵同级树,多一层且
看不出「104 只维护一个」。现按标准族收口:

  App/protocol/iec60870        -> App/iec60870
  App/protocol/iec104          -> App/iec60870/104_port
  App/protocol/{README.md,.gitkeep}  删除
  App/protocol/iec104/iec104_asdu.h  删除(零 include / 零注册的孤儿)

vendor 子树(104/ common/ examples/)逐字节未改:91 个 R100 重命名、
git diff --cached -M 后 0 insertions / 0 deletions,另按字节直比 89/89
一致;UPSTREAM.sha256 差异集仍等于既有 17 项受控差异,非篡改。
适配层只改注释里的路径字样,无逻辑行。

门禁配套:
- coding-standard 的 exclude 不能写祖先 App/iec60870/——rename_ref 机械
  改出的祖先形态会把 2,191 行适配层一起豁免掉。改为三条精确前缀
  common/ 104/ examples/,适配层 11/11 回到受检;vendor 直调脚本仍报
  88 处违规而钩子 Skipped,证明确实由 exclude 生效而非空跑。
- check_registration 的 KNOWN_GAPS 键与理由文本同步到新路径。

验证:Keil 0 errors 0 warnings(Code=367464 RO-data=48492
RW-data=2288 ZI-data=173544),构建日志与 .d 依赖证明 5 个适配 .o
真被编入;模拟器 0 警告并跑通 iec104-tcp 13/13 真实 TCP 回环;
pre-commit 25 Passed / 0 Failed;doc-links 30 处问题全在
IEC60870-Slave/ 供应商快照,我方文档零新增。

顺带删掉仓根误入库且零引用的 _all_hook.txt 与 _scope.txt。
This commit is contained in:
2026-11-18 14:15:10 +08:00
parent 263b00277e
commit c0cef2fca0
167 changed files with 29172 additions and 7007 deletions
+2 -2
View File
@@ -4,7 +4,7 @@
Historical bench leg; acceptance criteria: docs/子系统设计/IEC104上行设计说明.md §8.
docs/子系统设计/IEC104上行设计说明.md §3/§4. Constants mirror
App/protocol/iec104/iec104_asdu.h / iec104_link.h.
App/iec60870/104_port/iec104_asdu.h / iec104_link.h.
Flow:
1. TCP connect device :2404 (factory default; --port overrides),
@@ -78,7 +78,7 @@ COT_ACT, COT_ACTCON, COT_ACTTERM = 6, 7, 8
COT_PN = 0x40 # cause byte bit6: negative confirm
# NOTE(2026-10-25 m104fix): THIS SLAVE USES THE B4 IN-HOUSE 6-BYTE ASDU HEAD --
# T/PN/RBT FLAGS LIVE IN THE CAUSE BYTE (bit7/bit6/bit4), byte[3] IS OA+EVI(bit7).
# SEE App/protocol/iec104/iec104_asdu.c iec104_asdu_put_hdr(). The old RX path read
# SEE App/iec60870/104_port/iec104_asdu.c iec104_asdu_put_hdr(). The old RX path read
# PN from byte[3] (standard 2-byte-COT habit) -> pn was ALWAYS False and a rejected
# command logged cot=71 (7|0x40), so actcon_of(type, True) could never match.
# Bench proof 2026-10-25 (V5-gap replay): two out-of-range C_SE writes