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

Use random 128-bit UUIDs for characteristics in a service?

Is it possible to use random 128-bit UUIDs for custom services and characteristics? Or do the characteristics in a service need to share 96-bits with the custom service UUID?

If this is the custom service UUID: 04DC0000-BB82-4D0E-8C9C-65F674109A50

Do the characteristics need to be defined as this:

Characteristic 1 UUID: 04DCAAAA-BB82-4D0E-8C9C-65F674109A50

Characteristic 2 UUID: 04DCBBBB-BB82-4D0E-8C9C-65F674109A50

Characteristic 2 UUID: 04DCCCCC-BB82-4D0E-8C9C-65F674109A50

and so on.

Or is it possible to define random characteristic UUIDs that does not share bits with the service UUID (Or have I misunderstood the BLE standard and that is not allowed)?

Parents
  • You can have anything you like, the UUIDs are entirely unrelated to each other. The official 16bit UUIDS do all share a common base, they have to because there needs to be a way to map 16 bits to the full UUID, but for custom ones, you can have totally random numbers for every service and characteristic.

    I would suggest however sticking to as few base UUIDs as possible. Firstly it makes your characteristics and services easier to read when you're debugging them. Secondly each base UUID takes up RAM in the custom UUID table in the softdevice so if you have 10 of them you've used up 10x as much RAM as if you had one of them.

Reply
  • You can have anything you like, the UUIDs are entirely unrelated to each other. The official 16bit UUIDS do all share a common base, they have to because there needs to be a way to map 16 bits to the full UUID, but for custom ones, you can have totally random numbers for every service and characteristic.

    I would suggest however sticking to as few base UUIDs as possible. Firstly it makes your characteristics and services easier to read when you're debugging them. Secondly each base UUID takes up RAM in the custom UUID table in the softdevice so if you have 10 of them you've used up 10x as much RAM as if you had one of them.

Children
No Data
Related