refactor(libmodbus_m): 解耦线程模块,移除对外头文件
- 删除 myModbusM.h: 线程模块不再对外暴露头文件 - copy_headers.sh: 移除 libmodbus_m 拷贝 - modbus_m.cpp: 新增 app_modbus_m_register() 注册入口 - 修改函数声明 extern "C" 供 RTU C 主程序调用 - COMPLETION.md: RTU 标记完成 设计原则: system/ 下除 RTU 外所有线程模块不对外提供头文件, 通过 app_module_register() 动态注册,实现完全解耦
This commit is contained in:
parent
e1736315e4
commit
aed907a977
|
|
@ -41,7 +41,7 @@
|
|||
| Modbus 主站管理 | `libmodbus_m`(原工程自研模块,导入+适配) | ✅ |
|
||||
| 通讯通道解码 | `libcom_decode` | ⬜ |
|
||||
| Web 管理服务 | `libweb_server` | ⬜ |
|
||||
| 主程序入口 | `RTU` | ⬜ |
|
||||
| 主程序入口 | `RTU`(系统模块框架 + app_modules.c + main.c) | ✅ |
|
||||
|
||||
## 阶段 3:系统集成
|
||||
|
||||
|
|
|
|||
|
|
@ -106,6 +106,5 @@ copy_proto_module "lib60870" "myIec60870.h"
|
|||
# 系统模块(system/)
|
||||
# ================================================================
|
||||
copy_sys_header "mySystem.h"
|
||||
copy_sys_module "libmodbus_m" "myModbusM.h"
|
||||
|
||||
echo "=== done ==="
|
||||
|
|
|
|||
|
|
@ -1,13 +0,0 @@
|
|||
/**
|
||||
* @file myModbusM.h
|
||||
* @brief Modbus 主站管理模块统一入口
|
||||
* @details 原工程自研模块,通过 XML 配置通道和点表,轮询读取 Modbus 从站数据,
|
||||
* 写入 libdatacenter,支持遥控/遥调异步写入。
|
||||
* 调用者只需 #include "myModbusM.h"。
|
||||
*/
|
||||
#ifndef _MY_MODBUS_M_H_
|
||||
#define _MY_MODBUS_M_H_
|
||||
|
||||
#include "modbus_m.h"
|
||||
|
||||
#endif /* _MY_MODBUS_M_H_ */
|
||||
|
|
@ -1017,3 +1017,19 @@ void *app_modbus_m(void *arg)
|
|||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// ==================== 模块注册 ====================
|
||||
|
||||
static stru_app g_app_modbus_m;
|
||||
|
||||
extern "C" void app_modbus_m_register(void)
|
||||
{
|
||||
memset(&g_app_modbus_m, 0, sizeof(g_app_modbus_m));
|
||||
g_app_modbus_m.name = MODULE_MODBUS_M;
|
||||
|
||||
app_module_register(MODULE_MODBUS_M,
|
||||
app_modbus_m_init1,
|
||||
app_modbus_m_init2,
|
||||
app_modbus_m,
|
||||
&g_app_modbus_m);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue