startScan static method

Future<void> startScan({
  1. List<Guid> withServices = const [],
  2. List<String> withRemoteIds = const [],
  3. List<String> withNames = const [],
  4. List<String> withKeywords = const [],
  5. List<MsdFilter> withMsd = const [],
  6. List<ServiceDataFilter> withServiceData = const [],
  7. Duration? timeout,
  8. Duration? removeIfGone,
  9. bool continuousUpdates = false,
  10. int continuousDivisor = 1,
  11. bool oneByOne = false,
  12. AndroidScanMode androidScanMode = AndroidScanMode.lowLatency,
  13. bool androidUsesFineLocation = false,
})

Implementation

static Future<void> startScan({
  List<Guid> withServices = const [],
  List<String> withRemoteIds = const [],
  List<String> withNames = const [],
  List<String> withKeywords = const [],
  List<MsdFilter> withMsd = const [],
  List<ServiceDataFilter> withServiceData = const [],
  Duration? timeout,
  Duration? removeIfGone,
  bool continuousUpdates = false,
  int continuousDivisor = 1,
  bool oneByOne = false,
  AndroidScanMode androidScanMode = AndroidScanMode.lowLatency,
  bool androidUsesFineLocation = false,
}) async {
  if (Platform.isWindows) {
    return await FlutterBluePlusWindows.startScan(
      withServices: withServices,
      withRemoteIds: withRemoteIds,
      withNames: withNames,
      withKeywords: withKeywords,
      withMsd: withMsd,
      withServiceData: withServiceData,
      timeout: timeout,
      removeIfGone: removeIfGone,
      continuousUpdates:continuousUpdates,
      continuousDivisor:continuousDivisor,
      oneByOne: oneByOne,
      androidScanMode:androidScanMode,
      androidUsesFineLocation: androidUsesFineLocation,
    );
  }

  return await Mobile.FlutterBluePlus.startScan(
    withServices: withServices,
    withRemoteIds: withRemoteIds,
    withNames: withNames,
    withKeywords: withKeywords,
    withMsd: withMsd,
    withServiceData: withServiceData,
    timeout: timeout,
    removeIfGone: removeIfGone,
    continuousUpdates:continuousUpdates,
    continuousDivisor:continuousDivisor,
    oneByOne: oneByOne,
    androidScanMode:androidScanMode,
    androidUsesFineLocation: androidUsesFineLocation,
  );
}