0
我遇到了一个问题,即scanBleDevices(UUID ... filters)方法不支持使用不同的UUIDServices发现双类型的设备。Rxandroidble-方法scanBleDevices(UUID ... filters)不支持两种类型的服务
我猜args之间的关系是AND,但不是OR。但是我怎样才能获得具有不同UUIDService的双重设备?
下面的代码是我想用uuid 00001801-0000-1000-8000-00805F9B34FB
和另一个带uuid 6E400001-B5A3-F393-E0A9-E50E24DCCA9E
的设备来发现设备,但我始终无法用代码获得结果。 那么,我该如何解决这个问题呢?
scanScription = rxBleClient
.scanBleDevices(UUID.fromString("00001801-0000-1000-8000-00805F9B34FB"), UUID.fromString("6E400001-B5A3-F393-E0A9-E50E24DCCA9E"))
.subscribe(new Action1<RxBleScanResult>() {
@Override
public void call(RxBleScanResult rxBleScanResult) {
if (!bleDeviceHashMap.containsKey(rxBleScanResult.getBleDevice().getMacAddress())) {
bleDeviceHashMap.put(rxBleScanResult.getBleDevice().getMacAddress(), rxBleScanResult.getBleDevice());
HashMap<String, String> ble = new HashMap<String, String>();
ble.put("name", rxBleScanResult.getBleDevice().getName());
ble.put("address", rxBleScanResult.getBleDevice().getMacAddress());
bleDevices.add(ble);
adapter.notifyDataSetChanged();
}
}
});
娃〜O操作。我知道了 !谢谢你的帮助!! – Botasky