scientifichackers / flutter-rx-ble

A Flutter BLE plugin, based on RxAndroidBle and RxBluetoothKit.
GNU Lesser General Public License v3.0
35 stars 18 forks source link

Add 'withServices' option to startScan #10

Open pbaker5 opened 5 years ago

pbaker5 commented 5 years ago

When I do a scan, I only want devices with my service Id to be returned. Taking a look at their documentation, it seems like RxBluetoothKit has: manager.scanForPeripherals(withServices: [serviceId]) and RxAndroidBle has scan filters:

Disposable scanSubscription = rxBleClient.scanBleDevices(
        new ScanSettings.Builder()
            // .setScanMode(ScanSettings.SCAN_MODE_LOW_LATENCY) // change if needed
            // .setCallbackType(ScanSettings.CALLBACK_TYPE_ALL_MATCHES) // change if needed
            .build()
        // add filters if needed
)