蓝牙 - Linux:使用 bluetoothctl 更改外观广告失败

Kin*_*gPo 3 appearance bluetooth ads gatt

我喜欢使用 RaspberryPi 充当心率传感器,并通过 BLTH 将这些数据传输到其他健康/运动应用程序。最后,使用 python 和 bluez 一切正常,我可以创建 BLTH GATT 服务器并通过服务 0x180d 宣传 HR 数据。

最后一个问题是我无法更改通用访问 (0x1800) 中 BLTH 的外观。出现是在这里找到UUID:0x2A01。

我尝试通过 bluetoothctl 手动方式执行此操作:菜单广告外观 833(用于心率)外观在背面广告

这将失败:无法注册广告:org.bluez.Error.Failed

不管我将外观更改为哪个值(即使该值众所周知并被接受),它也会使广告失败。如果我关闭外观,它将开始广告。任何提示,做什么或我刚刚错过了什么?我已经将 bluez 从 5.50 更新到 5.54 也在实验模式下使用了 bluez

  • 并使用最新的 raspian 操作系统和所有更新

非常感谢您的帮助

ukB*_*Baz 7

这些是我在 Raspberry Pi 上使用的步骤:

pi@raspberrypi:~ $ bluetoothctl 
[bluetooth]# menu advertise 
[bluetooth]# clear
[bluetooth]# uuids 0x180D
[bluetooth]# appearance 833
[bluetooth]# name heart_test
[bluetooth]# discoverable on
[bluetooth]# back
[bluetooth]# advertise on
[CHG] Controller 00:02:5B:03:44:07 SupportedInstances: 0x04
[CHG] Controller 00:02:5B:03:44:07 ActiveInstances: 0x01
Advertising object registered
UUID: Heart Rate(0x180D)
Tx Power: off
LocalName: heart_test
Appearance: Heart Rate Belt (0x0341)
Discoverable: on
[bluetooth]#
Run Code Online (Sandbox Code Playgroud)

当我扫描它时,它在 nRF 应用程序中给了我这个:

nRF 应用程序中的扫描视图