chipweinberger / flutter_blue_plus

Flutter plugin for connecting and communicationg with Bluetooth Low Energy devices, on Android, iOS, macOS
Other
791 stars 479 forks source link

[Help]: scanning doesn't find my device #765

Closed salex996 closed 10 months ago

salex996 commented 10 months ago

Requirements

Have you checked this problem on the example app?

Yes

FlutterBluePlus Version

flutter_blue_plus: ^1.31.8

Flutter Version

3.16.7

What OS?

Android

OS Version

14

Bluetooth Module

Google Tensor G2

What is your problem?

I'm trying to write a piece of code that can return the id/name/rssi of the scanned devices but I am not achieving it, the return devices comes as size = 1 and the unique value is null everywhere:

Future<List> findDevices() async {
  List devices = [];
  var subscription = FlutterBluePlus.scanResults;

  await FlutterBluePlus.startScan(timeout: Duration(seconds: 20), oneByOne:true);

  devices.add(subscription);

  return devices;

}

Can you assist please?

Logs

Performing hot restart...
Syncing files to device Pixel 7...
D/[FBP-Android](32739): [FBP] onMethodCall: stopScan
D/BluetoothAdapter(32739): isLeEnabled(): ON
Restarted application in 1.653ms.
[GoRouter] Full paths for routes:
  => /
  => /homePage
  => /barescaneado
  => /estoysentado
  => /carta
  => /confirmarpedido
known full paths for route names:
  _initialize => /
  homepage => /homePage
  barescaneado => /barescaneado
  estoysentado => /estoysentado
  carta => /carta
  confirmarpedido => /confirmarpedido

[GoRouter] setting initial location /
D/permissions_handler(32739): Bluetooth permission missing in manifest
D/[FBP-Android](32739): [FBP] onMethodCall: flutterHotRestart
D/[FBP-Android](32739): [FBP] disconnectAllDevices(flutterHotRestart)
D/[FBP-Android](32739): [FBP] connectedPeripherals: 0
D/[FBP-Android](32739): [FBP] onMethodCall: getAdapterState
D/[FBP-Android](32739): [FBP] onMethodCall: turnOn
D/[FBP-Android](32739): [FBP] onMethodCall: startScan
D/BluetoothAdapter(32739): isLeEnabled(): ON
D/BluetoothLeScanner(32739): onScannerRegistered() - status=0 scannerId=4 mScannerId=0
I/ompany.terrazap(32739): Background concurrent mark compact GC freed 967924(23MB) AllocSpace objects, 0(0B) LOS objects, 88% free, 3214KB/27MB, paused 218us,7.145ms total 58.713ms
I/ompany.terrazap(32739): Background concurrent mark compact GC freed 975369(23MB) AllocSpace objects, 0(0B) LOS objects, 88% free, 3182KB/27MB, paused 219us,6.148ms total 58.033ms
I/ompany.terrazap(32739): Background concurrent mark compact GC freed 974940(23MB) AllocSpace objects, 0(0B) LOS objects, 88% free, 3182KB/27MB, paused 152us,10.296ms total 54.704ms
chipweinberger commented 10 months ago

dont use oneByOne:true

look at example app