简体   繁体   English

如何使用BlueZ获取RSSI?

[英]How to get the RSSI with BlueZ?

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. 为此,我试图让RSSI评估两个设备之间的距离。 How can I get the RSSI with Bluez in C/C++ ? 如何在C / C ++中使用Bluez获取RSSI?

Is there an hci command for this and if yes, is there a list of HCI commands ? 是否有一个hci命令,如果有,是否有一个HCI命令列表?

Thanks. 谢谢。

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. 如果您没有尝试安装所有bluez库,请尝试使用bluetoothctl。

You only have to start a scan an it gives you the rssi from all the devices. 您只需要开始扫描,它就会为您提供所有设备的rssi。

If you need to view the code. 如果您需要查看代码。 You also search in git code https://git.kernel.org/cgit/bluetooth/bluez.git/tree/ 您还可以使用git代码搜索https://git.kernel.org/cgit/bluetooth/bluez.git/tree/

你可以做hcitool rssi但是应该连接这个设备如果你是bluez然后它为rssi值提供了propertychanged信号你可以检查docs / device-api.txt文件

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM