locked
Bluetooth LE Discovery all Primary Services of a known Device's ID C#

    Question

  • HI guys,

    i'm trying to get all primary services from a bluetoorh LE device in c# using Windows.Devices.Bluetooth.GenericAttributeProfile.

    I use the UUID 0x2800 ( 00002800-0000-1000-8000-00805F9B34FB in extend notation) to find all primary services in according with the Bluetooth LE standard.

    However i can't get any services looking for the uiid 0x2800 but if i try to use 0x1800 (GenericAttributeProfile) that does work!! 

    Do you know why? or instead, is there someone who solved the problem?

    Thank's for reply!


    Thursday, March 27, 2014 3:50 PM

Answers

  • On Windows 8.0 and 8.1, there is no WinRT API that you can use to enumerate all services belonging to a Bluetooth LE device, nor all characteristics belonging to a service.

    These APIs exist on Windows Phone 8.1. We are hoping to integrate them into Windows in a future release.

    Tuesday, April 01, 2014 5:35 PM

All replies

  • I'll ask our networking guru to take a look at this.

    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    Monday, March 31, 2014 12:35 PM
    Moderator
  • https://onedrive.live.com/redir?resid=5BE612B436710862!505&authkey=!ACEdJR_uf_Alc6k&ithint=file%2c.zip

    This is where you can find the Test Project.

    I have created 2 buttons:

    • one to test the heartRate measurament characteristics;
    • another to test the search of all characteristics, in according to GATT standard.

    looking for all primary services or looking for all characteristics of a selected primary service should be the same thing.

    I link for more details this page:

    http://epx.com.br/artigos/bluetooth_gatt.php

    Tuesday, April 01, 2014 1:53 PM
  • On Windows 8.0 and 8.1, there is no WinRT API that you can use to enumerate all services belonging to a Bluetooth LE device, nor all characteristics belonging to a service.

    These APIs exist on Windows Phone 8.1. We are hoping to integrate them into Windows in a future release.

    Tuesday, April 01, 2014 5:35 PM
  • thanks for answering!

    Well, there are no APIs for our purpose, but why if i use a normal characteristic ( or service discovery ) using general UUID 0x2803 (or 0x2800) that doesn't work?

    also, if i use that statements,

    GattDeviceService firstService = await GattDeviceService.FromIdAsync(device.Id);
    
    ......
    
    IReadOnlyList<GattCharacteristic> a = firstService.GetCharacteristics(MY_CHAR_UUID);
    
     
     

    why GetCharacteristic(....) return a list of characteristics instead of a single value if the API by design can't search more than one characteristics????

    • Edited by Luca.Tresoldi Wednesday, April 02, 2014 8:56 AM add question
    Wednesday, April 02, 2014 7:20 AM
  • Thanks for the answer. It's disappointing, but at least nice to have confirmation that this is a known issue and there's hope for the future.

    That said, part of the limitation in the WinRT API is not just that it lacks the "...AllIncludedServices/Characteristics" versions of the GattDeviceService API, but that there appears to be a requirement that any services one wants to communicate with must be pre-declared in the app manifest.

    So a very important part of supporting the "all" enumerations will be to remove this restriction.

    I have been experimenting with custom BLE hardware and have been greatly disappointed to find that while Android supports full BLE device discovery and access, the Windows API is so restricted. I much prefer the Windows platform in general, but for better or worse, one has to go where the OS support is. :(

    If Windows can catch up to Android here, that would be great. (I haven't even looked at iOS yet...that's a last resort!).

    Sunday, May 11, 2014 5:04 AM