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.

Compiler: Write callback by characteristic handle

Other Parts Discussed in Thread: BLE-STACK

Tool/software: TI C/C++ Compiler

Hi,

I am using SimpleBlePeripheral example project. I changed the UUIDs of the server and characteristics to 128-bit UUIDs.

Now i am trying to change the simpleProfile_WriteAttrCB() function. I want to recognize the characteristics by their handle and not by their UUIDs.

I can see the handle of the characteristic that jumped to the simpleProfile_WriteAttrCB() function in the pAttr->handle, but i can't find the handle of this characteristic to compare with.

Can you help me please?

Thank you.

  • Hi Anna,

    So if I understand correctly, you changed your UUIDs and now you aren't sure which characteristic you are writing to but you know the characteristic's handle?

    You should do a full GATT discovery to determine which UUIDs correspond to which handle. If you have another dev board, you can program it with Host Test and and use BTool for discovery.
  • I think you did not understand me right. 

    Because i changed the UUIDs from 16-bit UUIDs to 128-bit UUIDs, i can't now to recognize to which characteristic the data was written.

    That 's why i want to recognize to which characteristic data was written by their handles and not by their UUIDs but i can't find the place where the handles int this project example.

    I want to know where i can see the handles of the characteristics. I am using the CC2541EM with the Smart tRF05 Evaluation board.

    Thank you

  • Hi Anna,

    The handles are generated during the process of adding services and characteristics. The handles are based on the order you are adding your services and characteristics. If you haven't made any other changes to the project except changing the UUIDs, the handles should be the same as they were before you made the change. You can use BTool to discover all characteristics, which will allow you to match the handles to the UUIDs.

    If you are using the TI BLE-Stack v1.4.2, Section 5.4 of the TI BLE Software Developer's Guide covers GATT characteristics and how to work with them.