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.

CC2642R: Define a 128 bit UUID

Part Number: CC2642R

Hi TI experts,

I downloaded the reference code and then integrated it to my code.

By the way, I would like to confirm some points with respect to the "UUID_SIZE".

As you can see the below configuration, 2nd characteristic value has wrong UUID_SIZE usages.

The custom-UUID for each characteristic has to have the UUID_SIZE and pre-defined Bluetooth Sig uses has to have the 16-bit UUID(ATT_BT_UUID_SIZE).

Your reference code needs to be corrected.

static gattAttribute_t simpleProfileAttrTbl[SERVAPP_NUM_ATTR_SUPPORTED] =
{
  // Simple Profile Service
  {
    { ATT_BT_UUID_SIZE, primaryServiceUUID }, /* type */
    GATT_PERMIT_READ,                         /* permissions */
    0,                                        /* handle */
    (uint8 *)&simpleProfileService            /* pValue */
  },

    // Characteristic 1 Declaration
    {
      { ATT_BT_UUID_SIZE, characterUUID },
      GATT_PERMIT_READ,
      0,
      &simpleProfileChar1Props
    },

      // Characteristic Value 1
      {
        { UUID_SIZE, simpleProfilechar1UUID },
        GATT_PERMIT_READ | GATT_PERMIT_WRITE,
        0,
        &simpleProfileChar1
      },

      // Characteristic 1 User Description
      {
        { ATT_BT_UUID_SIZE, charUserDescUUID },
        GATT_PERMIT_READ,
        0,
        simpleProfileChar1UserDesp
      },      

    // Characteristic 2 Declaration
    {
      { UUID_SIZE, characterUUID },
      GATT_PERMIT_READ,
      0,
      &simpleProfileChar2Props
    },

      // Characteristic Value 2
      {
        { ATT_BT_UUID_SIZE, simpleProfilechar2UUID },
        GATT_PERMIT_READ,
        0,
        &simpleProfileChar2
      },

      // Characteristic 2 User Description
      {
        { ATT_BT_UUID_SIZE, charUserDescUUID },
        GATT_PERMIT_READ,
        0,
        simpleProfileChar2UserDesp
      },           
      
    // Characteristic 3 Declaration
    {
      { UUID_SIZE, characterUUID },
      GATT_PERMIT_READ,
      0,
      &simpleProfileChar3Props
    },

      // Characteristic Value 3
      {
        { ATT_BT_UUID_SIZE, simpleProfilechar3UUID },
        GATT_PERMIT_WRITE,
        0,
        &simpleProfileChar3
      },

      // Characteristic 3 User Description
      {
        { ATT_BT_UUID_SIZE, charUserDescUUID },
        GATT_PERMIT_READ,
        0,
        simpleProfileChar3UserDesp
      },

    // Characteristic 4 Declaration
    {
      { UUID_SIZE, characterUUID },
      GATT_PERMIT_READ,
      0,
      &simpleProfileChar4Props
    },

      // Characteristic Value 4
      {
        { ATT_BT_UUID_SIZE, simpleProfilechar4UUID },
        0,
        0,
        &simpleProfileChar4
      },

      // Characteristic 4 configuration
      {
        { ATT_BT_UUID_SIZE, clientCharCfgUUID },
        GATT_PERMIT_READ | GATT_PERMIT_WRITE,
        0,
        (uint8 *)simpleProfileChar4Config
      },
      
      // Characteristic 4 User Description
      {
        { ATT_BT_UUID_SIZE, charUserDescUUID },
        GATT_PERMIT_READ,
        0,
        simpleProfileChar4UserDesp
      },
      
    // Characteristic 5 Declaration
    {
      { UUID_SIZE, characterUUID },
      GATT_PERMIT_READ,
      0,
      &simpleProfileChar5Props
    },

      // Characteristic Value 5
      {
        { ATT_BT_UUID_SIZE, simpleProfilechar5UUID },
        GATT_PERMIT_AUTHEN_READ,
        0,
        simpleProfileChar5
      },

      // Characteristic 5 User Description
      {
        { ATT_BT_UUID_SIZE, charUserDescUUID },
        GATT_PERMIT_READ,
        0,
        simpleProfileChar5UserDesp
      },


};

BR,

Ji-won Lee

  • Hello Ji-won,
    Which SDK is this from?
  • I downloaded it from the below link.

    processors.wiki.ti.com/.../128_Bit_UUID_SimpleBLE

    BR,
    Ji-won
  • You are right. I fixed it.
  • Thanks for your effort, but you just touched only one among wrong points.

    I will point them out as below in yellow color. Yellow ones needs to be changed to Green ones.

    static gattAttribute_t simpleProfileAttrTbl[SERVAPP_NUM_ATTR_SUPPORTED] =

    {

     // Simple Profile Service

     {

       { ATT_BT_UUID_SIZE, primaryServiceUUID }, /* type */

       GATT_PERMIT_READ,                         /* permissions */

       0,                                        /* handle */

       (uint8 *)&simpleProfileService            /* pValue */

     },

       // Characteristic 1 Declaration

       {

         { ATT_BT_UUID_SIZE, characterUUID },

         GATT_PERMIT_READ,

         0,

         &simpleProfileChar1Props

       },

         // Characteristic Value 1

         {

           { UUID_SIZE, simpleProfilechar1UUID },

           GATT_PERMIT_READ | GATT_PERMIT_WRITE,

           0,

           &simpleProfileChar1

         },

         // Characteristic 1 User Description

         {

           { ATT_BT_UUID_SIZE, charUserDescUUID },

           GATT_PERMIT_READ,

           0,

           simpleProfileChar1UserDesp

         },      

       // Characteristic 2 Declaration

       {

         { ATT_BT_UUID_SIZE, characterUUID },

         GATT_PERMIT_READ,

         0,

         &simpleProfileChar2Props

       },

         // Characteristic Value 2

         {

           { UUID_SIZE, simpleProfilechar2UUID },

           GATT_PERMIT_READ,

           0,

           &simpleProfileChar2

         },

         // Characteristic 2 User Description

         {

           { ATT_BT_UUID_SIZE, charUserDescUUID },

           GATT_PERMIT_READ,

           0,

           simpleProfileChar2UserDesp

         },          

       // Characteristic 3 Declaration

       {

         { UUID_SIZE, characterUUID },    ==> ATT_BT_UUID_SIZE

         GATT_PERMIT_READ,

         0,

         &simpleProfileChar3Props

       },

         // Characteristic Value 3

         {

           { ATT_BT_UUID_SIZE, simpleProfilechar3UUID },   ==> UUID_SIZE

           GATT_PERMIT_WRITE,

           0,

           &simpleProfileChar3

         },

         // Characteristic 3 User Description

         {

           { ATT_BT_UUID_SIZE, charUserDescUUID },

           GATT_PERMIT_READ,

           0,

           simpleProfileChar3UserDesp

         },

       // Characteristic 4 Declaration

       {

         { UUID_SIZE, characterUUID },  ==> ATT_BT_UUID_SIZE

         GATT_PERMIT_READ,

         0,

         &simpleProfileChar4Props

       },

         // Characteristic Value 4

         {

           { ATT_BT_UUID_SIZE, simpleProfilechar4UUID },   ==> UUID_SIZE

           0,

           0,

           &simpleProfileChar4

         },

         // Characteristic 4 configuration

         {

           { ATT_BT_UUID_SIZE, clientCharCfgUUID },

           GATT_PERMIT_READ | GATT_PERMIT_WRITE,

           0,

           (uint8 *)simpleProfileChar4Config

         },

         // Characteristic 4 User Description

         {

           { ATT_BT_UUID_SIZE, charUserDescUUID },

           GATT_PERMIT_READ,

           0,

           simpleProfileChar4UserDesp

         },

       // Characteristic 5 Declaration

       {

         { UUID_SIZE, characterUUID },    ==> ATT_BT_UUID_SIZE

         GATT_PERMIT_READ,

         0,

         &simpleProfileChar5Props

       },

         // Characteristic Value 5

         {

           { ATT_BT_UUID_SIZE, simpleProfilechar5UUID },    ==> UUID_SIZE

           GATT_PERMIT_AUTHEN_READ,

           0,

           simpleProfileChar5

         },

         // Characteristic 5 User Description

         {

           { ATT_BT_UUID_SIZE, charUserDescUUID },

           GATT_PERMIT_READ,

           0,

           simpleProfileChar5UserDesp

         },

    };

    BR,

    Ji-won

  • Aha, I see :). Thanks, I fixed the rest.