Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

340
Views
BLE Using WinRT: Access Denied When Executing "GetCharacteristicsForUuidAsync()" for Write Characteristic

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://docs.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.

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

For anyone who stumbles over the same stupid issue...Here's the solution:

On Windows, using .NET Framework 4.6.1+ and the WinRT libraries inside a Non-UWP application, you can only call ONCE for getting the characteristics, no matter if you call for all at once via gattDeviceService.GetCharacteristicsAsync(BluetoothCacheMode.Uncached) or for a specific one via gattDeviceService.GetCharacteristicsForUuidAsync(uuid, BluetoothCacheMode.Cached).

Any subsequent calls will fail with GattCommunicationStatus.AccessDenied... So my solution now is to retrieve all characteristics at once and filter them locally.

That did the trick! Anyways, this is so stupid...It wasted a lot of my time now! As it seems, I also do not need to set any AccessPermission via registry.

PS: I will call out to you, if I stumble over another tricky situation, just to let you guyz know.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!