Disable pairing with NRFC for multiple devices in runtime

Hello,

We use nRF Connect SDK v2.0.0 and we made a peripheral device with part of the characteristics available after connection (BT_PERM_READ), and others after pairing and bonding (BT_PERM_READ_ENCRYPT). We would like to limit the total number of the devices able to pair to our peripheral. As in if one phone was paired and bonded, any other phone will be able to connect and access some characteristics, but won't be able to pair and access other characteristics. Our pairing method is Just Works.

We've tried whitelisting, but it prevents other phones from connecting entirely.

We've tried CONFIG_BT_MAX_PAIRED=1 but it only limits the number of concurrent pairings. If the first phone disconnects, other phones can connect and pair.

The pairing have callbacks on pairing completion and maybe we can unpair and disconnect in the callback function if the address of the new phone does not match. But we think it can cause security issues.

Is there a way to detect an incoming pairing event and cancel it based on the matching address?

Thank you.

Parents Reply Children
Related