PreviousNext
getRSSI
Help > OS functions > RF > getRSSI

Function

 

Reads the RSSI_LEVEL register from RF IC. The current value is not measured but just read out the last one.

Purpose

 

Gets the RF signal level, especially for fast check without receiving.

Syntax

 

uns8 getRSSI()

Parameters

 

  –

Return value

 

RSSI_LEVEL value at the time of the last checkRF or RFRXpacket call.

RSSI [dBm] = RSSI_LEVEL – 130. See the RF IC datasheet.

Output values

 

The return value is also copied to the lastRSSI register.

Preconditions

 

     The return value is valid only if checkRF (or successful RFRXpacket) had been called before.

     To get the most precise RSSI value, use the strongest filter – checkRF(90).

Remarks

 

The lastRSSI register is updated also automatically:

     after RFRXpacket, if returns true. Thus, it makes no sense to call getRSSI after RFRXpacket.

     after getRSSI (valid after preceding checkRF call)

Side effects

 

  –

See also

 

checkRF, RFRXpacket

Example 1

 

if checkRF(0)

{

  if RFRXpacket()

  {

      ...

    i = lastRSSI;  // Get current RSSI level. getRSSI is not needed.

  }

}

Example 2

 

checkRF(90);        // 90 gets more precise value than 0 but checking takes longer

i = getRSSI();      // Get current RSSI level

   ...

checkRF(5);         // Then do not forget to use a reasonable checkRF filter

                    // before possible subsequent (X)LP receipt