Files
DataRouter/CHANGELOG.md
T

63 lines
3.0 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.
# Changelog
## [Unreleased]
### ⚠ Breaking Changes
- **API 前缀重命名**:所有 `datarouter_*` / `DATAROUTER_*` 改为 `dr_*` / `DR_*`
- `datarouter_init()` → `dr_init()`
- `datarouter_port_create()` → `dr_port_create()`
- `datarouter_send_<id>()` → `dr_send_<id>()`
- `datarouter_on_recv_<id>()` → `dr_on_recv_<id>()`
- `DATAROUTER_SEND_sensor` → `DR_SEND_sensor`
- `datarouter_port_t` → `dr_port_t`
- 配置宏 `DATAROUTER_SEND(...)` / `DATAROUTER_RECV(...)` → `DR_SEND(...)` / `DR_RECV(...)`
- **发送函数不再接收 port_id**:`dr_send_<id>(data, len)` 自动广播到所有 send_type 匹配的端口
- **端口移除 `recv_type`**:端口只保留 `send_type` + handler 列表,接收侧由用户自行调用 `dr_on_recv_<id>()`
### 🚀 新功能
- **自动广播路由**:调用 `dr_send_<id>(data, len)` 时遍历所有端口,自动匹配 `send_type`,逐一调用 handler
- **外部配置覆盖**:`datarouter.h` 通过 `__has_include(<datarouter_config.h>)` 优先加载用户配置,找不到时回退到库默认配置
- **配置模板**:新增 `datarouter_config_template.h` 供用户快速自定义
- **CMake Presets**:新增 `CMakePresets.json`,覆盖 7 种构建配置
- **Cortex-M 编译矩阵**:`DR_COMPILE_CHECK=ON` 自动检测 `arm-none-eabi-gcc`,验证 CM3 / CM4(soft/hard) / CM7(soft/hard-sp/hard-dp) 6 个变体的编译兼容性
- **嵌入式源文件直用模式**:`DR_SOURCE_ONLY=ON` 只暴露源码路径,用户将 `datarouter.c` 加入自身 target 以继承全部编译标志,消除 VFP/Thumb ABI 不匹配
- **Gitea CI 工作流**:新增 `.gitea/workflows/ci.yml`,PR/推送时执行 host 测试 + Cortex-M 编译矩阵
- **Release 工作流更新**:`.gitea/workflows/release.yml` 新增 Cortex-M compile matrix 步骤
### ✨ 增强
- 支持一个端口注册多个 handler(默认上限 4),发送时逐一调用
- 运行时通过 `dr_port_remove_handler()` / `dr_port_clear_handlers()` 动态改变路由
- 发送能力和接收能力分开声明,按需组合
### 📚 文档
- 新增 `DESIGN.md`(含 8 幅 PlantUML 架构图)
- 新增 `TEST_CASES.md`(22 个测试用例文档)
- 新增 `CHANGELOG.md`
- `README.md` 全面更新,覆盖嵌入式构建、Preset 用法、API 参考
- 所有源文件添加中文 Doxygen 注释
### 🧪 测试
- 22 个单元测试,覆盖端口管理、send_type/handler 设置、自动广播路由、类型过滤、移除/删除后路由、接收回调、能力元数据
### 🐛 修复
- 修复 ARM 交叉编译时 VFP 参数不匹配问题(通过 `DR_SOURCE_ONLY` 模式)
- 修复 `#undef` 宏名称残留旧前缀
---
## [1.0.0] - 2024-01-01
### 🚀 新功能
- 初始版本发布
- X-macro 代码生成:编译期声明通道,自动生成枚举、发送函数、回调声明
- 动态端口管理:创建、删除、运行时切换能力
- 弱符号回调默认实现
- Gitea Release 工作流:自动化构建 linux-amd64 / linux-arm64 / linux-armhf / windows-amd64 / baremetal-arm32