DA14580 配对密码

平台: 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

 

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值