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
  • FormerMember
    0 FormerMember

    My first thought is that the problem is related to how the db_discovery module works on the central side, it does only look for the services and the number of services it expects to find, see on_srv_disc_completion(), the variable p_db_discovery->discoveries_countand the variable m_num_of_handlers_reg.

    To make the central look for the "duplicate" service, you would need to make sure that the central looks for one more service than it currently does. And possibly also associate the extra service discovery with a UUID. (Note: I haven't tested this..)

  • I suppose it would be easier to change my services in that case. Thanks for the answer.

Reply Children
No Data
Related