Android BLE//使用自定义服务UUID

标签 android bluetooth bluetooth-lowenergy android-bluetooth

我们正在开发定制蓝牙低功耗外围设备,我们需要定义我们的定制服务。 基于此链接:https://www.bluetooth.org/en-us/specification/assigned-numbers/service-discovery

所有短 UUID(16 位)均保留,等待 BT 服务规范的 future 修订。 而且似乎当前版本的 Android (4.4) 不支持 128 位 UUID。

所以基本上我不能使用 16 位 UUID 来定义我的服务,但我不能使用 Android 为 128 位 UUID 过滤我的服务。 任何人都知道实现它的最佳方式吗? 谢谢

最佳答案

我仍然不确定是否可以使用自定义 16 位 UUIDS,因此我们设法根据这个 SO 问题做一些其他事情。 startLeScan with 128 bit UUIDs doesn't work on native Android BLE implementation

我们扫描所有设备并在 LeScanCallback 返回的 byte[] scanRecord 中搜索我们的服务。

关于Android BLE//使用自定义服务UUID,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21428455/

相关文章:

android - Unity3D : Is it possible to display a running mobile app on a texture?

java - Android Gallery 项目聚焦?

swift - 不支持 CoreBluetooth

javascript - 使用 react-native-ble-manager 获取可用蓝牙设备的列表

c# - 如何修复 GattStatus : 3 - WriteNotPermitted exception for BLE Xamarin forms application?

android - 如何自定义 Tab 指示器宽度?

android - Ble-getting error code - 128 while writing to characteristic 写入特征

c# - 如何在 C# 中通过蓝牙连接获取任何手机的 MAC 地址?

swift - 为什么移动到新场景时蓝牙会断开?

Android:关闭软键盘时显示空白