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 band manager



关于band,有几个疑问想问一下:

1)今天试验,peripheral的passcode=15,用手机连,输入密码,配对成功。将peripheral的passcode改为13,重新烧写peripheral,再用手机连,不用再输入密码了,直接连上了。这个配对只要配成功了一次,以后就再也不用配对了么?

2)我想用按键来动态改变passcode,在keyhandle程序中这样写:

if ( keys & HAL_KEY_SW_2 )
{

SK_Keys |= SK_KEY_RIGHT;

ComPrint("passcode change\r\n");
GAPRole_TerminateConnection();
GAPBondMgr_SetParameter( GAPBOND_ERASE_ALLBONDS, 0, NULL );
passcode = 13;

}

passcode 是全局变量,初始化为15。还是刚才操作,没有配对的情况下,手机连上peripheral,要输入密码,配对成功。按peripheral上的键,passcode被改为了13。手机重新连,也能连得上。GAPBondMgr_SetParameter( GAPBOND_ERASE_ALLBONDS, 0, NULL )不是擦除所有band么?

3)今天验证passcodeCB, pairCB函数。现象是,如果第一次连手机,peripheral端打出Pairing start,Pairing success。断开连接,再连,打印bond success,然后又是Pairing start,Pairing failed。这个Pair和bond的过程是啥样的啊?