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:
46
inc/events/ble_bond_multi_event.h
Normal file
46
inc/events/ble_bond_multi_event.h
Normal file
@@ -0,0 +1,46 @@
|
||||
#ifndef BLINKY_BLE_BOND_MULTI_EVENT_H_
|
||||
#define BLINKY_BLE_BOND_MULTI_EVENT_H_
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include <app_event_manager.h>
|
||||
#include <app_event_manager_profiler_tracer.h>
|
||||
#include <zephyr/bluetooth/addr.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define BLE_BOND_MULTI_DISPLAY_NAME_MAX_LEN 32U
|
||||
#define BLE_BOND_MULTI_BLE_SLOT_COUNT 3U
|
||||
#define BLE_BOND_MULTI_DONGLE_SLOT_ID 4U
|
||||
|
||||
enum ble_bond_multi_op {
|
||||
BLE_BOND_MULTI_OP_NONE = 0,
|
||||
BLE_BOND_MULTI_OP_REFRESH,
|
||||
BLE_BOND_MULTI_OP_SWITCH,
|
||||
BLE_BOND_MULTI_OP_ERASE,
|
||||
};
|
||||
|
||||
struct ble_bond_multi_slot_meta {
|
||||
bool occupied;
|
||||
bt_addr_le_t last_peer_addr;
|
||||
char display_name[BLE_BOND_MULTI_DISPLAY_NAME_MAX_LEN];
|
||||
};
|
||||
|
||||
struct ble_bond_multi_event {
|
||||
struct app_event_header header;
|
||||
uint8_t current_slot;
|
||||
uint8_t active_identity_id;
|
||||
enum ble_bond_multi_op op;
|
||||
uint8_t slot_occupied_bitmap;
|
||||
struct ble_bond_multi_slot_meta slots[BLE_BOND_MULTI_BLE_SLOT_COUNT];
|
||||
};
|
||||
|
||||
APP_EVENT_TYPE_DECLARE(ble_bond_multi_event);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* BLINKY_BLE_BOND_MULTI_EVENT_H_ */
|
||||
@@ -12,6 +12,8 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
struct ble_bond_multi_slot_meta;
|
||||
|
||||
void ui_settings_controller_open(void);
|
||||
void ui_settings_controller_close(void);
|
||||
bool ui_settings_controller_back(void);
|
||||
@@ -27,6 +29,9 @@ const char *ui_settings_ble_current_label(void);
|
||||
const char *ui_settings_ble_slot_label(uint8_t slot);
|
||||
void ui_settings_ble_select_slot(uint8_t slot);
|
||||
void ui_settings_ble_erase_current(void);
|
||||
void ui_settings_ble_set_current_slot(uint8_t slot);
|
||||
void ui_settings_ble_set_slot_meta(uint8_t slot,
|
||||
const struct ble_bond_multi_slot_meta *meta);
|
||||
void ui_settings_theme_set_current(struct theme_rgb theme);
|
||||
const char *ui_settings_theme_current_name(void);
|
||||
uint8_t ui_settings_theme_current_index(void);
|
||||
|
||||
Reference in New Issue
Block a user