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
  • Do I understand it correctly that your two primary services (representing two sensors) have different UUIDs (because that's what BT SIG demands)?

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

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

Children
No Data
Related