Jump to main content

# 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.

## Description

Takes a DRV_PLC_PHY_PIB_OBJ object as parameter and builds a serialized frame containing the Set result, see G3 DRV_PLC_PHY_PIB_OBJ Struct and PRIME DRV_PLC_PHY_PIB_OBJ Struct.

## Precondition

None.

## Parameters

Param | Description
--- | ---
pDataDst | Pointer to buffer where frame will be serialized.
pDataSrc | Pointer to a DRV_PLC_PHY_PIB_OBJ object containing PIB value.

## Returns

Length of serialized frame.

## Example

      Copied to clipboardSRV_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.

Rev: G