Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs

How to only allow a maximum of one bonded connection

If I only wanted to allow one bond at a time, how could I do this?

For example when someone connects for the first time they would pair and bond, by entering the passkey. If someone else wanted to pair and bond, the previous person who bonded should be deleted from the nRF side.

I know there are the two functions for deleting peers pm_peer_delete() / pm_peers_delete(). The problem is the previous peer should only be deleted, only after the new peer has paired and bonded, by typing in the correct passkey.

How would I go about implementing this? I don't know if there's somewhere that I can change the total number of allowed bonded connections (to 1), or if I would have to delete the previous peer using pm_peer_delete.

Related