This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Using the same characteristic UUID in multiple services

I have a demo(s110) set up with some custom services, and in them custom characteristics. The services each relate to a specific sensor element on my device, so have a mostly shared structure of the service, i.e. I re-use characteristic UUIDs across different services

I noticed when I enabled notifications on one characteristic in a service, the other characteristic notification in another service was also enabled.

Does this mean each service will have to have unique characteristic UUIDs? I assumed it was a sort of hierarchical thing where the characteristics scope was within it's parent service only. How does it really work with characteristic UUIDs?

Parents
  • As far as I know, it shouldn't be necessary to have unique characteristic UUIDs. After service discovery the ATT operations are referenced with the attribute handle, so this doesn't make sense to me. Could you explain to me how you check that both CCCDs are actually changed? Have you tried reading them to check that they are actually 0x0001? What is your central device? Do you have sniffer trace where this happens? Or could this be related to how you handle the write event (BLE_GATTS_EVT_WRITE) in ble_evt_dispatch()?

  • Accidentally converted that to answer. Oops.

    I've realised you have made a good point though. On checking the CCCD values it seems like the only one that actually changes is that of the one I activate. In the Nordic MCP app for my phone (which I'm using as the central) when I tap to turn on notifications, it changes all the notification icons. Pretty confusing.

    Must be a bug in the app itself.

    Good to know that I can reuse Characteristic UUIDs though, thanks.

Reply
  • Accidentally converted that to answer. Oops.

    I've realised you have made a good point though. On checking the CCCD values it seems like the only one that actually changes is that of the one I activate. In the Nordic MCP app for my phone (which I'm using as the central) when I tap to turn on notifications, it changes all the notification icons. Pretty confusing.

    Must be a bug in the app itself.

    Good to know that I can reuse Characteristic UUIDs though, thanks.

Children
No Data
Related