This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[参考译文] CC2640R2F:多角色示例中的绑定管理器

Guru**** 2563960 points


请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/wireless-connectivity/bluetooth-group/bluetooth/f/bluetooth-forum/587809/cc2640r2f-bond-manager-in-multirole-example

器件型号:CC2640R2F

您好!

对于作为 SDK3.0的一部分提供的多角色示例,我的客户只想在外设角色中启用配对/绑定-实现这一点的最佳方法是什么? 只需注释一下 GAPBondMgr_LinkEst 函数中突出显示的部分是否足够?

是否有人已经有了这方面的示例?

谢谢、

Padmaja

bStatus_t GAPBondMgr_LinkEst (uint8 addrType、uint8 *pDevAddr、uint16 connHandle、uint8 Role)

三、会议的报告

//更新 LRU 绑定列表
gapBondMgrUpdateLrubondList(idx);


#if (host_config 和 central _CFG)
如果(Role = GAP_PROFILE_CENTRAL &&)则为其他值
gapBond_PairingMode = GAPBOND_Pairing_mode_initiate)

//如果处于中央位置并且正在启动且未绑定,则启动配对
void gapBondMgrAuthenticate( connHandle, addrType, NULL );

//调用应用程序状态回调
if (pGapBondCB && pGapBondCB->pPAIRStateCB)

pGapBondCB->pairStateCB( connHandle, GAPBOND_Pairing_State_started,Success );


#endif // host_config & central _CFG

#if (host_config 和 peripheral_CFG)
//如果外设和正在启动,则向发送从机安全请求
//启动配对或加密
如果(角色= GAP_PROFILE_PERipheral &&
gapBond_PairingMode = GAPBOND_Pairing_mode_initiate)

gapBondMgrSlaveSecurityReq( connHandle );

#endif //host_config 和 peripheral_CFG

返回(成功);

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好、Padmaja、

    如果我理解正确、您不希望主设备启动配对/绑定、但仍希望您接受从设备的请求。

    为此、应将 GAPBOND_Pairing_mode 更改为 GAPBOND_Pairing_mode_wait_for_Req。

    #define DEFAULT_Pairing_mode GAPBOND_Pairing_mode_wait_for_Req
    
    ...
    
    //设置 GAP 绑定管理
    器 uint8_t pairMode = default_pairing_mode;
    GAPBondMgr_SetParameter (GAPBOND_pairing_mode、sizeof (uint8_t)、&pairMode); 

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    谢谢 Marie。 但是、这可能会导致外设失去发送请求以启动配对或加密的选项-不确定它们的用例是否有必要这样做。 我们将尝试并与您确认。

    谢谢、
    Padmaja

    #if (host_config 和 peripheral_CFG)
    //如果外设和正在启动,则向发送从机安全请求
    //启动配对或加密
    如果(角色= GAP_PROFILE_PERipheral &&
    gapBond_PairingMode = GAPBOND_Pairing_mode_initiate)

    gapBondMgrSlaveSecurityReq( connHandle );

    #endif //host_config 和 peripheral_CFG

    返回(成功);