1.2.3.4.5 SRV_PSERIAL_SerialSetPIB Function

C

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

Summary

Serializes a response to a SRV_PSERIAL_CMD_PHY_SET_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_SET_CFG) {
    SRV_PSERIAL_ParseSetPIB(&pibObj, pData);
    if (DRV_PLC_PHY_PIBSet(appData.drvPl360Handle, &pibObj))
    {
    size_t len;
    /* Serialize PIB data */
    len = SRV_PSERIAL_SerialSetPIB(appData.pSerialData, &pibObj);
    /* Send through USI */
    SRV_USI_Send_Message(appData.srvUSIHandle, SRV_USI_PROT_ID_PHY,
            appData.pSerialData, len);
    }
}

Remarks

None.