BLE设备(使用CC2541) : CC2541是否可以设置密码或者如何防止其他人连接BLE设备 ?
如果可以有参考吗?
谢谢!
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.
请前辈指教,
我的cc2540从机被连接的时候 需要输入密码的,我在
GAPBondMgr_ProcessGAPMsg( gapEventHdr_t *pMsg )
{
switch ( pMsg->opcode )
{
case GAP_PASSKEY_NEEDED_EVENT:
{
gapPasskeyNeededEvent_t *pPkt = (gapPasskeyNeededEvent_t *)pMsg;
if ( pGapBondCB && pGapBondCB->passcodeCB )
{
// Ask app for a passcode
pGapBondCB->passcodeCB( pPkt->deviceAddr, pPkt->connectionHandle, pPkt->uiInputs, pPkt->uiOutputs );
}
else
{
// No app support, use the default passcode
if ( GAP_PasscodeUpdate( gapBond_Passcode, pPkt->connectionHandle ) != SUCCESS )
{
VOID GAP_TerminateAuth( pPkt->connectionHandle, SMP_PAIRING_FAILED_PASSKEY_ENTRY_FAILED );
}
}
}
break;
这个里面看到 pPkt->uiInputs 这个是用户输入的密码,请问这个值传到哪里去了。我想判断这个值,如果和passcode相符就可以连接,
不相符就不连接。我想对这个手动输入密码进行判断,例如,输入 02 或者03 的话,我都认可密码就允许的。
请问在哪里修改? 谢谢!密码更新是用GAP_PasscodeUpdate这个函数么 谢谢