How to get the RSSI with BlueZ?

6.2k views Asked by At

I'm currently building a small utility to found my phone via Bluetooth and my computer. For this purpose I'm trying to get the RSSI to evaluate the distance between the two devices. How can I get the RSSI with Bluez in C/C++ ?

Is there an HCI command for this and if yes, is there a list of HCI commands?

3

There are 3 answers

0
David Neiss On
0
ASB On

You can do hcitool rssi but for this device should be connected And if you are bluez then it provides propertychanged signal for rssi value for this you can check docs/device-api.txt file

0
pepinho On

Is there an utility it can be usefull for you. Try with bluetoothctl if you don't have try to install all the bluez library.

You only have to start a scan an it gives you the rssi from all the devices.

If you need to view the code. You also search in git code https://git.kernel.org/cgit/bluetooth/bluez.git/tree/