I'm trying to write a program that can read the signal
strength(RSSI) of a bluetooth device linked to my APP
however
Doesnt seem like android exposes anyway to get the RSSI while it is during discovery.
Is there any other way to get the signal strength of the device after the device has been
linked(not pairing)
Any help would be appreciated.
Related
I'm right now focusing on Android, but I believe the answers to these questions apply to any operating system, they just will use different functions to get the data.
Once I've established a BLE connection, I can BluetoothGatt.readRemoteRssi() to "Read the RSSI for a connected remote device."
First question: am I understanding this function correctly, it is returning to me the strength of the signal (transmitted from the remote BLE device) that my Android device is receiving, right? I think it's the function name that's throwing me off, shouldn't the name just be readRssi()? readRemoteRssi() makes me think there's a companion function readLocalRssi() somewhere.
Second question: assuming I am understanding the function correctly, is there anything built into Bluetooth that lets me ask "what is the remote BLE device seeing for RSSI?" In other words, of the signal that the Android device is transmitting, how much of that is reaching the remote BLE device?
ADDED LATER
Based on the answer I got, apparently I'm not explaining myself very well. Let me try again.
The remote BLE device is transmitting with a certain power, and those radio waves head out in all directions, and some of those waves are received by my mobile device. My mobile device measures how strong those waves are, and that's reported as RSSI. RSSI stands for "Received Signal Strength Indicator" and since it's the local mobile device that's doing the receiving, it seems strange to name the function "remote". Of course RSSI measures something coming from a remote transmitter - otherwise it wouldn't be very useful.
Similarly, the mobile device is transmitting with a certain power, and those radio waves head out in all directions, and some of those radio waves are received by the remote BLE device. That remote BLE device measures the strength of those waves, and that would be his RSSI. My second question is asking whether there's anything in the Bluetooth standard (a predefined characteristic, for example, like "Battery Level") that lets me mobile device query the remote BLE device and ask "Hey dude, how much signal you getting?"
am I understanding this function correctly, it is returning to me the strength of the signal
(transmitted from the remote BLE device) that my Android device is receiving, right?
Actually rssi is calculated by ble chip based on the advertising packets that are received from the remote device. We don't directly get the rssi value from remote device.
I think it's the function name that's throwing me off, shouldn't the name just be readRssi()?
No. We are actually reading remote device's rssi.
readRemoteRssi() makes me think there's a companion function readLocalRssi() somewhere.
No there is no such method as rssi is determined at the other end to which the current device is connected to.
assuming I am understanding the function correctly, is there anything built into Bluetooth that lets me ask "what is the remote BLE device seeing for RSSI?" In other words, of the signal that the Android device is transmitting, how much of that is reaching the remote BLE device?
It is rssi. It is calculated based on how many advertising packets received against total packets.
Note: some of my answers are my guess based on my experience.
i want to get the bluetooth rssi of a another device which connected to my phone,
how can i get the bluetooth rssi?
i tried to search alot over stackoverflow/google and didnt find any answer, i found just the answer to get rssi of devices wich do not have any connection ! (Get bluetooth signal strength).
but i need the rssi of the connected devices !
can you help me please.
thanks alot
I was also looking for a solution and found this:
You can use the readRemoteRssi() function of BluetoothGatt. This will cause an asynchronous call of your BluetoothGattCallback.onReadRemoteRssi
I was wondering at; At what maximum rate would I be able to obtain the RSSI of Bluetooth device on my android phone? I have run a code identical to that given by Memochipan at the bottom of this thread:
Get bluetooth signal strength
It simply turns on “discovery”-mode on the phone, which then goes to scan for Bluetooth devices. However, it takes about 10-20 seconds to get an update from a specific device, which is too much for, what I’m doing. So, is it even possible to get an update quicker? What stops the other Bluetooth device from sending a signal back to my phone sooner? Physical limitations? Also, from what I read, actually connecting to device won’t give me a “reliable” RSSI-value at all.
Thank you very much
I'm trying to write a program that can read the signal strength of a bluetooth device linked to my android 2.0 handset. Doesnt seem like android exposes anyway to get the RSSI unless it is during discovery. Is there any other way to get the signal strength of the device after the device has been detected? I read of a way to do it using NDK to access the underlying BlueZ API, but I dont know how to use that. Any help would be appreciated.
No. Only during discovery as a bundle extra (EXTRA_RSSI).
I have a question about bluetooth RSSI functionality on the Android (either 2.0 or 2.1):
It's easy enough to get the RSSI value when a bluetooth connection is created, but how can you repeatedly get the RSSI value of a connection that is already active? It's really important to be able to do this, because this lets you determine if bluetooth devices are close to each other or far away, but I can't find any appropriate function calls in the Android API.
Could someone who understands Android RSSI please help me with this problem?
Thanks!
Alex
At the HCI level, there is a command to read a Bluetooth link RSSI from the Bluetooth chipset (Read_RSSI_Command). However its implementation can vary from Bluetooth chipset to Bluetooth chipset. And the value returned is not always useful, for example if there are no packets transmitted in the last few minutes, the Bluetooth chipset has no way to know the current RSSI.
So we don't expose this in any Android Java API at this time.
Nick Pelly
Android Bluetooth Team