AnsweredAssumed Answered

Is Gap_SaveCustomPeerInformation required when bonding is not in use?

Question asked by Stephen Langstaff on Sep 13, 2019
Latest reply on Sep 23, 2019 by Xiang Li

In the Location and Navigation Client example code (FRDM-KW36, SDK version 2.2.1) the call to Gap_LoadCustomPeerInformation is conditionally compiled with the gAppUseBonding_d macro, whereas the call to Gap_SaveCustomPeerInformation is not:

#if gAppUseBonding_d
            (void)Gap_CheckIfBonded(peerDeviceId, &mPeerInformation.isBonded);

            if ((mPeerInformation.isBonded) &&
                (gBleSuccess_c == Gap_LoadCustomPeerInformation(peerDeviceId,
                    (void*) &mPeerInformation.customInfo, 0, sizeof (appCustomInfo_t))))
            {
                /* Restored custom connection information. Encrypt link */
                (void)Gap_EncryptLink(peerDeviceId);
            }
#endif

vs.

                /* Write data in NVM */
                (void)Gap_SaveCustomPeerInformation(mPeerInformation.deviceId,
                                              (void*) &mPeerInformation.customInfo, 0,
                                              sizeof (appCustomInfo_t));

 

Is this just an omission in the example code (and similarly in the otap_server code) or does the custom peer information need to be saved even if bonding is not required?

Outcomes