refactor(protocol): 新增 comm_protocol 协议收发解析层,ble_transport 退化为纯传输
- 删除 protocol.h,帧定义和标定命令码统一迁入 comm_protocol.h - 新增 comm_protocol.c:上行组包(CoP/标定响应)、下行解析+msgq 分发 - ble_transport 剥离所有协议解析和参数 getter,仅保留字节收发+rx 回调注册 - main.c 初始化顺序:ble_transport → comm_protocol → adv_start → cal_init - 更新 README 架构图和项目结构表,补充标定流程章节 - 更新 BALANCE_BOARD_PROTOCOL.md 增加标定命令/响应帧格式文档
This commit is contained in:
@@ -9,6 +9,8 @@
|
||||
|
||||
#include "ble_transport.h"
|
||||
#include "button.h"
|
||||
#include "calibration.h"
|
||||
#include "comm_protocol.h"
|
||||
#include "sensor.h"
|
||||
|
||||
#include <zephyr/kernel.h>
|
||||
@@ -27,8 +29,14 @@ int main(void) {
|
||||
LOG_INF("--- GML670 System (CoP Binary Protocol) ---");
|
||||
|
||||
ble_transport_init();
|
||||
comm_protocol_init();
|
||||
ble_transport_adv_start();
|
||||
|
||||
if (cal_init()) {
|
||||
LOG_ERR("Failed to initialize calibration");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (button_init()) {
|
||||
LOG_ERR("Failed to initialize buttons");
|
||||
return -1;
|
||||
|
||||
Reference in New Issue
Block a user