You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jun 20, 2025. It is now read-only.
Hallo everyone, I'm currently playing around with Bluetooth LE and observing this strange behavior when probing a device and calling GattDeviceService.GetCharacteristicsAsync on a service: System.ArgumentException: 'Value does not fall within the expected range.'
My code:
var serviceId = Guid.Parse("04313ed3-8c7e-4e2e-9771-a415cd2b4623");
var bleDevice = await BluetoothLEDevice.FromBluetoothAddressAsync(228844339811492);
var gatt = await bleDevice.GetGattServicesAsync();
var service = gatt.Services.Single(e => e.Uuid == serviceId);
var accessStatus = await service.RequestAccessAsync(); // Allowed
var openStatus = await service.OpenAsync(GattSharingMode.SharedReadAndWrite); // Success
var characteristics = await service.GetCharacteristicsAsync(); // Crash
Using the Android BLE Scanner app I can clearly see the service and related characteristics:
I can also reproduce this issue when using the Bluetooth LE Explorer Windows app which is using the same API:
I can probe other devices (eg. my Bluetooth mice) without any problem so something must be special here.
I'm using the .NET SDK 6.0.400 with a console application targeting net6.0-windows10.0.19041.0 from within Visual Studio 2022 17.3.1.
I tested it on a Windows 11 (22000.856) notebook with an embedded Intel Bluetooth card and a Windows 10 (19044.1889) desktop using a generic USB Bluetooth dongle.