stopScan method
stopScan stops scanning for BLE devices.
This method will stop the streaming of BLE devices.
Implementation
@override
Future<bool?> stopScan() async {
if (!_isScanning) return true;
_eventController.add(BleEvent.scanStopped);
try {
final adapter = _client?.adapters.firstOrNull;
await adapter?.stopDiscovery();
_isScanning = false;
return true;
} catch (e) {
log("Error initializing BlueZClient: $e");
return false;
}
}