Android 如何可靠地检测保税设备是否支持GATT?

Android 如何可靠地检测保税设备是否支持GATT?,android,bluetooth-lowenergy,gatt,Android,Bluetooth Lowenergy,Gatt,我正在尝试检测绑定的蓝牙设备是否支持 扫描时,调用BluetoothDevice.getType()会将我的设备识别为类型3(双模式-BR/EDR/LE)。但是,在绑定设备并调用BluetoothAdapter.getBondedDevices()后,相同的方法会将我的设备作为类型1(经典)返回 @覆盖 public void onScanResult(int callbackType,android.bluetooth.le.ScanResult){ result.getDevice().ge

我正在尝试检测绑定的蓝牙设备是否支持

扫描时,调用
BluetoothDevice.getType()
会将我的设备识别为类型3(双模式-BR/EDR/LE)。但是,在绑定设备并调用
BluetoothAdapter.getBondedDevices()
后,相同的方法会将我的设备作为类型1(经典)返回

@覆盖
public void onScanResult(int callbackType,android.bluetooth.le.ScanResult){
result.getDevice().getType();//值为3
}
...
//这将向用户显示配对请求
connectGatt(上下文,false,回调);
...
//设备配对后,我将查询新的绑定设备集。
Set=BluetoothAdapter.getDefaultAdapter().getBondedDevices();
用于(蓝牙设备:套)
{
device.getType();//值为1
}
如何可靠地检测粘结设备支架(类型3或类型2)

我还尝试使用以下工具交叉检查粘结设备:

int[] ALL_STATES = { BluetoohtProfile.STATE_DISCONNECTED, BluetoohtProfile.STATE_CONNECTING, BluetoohtProfile.STATE_CONNECTED, BluetoohtProfile.STATE_DISCONNECTING };
List<BluetoothDevice> list = BluetoothManager.getDevicesMatchingConnectionState(BluetoothProfile.GATT, ALL_STATES);
int[]ALL_STATES={BluetoohtProfile.STATE_DISCONNECTED,BluetoohtProfile.STATE_CONNECTING,BluetoohtProfile.STATE_CONNECTED,BluetoohtProfile.STATE_DISCONNECTING};
List List=BluetoothManager.getDevicesMatchingConnectionState(BluetoothProfile.GATT,所有州);
但结果总是一个空列表


谢谢你的帮助

您可以再次检查扫描结果中的设备和绑定设备是否为同一设备


我猜绑定设备是与Android设备绑定的其他BT设备。

您可以再次检查扫描结果和绑定设备中的设备是否是同一设备

我猜绑定设备是与您的Android设备绑定的其他BT设备

int[] ALL_STATES = { BluetoohtProfile.STATE_DISCONNECTED, BluetoohtProfile.STATE_CONNECTING, BluetoohtProfile.STATE_CONNECTED, BluetoohtProfile.STATE_DISCONNECTING };
List<BluetoothDevice> list = BluetoothManager.getDevicesMatchingConnectionState(BluetoothProfile.GATT, ALL_STATES);