If I have multiple peripheral devices, advertising at the same time with NUS service, what factors determine to which peripheral, the BLE central connects?
How can I configure the central device to connect to specific peripheral device only?
If I have multiple peripheral devices, advertising at the same time with NUS service, what factors determine to which peripheral, the BLE central connects?
How can I configure the central device to connect to specific peripheral device only?
Hi
It is up to the application to determine which method to use for determining which device to connect to.
The standard central_uart application will simply connect to the first advertiser it sees that advertises the right UUID. If you have multiple peripheral devices all advertising in the same area this will essentially be random, since the various devices will advertise asynchronously at different times.
In case you only want to connect to a specific device, how will the central device know which device to connect to?
You can connect to a specific device by referencing its unique BLE address, but you need some way to tell the central which address is the one it should be looking for.
It is also possible to use the RSSI of the advertisement to try and connect to the device with the strongest signal, which is normally the device that is closer to you, but this requires a bit more logic on the central side to capture and compare RSSI values of all the advertisers in the area.
Best regards
Torbjørn