feat(ble): 添加BLE NUS模块替换原有的BLE串口功能

- 将ble_serial_module替换为ble_nus_module以使用标准的BLE NUS服务
- 移除不再使用的cdc_wrapper_module和相关事件处理
- 更新协议传输层抽象,支持USB CDC和BLE NUS两种传输方式
- 创建统一的proto_rx_event和proto_tx_event替代专用的串行通信事件
- 添加proto_common.h定义传输类型枚举
- 修改protocol_module接口以支持多传输方式
- 在prj.conf中启用CONFIG_BT_ZEPHYR_NUS配置选项
This commit is contained in:
2026-04-15 10:23:12 +08:00
parent c4b205b8a1
commit bc42a4dd63
25 changed files with 538 additions and 1499 deletions

View File

@@ -25,7 +25,7 @@ target_sources(app PRIVATE
src/ble_adv_uuid16.c
src/ble_bas_module.c
src/ble_hid_module.c
src/ble_serial_module.c
src/ble_nus_module.c
src/display_module.c
src/encoder_module.c
src/hid_flowctrl_module.c
@@ -35,15 +35,11 @@ target_sources(app PRIVATE
src/led_strip_module.c
src/time_sync_module.c
src/ui/ui_main.c
src/cdc_wrapper_module.c
src/protocol_module.c
src/usb_cdc_module.c
src/usb_device_module.c
src/usb_hid_module.c
src/events/bat_state_event.c
src/events/ble_serial_rx_event.c
src/events/ble_serial_tx_event.c
src/events/cdc_proto_tx_event.c
src/events/datetime_event.c
src/events/encoder_event.c
src/events/function_bitmap_update_event.c
@@ -56,10 +52,10 @@ target_sources(app PRIVATE
src/mode_switch_module.c
src/events/keyboard_hid_report_event.c
src/events/mode_switch_event.c
src/events/proto_rx_event.c
src/events/proto_tx_event.c
src/events/set_protocol_event.c
src/events/theme_rgb_update_event.c
src/events/time_sync_event.c
src/events/usb_cdc_rx_event.c
src/events/usb_cdc_tx_event.c
src/events/usb_state_event.c
)