- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Solved! Go to Solution.
- Labels:
-
BLE
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
With Android nearly everything works asynchronously, so you need callbacks. After a while one gets used to this.