This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

gatt service inquiry

Hi,

In addition to listening the advertiser's and beacon data we also need to offer the master application - which is connected to BLE-module via UART - the possibility to connect to peripheral and get information of available GATT-services. For this we need to be able to inquire service uuids from the connected peripheral.

I've been browsing through the examples but not been able to find out the solution for this. There are samples for listening the defined services, but not one for getting the information of all the available services.

Could anyone please guide me to the correct example, or give me some step-by-step information for building such an application.

Devkit used is nRF52840-DK, SDK revision is nRF5_SDK_16.0.0_98a08e2

Regards, Jukka

Parents
  • Hi Jukka

    This is done similarly in the Android app as well. It does a service discovery (including registering the UUIDs from the peripheral) and then does a service discovery to find all services, both known and unknown.

    Best regards,

    Simon

  • ok Simon,

    It seems that I haven't been able to express our problem clearly enough.

    Lets go step by step:

    1. we listen to beacons and find a peripheral with UUID 0x7571823740D8 as shown in the above conversation

    2. we make a connection to the peripheral

    3. we know absolutely nothing about the services the peripheral is offering

    4. how do we make an application, which after making a connection can find that e.g. service with uuid 0x180F is found on the peripheral, without us knowing it in advance? So that we can make a similar list that the Android app is showing.

    The modification I made using ble_db_discovery_evt_register() above made an assumption that I knew the services registered are available, which I actually don't know in the real world.

    I think that we now need some code examples showing step-by-step the operation needed.

    BR Jukka

Reply
  • ok Simon,

    It seems that I haven't been able to express our problem clearly enough.

    Lets go step by step:

    1. we listen to beacons and find a peripheral with UUID 0x7571823740D8 as shown in the above conversation

    2. we make a connection to the peripheral

    3. we know absolutely nothing about the services the peripheral is offering

    4. how do we make an application, which after making a connection can find that e.g. service with uuid 0x180F is found on the peripheral, without us knowing it in advance? So that we can make a similar list that the Android app is showing.

    The modification I made using ble_db_discovery_evt_register() above made an assumption that I knew the services registered are available, which I actually don't know in the real world.

    I think that we now need some code examples showing step-by-step the operation needed.

    BR Jukka

Children
No Data
Related