【问题标题】:Bluez BLE peripheral advertise custom characteristic with ADV dataBluez BLE 外设使用 ADV 数据宣传自定义特性
【发布时间】:2019-05-02 05:09:13
【问题描述】:

是否有允许广告自定义 UUID 和特征以及特定 ADV 数据的示例应用? Bluez 的文档较少。任何帮助表示赞赏。

【问题讨论】:

    标签: bluez


    【解决方案1】:

    您拥有哪个版本的 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 实现的。

    我希望这会有所帮助。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-10-02
      • 2017-01-01
      • 2019-05-31
      • 2020-01-19
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多