当前位置: 代码迷 >> 综合 >> Nordic 52832 密码配对
  详细解决方案

Nordic 52832 密码配对

热度:42   发布时间:2023-11-22 21:54:54.0

一,蓝牙连接参数设置及初始化(gap_params_init())

static uint8_t DEVICE_NAME[11]    =   "AS8945_UART";  
#define MIN_CONN_INTERVAL               MSEC_TO_UNITS(20, 1250)            
#define MAX_CONN_INTERVAL               MSEC_TO_UNITS(75, 1250)             
#define SLAVE_LATENCY                   0                                          
#define CONN_SUP_TIMEOUT                MSEC_TO_UNITS(4000, 10000)            
#define FIRST_CONN_PARAMS_UPDATE_DELAY  APP_TIMER_TICKS(5000)                       
#define NEXT_CONN_PARAMS_UPDATE_DELAY   APP_TIMER_TICKS(30000)                      
#define MAX_CONN_PARAMS_UPDATE_COUNT    3                            static void gap_params_init(void)
{uint32_t                err_code;ble_gap_conn_params_t   gap_conn_params;ble_gap_conn_sec_mode_t sec_mode;ble_opt_t passkey_opt;							BLE_GAP_CONN_SEC_MODE_SET_OPEN(&sec_mode);err_code = sd_ble_gap_de