2.3.4 PHY_PibSet Function

C

PHY_Retval_t PHY_PibSet(uint8_t attribute, PibValue_t *value)

Summary

Sets the PHY PIB attribute with value

Description

This function is called to set the transceiver information base attributes. The list of PHY PIB attributes, its default values and range are described in the above table. For more information refer ieee_phy_const.h file

Precondition

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

Parameters

ParamDescription
attributePHY infobase attribute ID
valuePointer to the PHY infobase attribute value to be set

Returns

PHY_UNSUPPORTED_ATTRIBUTE - if the PHY info base attribute is not found

PHY_BUSY - If the PHY is not in PHY_IDLE state.An exception is macBeaconTxTime which can be accepted by PHY even if PHY is not in PHY_IDLE state

PHY_SUCCESS - If the attempt to set the PIB attribute was successful

PHY_TRX_ASLEEP - If trx is in SLEEP mode and access to trx is required

Example

PHY_Retval_t retVal = PHY_FAILURE;
uint8_t phyChannel = 15;
uint8_t shortAddr = 0x1234;
PibValue_t pibValue;

// Setting Current channel
pibValue.pib_value_8bit = phyChannel;
retVal = PHY_PibSet(phyCurrentChannel, &pibValue);
if(PHY_SUCCESS == retVal)
{
    //Channel is configured
}

//Setting short Address
pibValue.pib_value_16bit = shortAddr;
retVal = PHY_PibSet(macShortAddr, &pibValue);
if(PHY_SUCCESS == retVal)
{
    //Short Address is configured
}

Remarks

None