bluez - Bluez BLE 外设使用 ADV 数据宣传自定义特性
问题描述
是否有允许广告自定义 UUID 和特征以及特定 ADV 数据的示例应用程序?Bluez 的文档较少。任何帮助表示赞赏。
解决方案
你有哪个版本的 BlueZ?使用较新版本的 BlueZ(例如 5.50),您可以从命令行使用 bluetoothctl 执行此操作,如下所示:-
#bluetoothctl
[bluetooth]# menu advertise
[bluetooth]# uuids 0x1800 0x1801 0x1802
[bluetooth]# name MyDevice
[bluetooth]# data 0 01 02 03
[bluetooth]# back
[bluetooth]# advertise on
这允许您设置自定义 UUID、广告数据和广告设备名称。您可以深入研究 BlueZ 源代码,了解如何使用 C 实现这一点。
我希望这有帮助。
推荐阅读
- r - 使用带有“rf”方法的 train 函数收到错误消息
- excel - 替换和评估数组
- python - 如何在熊猫中以 d-month-y 格式按日期排序?
- ruby - 未定义的方法 `<' 为 true:TrueClass (NoMethodError)
- java - 当我想要返回结果列表时,如何修复 Java 中的“class java.lang.Long cannot be cast to class java.lang.Integer”错误?
- ios - 使用运行时替换字典的对象方法无效
- android - 用 ViewModel 替换 IntentService
- html - 如何修复:CSS display:inline-block with text-align:center on parent 稍微偏离中心
- jpa - 遇到数组值参数绑定,但期待 [java.lang.String (n/a)]
- .net - Sql Package Exe可以在命令行中运行部署后脚本吗?