Friday 9 December 2016

Let's ID UUIDs

A UUID stands for Universally Unique Identity. Pretty heavy don't you think? To claim that something is unique in the entire universe is a bold move. Anyway, a UUID is a number representing the type of data stored in BLE servers, beacons and anything that uses Bluetooth and stores some data.
The way Bluetooth technology looks at data is centred around UUIDs. A UUID is used to classify data into certain types. It is just like a data type like your ints and floats of the world. The difference is that each type is a huge number and there is a huge number of these types.
Like in any programming language, same binary digits would mean different things depending on what type of data they are i.e. what is their UUID.
Now that you know what a UUID is, I want you to question who decides these UUIDs? The obvious answer would be the people that came up with the whole idea of UUIDs i.e. the Bluetooth SIG. This answer is true but not complete. As it turns out, there are two types of UUIDs that can be found:

One type is of the UUIDs that are 16 bits long and the other is of the UUIDs that are 16 bytes long. So you can imagine that the first type will contain a much lesser number of UUIDs.

The 16 bit UUIDs are provided by the standard. They were set at the time of inception of this specification or in consecutive years but only the SIG. A list of these UUIDs can be found at the Bluetooth website. Since these are provided by SIG, they remain constant. These are sort of like the built in data types supplied by a programming language.

The 16 byte UUIDs are kind of made up by various organisations and companies around the globe (or dare I say the universe) as they go along exploring newer areas and inventing new kinds of data crunched by Bluetooth devices. Once someone has an idea for a new type of data (a new profile), then they have to register that with the SIG and also provide the specification for it. This type will then be given a 16 byte unique number which will not be used by any other type afterwards. The larger length of this type of UUID make sense because the number of such applicants is enormously big. This whole thing is like making a new class and then turning it into a library for the rest of the world to use. The UUID is just a unique ID for your class/library.

No comments:

Post a Comment