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.

Problem sending data to peripheral using 128 bit UUIDs

I have made the changes from the Wiki 128 bit UUID example to my working app and now cannot send data from central to peripheral.

I am sending the data using the correct handle for SIMPLEPROFILE_CHAR1 using GATT_WriteCharValue.

The packet arrives at the peripheral but the 2 bytes of the UUID which should be FF F1 and actually 00 00.

It would help to diagnose this problem if I knew how it worked. The UUID does not appear in the data as shown in the sniffer, only the handle does as far as I can see. Where does the UUID come from? The relevant bytes are pAttr->type.uuid[0], pAttr->type.uuid[1] on the peripheral. I am not clear on where these are populated from and why they are 00 instead of FF F1.

If I remove the define to revert to 16 bit UUID everything works again.

  • I found the problem and it seems to be a bug in the Wiki 128 bit UUID code.

    In SimpleGATTProfile.C:

    in simpleProfile_WriteAttrCB:

    // 128-bit UUID
    const uint8 uuid[ATT_UUID_SIZE] =
    {
    TI_UUID(BUILD_UINT16( pAttr->type.uuid[0], pAttr->type.uuid[1]))
    };

    if ( osal_memcmp(uuid, simpleProfilechar1UUID, ATT_UUID_SIZE) || osal_memcmp(uuid, simpleProfilechar3UUID, ATT_UUID_SIZE))
    {
    //Validate the value

    This code is using the wrong bytes of the 128 bit UUID which is sent, to do the validation. The bytes which are specific to the characteristic are only bytes 0 and 1 if a 16-bit UUID is being used. For 128 bit UUID it should be bytes 12 and 13:

    TI_UUID(BUILD_UINT16( pAttr->type.uuid[12], pAttr->type.uuid[13]))

  • hi,Andy,I meet  the same problem with you.

    Did you solved your problem? If yes, could you pls kindly give me some suggestion? It will be highly appreciated to receive any your reply.

  • Yes I did solve it, I described the bug in the TI code exactly above.

  • OH!yes!I got it! thank you very much!