Hi, I am using the FRDM-KW20Z dev board to develop an application based on the 802.15.4 My Wireless App sample application provided in the Connectivity Software.
I would like the Coordinator to be able to record the RSSI value after receiving a message from an End Device. I tried doing this by calling Asp_GetRSSILevel() (from ASP.c) within the App_HandleMcpsInput() function in App.c. Here is what the function looks like with the 2 lines I added in bold:
static void App_HandleMcpsInput(mcpsToNwkMessage_t *pMsgIn, uint8_t appInstance)
uint8_t rssi = 0;
/* The MCPS-Data confirm is sent by the MAC to the network or application layer when data has been sent. */
/* The MCPS-Data indication is sent by the MAC to the network
or application layer when data has been received. We simply
copy the received data to the UART. */
rssi = Asp_GetRSSILevel();
Serial_SyncWrite( interfaceId,pMsgIn->msgData.dataInd.pMsdu, pMsgIn->msgData.dataInd.msduLength );
I didn't change anything else in the My Wireless App code, except for #include "AspInterface.h" in the App.c file.
The values that the function is returning are always within the range of about 157-170 (in decimal), even when the boards are separated by about 20m. I was expecting values from 0 to 102 since the FRDM documentation states that the radio has accurate RSSI indication for RF inputs from -102 dBm to 0 dBm.
The Asp_GetRSSILevel() function calls the PhyPlmeGetRSSILevelRequest(), which gets the value from ZLL_RD_LQI_AND_RSSI_RSSI(ZLL). I am not sure whether this value is supposed to be signed or unsigned.
Is this the correct way to go about this problem?
I also tried the PhyGetLastRxRssiValue(void) function from the PhyISR.c file, this was giving me values in the 200's.
Thanks in advance!