This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Service discovery when peripheral has the same service multiple times

My peripheral uses a generic sensor service which I use for various sensors. Most of the sensors only have one integer as value and can be abstracted the same, hence I made a generic sensor service. Now there will be cases where the peripheral has two sensors, each having their instance of my sensor service. This seems to work fine on the nRF Connect app.

The issues I am having is discovering both these services in my central device. I registered the uuid using ble_db_discovery_evt_register(), but I only get one event.

Parents Reply Children
  • They don't, it's the same UUID. I thought it was allowed because of this in the Core Spec Vol 3 Part G 3.1 Service Definition: A device or higher level specification may have multiple service definitions and may have multiple service definitions with the same service UUID.. I thought this meant it was fine to implement the exact same service twice.

  • OK, you seems to be right, that's what BT spec says. It doesn't make much sense to me (because on GATT you cannot do any straight forward enumeration) but you probably can do it if you want. However if ble_db module works on UUID level it's no surprise it cannot handle it. To be sure it is limitation/bug in that module you can either wait for someone else to answer (I'm not using it, I prefer custom Service Discovery mechanism done by my code) or get BLE RF sniffer log and verify that really both services were "discovered" on radio but you got triggered only once.

Related