How to bond with another host B (central) during device is connecting to bonded host A

In this blog, I would like to show the demo how to bond with another central (host B) while the device is connecting to the bonded central (host A).

user_scenario

Scenario:

A device is paired / bonded with the central (host A).  Also, this device is using the advertising with whitelist.  Thus, the device can only connect with bonded host.

If the device needs to bond with another central (host B) during the connection with host A, this requirement or scenario is quite common particular on the HID application.

In the original Nordic SDK, if the device needs to pair with the new host, it needs to remove all the bonding record first by pressing button 2 during power up. It needs to disconnect the existing link and do the bonding with new host.

Requirement

  • Device bonds with host A (using the advertising with whitelist for reconnection)
  • Press button to trigger the device in the discovery mode (other host can discover and bond)
  • During the discovery mode, the existing link between device and host A is still there and continuous functioning with host A.
  • The device does not disconnect with host A until a new bonding with host B is success.
  • The new bonding record with host B would be automatic replaced the bonding with host A when the new bonding is success.

Test Procedure:

Step 1:  Remove the all the bonding information by pressing button 1 at NRF52 DK.

The device is advertising without whitelist.

Step 2: Bonding with Host A

Bonding with Host A

Step 3 : Press button 2 to start advertising without whitelist (device is in discovery mode)

Step 4: Bond with Host B and remove the bond record with Host A.

The source code is placed at https://github.com/jimmywong2003/nrf5-bond-with-2nd-central-example.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.