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

How to fetch peer's base uuid?

Hi experts,

I have just tried lbs example. I saw in the ble_lbs_c.h, the base uuid and service uuid are defined for the peripheral peers who are going to be connected. However, if I don't know these uuids, I would like to read them from the peripheral devices when they are discovered or connected. Is there any way to do this?

thanks.

  • The device i want to connect is a nrf51822 device, whose app is modified from lbs example. it should be a GATT server i think. the other side is a 52832 device, running lbs_c example, so it is a GATT client. The two side should define the same service uuid, then 52832can successfully finish db discovery after connecting. if 52832 give wrong service uuid, db discovery will fail. I want to know if there is a method for 52832 to read full uuid from 51822 after connecting, then start db discovery. The reason is there are lots of custom devices with non-standard service uuid 52832 needs to connect. android app can do this, right?

  • What Android app is doing is "full" ATT/GATT Service Discovery so it will try to show you what all is on ATT stack. You can do that in nRF5x FW with GATT Client as well, just not sure how to do it with DB module, I'm not using it. I'm afraid the example you are using is single-app example which assumes you are using particular Services/Characteristics (with fixed UUIDs known to both sides from the beginning). But you can take ble-db-discovery module as example and rewrite it i order to do "full" service discovery in the code so you can extract all discovered handles, their type and UUID (if applicable) and do whatever you need with them.

Related