When I want to enumerate the discovered devices, the app blocks forever.
// get permissions
var status = await Permissions.RequestAsync<Permissions.Bluetooth>();
if (status != PermissionStatus.Granted) return;
var client = new BluetoothClient();
// Output window: [BluetoothAdapter] BluetoothAdapter() : osre.nanodog.control
var deviceEnumerator = client.DiscoverDevicesAsync(cancellationToken).GetAsyncEnumerator(cancellationToken);
while (await deviceEnumerator.MoveNextAsync())
// Output window: [BluetoothAdapter] startDiscovery
// now execution is blocked, deviceEnumerator.MoveNextAsync() never returns
{
var device = deviceEnumerator.Current;
}
I have a .NET8 MAUI project (Target SDK 34, min SDK 31). Package references:
When I want to enumerate the discovered devices, the app blocks forever.
my manifest:
But if I use the BluetoothDevicePicker everything works and I can communicate with my device:
Any ideas what I am doing wrong here?