1.4.3.19 PAL_PLC_MacSnifferIndication Typedef

C

typedef void (*PAL_PLC_MacSnifferIndication)(uint8_t *pData, uint16_t length);

Summary

Pointer to a PLC PAL G3 MAC Sniffer Reception Event handler function.

Description

This data type defines the required function signature for the PLC PAL G3 MAC sniffer event handling callback function. When PAL_PLC_Initialize is called, a client must register a pointer whose function signature (parameter and return value types) matches the types specified by this function pointer in order to receive transfer related event calls back from the PLC PAL.

The parameters and return values are described here and a partial example implementation is provided.

Parameters

ParamDescription
pDataPointer to the data content.
lengthLength of the received data in bytes.

Returns

None.

Example

static void _plcMACSnifferIndication( uint8_t *pData, uint16_t length )
{
    // MAC sniffer handling here.
}

PAL_PLC_INIT palPlcInitData;
SYS_MODULE_OBJ palPlcObj;

palPlcInitData.macRtBand = G3_FCC;
palPlcInitData.macRtHandlers.palPlcDataIndication = _plcDataIndication;
palPlcInitData.macRtHandlers.palPlcTxConfirm = _plcTxConfirm;
palPlcInitData.macRtHandlers.palPlcCommStatusIndication = _plcCommStatusIndication;
palPlcInitData.macRtHandlers.palPlcRxParamsIndication = _plcRxParamsIndication;
palPlcInitData.macRtHandlers.palPlcMacSnifferIndication = _plcMACSnifferIndication;
palPlcInitData.initMIB = true;    
// Initialize the PLC PAL module
palPlcObj = PAL_PLC_Initialize(PAL_PLC_PHY_INDEX, (const SYS_MODULE_INIT *) &palPlcInitData);

Remarks

This handler function definition is only available if MAC sniffer is enabled in MCC of PLC PAL.