SDK:simplelink_cc2640r2_sdk_3_20_00_21
处理器:CC2640R2F
问题描述:使用 SDK “simplelink_cc2640r2_sdk_3_20_00_21 ” 的 BLE 5 simple_peripheral 例程时,使用手机连接蓝牙模块,6 秒后蓝牙模块调用“SimplePeripheral_processParamUpdate()” 函数更新连接参数,函数调用返回状态是“SUCCESS(0x00)”的,但是抓包看“连接参数更新”是没有发出来的。
我使用的是例程源码,没有任何更改,为什么“连接参数更新”命令会无法发出?
Viki Shi:
你看一下是不是类似这个问题:另外,SimplePeripheral_processParamUpdate()这个函数有个已知bug,更新参数可能导致程序崩溃,详细描述如下:In SimplePeripheral_processParamUpdate(), the param update data and clock should only be freed / destructed when the status of the update is bleAlreadyInRequestedMode. Therefore, this freeing / destructing should be surround by a check for this status:// Send parameter update bStatus_t status = GAP_UpdateLinkParamReq(&req);// If there is an ongoing update, queue this for when the udpate completes if (status == bleAlreadyInRequestedMode) { spConnHandleEntry_t *connHandleEntry = ICall_malloc(sizeof(spConnHandleEntry_t)); if (connHandleEntry) { connHandleEntry->connHandle = connHandle;List_put(¶mUpdateList, (List_Elem *)connHandleEntry); } } else { // Deconstruct the clock object Clock_destruct(connList[connIndex].pUpdateClock); // Free clock struct ICall_free(connList[connIndex].pUpdateClock); connList[connIndex].pUpdateClock = NULL; // Free ParamUpdateEventData ICall_free(connList[connIndex].pParamUpdateEventData); }
Jesse Huang:
回复 Viki Shi:
不是这个崩溃的 BUG,在 “simplelink_cc2640r2_sdk_3_20_00_21 ” 中已经没有 else 后面那部分了。
但是在调用 “GAP_UpdateLinkParamReq()” 函数后,status 状态返回为 SUCCESS,但是抓包发现并没有 连接参数命令 发出。
Jesse Huang:
回复 Viki Shi:
我的芯片是 CC2640R2F 7×7 的,是需要别的预编译吗?