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.

[参考译文] LAUNCHXL-CC26X2R1:ProjectZero:如何默认启用 DataService 通知

Guru**** 2540720 points
Other Parts Discussed in Thread: CC2540

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

https://e2e.ti.com/support/wireless-connectivity/bluetooth-group/bluetooth/f/bluetooth-forum/1413314/launchxl-cc26x2r1-projectzero-how-to-enable-dataservice-notifications-by-default

器件型号:LAUNCHXL-CC26X2R1
Thread 中讨论的其他器件:CC2540

工具与软件:

大家好!

希望你有一个伟大的星期五。

我希望对代码进行修改、以便将其刷写到 CC26X2R 后、默认情况下会启用 DataService 通知、而无需我发送 BLE 帧以在其配置中放入"1"。

如果我启用它们、我的代码就可以正常运行、但我希望从头开始完成这项工作。

如何为此修改 ProjectZero?

非常感谢。

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

    您好、Kazola、

    感谢您的咨询。

    在连接时默认启用通知(来自外设)而不通过中央触发它、从技术上而言并不符合蓝牙规范。 我建议您查看该主题: https://e2e.ti.com/support/wireless-connectivity/bluetooth-group/bluetooth/f/bluetooth-forum/1104751/cc2640-how-can-i-enable-the-characteristic-4-notification-in-the-simple-peripheral-project-by-default

    BR、

    David。

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

    你好、大卫!

    我可以理解它不符合规格。

    这些链接适用于 CC2540、因此用处不大。

    是否有一种快速的方法使用 Service_Set converte 来执行此操作或直接修改属性表? 我们只是进行性能测试、我们对蓝牙规格不是很关心。

    谢谢。

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

    您好、Kazola、

    我明白了。 尽管链接适用于 CC2540、但思路是相似的:"...完全忽略 CCCD、只需手动调用 GATT_Notification ()"。 您可以看到外设执行的 CCC 验证、以确认中央设备在该函数内启用了通知(GATT_CLIENT_CFG_NOTIFY):SDK 中 simple_peripheral 示例的 iCall_hci_tl.c 中的 processExtMsgATT ()。

    ...
    if ((value & GATT_CLIENT_CFG_NOTIFY) || (pNoti->handle == 0))
    {
        stat = GATT_Notification(connHandle, pNoti, pBuf[2]);
        if((stat == SUCCESS) && (pNoti->pValue != NULL))
        {
            safeToDealloc = FALSE; // payload passed to GATT
            ...

    BR、

    David。