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.

Parents
  • As GATT Client you can do full GATT service discovery meaning read all handles and their UUIDs as soon as you connect and see GATT Server on the other side. But if you don't know it before connection then you obviously don't have it. Actually UUIDs are meant to be always known and public, that's how any application can work on top of ATT/GATT (= looks for the particular Service/Characteristic etc. all named just by UUIDs).

  • 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.

Reply
  • 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.

Children
No Data
Related