1.3.2.3.71 MAC_WRP_SerialParseGetRequest Function
C
uint32_t MAC_WRP_SerialParseGetRequest(uint8_t* pData, uint16_t* index);
Summary
Parse PIB get request serial message.
Description
This routine parses a PIB get request serial message. It gives the PIB attribute and index from the data contained in the serial message.
Precondition
None.
Parameters
Param | Description |
---|---|
pData | Pointer to serial message data |
index | Pointer to attribute index (output) |
Returns
PIB attribute.
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.