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.

[参考译文] CC2540:将 CC2540 BLE 1.4.0升级到1.4.1时、外围设备中心只能接收一个软件包、然后卡死并断开连接。

Guru**** 2538960 points


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

https://e2e.ti.com/support/wireless-connectivity/bluetooth-group/bluetooth/f/bluetooth-forum/629053/cc2540-when-upgrading-cc2540-ble-1-4-0-to-1-4-1-the-peripheral-central-can-only-receive-one-package-then-stuck-and-disconnected

器件型号:CC2540

大家好、  

最近、我将代码从 BLE 1.3.2升级到 BLE 1.4.0、然后是 BLE1.4.1。 但是、在我从 BLE 1.4.0升级到 BLE 1.4.1后、我发现中央只能接收一个封装、然后卡在并断开连接、但外设会持续向 中央发送20字节数据包、并从中央的 simpleBLECentralPRocessGATTMSG 读取数据包。 我已经在 BLE 1.3.2和 BLE 1.4.0中进行了测试、没有问题。  

我已,软件包监听器来读取软件包在这里我确实发现只有一个软件包被发送、然后屏幕被冻结了一段时间、然后断开连接并再次开始扫描。  

我还尝试使用浅蓝色连接外设、在这里我可以持续接收软件包。  

请帮助您了解下一步的行动。

非常感谢。

我编写的代码位于 simpleBLEcentralProcessGATTMsg 中 : (根据  BLE1.4.1中的 simplecentral 文件,我在 simpleBLEcentralProcessGATT_FREE (&pMsg->msg,pMsg->method)”末尾添加了"GATT_BM_BM_FREE(&pMsg->msg,pMsg->METHOD )")

if (pMsg->method =ATT_Handle_value_Noti ||
pMsg->method == ATT_Handle_value_indD )
{
如果(pMsg->msg.handleValueNoti.handle ==0x004C)// 0x004D 是通知的句柄,则0x004C 是特征的句柄
{
attHandleValueNoti_t noti14;
noti14.handle = pMsg->msg.handleValueNotti.handle;
noti14.len = pMsg->msg.handleValueNotti.len;


oSAL_memcpy (noti14.pValue、&pMsg->msg.handleValueNotti.pValue、noti14.len);
OSAL_memcpy (&char14buffer、&noti14.pValue、noti14.len);

USBio_WriteTransport (char14缓冲区、20);
USBPrintString ("Receive14:");
} 

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

    请参阅 BLE Wiki 上的移植指南。 一个明显的遗漏是您没有使用 GATT_BM_ALoc 为通知值从堆中分配 GATT 缓冲区。 这是 BLE 1.4.0和1.4.1+之间所做的更改之一。

    祝你一切顺利