cancel
Showing results for 
Search instead for 
Did you mean: 

Generating BLE 128 bit Custom UUID

RADS1
Associate II
Posted on March 15, 2017 at 10:48

Hi,

What is the best way to generate custom BLE 128 bit UUIDs ?

How has ST generated the custom UUIDs in the firmware examples of Sensortile kit related to BLE ? For example, following are some UUIDs(in bold) in one of the firmware example :

/* Hardware Characteristics Service */

&sharpdefine COPY_HW_SENS_W2ST_SERVICE_UUID(uuid_struct)    COPY_UUID_128(uuid_struct,0x00,0x00,0x00,0x00,0x00,0x01,0x11,0xe1,0x9a,0xb4,0x00,0x02,0xa5,0xd5,0xc5,0x1b)

&sharpdefine COPY_ENVIRONMENTAL_W2ST_CHAR_UUID(uuid_struct) COPY_UUID_128(uuid_struct,0x00,0x00,0x00,0x00,0x00,0x01,0x11,0xe1,0xac,0x36,0x00,0x02,0xa5,0xd5,0xc5,0x1b)

Is there a tool available for the same ?

Best Regards.

#ble-128-bit-custom-uuid #uuid #bluenrg #st-bluenrg
2 REPLIES 2
Rashedul Islam
Associate III
Posted on October 17, 2017 at 14:31

Hi I am also having similar type of problem. For bluetooth module I want to add new characteristic under an existing service. But I am not sure how the UUID pattern is used. If you have resolved the issue then please share

#

#bluenrg

#st%20bluenrg

Antonio Vilei
Senior III
Posted on October 18, 2017 at 15:25

You are free to use any 128-bit UUID that you want, provided that it is not in the range of pre-allocated UUIDs, as specified below.

According to the Bluetooth specification:

'A UUID is a universally unique identifier that is guaranteed to be unique across

all space and all time. UUIDs can be independently created in a distributed

fashion. No central registry of assigned UUIDs is required. A UUID is a 128-bit

value.

To reduce the burden of storing and transferring 128-bit UUID values, a range

of UUID values has been pre-allocated for assignment to often-used, registered

purposes. The first UUID in this pre-allocated range is known as the

Bluetooth Base UUID and has the value 00000000-0000-1000-8000-

00805F9B34FB, from the Bluetooth Assigned Numbers

document. UUID values

in the pre-allocated range have aliases that are represented as 16-bit or

32-bit values. These aliases are often called 16-bit and 32-bit UUIDs, but it is

important to note that each actually represents a 128-bit UUID value.

The full 128-bit value of a 16-bit or 32-bit UUID may be computed by a simple

arithmetic operation.

128_bit_value = 16_bit_value * 2^

96

+ Bluetooth_Base_UUID

128_bit_value = 32_bit_value * 2^

96

+ Bluetooth_Base_UUID

'.

Also, please notice that you can't use 16-bit or 32-bit values for user-defined services and characteristics, as they are reserved for registered purposes.

Best regards,

Antonio