This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

How to detect the nearest peripheral before connecting ?

Other Parts Discussed in Thread: CC2541

Hi guys,

I'm using the cc2541 as BLE central device, but my customer want the central device to automaticaly connect to the nearest peripheral. 

Actualy the central device is a remote control unit, and one of the requierement is:

"If the remote control unit detect several peripheral, it will connect to the nearest ..."

How to do that ? Is the order of discover response can help me ?

Thanks

Mikael

  • Hello Mikael,

    You may want to look at the iBeacon source code found in the BLE stack as a guide.  http://www.ti.com/tool/ble-stack

    Plus read through the wiki.

    http://processors.wiki.ti.com/index.php/Bluetooth_SensorTag?INTC=SensorTag&HQS=sensortag-wiki

    Thanks,

  • Hey Mikael,

    Each peripheral device normally transmits its Tx Power value in the advertising event. You could read that and the received RSSI value to calculate the nearest peripheral:

    Distance is proportional to TxPower minus RSSI Value.

    If you have the freedom to program the peripheral devices too, then make sure they expose their transmit power.

    Regards
    Pranjal Saxena