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.

[参考译文] CC2541:写入和读取长于一个字节的属性

Guru**** 2592410 points
Other Parts Discussed in Thread: CC2541

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

https://e2e.ti.com/support/wireless-connectivity/bluetooth-group/bluetooth/f/bluetooth-forum/608020/cc2541-writing-and-reading-attributes-longer-than-one-byte

器件型号:CC2541

您好!

我已将固件刷写到 CC2541中、其中内置了 simpleGATT 配置文件、我一直在使用 BTool 来读取属性值。 我在固件中修改了 SimpleProfileChar3、以便能够写入和读取值。 我的问题是:我在代码中做了哪些更改、以便能够将2个字节写入 SimpleProfileChar3、并能够读取我写入其中的2个字节。

在 BTool 中、我使用 GATT_WriteLongCharValue 写入"aa:bb"、然后使用 GATT_ReadLongCharDesc 读取它、但我只得到1个字节("aa")。 我怀疑 GATT_WriteLongCharValue 仅写入第一个字节、即使您必须在 BTool 中的命令中写入2个字节的数据。

有什么想法吗? 我一直在查看代码、但我找不到要修改的位置。

-Al

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

    请从我们的存档中查看此帖子: e2e.ti.com/.../204508

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

    这取决于您如何配置 GATT 配置文件/服务。 查看当您更改特征的大小时生成器产生的结果、以获得有关更改内容的指导:

    software-dl.ti.com/.../ble_01_custom_profile.html

    (如果可以、请查看您是否可以使用 cc2541完成该模块、这对于了解所有 GATT 内容的工作方式非常有帮助)

    此致、
    反叛分子