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

Looking for way to get central to match service UUID pattern

I am trying to provide a custom peripheral service with a 128-bit UUID in an nRF51822. I would like to use two bytes of the UUID to encode a piece of information unique to each device, but the service is the same in all devices, and the characteristic UUID are all the same. I need to connect to each peripheral with a central (S130) softdevice, but the only way I see to do this is to register a separate service for every expected UUID with ble_db_discovery_evt_register. This is impractical for any more than a few values. Is there any way to have the discovery process treat the UUID as a pattern, producing a match for only part of it? Or is there some way to update the discovery db with the appropriate service UUID each time before connecting to a peripheral? Thanks in advance for any suggestions.

Parents
  • Advertising and scanning happens before connection, and service discovery happens after connection. You do not have to advertise the same UUID as you have in you gatt server (the one found in service discovery). You can advertise a custom uuid (with encoded data inside), and recognize this in you scanner handling. Alternatively you can put custom data in the manufacturer specific field in the advertisement.

Reply
  • Advertising and scanning happens before connection, and service discovery happens after connection. You do not have to advertise the same UUID as you have in you gatt server (the one found in service discovery). You can advertise a custom uuid (with encoded data inside), and recognize this in you scanner handling. Alternatively you can put custom data in the manufacturer specific field in the advertisement.

Children
No Data
Related