Reading RSSI value of connected BLE device on Android App

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

Hello,

   

I have been working on a BLE project with the CY8CKIT-042-BLE Pioneer Kit, and now I am in the process of making an Android Application. I would like to know if it's possible to read the RSSI value of a device after connecting to it.

   

I know that you can read the RSSI when scanning for devices, but once you connect to one of them, I didn't see an option to get its RSSI.

   

In the CySmart App there is no indication of the RSSI once you connect to the device.

   

Is the solution in the Android Studio code? Or perhaps you could send the RSSI as a characteristic with notifications?

   

Thanks in advance,

   

Yosef

0 Likes
1 Solution
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

The Android BluetoothGatt class has a readRemoteRssi method: http://developer.android.com/reference/android/bluetooth/BluetoothGatt.html#readRemoteRssi%28%29 . Just call it regularly and define the callback.

View solution in original post

0 Likes
4 Replies
Anonymous
Not applicable

I'm not familiar with Android Application code base, so I can't comment on it, but I'd imagine there is a way to retrieve the RSSI for the Android device.

   

For the PSoC device, if you are using PSoC Creator, there is a function to get the RSSI value of the connected device.

   

int8 CyBle_GetRssi(void)

   

Documentation for this can be found in the BLE component datasheet.  I would use this function to write to a characteristic which can be retrieved by the connected device.

   

Matt

0 Likes
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

The Android BluetoothGatt class has a readRemoteRssi method: http://developer.android.com/reference/android/bluetooth/BluetoothGatt.html#readRemoteRssi%28%29 . Just call it regularly and define the callback.

0 Likes
Anonymous
Not applicable

Thanks hli, it worked just fine!

   

At first I saw the readRemoteRssi method that returns a boolean, which doesn't make much sense. But the callback method is where you can find the RSSI.

0 Likes
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

With Android nearly everything works asynchronously, so you need callbacks. After a while one gets used to this.

0 Likes