This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

128-bit UUID with the TI BLE stack

Hi,

A couple quick questions that I hope someone can help me with. I've had a good look through the Bluetooth standards documents, but I can't find where any of this is referenced/explained in the very heavy Bluetooth standards documents.

1. I believe all 16-bit UUIDs are strictly to be defined by the Bluetooth SIG. If you are using custom profiles, I believe you need to use 128-bit UUID's that do not conflict with the 16-bit UUIDs. Is this true?

2. If above is true, how do you pick a 128-bit UUID to use? Is there a standised way from the Bluetooth SIG, or can you just pick any number out of the air? 

3. Currently I'm using custom 16-bit UUIDs for development purposes, hence I would need to use 128-bit UUIDs. I don't see any TI examples using 128-bit UUIDs, so I can't confirm if this below is correct. However I assume the Gatt Attribute array is define as per this:

{
  { ATT_UUID_SIZE, fooUUID }, /* type */
  GATT_PERMIT_READ, /* permissions */
  0, /* handle */
  (uint8 *)&barValue /* pValue */
},

Where fooUUID is a 128bit number made up with the UUID.

4. Do custom profiles have to be registered with the SIG? If not, what mechanisms are in place to prevent 128-bit UUIDs conflicting between devices?

Thanks,
Simon.

  • Would love to know the answer to this too..

  • Hi Simon,

    just a quick response.

    1) True. Custom means you must use 128bit

    2) Google UUID generator and you'll get more leads than you can poke a stick at.

    3) That's the way; use ATT_UUID_SIZE for 128bit values. Here's a snippet from my code. I have fudged a 128bit UUID to make debugging (with BTool etc) a bit easier on the brain.

    CONST uint8 A128_Type0_W_CharUUID[ATT_UUID_SIZE] =
    {//NSString *kType0_W_CharacteristicUUIDString = @"D1D1D1D1-DEAD-F154-1319-740381000000";
      0x00,  0x00,  0x00,  0x81,  0x03,  0x74,  0x19,  0x13,
      0x54,  0xF1,  0xAD,  0xDE,  0xD1,  0xD1,  0xD1,  0xD1,
    };

    // Core 4.0 1895/2302
    static gattAttribute_t TDP_A_AttrTbl[] =
    {
      //===== 128 bit Service =====
      { { ATT_BT_UUID_SIZE, primaryServiceUUID }, /* type */ //ks [ 0](0F) 0x2800 // Primary Service
          GATT_PERMIT_READ,                       /* permissions */
          0,                                      /* handle */
          (uint8 *)&TDP_A_A128_Service             /* pValue */
      },

      //===== 128 bit Type0 Packet Write Characteristic =====
      // = Characteristic Declaration =
      { { ATT_BT_UUID_SIZE, characterUUID }, //ks [ 1] 0x2803 // Characteristic
          GATT_PERMIT_READ,
          0,
          &A128_Type0_W_Props
      },
      // = Characteristic Value =
      { { ATT_UUID_SIZE, A128_Type0_W_CharUUID }, //ks [ 2] "D1D1D1D1-DEAD-F154-1319-740381000000"
          GATT_PERMIT_READ | GATT_PERMIT_WRITE,
          0,
          (uint8 *)&A128_Type0_W_Char
      },

    4) Re: the SIG. I don't think you have to register your 128bit UUID with SIG, but I would assume that your profile would have to be tested (self test may be possible), but when in doubt ask the SIG. Re: conflicting 128 UUIDs -> Think to yourself, how big is a 128bit number? Again Google UUID Generator and educate yourself.

    Karel

  • Thanks for your answer, very useful. Especially with the example showing the Endianness of the UUID array - something I always forget to check when developing across platforms and come a cropper on!

    Its reminded me that Microsoft has a very good UUID (called GUID in the MS world) generator - which is 128bits long - I'll probably use that.

    Cheers,

    Si.

  • Anyone reading along or coming across this thread maybe interested in this TI Wiki entry on 128-bit UUID's too - http://processors.wiki.ti.com/index.php/128_Bit_UUID_SimpleBLE

    Si.

  • I think, SensorTag example will help you to get some idea about 128-bit UUID.