2.3.10 PHY_EdStart Function

C

PHY_Retval_t PHY_EdStart(uint8_t scanDuration)

Summary

Starts Energy Detection Scan

Description

This function starts an ED Scan for the scan duration specified by the upper layer. Actual ED result of Energy level on current channel will be indicated by PHY_EdEndCallback(eneryLevel). Scan duration formula:

aBaseSuperframeDuration x (2^SD + 1) symbols

where SD - scanDuration parameter (0 - 14)

Precondition

PHY_Init() should have been called before calling this function

Parameters

ParamDescription
scanDurationSpecifies the ED scan duration in symbols
Range - (0 to 14)

Returns

PHY_SUCCESS - ED scan is started successfully

PHY_BUSY - PHY is busy servicing the previous request

PHY_TRX_ASLEEP - Transceiver is currently sleeping, wakeup the transceiver using PHY_TrxWakeup() function

PHY_FAILURE - otherwise

Example

PHY_Retval_t retVal = PHY_FAILURE;
uint8_t scanDurationSym = 1;

retVal = PHY_EdStart(scanDurationSym);
if (PHY_SUCCESS =! retVal)
{
    //ED scan cannot be started at this moment
}

Remarks

PHY_EdEndCallback(energyLevel) will be called after scanning the current channel for a time period of aBaseSuperframeDuration x (2scanDuration + 1) symbols. For scanDuration of value 0, ScanTime = 960 x(20 +1) = 1920 symbols = 30720 us.