1.4.3.18 PAL_PLC_CommStatusIndication Typedef

C

typedef void (*PAL_PLC_CommStatusIndication)(uint8_t *pData);

Summary

Pointer to a PLC PAL Communication Status event handler function.

Description

This data type defines the required function signature for the PLC PAL communication status 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.

Returns

None.

Example

static uint8_t macCommStatusBuffer[MAC_RT_FULL_HEADER_SIZE];

static void _plcCommStatusIndication(uint8_t *pData)
{
    // extract data from received message
    memcpy(macCommStatusBuffer, pData, MAC_RT_FULL_HEADER_SIZE);
}

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.initMIB = true;
// Initialize the PLC PAL module
palPlcObj = PAL_PLC_Initialize(PAL_PLC_PHY_INDEX, (const SYS_MODULE_INIT *) &palPlcInitData);

Remarks

This handler function is called before the data indication callback.