Android:将蓝牙经典扫描与低功耗扫描分开,或区分经典设备和低功耗设备

3
我正在开发一款实现蓝牙功能的安卓应用。蓝牙扫描和所有操作都正常运行(我参考了安卓蓝牙聊天代码示例:(https://android.googlesource.com/platform/development/+/25b6aed7b2e01ce7bdc0dfa1a79eaf009ad178fe/samples/BluetoothChat)),但是当蓝牙扫描运行时,我的设备也会发现蓝牙低功耗设备。我已经在Galaxy Nexus (Android KitKat)和Nexus 7 (2013) (同样是KitKat)上尝试过。

在使用该函数时,我该如何防止BluetoothAdapter发现蓝牙低功耗设备?

mBluetoothAdapter.startDiscovery();

官方的蓝牙低功耗示例(http://developer.android.com/samples/BluetoothLeGatt/index.html)表示,要进行低功耗扫描,您需要使用以下代码:
mBluetoothAdapter.startLEScan();

作为一种解决方法,是否可以区分发现的经典蓝牙设备和发现的低功耗蓝牙设备?
1个回答

3

太好了!非常感谢。 - Jakob

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接