startLeScan 128位的UUID不会对原生Android BLE实施工作 [英] startLeScan with 128 bit UUIDs doesn't work on native Android BLE implementation

查看:896
本文介绍了startLeScan 128位的UUID不会对原生Android BLE实施工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在使用的麻烦<一href="http://developer.android.com/reference/android/bluetooth/BluetoothAdapter.html#startLeScan(java.util.UUID%5B%5D%2C%20android.bluetooth.BluetoothAdapter.LeScanCallback)">startLeScan(新的UUID [] {} MY_DESIRED_128_BIT_SERVICE_UUID,回调)在Android 4.3新引入的BLE API在我的Nexus 4。

I am having trouble using startLeScan( new UUID[]{ MY_DESIRED_128_BIT_SERVICE_UUID }, callback ) on the new introduced BLE API of Android 4.3 on my Nexus 4.

回调只是不会被调用。我仍然可以看到进入的数据包的日志中:

The callback just doesn't get called. I still can see incoming packages in the log:

08-02 15:48:57.985: I/bt-hci(1051): btu_ble_process_adv_pkt
08-02 15:48:58.636: I/bt-hci(1051): BLE HCI(id=62) event = 0x02)

如果我不使用该参数为的UUID它的工作原理过滤。我们使用的是特定制造商的128位UUID 作为我们公司的设备。

If I don't use the parameter to filter for UUIDs it works. We are using a manufacturer specific 128bit UUID for device of our company.

现在,我们的设备提供更多的服务比我提供的数组中开始。但是这不应该成为问题。

Now, our device offers more services than I am providing in the array. But that shouldn't be the problem.

有没有人面临同样的问题?任何解决办法?

Is anyone facing the same problem? Any solutions?

修改

有相关的扫描几个问题,这个问题只讨论之一:如果您也有一些问题,扫描,读取<一href="http://stackoverflow.com/questions/18019161/startlescan-with-uuids-doesnt-work-on-native-android-ble-implementation?noredirect=1#comment27879874_18019161">this第一条评论。还要记住,我的设备征收16位和128位的UUID。大多数的你们使用由像心率或速度和Cadence公司的BLE标准提供16位的UUID。

There are several problems related to scanning, this question only discusses one: If you also have some issue with scanning, read this comment first. Also keep in mind, that my device imposes a 16bit and a 128bit UUID. Most of you guys use 16bit UUIDs provided by the BLE standard like Heart rate or Speed and Cadence.

推荐答案

这是一个<一个href="http://$c$c.google.com/p/android/issues/detail?id=59490&q=BLE&colspec=ID%20Type%20Status%20Owner%20Summary%20Stars"相对=nofollow>报告的bug 至少在安卓4.3 JWR66Y:

This is a reported bug at least in Android 4.3 JWR66Y:

  • 筛选工作,如果我提供我的16位UUID
  • 在过滤不返回任何扫描结果,如果我提供我的128位UUID,或者如果我同时提供的UUID

我的设置:我的设备提供2的UUID广告(<一href="http://stackoverflow.com/questions/18019161/startlescan-with-uuids-doesnt-work-on-native-android-ble-implementation?noredirect=1#comment26760666_18246832">1 16位和128位1 )和4的UUID服务发现(1 128位和3 16位)。

My setting: My device offers 2 UUIDs on advertising (1 16bit and 1 128bit) and 4 UUIDs on service discovery (1 128bit and 3 16bit).

即使它被固定,我警告大家不要使用Android的所提供的过滤选项。为了向后兼容,因为它是上破三星Galaxy S3采用Android 4.3

这篇关于startLeScan 128位的UUID不会对原生Android BLE实施工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆