1.3.3.1.7 MAC_COMMON_SetRequestSync Function

C

MAC_STATUS MAC_COMMON_SetRequestSync
(
    MAC_COMMON_PIB_ATTRIBUTE attribute,
    uint16_t index,
    const MAC_PIB_VALUE *pibValue
);

Summary

The MAC_COMMON_SetRequestSync primitive sets the value of an attribute in the MAC Common layer Parameter Information Base (PIB).

Description

SetRequestSync primitive is used to set the value of a PIB. Sync suffix indicates that result of set operation is provided upon function call return, in the return status code.

Precondition

MAC_COMMON_Init primitive has to be called before.

Parameters

ParamDescription
attributeIdentifier of the Attribute to provide value
indexIndex of element in case Attribute is a table. Otherwise index must be set to '0'
pibValuePointer to MAC_PIB_VALUE object where value is contained

Returns

Result of set operation as a MAC_STATUS code.

Example

MAC_STATUS status;
const MAC_PIB_VALUE value = {
    .length = 2,
    .value = {0xFF, 0xFF}
};

status = MAC_COMMON_SetRequestSync(MAC_COMMON_PIB_RC_COORD, 0, &value);
if (status == MAC_STATUS_SUCCESS)
{
    // PIB correctly set
}

Remarks

None.