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.

CC2642R: How to get RSSI?

Part Number: CC2642R

Hi team,

Here's the request from the customer:

The example is simple_peripheral_oad_offchip and how to get RSSI? Does he use the hciStatus_t HCI_ReadRssiCmd (uint16 connHandle);? And which function should it be used in?

Customer tried to get RSSI in the following figure, but pReport->lastRssi prints as 0, how to do it?

Could you help check this case? Thanks.

Best Regards,                                                            

Nick    

  • Hey Nick,

    The HCI_ReadRssiCmd API call will not immediately return with the requested data. The API will trigger an HCI command which will then be processed by the stack and sent back up to the application layer in the registered callback. Luckily for us, the simple_peripheral example sets this up for us. See an excerpt below of where the customer can find the RSSI. Inside the case HCI_READ_RSSI.

    static void SimplePeripheral_processCmdCompleteEvt(hciEvt_CmdComplete_t *pMsg)
    {
      uint8_t status = pMsg->pReturnParam[0];
    
      //Find which command this command complete is for
      switch (pMsg->cmdOpcode)
      {
        case HCI_READ_RSSI:
        {
          int8 rssi = (int8)pMsg->pReturnParam[3];  
    
          // Display RSSI value, if RSSI is higher than threshold, change to faster PHY
          if (status == SUCCESS)
          {
            uint16_t handle = BUILD_UINT16(pMsg->pReturnParam[1], pMsg->pReturnParam[2]);
    
            uint8_t index = SimplePeripheral_getConnIndex(handle);
            if (index >= MAX_NUM_BLE_CONNS)
            {
              Display_printf(dispHandle, SP_ROW_STATUS_1, 0, "Connection handle is not in the connList !!!");
              return;
            }
    
            if (rssi != LL_RSSI_NOT_AVAILABLE)
            {
              connList[index].rssiArr[connList[index].rssiCntr++] = rssi;
              connList[index].rssiCntr %= SP_MAX_RSSI_STORE_DEPTH;

    I hope this helps.

  • Hi Ammar,

    Customer says that he modified the program with reference to the simple_peripheral example. But the obtained RSSI is 127. Is this value normal? What is the general range about it?

    Regards and Thanks,                                                            

    Nick  

  • Hey Nick,

    127 means LL_RSSI_NOT_AVAILABLE. Is the customer in an active BLE connection when calling the HCI_ReadRssiCmd?