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.

[参考译文] CC2640R2F:绑定在第二次连接时完成回调触发

Guru**** 2577385 points


请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/wireless-connectivity/bluetooth-group/bluetooth/f/bluetooth-forum/590062/cc2640r2f-bonding-complete-callback-triggering-on-second-time-connection

器件型号:CC2640R2F

大家好、

我使用的是 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"回调

请提供您的建议。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    您好!

    在保存绑定后首次检查时、应使用的回调参数是 GAPBOND_PAING_STATE_BON_SAVED。
    之后、您可以使用 GAPBOND_Pairing_State_Bonded。

    您可以在我们的软件开发人员指南中找到更多信息。 其中包括有关首次配对/绑定和重新绑定的整个序列图。

    software-dl.ti.com/.../index.html
  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    是的。感谢您的意见。