This commit is contained in:
lmx
2025-12-17 19:12:13 +08:00
parent c856031d2f
commit 01f442d636
3 changed files with 27 additions and 26 deletions

View File

@ -1,33 +1,33 @@
/* /*
************************************************************************************** **************************************************************************************
* - BLE Client 初始化和配置 * BLE Client 初始化和配置
* - 设备扫描和匹配按名称、MAC 地址、广播数据) * 设备扫描和匹配按名称、MAC 地址、广播数据)
* - 连接指定设备或自动连接(支持配对和绑定) * 连接指定设备或自动连接(支持配对和绑定)
* - 服务发现 (Service Discovery) 和特性 (Characteristic) 查找 * 服务发现 (Service Discovery) 和特性 (Characteristic) 查找
* - 数据读写 (Read, Write, Write Without Response) * 数据读写 (Read, Write, Write Without Response)
* - 数据通知 (Notify) 和指示 (Indicate) 的接收 * 数据通知 (Notify) 和指示 (Indicate) 的接收
* - 连接参数更新 * 连接参数更新
* - 功耗管理和状态机 * 功耗管理和状态机
* - 数据传输速率显示 (可选) * 数据传输速率显示
************************************************************************************** **************************************************************************************
*/ */
//====================================================================================== //======================================================================================
// 包含头文件 // 头文件
//====================================================================================== //======================================================================================
#include "system/app_core.h" // 应用程序核心相关定义 #include "system/app_core.h"
#include "system/includes.h" // 系统包含文件,提供基础类型和宏定义 #include "system/includes.h"
#include "app_config.h" // 应用程序配置宏定义 #include "app_config.h"
#include "app_action.h" // 应用程序动作或状态机相关定义 #include "app_action.h"
#include "btstack/btstack_task.h" // BTstack 任务相关头文件 #include "btstack/btstack_task.h"
#include "btstack/bluetooth.h" // Bluetooth 核心 API 定义 #include "btstack/bluetooth.h"
#include "user_cfg.h" // 用户自定义配置 #include "user_cfg.h"
#include "vm.h" // Virtual Machine (VM) 存储相关接口 #include "vm.h"
#include "btcontroller_modules.h" // 蓝牙控制器模块定义 #include "btcontroller_modules.h"
#include "bt_common.h" // 蓝牙通用定义 #include "bt_common.h"
#include "le_client_demo.h" // LE Client Demo 相关头文件 (本文件对应的头文件) #include "le_client_demo.h"
#include "le_common.h" // LE 通用定义 #include "le_common.h"
#include "ble_user.h" // BLE 用户相关定义 #include "ble_user.h"
//====================================================================================== //======================================================================================
// 功能使能宏定义 // 功能使能宏定义
@ -43,8 +43,9 @@
// 是否显示 TX (发送) 数据速率 // 是否显示 TX (发送) 数据速率
#define SHOW_TX_DATA_RATE 1 #define SHOW_TX_DATA_RATE 1
// LE_DEBUG_PRINT_EN: 控制 BLE 相关日志输出的宏 //log显示
#if LE_DEBUG_PRINT_EN #define client_log 1
#if client_log == 1
/* #define log_info printf */ /* #define log_info printf */
#define log_info(x, ...) printf("[LE_CLIENT]" x "\n", ## __VA_ARGS__) // 格式化打印日志信息,添加前缀 "[LE_CLIENT]" #define log_info(x, ...) printf("[LE_CLIENT]" x "\n", ## __VA_ARGS__) // 格式化打印日志信息,添加前缀 "[LE_CLIENT]"
#define log_info_hexdump put_buf // 打印十六进制数据 (假设 put_buf 是一个 hex dump 函数) #define log_info_hexdump put_buf // 打印十六进制数据 (假设 put_buf 是一个 hex dump 函数)
@ -302,7 +303,7 @@ static void default_report_data_deal(att_data_report_t *report_data, target_uuid
} }
// 默认要匹配的远程设备名称 1 // 默认要匹配的远程设备名称 1
static const u8 test_remoter_name1[] = "CM-22222"; static const u8 test_remoter_name1[] = "X100_TEST";
// static const u8 test_remoter_name1[] = "AC637N_MX(BLE)"; // 备选名称 // static const u8 test_remoter_name1[] = "AC637N_MX(BLE)"; // 备选名称
// static const u8 test_remoter_name2[] = "AC630N_HID567(BLE)"; //备选名称 // static const u8 test_remoter_name2[] = "AC630N_HID567(BLE)"; //备选名称

Binary file not shown.