您好!
对于作为 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
返回(成功);
}