Open summeryi opened 4 days ago
how are you triggering the scan when the screen is off? this is not something FBP really supports
but this sounds like an android bug, not FBP
After turning off the screen on my end, I wrote a timer that triggered it in 1 second. The problem occurred 100% of the time, and after the problem occurred, the search continued to fail
Future onScanPressed() async { Future.delayed(Duration(seconds: 1),() async { try { _systemDevices = await FlutterBluePlus.systemDevices; } catch (e) { Snackbar.show(ABC.b, prettyException("System Devices Error:", e), success: false); } try { await FlutterBluePlus.startScan(timeout: const Duration(seconds: 15)); } catch (e) { Snackbar.show(ABC.b, prettyException("Start Scan Error:", e), success: false); } if (mounted) { setState(() {}); } }); }
Requirements
Have you checked this problem on the example app?
Yes
FlutterBluePlus Version
1.32.8
Flutter Version
3.19.5
What OS?
Android
OS Version
Android 13
Bluetooth Module
null
What is your problem?
When my phone turns off the screen and triggers a startScan(), it will report an error(UNKNOWN_SCAN_ERROR). If I search again, it will report an error(SCAN_FAILED_ALREADY_STARTED)
Logs