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

  • "Base UUIDs" is visible in the full UUID as well. You cannot "fix" UUID without knowing the base, again on both sides. The only difference between "short" UUID (2-byte) and "full UUID" (16-byte) is that short UUIDs are mapped on "BT SIG base UUID" which is well known. but if you would expose it in 16-byte format it would mean the same and GATT compliant devices should understand it. So to summarize: you see "base UUID" if you see full UUID (and these are typically exposed freely on GATT Server side), if you change "base UUID" it will of course change all the UUIDs which are using that as "common" base and so UUIDs will become unknown to the other party.

Reply
  • "Base UUIDs" is visible in the full UUID as well. You cannot "fix" UUID without knowing the base, again on both sides. The only difference between "short" UUID (2-byte) and "full UUID" (16-byte) is that short UUIDs are mapped on "BT SIG base UUID" which is well known. but if you would expose it in 16-byte format it would mean the same and GATT compliant devices should understand it. So to summarize: you see "base UUID" if you see full UUID (and these are typically exposed freely on GATT Server side), if you change "base UUID" it will of course change all the UUIDs which are using that as "common" base and so UUIDs will become unknown to the other party.

Children
No Data
Related