This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Connection and Passkey

In my application, a static passkey is given to the user(I have implemented static pass key in my application and it is working).

Suppose the Nordic device is advertising and some random user (who doesn't have a static key) connects with the peripheral. The user with the passkey has to wait till the other invalid user disconnects .

My question is , How can I make sure that only user with static key can connect with the peripheral?

Even if a user has a passkey(it is valid only fort pairing) but if a random user connects(anyone can connect but cannot pair)and the valid user has to wait for the random user (who doesn't have a static key) to disconnect

  • Hi,

    The only way to limit connections, is to use whitelisting. If you have an existing bond, you can whitelist the identity address (or the identity resolving key (IRK) if you are using Privacy). A common implementation is to always whitelist when there is an existing bond, and allow the user to clear all bonds by button press. An alternative is to do whitelisted, connectable advertising until a button is pressed, then have a few seconds of non-whitelisted advertisements so new peers can bond. Please note that the maximum amount of whitelisted peers is 8 in the most recent softdevices, and that you need to store the bonding information for each of them locally.

    An alternative implementation is to immediately send a security request to the peer upon connection. If the peer does not respond to the pairing within a certain time-frame, you can call disconnect and go back to advertising.

Related