【发布时间】:2020-05-06 16:40:04
【问题描述】:
我使用BluetoothLeScanner 的startScan 方法遇到了问题,找到了一个BLE 设备,但是当我关闭BLE 设备时,我的手机仍然显示此设备已打开!!
我试过用:
private ScanCallback mScanCallback = new ScanCallback() {
@Override
public void onScanResult(int callbackType, ScanResult result) {
Log.i("ScanCallback", String.format("onScanResult(int callbackType[%d], ScanResult result)", callbackType));
final BluetoothDevice btDevice = result.getDevice();
if (btDevice == null){
Log.e("ScanCallback", "Could not get bluetooth device");
return;
}
final String macAddress = btDevice.getAddress();
if (callbackType == ScanSettings.CALLBACK_TYPE_MATCH_LOST) {
// NOTE: I've never got here
final BluetoothDevice outOfRangeDevice = mBtDevices.get(macAddress);
...
} else {
...
}
}
...
};
伙计,我还没有找到解决方案如何检测 BLE 设备在其他资源中丢失,例如(Android SDK 参考、论坛、stackoverflow 等)(:
任何帮助将不胜感激!
【问题讨论】:
-
@DanielReyhanian 不,我询问了范围内的任何 BT 设备,不仅是配对的。在我的情况下它不起作用
-
你不能进入系统属性并检查一下吗?所有远程设备都没有任何属性吗?很奇怪。
-
this 呢?
-
另一个possibility。
标签: android bluetooth bluetooth-lowenergy