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.
Description
Takes a DRV_PLC_PHY_RECEPTION_OBJ object as parameter and builds a serialized frame containing the PLC frame and its related reception parameters, see G3 DRV_PLC_PHY_RECEPTION_OBJ Struct and PRIME DRV_PLC_PHY_RECEPTION_OBJ Struct.
Precondition
None.
Parameters
Param | Description |
---|---|
pDataDst | Pointer to buffer where frame will be serialized |
pDataSrc | Pointer 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.