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.

为什么2540 配对绑定后仍无法读 requires Authentication 的特征值



Central端配置成:

void SimpleBLECentral_Init( uint8 task_id )

{

..................

   uint32 passkey = DEFAULT_PASSCODE;
    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 );

..........

}

第一次连接成功后,lcd显示pairing success 。断开连接,重新连接一次,LCD显示bonding success。

此时 去读 SimpleBLEPeripheral 的 FFF5 值,返回错误码 05  ,和没bonding时读的结果一样。

有几个问题请教各位:

1,为什么第二次连接后才显示bonding success ?

2,为什么绑定后还是无法读加密的数据,是绑定没有完成吗?

3,看以前的绑定讨论贴,密码是底层自动生成,如果是这样的话,那么主机即使不知道从机的密码也可以强行绑定?这样加密就失去意义了?

应当如何理解密码生成问题呢?

4,如何在Central端的代码里实现 BTool里的 send Pairing Request/Send Passkey/encrypt Link 的过程呢?

谢谢!