DA14580 配对密码

版权声明:本文为博主原创加整合,欢迎大家转载,转载注明出处。 https://blog.csdn.net/jiangchao3392/article/details/84865453

平台: DA14580 官方SDK5.0.4

工程:\5.0.4\projects\target_apps\ble_examples\ble_app_all_in_one\Keil_5

位置:user_all_in_one.h   第60行

密码:123456

/// Passkey that is presented to the user and is entered on the peer device (MITM)
#define APP_SECURITY_MITM_PASSKEY_VAL      (123456)

user_all_in_one.c   第364-386 行

#if (BLE_APP_SEC)
void user_app_on_tk_exch_nomitm(uint8_t connection_idx,
                                    struct gapc_bond_req_ind const * param)
{
#if defined (USER_CFG_PAIR_METHOD_JUST_WORKS) || defined (USER_CFG_PAIR_METHOD_PASSKEY) || defined (USER_CFG_PAIR_METHOD_OOB)
    if (param->data.tk_type == GAP_TK_DISPLAY)
    {
        // By default we send hardcodded passkey
        uint32_t passkey = APP_SECURITY_MITM_PASSKEY_VAL;

        app_easy_security_tk_exch(connection_idx, (uint8_t*) &passkey, 4);
    }
    else if (param->data.tk_type == GAP_TK_OOB)
    {
        // By default we send hardcodded oob data
        uint8_t oob_tk[KEY_LEN] = APP_SECURITY_OOB_TK_VAL;

        app_easy_security_tk_exch(connection_idx, (uint8_t*) oob_tk, KEY_LEN);
    }
#else
    default_app_on_tk_exch_nomitm(connection_idx, param);
#endif
}

默认配对密码为:123456

连接上后:

在仿真运行中程序停在:

问题:

当主板上只有12M的主晶振,没有32.768K的晶振时会出现这种情况.

解决办法是:在da1458x_config_advanced.h 文件中修改

将:CFG_LP_CLK的  定义由:LP_CLK_XTAL32  改为 LP_CLK_RCX20

/****************************************************************************************************************/
/* Low Power clock selection.                                                                                   */
/*      -LP_CLK_XTAL32      External XTAL32 oscillator                                                          */
/*      -LP_CLK_RCX20       External internal RCX20 clock                                                       */
/*      -LP_CLK_FROM_OTP    Use the selection in the corresponding field of OTP Header                          */
/****************************************************************************************************************/
//#define CFG_LP_CLK              LP_CLK_XTAL32
#define CFG_LP_CLK  LP_CLK_RCX20

参考:https://wenku.baidu.com/view/01246627eef9aef8941ea76e58fafab069dc4465.html

https://support.dialog-semiconductor.com/forums/post/dialog-smartbond-bluetooth-low-energy-42-%E2%80%93-software-dialog-%E2%80%9Csmartbond%E2%80%9D%E7%B3%BB%E5%88%97%E4%BD%8E%E5%8A%9F%E8%80%97%E8%93%9D%E7%89%99bt42%E2%80%94%E8%BD%AF%E4%BB%B6-2

猜你喜欢

转载自blog.csdn.net/jiangchao3392/article/details/84865453
今日推荐