如何找到连接的蓝牙设备的信号强度蓝牙、强度、信号、设备

2023-09-05 10:38:04 作者:ぐ箛茗

在我的应用程序之一,我需要显示所有的无线网络连接和它们配对到我的手机的蓝牙设备,以及它们的信号强度。通过Wi-Fi,没关系,我可以显示信号强度(RSSI)。但我有蓝牙的一个问题。我搜索一些方法,该方法适合于该任务;我发现了一个方法:

In one of my applications, I need to display all the wi-fi and Bluetooth devices which are paired to my mobile, and their signal strengths. With wi-fi, it's okay for me to display signal strength (RSSI). But I have a problem with the Bluetooth. I searched for some method which is suitable for this task; I found one method:

intent.getShortExtra(BluetoothDevice.EXTRA_RSSI, Short.MIN_VALUE);

但它仅显示未配对我的移动新设备的RSSI。有没有什么想法让所有的蓝牙设备RSSI?

But it is displaying only the new device RSSI which is not paired to my mobile. Is there any idea for getting all Bluetooth devices RSSI?

推荐答案

有关蓝牙RSSI,你可以阅读RSSI连接的设备,或执行一个蓝牙发现,检查RSSI附近的设备。

For bluetooth RSSI, you can read RSSI for connected devices, or perform a bluetooth discovery to check the RSSI for nearby devices.

基本上是一个蓝牙的发现是一个广播范围内的所有站来响应。由于每个设备respons回来了,Android的触发了一个ACTION_FOUND意图。在此意向,你可以getExtra EXTRA_RSSI获得RSSI。

Basically a bluetooth discovery is a broadcast to all stations within range to respond back. As each devices respons back, Android fires off an ACTION_FOUND intent. Within this intent you can getExtra EXTRA_RSSI to obtain the RSSI.

请注意,并非所有的蓝牙硬件支持RSSI。

Note that not all bluetooth hardware supports RSSI.

也有关系:http://stackoverflow.com/questions/2149776/android-irc-office-hours-question-about-android-bluetooth-rssi