Skip to content

scanForBluetoothDevices() can only be called once #21

@basvdijk

Description

@basvdijk

You can only call await FTMS.scanForBluetoothDevices(); once:

    await FTMS.scanForBluetoothDevices();
    Stream<List<ScanResult>> scanResults = FTMS.scanResults;

    scanResults.listen((results) {
      developer.log('Scan results ${results.toString()}');

If there are no results and you call await FTMS.scanForBluetoothDevices(); again. XCode shows only one trigger of the Bluetooth scanning:

image

I think that the current default timeout of 4 seconds is too short.

FlutterBluePlus has a on option to scan continuously:

FlutterBluePlus.startScan(continuousUpdates: true);

Calling FlutterBluePlus.stopScan() will then stop the scanning.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions