cc2541与lightblue密码配对连接
cc2541作为从机广播。手机作为主机,当打开手机上的lightblue时会弹出输入密码配对的对话框,但是此时cc2541已经显示从广播状态变为连接状态,手机上不管输入正确或者错误密码都会连接上,怎么回事?
// Setup the GAP Bond Manager
{
uint32 passkey = 111111; // passkey "000000"
//uint8 pairMode = GAPBOND_PAIRING_MODE_WAIT_FOR_REQ;
uint8 pairMode = GAPBOND_PAIRING_MODE_INITIATE;
uint8 mitm = TRUE;
uint8 ioCap = GAPBOND_IO_CAP_DISPLAY_ONLY;
uint8 bonding = TRUE;
GAPBondMgr_SetParameter( GAPBOND_DEFAULT_PASSCODE, sizeof ( uint32 ), &passkey );
GAPBondMgr_SetParameter( GAPBOND_PAIRING_MODE, sizeof ( uint8 ), &pairMode );
GAPBondMgr_SetParameter( GAPBOND_MITM_PROTECTION, sizeof ( uint8 ), &mitm );
GAPBondMgr_SetParameter( GAPBOND_IO_CAPABILITIES, sizeof ( uint8 ), &ioCap );
GAPBondMgr_SetParameter( GAPBOND_BONDING_ENABLED, sizeof ( uint8 ), &bonding );
}
Frank,
iOS本身的连接是不需要配对的。所以不管配对结果怎么样,连接是建立的。