feat: 添加蓝牙多槽位绑定支持模块
- 新增 ble_bond_multi_module.c 实现多槽位蓝牙绑定管理功能 - 添加 ble_bond_multi_event 事件系统支持槽位状态广播 - 在 CMakeLists.txt 中注册新模块和事件源文件 - 更新 Kconfig 配置添加 BLINKY_BLE_BOND_MULTI 选项 - 修改 prj.conf 配置支持 4 个配对设备和 5 个身份标识 - 关闭默认 CAF ble_bond 模块使用自定义实现 - 更新 ui_settings_controller.h 接口支持槽位元数据设置 - 在 display_module.c 中添加事件订阅刷新UI显示 - 编写详细的设计文档 ble_multi_slot_design.md
This commit is contained in:
38
src/events/ble_bond_multi_event.c
Normal file
38
src/events/ble_bond_multi_event.c
Normal file
@@ -0,0 +1,38 @@
|
||||
#include "ble_bond_multi_event.h"
|
||||
|
||||
static void log_ble_bond_multi_event(const struct app_event_header *aeh)
|
||||
{
|
||||
const struct ble_bond_multi_event *event =
|
||||
cast_ble_bond_multi_event(aeh);
|
||||
|
||||
APP_EVENT_MANAGER_LOG(aeh, "slot:%u identity:%u op:%u occ:0x%02x",
|
||||
event->current_slot, event->active_identity_id,
|
||||
event->op, event->slot_occupied_bitmap);
|
||||
}
|
||||
|
||||
static void profile_ble_bond_multi_event(struct log_event_buf *buf,
|
||||
const struct app_event_header *aeh)
|
||||
{
|
||||
const struct ble_bond_multi_event *event =
|
||||
cast_ble_bond_multi_event(aeh);
|
||||
|
||||
nrf_profiler_log_encode_uint8(buf, event->current_slot);
|
||||
nrf_profiler_log_encode_uint8(buf, event->active_identity_id);
|
||||
nrf_profiler_log_encode_uint8(buf, event->op);
|
||||
nrf_profiler_log_encode_uint8(buf, event->slot_occupied_bitmap);
|
||||
}
|
||||
|
||||
APP_EVENT_INFO_DEFINE(ble_bond_multi_event,
|
||||
ENCODE(NRF_PROFILER_ARG_U8,
|
||||
NRF_PROFILER_ARG_U8,
|
||||
NRF_PROFILER_ARG_U8,
|
||||
NRF_PROFILER_ARG_U8),
|
||||
ENCODE("current_slot", "active_identity_id", "op",
|
||||
"slot_occupied_bitmap"),
|
||||
profile_ble_bond_multi_event);
|
||||
|
||||
APP_EVENT_TYPE_DEFINE(ble_bond_multi_event,
|
||||
log_ble_bond_multi_event,
|
||||
&ble_bond_multi_event_info,
|
||||
APP_EVENT_FLAGS_CREATE(
|
||||
APP_EVENT_TYPE_FLAGS_INIT_LOG_ENABLE));
|
||||
Reference in New Issue
Block a user