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.

Change UUID to 128bit (costum profile) and is GATT service replaced ?

Hi

I need to make ONE costum profile with following UUID's:

GATT service with UUID:    E20A39F4-73F5-4BC4-A12F-17D1AD07A961
Device characteristic with UUID:    08590F7E-DB05-467E-8757-72F6FAEB13D4
Data characteristic with UUID:    08590F7E-DB05-467E-8757-72F6FAEB13D2

I use SimpleBLEPeripheal project as template but i cannot find where to type in the "new" UUID

One place where i have found UUID (128Bit) is here:

// TI Base 128-bit UUID: F000XXXX-0451-4000-B000-000000000000
#define TI_BASE_UUID_128( uuid ) 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xB0, \
0x00, 0x40, 0x51, 0x04, LO_UINT16( uuid ), HI_UINT16( uuid ), 0x00, 0xF0

When i chage it here the BLE Device Monitor tool do not show any different values !!!

Can someone tell me how this costum profile corresponds to the GATT service 00:18 (Generic Access Profile)

01:18 (Generic Attribute Service) and for example 0A:18 (Device Information Service)

Are above GATT services still available after a new profile has been implemented or is the GATT services replaced ?

Hope for a quick reply, thanks in advance.

Kind regards

Christian

 

  • Hi Christian,

    For each service, the UUIDs associated with it is inserted into the code in the service/profile file's attribute table.

    For example for the SimpleGATTService that's in SimpleBLEPeripheral; simpleGATTprofile.c,

    /* First, the UUID is taken from a define and put into a variable */
    
    // Simple GATT Profile Service UUID: 0xFFF0
    CONST uint8 simpleProfileServUUID[ATT_BT_UUID_SIZE] =
    { 
    LO_UINT16(SIMPLEPROFILE_SERV_UUID), HI_UINT16(SIMPLEPROFILE_SERV_UUID)
    };
    
    /* Next, this UUID variable is pointed to in another variable */
    
    // Simple Profile Service attribute
    static CONST gattAttrType_t simpleProfileService = { ATT_BT_UUID_SIZE, simpleProfileServUUID };
    
    
    /* Third, in the attribute table, the composite variable is pointed to */
    
    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 */
    },

    For 128-bit UUIDs, the size has to be ATT_UUID_SIZE instead of ATT_BT_UUID_SIZE.

    For characteristics, it's a bit different, but similar approach. See the sensortag project, for example the accelerometer service, for how this is handled there.

    BR,
    Aslak