1.3.2.3.72 MAC_WRP_SerialStringifyGetConfirm Function

C

uint8_t MAC_WRP_SerialStringifyGetConfirm (
    uint8_t *serialData,
    MAC_WRP_STATUS getStatus,
    MAC_WRP_PIB_ATTRIBUTE attribute,
    uint16_t index,
    uint8_t* pibValue,
    uint8_t pibLength
);

Summary

Serialize MAC PIB get confirm.

Description

This routine serializes a MAC PIB get confirm message.

Precondition

MAC PIB should have been read through MAC_WRP_GetRequestSync.

Parameters

ParamDescription
serialDataPointer to serial message data
getStatusResult of getting the PIB
attributePIB attribute
indexAttribute index
pibValuePointer to PIB value
pibLengthPIB length in bytes

Returns

Serial message length.

Example

// macWrpHandle returned from MAC_WRP_Open
// usiHandle returned from SRV_USI_Open
uint32_t attribute;
uint16_t index;
MAC_WRP_PIB_VALUE pibValue;
MAC_WRP_PIB_ATTRIBUTE pibAttr;
MAC_WRP_STATUS getStatus;
uint8_t serialRspBuffer[512];
uint8_t serialRspLen = 0;

// Get PIB from MAC
attribute = MAC_WRP_SerialParseGetRequest(pData, &index);
pibAttr = (MAC_WRP_PIB_ATTRIBUTE) attribute;
getStatus = MAC_WRP_GetRequestSync(macWrpHandle, pibAttr, index, &pibValue);

// Fill serial response buffer
serialRspBuffer[serialRspLen++] = MAC_WRP_SERIAL_MSG_MAC_GET_CONFIRM;
serialRspLen += MAC_WRP_SerialStringifyGetConfirm(&serialRspBuffer[serialRspLen],
        getStatus, pibAttr, index, pibValue.value, pibValue.length);

// Send through USI
SRV_USI_Send_Message(usiHandle, SRV_USI_PROT_ID_MAC_G3, serialRspBuffer, serialRspLen);

Remarks

This function is only available if MAC layer Serialization is enabled.