Removing oldest bonded device

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

cross mob
Anonymous
Not applicable

I am trying to implement a FIFO policy in the bonded device list: when the list is full the oldest bonded device will be removed and the new bonding device will be inserted at the top.

   

I am using the function CyBle_GapRemoveOldestDeviceFromBondedList().

   

I am facing the following problem: when a bonded device updates the key the function CyBle_StoreBondingData() is executed. Correct, but from my tests this will result in moving the device at the top of the bonded device list.

   

 

   

 

   

You test it by following this procedure:

   

-Bond a iOS device: deviceA​

   

-Bond a second device: deviceB

   

-Disable and re-enable the Bluetooth pheriferal in the deviceA, the iOS operating system will update the key

   

-Connect deviceA: function CyBle_StoreBondingData() will be executed because the key was updated

   

-Disconnect deviceA

   

-Execute function CyBle_GapRemoveOldestDeviceFromBondedList(): deviceB will be removed instead of deviceA which was actually the oldest device bonded in the list!!!!!!

   

 

   

 

   

It looks like the function CyBle_StoreBondingData() is moving up the device in the bonded device list. This will result in a bonded device list not properly sorted and it will be impossible to implement a FIFO policy.

   

 

   

Has anybody faced the same problem?

   

Is there any work around?

   

 

   

Many thanks

0 Likes
4 Replies
himam_31
Employee
Employee
50 likes received 25 likes received 10 likes received

Hello,

   

Can you use the API CyBle_GapGetBondedDevicesByRank() and check if the rank is proper.

   

Thanks,

   

Hima

0 Likes
Anonymous
Not applicable

Hallo Hima,

   

after checking with the API CyBle_GapGetBondedDevicesByRank() I confirm you that the update of the key will pull the device at the top of the list (0 index, newest device bonded).

0 Likes
himam_31
Employee
Employee
50 likes received 25 likes received 10 likes received

Hello,

   

 

   

Is it possible for you to attach your project.

   

 

   

Thanks,

   

Hima

0 Likes
Anonymous
Not applicable

Any news on this issue? Or is it intentional for the devices to be listed by "last key update" for the rank?

   

It would definitely be handy to have a FIFO method of adding and removing bonded devices.

0 Likes