TI中文支持网
TI专业的中文技术问题咨询交流网站

CC2640R2 HID profile自动重链接后操作失败

1,CC2640R2 HID profile应用,主机上电主动配对链接BLE, 然后BLE按键,主机能解析到BLE按键操作,功能完全正常。

2, BLE 主动调用API(HidDev_Close() )中断链接,BLE进入sleep

3,  BLE 按键唤醒并再次自动配对链接主机, 然后BLE按键,主机不能解析BLE的按键操作,为什么?跟什么配置或时序有关了?

Viki Shi:

请问是hid_emu_kbd这个demo吗?

bing zhou:

回复 Viki Shi:

是的,simplelink_cc2640r2_sdk_ble_example_pack_1_50_00_62版本里的demo, SDK是simplelink_cc2640r2_sdk_1_50_00_58版本

bing zhou:

回复 Viki Shi:

Viki 能给我一些建议或方向吗?

Viki Shi:

回复 bing zhou:

跟同事讨论了一下,仅提供的这些信息无法判断。是否能提供抓包数据,看一下唤醒后的BLE数据是否正常传递

bing zhou:

回复 Viki Shi:

ble_diff.zip多谢Viki, 搭建好抓包工具,抓包发现跟客户提供demo机,有2处差异(看附近文本),demo多发了GAP_SlaveRequestedSecurity事件包和安全链接数据全部为0,但不知道怎么修改跟客户demo样机一样,能提供修改方法?

bing zhou:

回复 bing zhou:

Viki, 现发现可以跟(BLE_V42_FEATURES & PRIVACY_1_2_CFG)配置有关,目前PRIVACY_1_2_CFG配置默认是1,我打算配置为0, 但是在build_config.opt 添加-DV42_FEATURES=EXT_DATA_LEN_CFG+SECURE_CONNS_CFG设置,似乎无作用, PRIVACY_1_2_CFG还是配置为1,
你能告诉我如何修改PRIVACY_1_2_CFG配置为无效,谢谢

build_config.opt as follows:
/* BLE v4.2 Features */
-DV42_FEATURES=EXT_DATA_LEN_CFG+SECURE_CONNS_CFG
/* Note: For advanced users who choose to explicitly build their BLE*/
/* Stack without ROM the following upper limit on RAM usage must be*/
/* observed when using the Secure Connections Feature:*/
/* R1: 0x20004F2C*/
/* R2: 0x20004F80*/
/* When using linker command files provided by this SDK, the linker*/
/* symbol ENCRYPTION_ROM=1 or ENCRYPTION_ROM=2 may be defined to set*/
/* this upper limit for R1 and R2 devices, respectively.*/

List file as follows:// If using Privacy 1.2 then controller will have all IRK values stored
N// in the bond records and will try to resolve every incoming RPA. Meaning
N// if the host is given an RPA it will not be able to resolve it. Thus,
N// resolving an address at the host level is only possible if Privacy 1.2
N// is not enabled
N#if !defined (BLE_V42_FEATURES) || !(BLE_V42_FEATURES & PRIVACY_1_2_CFG)
X#if !1L || !(V42_FEATURES+0x01+0x04+0x02 & 0x01)
Selse if ( randomSubType == RANDOM_ADDR_SUBTYPE_RPA )

Viki Shi:

回复 bing zhou:

你要disable  PRIVACY_1_2_CFG吗:

BLE_V42_FEATURESConfigure the stack to use features from the BLE 4.2 SpecificationThe following BLE 4.2 features are enabled by default and cannotbe disabled.EXT_DATA_LEN_CFG- Enable the Extended Data Length Feature in the ControllerSECURE_CONNS_CFG- Enable Secure Connections Pairing ProcedurePRIVACY_1_2_CFG- Enable Enhanced Privacy

bing zhou:

回复 Viki Shi:

是的, 如何disablePRIVACY_1_2_CFG 配置

bing zhou:

回复 bing zhou:

Viki,因为我们发现再链接不工作的特定设备配对时用ADDRTYPE_RANDOM , RANDOM_ADDR_SUBTYPE_RPA类型配对,最后它没有绑定配对信息,我猜测再链接不工作可能跟这个有关,因为下面开关disable触发绑定的命令,你觉得对吗?

// If using Privacy 1.2 then controller will have all IRK values stored// in the bond records and will try to resolve every incoming RPA. Meaning// if the host is given an RPA it will not be able to resolve it. Thus,// resolving an address at the host level is only possible if Privacy 1.2// is not enabled
#if !defined (BLE_V42_FEATURES) || !(BLE_V42_FEATURES & PRIVACY_1_2_CFG)else if ( randomSubType == RANDOM_ADDR_SUBTYPE_RPA ){

//Board_setLeds( Board_LED_MODE_TOGGLE, 1<<Board_TEST_PIN1, 0, 0 );

idx = gapBondMgrResolvePrivateAddr( pDevAddr );if ( (idx < GAP_BONDINGS_MAX) && (pResolvedAddr) ){VOID gapBondMgrGetPublicAddr( idx, pResolvedAddr );}}
#endif // ! BLE_V42_FEATURES | ! PRIVACY_1_2_CFG

Viki Shi:

回复 bing zhou:

CC2640R2F的例程里说明了不能disable。CC2640是可以的

赞(0)
未经允许不得转载:TI中文支持网 » CC2640R2 HID profile自动重链接后操作失败
分享到: 更多 (0)