Assuming you send data through Notification.
To get RSSI value, Cy_BLE_GetRssiPeer() is called at every time event #CY_BLE_EVT_GATTC_HANDLE_VALUE_NTF is generated. The RSSI value is informed through #CY_BLE_EVT_GET_RSSI_COMPLETE.
The parameter generated along with #CY_BLE_EVT_GET_RSSI_COMPLETE must be cast to proper format to show correct RSSI value, as below capture shows -
Thank you. I've modified the project in PSoC6 RSSI value measurement issue
with your code suggestion and got it to work.
Next I'm going to modify the CE222046_GATT_Services projects to include RSSI info. Cross your fingers!
Thank you for your help. With your suggestions I have been partially successful.
Let me explain what I'm trying to do.
I have an application that is relatively simple.
In advertising mode, I'm trying to read both RSSI and Tx Power level for the packets received at the scanning end.
In connection mode, I'm trying to read both RSSI and Tx Power level for the Peripheral packets received at the Connection end.
Attached is a project. It successfully gets the RSSI event but occasionally gets the Tx Power Level event.
Do I have to coordinate the Cy_BLE_GetRssiPeer() and Cy_BLE_GetTxPowerLevel() calls?
Second question: Is there a way for the RSSI and Tx Pwr level to be returned once the Peripheral packet is received?
RSSI_2.cyprj.Archive01.zip 83.8 K
I believe I might have solved the post above. However, it might not be elegant.
The way I get new RSSI and TxPowerLevel for each incoming LL_DATA packet is to decode the connection parameters and determine the connection Interval. I then start up a SysTick at the connection Interval. In the SysTick ISR, I re-request Cy_BLE_GetRssiPeer() and Cy_BLE_GetTxPowerLevel() calls. As I said, it works but is not elegant.
A more elegant way is to get a BLE event every time the LL_DATA packet is received, I can then issue Cy_BLE_GetRssiPeer() and Cy_BLE_GetTxPowerLevel() calls without the need of the SysTick ISR.
Is there a BLE event for the received LL_DATA packet?
Attached is an improved RSSI measurement project for those interested.
Update 12.24.2019: I found a possible solution. I'm using the BLE Inter-Processor-Communication (IPC) interrupt callback. I'm using CY_BLE_INTR_CALLBACK_BLESS_STACK_ISR as the interrupt event. It may still not be as efficient as I need but it appears to be working.
Happy Holidays to everyone!