【发布时间】:2021-07-28 15:42:11
【问题描述】:
我想将我的 android 设备的蓝牙 UUID 更改为预定义的值,以便我的 BLE 信标无需配对即可识别它。
来自this的问题,我收集到我必须更改服务 UUID,但我找不到相关文档或教程。
如何通过我的应用实现 UUID 的这种更改?
【问题讨论】:
标签: android android-bluetooth android-ble
我想将我的 android 设备的蓝牙 UUID 更改为预定义的值,以便我的 BLE 信标无需配对即可识别它。
来自this的问题,我收集到我必须更改服务 UUID,但我找不到相关文档或教程。
如何通过我的应用实现 UUID 的这种更改?
【问题讨论】:
标签: android android-bluetooth android-ble
您看过 Android API 文档吗?
您使用这个https://developer.android.com/reference/android/bluetooth/le/AdvertiseData.Builder#addServiceUuid(android.os.ParcelUuid) 函数来设置一个自定义的服务uuid 来发布。
关于广告的一般教程可以在这里找到:https://source.android.com/devices/bluetooth/ble_advertising。
【讨论】: