startScanningDevices method

  1. @override
Stream<List<MoveDevice>> startScanningDevices({
  1. List<MoveDeviceFilter> filter = const [MoveDeviceFilter.paired],
  2. String? uuid,
  3. int? manufacturerId,
})
override

Starts scanning for devices that can be registered with the sdk Scan can be filtered with filter, default includes only paired devices for scanning beacons uuid and manufacturerId must be specified

Implementation

@override
Stream<List<MoveDevice>> startScanningDevices(
    {List<MoveDeviceFilter> filter = const [MoveDeviceFilter.paired],
    String? uuid,
    int? manufacturerId}) async* {
  var filters = filter.map((e) => e.name).toList();
  yield* deviceScannerChannel.receiveBroadcastStream(<String, dynamic>{
    'filter': filters,
    'uuid': uuid,
    'manufacturerId': manufacturerId
  }).asyncMap<List<MoveDevice>>((devices) {
    var result = MoveDevice.fromNative(devices);
    return result;
  });
}