Part Number: CC2640R2F
1.从机使用CC2640R2F 的C:\tii\simplelink_cc2640r2_sdk_5_30_01_11\examples\rtos\CC2640R2_LAUNCHXL\ble5stack\simple_peripheral(或者我自己的从机代码)。开启绑定前,通信都正常。但是打开GAP_BOND_MGR(从机例子默认打开),手机是可以成功配对并连接,而且不会断开;电脑怎么都不行,换几个电脑都是;
2.针对这些参数或者连接参数已经更改了很多种组合,结果都是一样的
#if defined(GAP_BOND_MGR)
// Setup the GAP Bond Manager. For more information see the GAP Bond Manager
// section in the User's Guide:
{
// Don't send a pairing request after connecting; the peer device must
// initiate pairing
uint8_t pairMode = GAPBOND_PAIRING_MODE_WAIT_FOR_REQ;
// Use authenticated pairing: require passcode.
uint8_t mitm = TRUE;
// This device only has display capabilities. Therefore, it will display the
// passcode during pairing. However, since the default passcode is being
// used, there is no need to display anything.
uint8_t ioCap = GAPBOND_IO_CAP_DISPLAY_ONLY;
// Request bonding (storing long-term keys for re-encryption upon subsequent
// connections without repairing)
uint8_t bonding = TRUE;
// uint8_t keySize = 16; // 强制16字节密钥,和Windows一致
uint8_t KeyDistList = GAPBOND_KEYDIST_MSIGN // 接收主机的 CSRK
| GAPBOND_KEYDIST_MIDKEY // 接收主机的 IRK
| GAPBOND_KEYDIST_MENCKEY // 接收主机的 CSRK
| GAPBOND_KEYDIST_SENCKEY // 发送从机的 LTK(必须)
| GAPBOND_KEYDIST_SIDKEY // 发送从机的 IRK(建议)
| GAPBOND_KEYDIST_SSIGN; // 发送从机的 CSRK(必须)
uint8_t AllowSecureConn = GAPBOND_SECURE_CONNECTION_ALLOW;
GAPBondMgr_SetParameter( GAPBOND_KEY_DIST_LIST, sizeof(uint8_t), &KeyDistList);
GAPBondMgr_SetParameter(GAPBOND_PAIRING_MODE, sizeof(uint8_t), &pairMode);
GAPBondMgr_SetParameter(GAPBOND_MITM_PROTECTION, sizeof(uint8_t), &mitm);
GAPBondMgr_SetParameter(GAPBOND_IO_CAPABILITIES, sizeof(uint8_t), &ioCap);
GAPBondMgr_SetParameter(GAPBOND_BONDING_ENABLED, sizeof(uint8_t), &bonding);
GAPBondMgr_SetParameter(GAPBOND_SECURE_CONNECTION, sizeof(uint8_t), &AllowSecureConn);
}
#endif
我很想知道是什么原因,已经尝试了很多办法。