You are here

Removing oldest bonded device | Cypress Semiconductor

Removing oldest bonded device

Summary: 4 Replies, Latest post by e.pratt_1639216 on 17 Mar 2017 08:26 AM PDT
Verified Answers: 0
Last post
Log in to post new comments.
mfabiani_1497536's picture
User
2 posts

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

HIMA's picture
Cypress Employee
359 posts

Hello,

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

Thanks,

Hima

mfabiani_1497536's picture
User
2 posts

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).

 

 

 

 

HIMA's picture
Cypress Employee
359 posts

Hello,

 

Is it possible for you to attach your project.

 

Thanks,

Hima

e.pratt_1639216's picture
User
372 posts

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.

Log in to post new comments.