feat(ota): 实现 GD32 Flash 存储抽象层和 OTA 协调器接口解耦

- 新增 storage/gd32_flash_store.cpp 组件,提供 GD32 Flash 存储抽象层
- 修改 ota_coordinator.cpp/h 使其继承 IRelayListener 接口,实现与
  OtaRelay 的解耦设计
- 将 GD32 相关存储操作统一通过协调器访问,解决 H3 绕过协调器的问题
- 添加完整的 Doxygen 注释到所有公共接口和关键函数
- 更新 CMakeLists.txt 构建配置,添加 storage 组件依赖
- 重构元数据加载/清除操作使用 Gd32FlashStore 实例而非 OtaRelay 直接访问
- 添加中继事件回调接口实现,使 OtaRelay 可通知协调器状态变化
This commit is contained in:
小龙虾
2026-06-21 23:48:31 +08:00
parent 3fff959a2b
commit 00ce8dbbb5
30 changed files with 2087 additions and 1541 deletions
+5
View File
@@ -108,6 +108,11 @@ bool DebugLog::ringPopOldest(char *out, size_t out_size, int *out_len)
return true;
}
/**
* @brief 将环形缓冲区所有日志导出为 JSON 数组字符串。
* @param out_len 输出 JSON 字符串长度。
* @return 动态分配的 JSON 字符串,调用者须 free()。
*/
char* DebugLog::ringDrainJson(int *out_len)
{
if (!out_len) return NULL;