Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get the RSSI with BlueZ?

Tags:

c++

c

bluetooth

hci

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 ?

Thanks.

like image 639
Gp2mv3 Avatar asked Nov 14 '22 03:11

Gp2mv3


2 Answers

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/

like image 158
pepinho Avatar answered Dec 05 '22 17:12

pepinho


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

like image 35
ASB Avatar answered Dec 05 '22 18:12

ASB