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.

[参考译文] CC2340R5:根据单字节通知实现多字节通知

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

https://e2e.ti.com/support/wireless-connectivity/bluetooth-group/bluetooth/f/bluetooth-forum/1525246/cc2340r5-implement-multi-byte-notify-based-on-single-byte-notify

器件型号:CC2340R5

工具/软件:

我需要基于单字节通知实施多字节通知、基于 basic_ble_LP_EM_CC2340R5_freertos_ticlang 的单字节通知、任何人都能帮到我?

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

    您好、Peter、

    感谢您联系我们! 如果我理解正确、您希望在 basic_ble 示例中增加通知发出的字节数。

    如果是这种情况,修复应该相对容易,因为这是一个常见的问题!

    最后、如果您使用的 是 GATTServ.CharCfg() App_Process 函数、该函数将引导至 SimpleGattProfile_readAttrCB 回调。 在开箱即用示例中、回调仅管理1个字节、如下所示:

            *pLen = 1;
            pValue[0] = *pAttr->pValue;


    不过、只需将其更改为 memcpy (如下所示)、就可以解决问题。

    *plen = x; // where x is the number of bytes
    memcpy(pValue, pAttr->pValue, x);

    我希望这对您有所帮助! 如果这不能解决问题、请向我提供有关您所看到内容的更多详细信息、我一定会提供帮助!

    此致、

    Tarek D