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:
ypc 2026-07-08 16:23:49 +08:00
parent e1736315e4
commit aed907a977
4 changed files with 17 additions and 15 deletions

View File

@ -41,7 +41,7 @@
| Modbus 主站管理 | `libmodbus_m`(原工程自研模块,导入+适配) | ✅ |
| 通讯通道解码 | `libcom_decode` | ⬜ |
| Web 管理服务 | `libweb_server` | ⬜ |
| 主程序入口 | `RTU` | ⬜ |
| 主程序入口 | `RTU`(系统模块框架 + app_modules.c + main.c | ✅ |
## 阶段 3系统集成

View File

@ -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 ==="

View File

@ -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_ */

View File

@ -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);
}