1.2.2.4.3 SRV_PSNIFFER_SerialCfmMessage Function
C
size_t SRV_PSNIFFER_SerialCfmMessage ( uint8_t* pDataDst, DRV_PLC_PHY_TRANSMISSION_CFM_OBJ* pCfmObj );
Summary
Serializes a transmitted PLC frame along with its parameters.
Description
This function takes a previously stored PLC transmitted frame and its related parameters and serializes it in a buffer for further transmission.
Precondition
SRV_PSNIFFER_SetTxMessage has to be previously called to store the PLC transmitted frame and its parameters. SRV_PSNIFFER_SetTxPayloadSymbols has to be called before to set the correct number of transmitted symbols in Sniffer library.
Parameters
Param | Description |
---|---|
pDataDst | Pointer to buffer where frame is serialized |
pCfmObj | Pointer to PLC Transmission Confirm object containing the transmission result (see G3 DRV_PLC_PHY_TRANSMISSION_CFM_OBJ Struct and PRIME DRV_PLC_PHY_TRANSMISSION_CFM_OBJ Struct) |
Returns
Number of bytes for serialized output.
Example
static void APP_PLCDataCfmCb(DRV_PLC_PHY_TRANSMISSION_CFM_OBJ *pCfmObj) { /* Report TX Symbols */ appData.plcPIB.id = PLC_ID_TX_PAY_SYMBOLS; appData.plcPIB.length = 2; DRV_PLC_PHY_PIBGet(appData.drvPl360Handle, &appData.plcPIB); SRV_PSNIFFER_SetTxPayloadSymbols(*(uint16_t *)appData.plcPIB.pData); /* Serialize transmitted message */ length = SRV_PSNIFFER_SerialCfmMessage(appData.pSerialData, pCfmObj); /* Send through USI */ SRV_USI_Send_Message(appData.srvUSIHandle, SRV_USI_PROT_ID_SNIFF_G3, appData.pSerialData, length); }
Remarks
None.