fix: improve BLE scanning reliability and filter out own node from contacts list improve text scaling
This commit is contained in:
1 parent
fa514533eb
commit
09e1cd2b8d
2 files changed
+42
-14
No files matched your search
@@ -625,6 +625,17 @@ class MeshCoreConnector extends ChangeNotifier {
|
||||
_scanResults.clear();
|
||||
_setState(MeshCoreConnectionState.scanning);
|
||||
|
||||
// Ensure any previous scan is fully stopped
|
||||
await FlutterBluePlus.stopScan();
|
||||
await _scanSubscription?.cancel();
|
||||
|
||||
// On iOS/macOS, add a small delay to allow BLE stack to reset
|
||||
// This prevents cached results from interfering with new scans
|
||||
if (defaultTargetPlatform == TargetPlatform.iOS ||
|
||||
defaultTargetPlatform == TargetPlatform.macOS) {
|
||||
await Future.delayed(const Duration(milliseconds: 300));
|
||||
}
|
||||
|
||||
_scanSubscription = FlutterBluePlus.scanResults.listen((results) {
|
||||
_scanResults.clear();
|
||||
for (var result in results) {
|
||||
|
||||
Reference in new issue
Block a user