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.

After bonding, Do I have to call GAPBond_ServiceChangeInd or GAPBondMgr_UpdateCharCfg API to save the changed client characteristic configuration ?

Other Parts Discussed in Thread: CC2541

Hi TI engineers and Forum members,

After bonding, Do I have to call GAPBond_ServiceChangeInd or GAPBondMgr_UpdateCharCfg API to save the changed client characteristic configuration data to non-volatile memory of CC2541.

And if saved well, when board Power on reset, automatically the values are automatically loaded? or do I have to load it?

or

Do I not have to call GATTServApp_InitCharCfg in adding service?

Thanks in advance,

John

  • Hi John,

    You only need to send  GAPBond_ServiceChangeInd if you have removed or added new characteristics or services before you bonded. I think I may be able to answer your question if you explain what you want to achieve. At this point I do not fully understand what you are asking for.

    Best Regards

    Joakim

  • Thanks Joakim,

    My intention is to save a client configuration descriptor data like notifiy or indicate on/off flag and then when power on reset of peripheral device, when iOS device bonded before re-connected, automatically load the configuration data.

    Best regards,

    John 

  • Hi John,

    You choose which characteristic configurations to store by function GATTServApp_InitCharCfg in ###_HandleConnStatusCB( uint16 connHandle, uint8 changeType ), you have an example in simpleGATTProfile.c and also in all sensor tag sensor profiles.

    Best Regards 

    Joakim

  • Hi Joakim,

    I am now using the function APIs to save the client configuration decripter data when enable/disable the 'start indication' or 'start notify'.

    My question is related to the bonding.

    As I understand, after Bonding process complete, the client configuration could be saved to non-volatile memory.

    So, when powr on reset, central device (iOS device) is not neccessary to enable them again. So, peripheral device can notify or indicate some thing.

    By the way, my question is to save them to non-volatile memory, should I call the GAPBondMgr_ServiceChangeInd() for it? or not.

    And now, I am calling the GATTServApp_InitCharCfg by adding the related services and also when calling the xxx_HandleConnStatusCB(), it calls GATTServApp_InitCharCfg.

    On your Software Developer Guide, it mentions as follows.

    - simpleProfile_WriteAttrCB - When a client characteristic configuration value is written to a bonded device, it also notified the bond manager so that it can store the data in non-volatile memory along with the bond data. This function would not be required if the profile didn't contain any attributes with write permissions.

    Through this above guide, I understood that if I assigned any write permission like GATT_PERMIT_WRITE or GATT_PERMIT_AUTHEN_WRITE, the client configuration will be written automatically to non-volatile memory without calling the  GAPBondMgr_ServiceChangeInd() or GAPBondMgr_UpdateCharCfg by me. My understanding is right?

    Thanks,

    John

  • Hi John,

    John Lee4 said:

    As I understand, after Bonding process complete, the client configuration could be saved to non-volatile memory.

    So, when powr on reset, central device (iOS device) is not neccessary to enable them again. So, peripheral device can notify or indicate some thing

    Yes, that should be the case.

    John Lee4 said:
    By the way, my question is to save them to non-volatile memory, should I call the GAPBondMgr_ServiceChangeInd() for it? or not.

    No. GAPBondMgr_ServiceChangeInd() should only be used if you have made a firmware update or something so you need to update the peer device to trigger a new service discovery (service discovery is not made at re-connected and re-bonded).

    John Lee4 said:
    the client configuration will be written automatically to non-volatile memory

    Yes, but not based on the permission. It's written by GATTServApp_InitCharCfg in AddService function. If it's a client configuration, upon re-connect GATTServApp_InitCharCfg will read in the stored values.

    Best Regards

    Joakim

  • Thanks a lot Joakim,

    Just before, I confirmed that with LightBlue App.

    Thank you so much again and have a nice weekend.

    Best regards,

    John