Building Bluetooth Low Energy Systems
上QQ阅读APP看书,第一时间看更新

Universally Unique Identifiers (UUIDs)

A UUID is a unique identifier that is guaranteed to be globally unique all the time. It is a 128-bit identifier out of which some pre-allocated values are used for registration purposes as described by the Bluetooth SIG. One of the very first pre-allocated values for UUID is known as Bluetooth Base UUID and has a value of 00000000-0000-1000-8000- 00805F9B34FB. Pre-allocated values in the UUID often has 16-bits or 32-bits aliases that can be used to generate your own UUIDs. The formula for generating a 128-bits UUID with pre-allocated alias is:

128-bit-UUID = 16-bit-value * 2 ^ 96 + Bluetooth-Base-UUID
128-bit-UUID = 32-bit-value * 2 ^ 96 + Bluetooth-Base-UUID

Bluetooth SIG provides UUIDS for services and profiles and they are made for a specific purpose. If it doesn't specify a particular need, a new UUID can be created. Using the Bluetooth-Base-UUID is recommended by the SIG for this purpose.