This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

How to read RSSI value at CC2530

Other Parts Discussed in Thread: CC2530

Dear friends,

I am using CC2530, and i want to read RSSI value at Coordinator after received data fron other point, thus, I set a breakpoint at callback function :

void zb_ReceiveDataIndication( uint16 source, uint16 command, uint16 len, uint8 *pData  )

and to view the RSSI value at IAR, but I found that the RSSI value almost at the same value --0xE2, ignore I take off the antenna or put the antenna, so how can I get the right RSSI value after received data.

 the ENERGY_SCAN = 0 and  RSSI_VALID = 1   stack is ZStack-CC2530-2.3.0-1.4.0

please give help.

  • Hello,

    It looks like you are using Simple API. For getting RSSI values you will need to use a more complex API: AF & ZDO

    The RSSI and Correlation values are contained in all messages from the AF

    layer to the application. You can get the RSSI and Correlation values of
    any received packet by adding the following (in bold) into the event loop
    in the application, e.g. zcl_samplelight.c - zclSampleLight_event_loop():

    uint16 zclSampleLight_event_loop( uint8 task_id, uint16 events )
    {
    afIncomingMSGPacket_t *MSGpkt;

    (void)task_id; // Intentionally unreferenced parameter

    if ( events & SYS_EVENT_MSG )
    {
    while ( (MSGpkt = (afIncomingMSGPacket_t *)osal_msg_receive
    ( zclSampleLight_TaskID )) )
    {
    int8 msgRssi = MSGpkt->rssi;
    uint8 msgCorrelation = MSGpkt->correlation;

    #ifdef LCD_SUPPORTED
    HalLcdWriteStringValue( "RSSI: ", msgRssi, 10, HAL_LCD_LINE_1 );
    HalLcdWriteStringValue( "Correlation: ", msgCorrelation, 10,
    HAL_LCD_LINE_2 );
    #endif

    switch ( MSGpkt->hdr.event )

    ...

    Look at Home automation Sample Application in C:\Texas Instruments\ZStack-CC2530-2.3.0-1.4.0\Projects\zstack\HomeAutomation

    Best regards

  • Hi Koopa,

    Very thanks, and the problem resolved.

    BestRegard.Yihua