2e9272cc8a
引入成熟 IEC 60870-5-104 子站的只读子集(App/protocol/iec60870,28 个源文件 按原字节复制,UPSTREAM.sha256 记录来源,兼容补丁保留全部断言与容量),在其上 装配单属主共享核心(Start/Poll/Stop/Get_Status),并把标准 DTU 演示点表全量 接入为唯一真源。 - iec104_core:threadless 推进,poll 零等待,通知/交互/COV 扫描全部有界; 生命周期区分失败启动待重试、重复启动拒绝、断线保固化 RAM。 - iec104_dtu_table / iec104_source:标准 DTU 全点表注册,无数据源的点读 0, 遥控只做模拟状态可读回,不触碰实际出口。 - iec104_sim:仅窗口与独立服务模式起真实 TCP,无头黄金模式保持确定性假统计。 - test/host/iec104_dtu:独立真实 TCP 11 项、传输层 10 项、生命周期与借用负例。 验证:lvgl_sim 真实 TCP 11/11、传输 10/10,UI 像素回归未回退;AC5 单 TU 编译 0 错误 0 诊断。板端尚未切换:完整库闭包 RAM 超 92% 门禁净增预算 25730B, 结论为停止转实施,记录在 IEC104_MCU最小可行性验证.md。旧实现与 board 服务 保持原样,未提交 MDK 工程改动,未烧板。
32 lines
1.1 KiB
C
32 lines
1.1 KiB
C
/*
|
|
* 模块名称:IEC104 模拟器生命周期接口
|
|
* 作者:STM32F4-Base 项目组
|
|
* 说明:同进程协议适配,不调用 LVGL 或物理硬件输出。
|
|
*/
|
|
#ifndef IEC104_SIM_H
|
|
#define IEC104_SIM_H
|
|
#include <stdint.h>
|
|
|
|
typedef struct {
|
|
uint16_t port;
|
|
uint32_t duration_s;
|
|
int enabled;
|
|
int headless;
|
|
} iec104_sim_options_t;
|
|
|
|
/* Parse only the protocol options, rejecting golden/selftest combinations.
|
|
* Return 0 on success or 2 for invalid command-line usage. */
|
|
int iec104_sim_parse(int argc, char **argv, iec104_sim_options_t *options);
|
|
/* One main-thread owner, paired start/stop. 0 success, -1 failure. */
|
|
int iec104_sim_start(const iec104_sim_options_t *options);
|
|
int iec104_sim_poll(void);
|
|
int iec104_sim_stop(void);
|
|
int iec104_sim_enabled(void);
|
|
/* Finite service in this executable, without LVGL timers or a second process. */
|
|
int iec104_sim_run_headless(const iec104_sim_options_t *options);
|
|
/* Device wall clock only, shared with the protocol source, never the OS clock. */
|
|
uint64_t iec104_sim_clock_ms(void);
|
|
uint64_t iec104_sim_clock_local_s(void);
|
|
int iec104_sim_clock_set(uint32_t epoch_s);
|
|
#endif
|