Maybe someone can help me out because I have a really tricky situation with Bluetooth LE using WinRT on Windows 10 (like supposed here: Bluetooth Low Energy in .Net (C#)).
I need BLE within a Win32 classic desktop application.
Our code is running in a 32 Bit frame application using the .NET runtime (v4.0.30319, .NET Framework 4.6.2). I was able to manage all the other issues (strong naming some NuGet assemblies (Shiny.BluetoothLE), running BluetoothAdapter.GetRadioAsync()
in a 64 Bit COM surrogate DLL when running on 64 Bit Windows) but now I am totally stuck with this and here’s where:
The problem occurrs when executing var result = await gattDeviceService.GetCharacteristicsForUuidAsync(uuid, BluetoothCacheMode.Cached);
see here https://learn.microsoft.com/de-de/uwp/api/windows.devices.bluetooth.genericattributeprofile.gattdeviceservice.getcharacteristicsforuuidasync?view=winrt-20348.
When getting the read characteristics, the result.Status
is GattCommunicationStatus.Success
and the result contains the desired characteristic.
But of course I also need to get the write characteristic and I am ALWAYS getting GattCommunicationStatus.AccessDenied
!
Because of that the result contains NO characteristic.
Has anybody a clue why is that? I really need help here because I am kinda lost right now…
I also tried to set AccessPermission
via registry like supposed here but no luck at all…
PS: I use Windows 10 SDK Kit Build 20348 and like stated above it is a C# .NET Framework 4.6.2 project and all our assemblies are strong named because of using GAC. If I am missing anything don’t hesitate to contact me.