2.3.13 PHY_CCAPerform Function

C

PHY_Retval_t PHY_CCAPerform(void)

Summary

Perform a clear channel assessment

Description

This function is used to perform a clear channel assessment on current channel. using configured CCA mode (can be set using PHY_PibSet of phyCCAMode). This results in the status of channel is current busy or Idle.

The different CCA modes supported by Transceiver are The CCA mode

  • CCA Mode 1: Energy above threshold. CCA shall report a busy medium upon detecting any energy above the ED threshold.

  • CCA Mode 2: Carrier sense only. CCA shall report a busy medium only upon the detection of a signal with the modulation and spreading characteristics of IEEE 802.15.4. This signal may be above or below the ED threshold.

  • CCA Mode 3: Carrier sense with energy above threshold. CCA shall report a busy medium only upon the detection of a signal with the modulation and spreading characteristics of IEEE 802.15.4 with energy above the ED threshold.

Precondition

PHY_Init() should have been called before calling this function.

Parameters

None

Returns

PHY_CHANNEL_IDLE - The CCA attempt has detected an idle channel

PHY_CHANNEL_BUSY - The CCA attempt has detected a busy channel

Example

PHY_Retval_t retVal = PHY_FAILURE;
uint8_t phyChannel = 15;
PibValue_t pibValue;
bool isChIdle = false;

// Setting Current channel
pibValue.pib_value_8bit = phyChannel;
retVal = PHY_PibSet(phyCurrentChannel, &pibValue);
if(PHY_SUCCESS == retVal)
{
    //Take the Ed sample
    retVal = PHY_CCAPerform();
    if (PHY_CHANNEL_IDLE == retVal)
    {
        isChIdle = true;
    }
}

Remarks

None