sa_*_*uin 7 android bluetooth-lowenergy android-bluetooth android-ble
我正在使用设备名称过滤器连接到特定的 BLE 设备。但是我的扫描回调没有执行。当我使用 MAC 地址作为过滤器时,它工作正常。这是已知问题还是错误?我正在使用 Android 6.0 的华硕平板电脑进行测试。当我从设备名称数据库读取要使用的扫描过滤器时,我没有使用 MAC 地址的替代方法。
//这不起作用
ScanFilter scanFilter = (new android.bluetooth.le.ScanFilter.Builder())
.setDeviceName(device_name).build();
Run Code Online (Sandbox Code Playgroud)
//这有效
ScanFilter scanFilter = new ScanFilter.Builder()
.setDeviceAddress(dev_mac_address).build();
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
967 次 |
| 最近记录: |