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

How to enforce connecting to a specific master when bonded to many.

Problem:

In our project we have one peripheral which can be bonded to many phones at the same time (of cause) while they are still close to it, thus connected via OS.

In that situation we need to selectively unblock the peripheral so that only one phone can connect to the peripheral. Thus if there are other phones nearby which are also bonded and one of them even is connected already, we need to disconnect them fist to allow the connection to the intended phone?

The connection should only be forced in a specific moment, i.e. not disconnect the other phones (masters) permanently. What wuld be the most appropriate technical solution for this scenario?

We are using the Nrf51 with S310 (v3.0.0). Our peripheral has an color LED to indicate state and a physical button (only) which supports hold/press gestures.

Thanks in advance for your help!

  • I think I understood your approach, but I guess it only helps in a 2 centrals, one peripheral. You'd delete the currently connected device from the whitelist until the other device is connected. Then put the first device back to the whitelist. Right? With 3 centrals around, that doesn't solve the problem (completely).

  • The new device cannot connect, it is not possible. A peripheral can only be connected to one central. So you always want to be connected to the closest central? You could have added that piece of information is the question ;)

    An idea is to first do scannable non-connectable advertising, then you will get a BLE_GAP_EVT_SCAN_REQ_REPORT event every time a central scans your advertising packet. With it you will get the RSSI and the peer address. Then you switch to connectable advertising, with the peer address of the best RSSI in the whitelist.

    After you have connected you can start doing scannable non-connectable advertising, and monitor continue the RSSI values to see if another central gets closer. If it does, disconnect from current connected central and do connectable advertising, with the peer address of the new central in the whitelist.

  • Hey Petter. Sorry for missing that important detail. Your approach sounds very promising. I still wonder if we could build that fully automated. I.e. even disconnect the connected peripheral if another peripheral requests connection and is closer than the connected device at that time. That would require advertising and a connection being enabled a the same time. But that's not possible, right?

  • Correct. That is not possible with any of the SoftDevices for the nRF51, it is possible with the S132 4.0.0-2.alpha SoftDevice available for the nRF52832.

Related