We have a system with a central device and a peripheral both based on nrf5340. The central device is also a Broadcast source and the peripheral is also a Broadcast sink in addition to the ACL connection. The current firmware version has a hardcoded name for the peripheral to look for and connect to to get the system up and running automatically, but this won't work in the long run as we would like the system to be more flexible.
We can use a standard method of scanning for nearby devices and a user chooses a peripheral to connect to. But ideally we would like an automatic connection to the peripheral when it gets close to the central.
I had an idea of using the RSSI to determine which devices are closest to each other in the event of several central devices or several peripherals being close. The central device could measure the RSSI values and choose the one with the strongest signal, as this will likely be closest, but in the event of 2 central devices I'm not sure how this would work. I assume it would be a bit random which central is able to initiate a connection first?
I was thinking about setting a treshold RSSI value for when the central can initiate a connection, but how far apart would the centrals then need to be to be able to reliably make the right choice (of getting the closest peripheral/central pair to connect)? I know RSSI is not a super reliable measurement, but maybe it would be good enough if we can set the treshold at a quite high signal strength and set some limitations on how close together two centrals can be?
I've also been looking a little bit into the distance toolbox and it seems that there are some more accurate ways of measuring distance where we could let the peripheral find out which central it is closest to and do direct advertising. Would this require a lot of extra resources from our devices? I am not sure if it's realistic to be able to integrate this in our LE Audio devices.
I will of course do some experimenting myself (and have already started), but would be great to have some input on the most realistic solutions if possible
