1.2.3.4.7 SRV_PSERIAL_SerialRxMessage Function

C

size_t SRV_PSERIAL_SerialRxMessage
(
    uint8_t* pDataDst,
    DRV_PLC_PHY_RECEPTION_OBJ* pDataSrc
);

Summary

Serializes a received PLC frame and its related information.

Precondition

None.

Parameters

ParamDescription
pDataDstPointer to buffer where frame will be serialized
pDataSrcPointer to a DRV_PLC_PHY_RECEPTION_OBJ object containing the PLC frame

Returns

Length of serialized frame.

Example

static void APP_PLCDataIndCb(DRV_PLC_PHY_RECEPTION_OBJ *indObj, uintptr_t context)
{
    /* Send Received PLC message through USI */
    if (indObj->dataLength)
    {
        size_t length;

        /* Serialize received message */
        length = SRV_PSERIAL_SerialRxMessage(appData.pSerialData, indObj);
        /* Send through USI */
        SRV_USI_Send_Message(appData.srvUSIHandle, SRV_USI_PROT_ID_PHY,
                appData.pSerialData, length);
    }
}

Remarks

None.