大家好、
我使用的是 BLE 堆栈版本 v3.0.1 (C:\ti\simplelink_cc2640r2_sdk_1_00_00_22)以及 cc2640R2F 芯片组。
使用的示例项目:C:\ti\simplelink_cc2640r2_sdk_1_00_00_22\examples\rtos\CC2640R2_LAUNCHXL\blestack\simple_peripheral
uint32_t 密钥= 0;//密钥"000000"
uint8_t pairMode = GAPBOND_Pairing_mode_wait_for_Req;
uint8_t MIPTM = true;
uint8_t ioCap = GAPBOND_IO_CAP_DISPLAY_ONLY;
uint8_t 绑定= true;
GAPBondMgr_SetParameter (GAPBOND_DEFAULT_Passcode、sizeof (uint32_t)、
密钥);
GAPBondMgr_SetParameter (GAPBOND_Pairing_mode、sizeof (uint8_t)、&pairMode);
GAPBondMgr_SetParameter (GAPBOND_MITM_protection、sizeof (uint8_t)、&MIPTM);
GAPBondMgr_SetParameter (GAPBOND_IO_Capabilities、sizeof (uint8_t)、&ioCap);
GAPBondMgr_SetParameter (GAPBOND_BUSIONIND_ENABLED、sizeof (uint8_t)、&bonding);
注册了配对和绑定状态回调的回叫
// GAP 债券经理回调
静态 gapBondCBs_t simpleBLEPeripheral_BondMgrCBs =
{
空、//密码回调(不被应用程序使用)
PAIRStateCB //配对/绑定状态回调(不被应用使用)
};
静态空 pairStateCB (uint16_t connHandle、uint8_t state、uint8_t status)
{
IF (GAPBOND_Pairing_State_Bonded =状态)
{
将事件排队();
}
}
因此、我希望在第一次连接上完成配对和绑定后、回调线对状态 CB 的状态为 GAPBOND_Pairing_State_Bonded。
但对于第一个连接、状态变为"GAPBOND_Pairing_State_Started"、然后如果我们断开连接并再次连接、则仅获取状态"GAPBOND_Pairing_State_Bonded"。 调用 pairStateCB 中。
但是 、在绑定成功后、我需要在第一个连接中使用状态"GAPBOND_Pairing_State_Bonded"回调
请提供您的建议。