1.3.2.3.13 MAC_WRP_SetRequestSync Function

C

MAC_WRP_STATUS MAC_WRP_SetRequestSync
(
    MAC_WRP_HANDLE handle,
    MAC_WRP_PIB_ATTRIBUTE attribute,
    uint16_t index,
    const MAC_WRP_PIB_VALUE *pibValue
);

Summary

The MAC_WRP_SetRequestSync primitive sets the value of an attribute in the MAC 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

A valid handle has to be obtained before calling this function, by means of MAC_WRP_Open function.

Parameters

ParamDescription
handleA valid handle which identifies the Mac Wrapper instance
attributeIdentifier of the Attribute to provide value. See MAC_WRP_PIB_ATTRIBUTE
indexIndex of element in case Attribute is a table. Otherwise index must be set to '0'
pibValuePointer to MAC_WRP_PIB_VALUE object where value is contained

Returns

Result of set operation as a MAC_WRP_STATUS code.

Example

// ...
MAC_WRP_HANDLE handle;
handle = MAC_WRP_Open(G3_MAC_WRP_INDEX_0, MAC_WRP_BAND_CENELEC_A);
// ...

MAC_WRP_STATUS status;
const MAC_WRP_PIB_VALUE value = {
    .length = 1,
    .value = 6
};

status = MAC_WRP_SetRequestSync(handle, MAC_WRP_PIB_MAX_FRAME_RETRIES, 0, &value);
if (status == MAC_WRP_STATUS_SUCCESS)
{
    // PIB correctly set
}

Remarks

None.