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.

CC2340R5: How to Delete a Specific Profile After Addition

Part Number: CC2340R5

Hello.

I would like to know how to delete a specific profile after it has been added.
I am using SDK 8.40.00.61.

I want to dynamically add and delete the OAD profile.
For dynamic addition, I found that calling OADProfile_start from oad_profile.c at any timing works.
However, regarding dynamic deletion, I could not find any API related to this.

Could you please suggest a way to address this issue?
I would appreciate your response by November 10th.

Thank you.

  • Hi !

    The OADProfile_start function calls the OAD_AddService function, which in turn call our API function GATTServApp_RegisterService.
    According to the GATTServApp API that you can find at this link, our BLE API also has a GATTServApp_DeregisterService function, which looks like the perfect fit for your situation.

    This function takes in parameter the handle to the service. You can get the handle of the service with the following macro GATT_SERVICE_HANDLE( yourGATTTable ), where yourGATTTable is the array of characteristics used to register the service.

    For example, in simple_gatt_profile this would be GATT_SERVICE_HANDLE(simpleProfileAttrTbl)

    Just a word of caution, some smart phone devices will cache the GATT table after first discovery and you must either re pair and bond or use the GATT Service Changed function to force the phone to rediscover services on your device. If you are connected between two embedded devices, this should not be an issue.

    Kind regards;
    Léa

  • Note that when using the GATTServApp_DeregisterService function, according to the API link I have shared with you, it is also your responsability to free the service attribute list returned from this API.

  • Thank you for your detailed explanation!

    I implemented the code as you suggested.
    After calling GATTServApp_DeregisterService(), I made sure to free the returned attribute list using ICall_free().
    I have tested it on my setup, and it works as expected—there are no issues and no memory leaks observed.

    Your support was very helpful.
    Thank you again!

  • That's great to hear, have a good day !