1.2.2.4.2 SRV_PSNIFFER_SerialRxMessage Function

C

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

Summary

Serializes a received PLC frame along with its parameters.

Description

This function takes an object containing a PLC frame and its related parameters and serializes it in a buffer for further transmission.

Returns

Number of bytes for serialized output.

Example

static void APP_PLCDataIndCb(DRV_PLC_PHY_RECEPTION_OBJ *indObj, uintptr_t context)
{
    /* Report RX Symbols */
    appData.plcPIB.id = PLC_ID_RX_PAY_SYMBOLS;
    appData.plcPIB.length = 2;
    DRV_PLC_PHY_PIBGet(appData.drvPl360Handle, &appData.plcPIB);

    SRV_PSNIFFER_SetRxPayloadSymbols(*(uint16_t *)appData.plcPIB.pData);

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

Remarks

None.