Does CyBle_StoreBondingData also add dev. to W.L.

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
DeCo_1926091
Level 4
Level 4
First like received

CyBle_GapRemoveBondedDevice apparently removes the device from the whitelist as well as from the Bonded Device List.  (The documentation says: "This function removes device from the white list also when autopopulate white list with bonded devices option is enabled".  Autopopulate enable is no longer included in the BLE component so I guess autopopulate is now always enabled).

So does CyBle_StoreBondingData add the device to both the Bonded Device List and the whitelist?

Thanks for your help,

Dennis

0 Likes
1 Solution
SudheeshK
Moderator
Moderator
Moderator
250 sign-ins First question asked 750 replies posted

Hello,

The BLE stack will update the bonding data in RAM while the devices are connected. If the bonding data is to be retained during shutdown, the application can use CyBle_StoreBondingData() API to write the bonding data from RAM to the dedicated flash location, as defined by the Component.

After bonding, the connected device will be automatically added to whitelist. Please see a related thread at following link, Whitelist is just RAM ? . You can refer the following code example for a better understanding, PSoC-4-BLE/100_Projects_in_100_Days/Day015_Bonding at master · cypresssemiconductorco/PSoC-4-BLE · G... .

Please feel free to ask if you have any related queries.

Thanks and Regards,

Sudheesh

View solution in original post

0 Likes
3 Replies
SudheeshK
Moderator
Moderator
Moderator
250 sign-ins First question asked 750 replies posted

Hello,

The BLE stack will update the bonding data in RAM while the devices are connected. If the bonding data is to be retained during shutdown, the application can use CyBle_StoreBondingData() API to write the bonding data from RAM to the dedicated flash location, as defined by the Component.

After bonding, the connected device will be automatically added to whitelist. Please see a related thread at following link, Whitelist is just RAM ? . You can refer the following code example for a better understanding, PSoC-4-BLE/100_Projects_in_100_Days/Day015_Bonding at master · cypresssemiconductorco/PSoC-4-BLE · G... .

Please feel free to ask if you have any related queries.

Thanks and Regards,

Sudheesh

0 Likes

Sudheesh.

Your answer says that after bonding, the connected device will be automatically added to the whitelist.  The following code, from the example, perhiperal_Resolving_List,  contains lines to fill a tempory structure and add the device to the whitelist.  Why is this necessary if the device is automatically added to the whitelist?

Thanks,

Denis

for(;;)

    {

        /* Place your application code here. */

        CyBle_ProcessEvents();

        if((cyBle_pendingFlashWrite != 0u))

        {

            apiResult = CyBle_StoreBondingData(0u);

            if(apiResult == CYBLE_ERROR_OK)

            {

                printf("Bonding Data stored.\r\n");

                /* Add to resolving list only if random address */

CyBle_GapGetPeerBdAddr(cyBle_connHandle.bdHandle,&peerBdAddr);

if((cyBle_discoveryModeInfo.advParam->advFilterPolicy == 0x00) && (peerBdAddr.type == 1))

                {

CyBle_GapGetPeerDevSecurityKeyInfo(cyBle_connHandle.bdHandle , &localKeyFlag , &peerKeys );

                    CyBle_GapGetDevSecurityKeyInfo( &localKeyFlag, &localKeys);

                    memcpy( &deviceToResolve.localIrk , &localKeys.irkInfo , sizeof(localKeys.irkInfo));

                    memcpy( &deviceToResolve.peerIrk , &peerKeys.irkInfo , sizeof(peerKeys.irkInfo));

                    deviceToResolve.type=peerKeys.idAddrInfo[0];

                    memcpy(&deviceToResolve.bdAddr[0], &peerKeys.idAddrInfo[1], CYBLE_GAP_BD_ADDR_SIZE);

                    apiResult = CyBle_GapAddDeviceToResolvingList(&deviceToResolve);

                    printf("Device addition to resolving list result = %x\r\n",apiResult);

                    // fill temporary struct to add device to whitelist

                    memcpy(&temporaryBDAddress.bdAddr, &peerKeys.idAddrInfo[1], CYBLE_GAP_BD_ADDR_SIZE);

                    temporaryBDAddress.type = peerKeys.idAddrInfo[0];

                    // add device to whitelist

                    apiResult = CyBle_GapAddDeviceToWhiteList(&temporaryBDAddress);

                    printf("Device id address added to whitelist = %x\r\n",apiResult);

                    CyBle_GapSetAddressResolutionEnable(1u);

                    apiResult = CyBle_GapReadResolvingList(&resolvingDeviceList);

                    printf("\r\nCyBle_GapReadResolvingList api result is %x",apiResult);

                    printf("\r\n Resolving list data is %x \r\n",resolvingDeviceList.noOfDevice);

                }

            }

        }

    }

0 Likes

Hello,

As I mentioned in my previous response, after bonding the connected device automatically get added to white list. It is not required to update whitelist separately. Are you observing any related issues in your application?

Thanks and Regards,

Sudheesh

0 Likes