FR306设备做ble host/central流程问题



  • FR306做ble host连接FR8016HA的从,
    从设备设置了pin码,123456
    FR306流程不知道怎么进行下一步了,没有发现设置pin码的地方
    case GAP_EVT_SMP_TK_REQ:
    {
    printf("gap_callback: GAP_EVT_SMP_TK_REQ, conidx:%d, tk_type:%d\r\n", event->param.tk_req.conidx, event->param.tk_req.tk_type
    uint32_t tk = 123456;
    gap_security_tk_rsp(event->param.tk_req.conidx, tk, true);
    }
    break;
    看注释,设置了这个gap_evt,但是没有触发,不知道如何进行下一步流程了。
    附图手机连接蓝牙从,和FR306连接蓝牙从时
    蓝牙从,FR8016HA的LOG
    0_1749695584502_63663d6f-e349-4c14-b588-df0f3ff6c2ec-5e3cd3d10a54ed3987edc4d8540f321.png
    0_1749695605217_b2096ee0-ce42-4bd5-9451-5de339f4026b-fbe3b5cf6dde04282cf5a7fd4862a8e.png



  • 配置初始化的参数
    gap_security_param_t smp_param = {
    .mitm = true,
    .secure_connection = false,
    .bond = true,
    .rsp_mode = ENABLE_AUTO_RSP,
    .oob_used = GAP_OOB_AUTH_DATA_NOT_PRESENT,
    .io_cap = GAP_IO_CAP_KB_ONLY, // OR GAP_IO_CAP_KB_ONLY
    };
    gap_security_param_init(&smp_param);
    第一在GAP_EVT_SMP_SEC_REQ中加入绑定
    0_1749713107039_382ab402-6168-4f74-92c5-7bb7a70a2783-image.png !
    第二、加入在GAP_EVT_SMP_TK_REQ加入填写密钥
    0_1749713144449_ccb76782-0389-4dd6-be59-ae2b4783e6d7-image.png