Fix: linux: getSystemDevices (#154)
Make sure getSystemDevices connects the bluez client first. This ensures that the list of devices is correctly populated. Signed-off-by: Tim Froidcoeur <tim.froidcoeur@comate.be> Co-authored-by: Tim Froidcoeur <tim.froidcoeur@comate.be>
This commit is contained in:
@@ -350,6 +350,7 @@ class UniversalBleLinux extends UniversalBlePlatform {
|
||||
Future<List<BleDevice>> getSystemDevices(
|
||||
List<String>? withServices,
|
||||
) async {
|
||||
await _ensureInitialized();
|
||||
List<BlueZDevice> devices =
|
||||
_client.devices.where((device) => device.connected).toList();
|
||||
if (withServices != null && withServices.isNotEmpty) {
|
||||
|
||||
Reference in New Issue
Block a user