1.2.3.4.3 SRV_PSERIAL_SerialGetPIB Function

C

size_t SRV_PSERIAL_SerialGetPIB
(
    uint8_t* pDataDst,
    DRV_PLC_PHY_PIB_OBJ* pDataSrc
);

Summary

Serializes a response to a SRV_PSERIAL_CMD_PHY_GET_CFG command.

Precondition

None.

Parameters

ParamDescription
pDataDstPointer to buffer where frame will be serialized
pDataSrcPointer to a DRV_PLC_PHY_PIB_OBJ object containing PIB value

Returns

Length of serialized frame.

Example

SRV_PSERIAL_COMMAND command;
DRV_PLC_PHY_PIB_OBJ pibObj;

/* Process received message from USI */
command = SRV_PSERIAL_GetCommand(pData);
if (command == SRV_PSERIAL_CMD_PHY_GET_CFG) {
    SRV_PSERIAL_ParseGetPIB(&pibObj, pData);
    if (DRV_PLC_PHY_PIBGet(appData.drvPl360Handle, &pibObj))
    {
    size_t len;
    /* Serialize PIB data */
    len = SRV_PSERIAL_SerialGetPIB(appData.pSerialData, &pibObj);
    /* Send through USI */
    SRV_USI_Send_Message(appData.srvUSIHandle, SRV_USI_PROT_ID_PHY,
            appData.pSerialData, len);
    }
}

Remarks

None.