You are here: Information > Use Decoder Script to Extend Frontline Products > Handling 128-bit UUIDs

Handling 128-bit UUIDs

In ATT, UUIDs come in two sizes: 16 bit and 128 bit. The Bluetooth® SIG uses a ‘Base UUID’.

0000xxxx-0000-1000-8000-00805F9B34FB

The only part that changes is the second double-word where the xxxx as shown above. Generally the SIG adopted profiles transmit only 16 bit UUIDs. Default processing in ComProbe software is to extract 16 bits from any 128 bit UUID and match to the GATT_UUIDs table.

If your 128 bit UUIDs are unique in those 16 bits, you can just extract those bits and enter them as above. But there is some risk to that. If the SIG uses your 16 bit value, you will have a conflict with the SIG. If your UUIDs don’t differ in those 16 bits, you have an internal conflict. DecoderScript cannot perform logic on any value larger than 64 bits so simply entering the full UUID is not possible. Trying to do two 64 bit comparisons is unworkable.

Fortunately, Frontline has a solution.

  1. Create a text file in your ‘My Decoders’ directory and name it “ATT_Custom_LongUUIDs.ini”. It MUST be in the‘My Decoders̕ directory and the name MUST match. The content of that file should look like this:

    [Long UUIDs]

    ; HELLO BLUETOOTH

    b8d02d81-6329-ef96-8a4d-55b376d8b25a = 0x7f000001 // Service

    5a50528d-e5ba-4620-90ac-33e5b913684c = 0x7f000002 // Characteristic Use Name

    There must be a section called [Long UUIDs].

    The first field is the long UUID.

    • You may enter the bytes as transmitted or in reverse order.
    • You may include dashes.
    • You can use the // comment
    • Lines beginning with ";" are ignored.

    The second field is one you choose. This is the number you will add to GATT_UUIDs.

    • Make your number greater than 16 bits (4 hex digits). This ensures that your value cannot conflict with SIG UUIDs.
    • No negative numbers. Note the 0x7F in the code above. That puts a "0" in the high bit and ensures a positive number.
  2. When you have created ATT_Custom_LongUUIDs.ini, you are ready to use your numbers in GATT_UUIDs. Note that the 0x7f000001 in GATT_UUIDs corresponds to the mapping in the ATT_Custom_LongUUIDs.ini

    TABLE tMyTable APPENDS_AND_OVERWRITES GATT_UUIDs

    // Hello Bluetooth Service

    { 0x7f000001 "Hello Bluetooth" }

    { 0x7f000002 "User Name" "User Name" 0 chHelloBT_UserName }

    ENDTABLE

Walking through what happens: When we receive a long UUID, we check the LongUUID table first. We check for the UUID both in transmitted order and reverse order. If there is a mapping to a 32 bit number, we use it. If there is no mapping, we extract the second doubleword and use that.