1.4.3.16 PAL_PLC_TxConfirm Typedef

C

typedef void (*PAL_PLC_TxConfirm)(MAC_RT_STATUS status, bool updateTimestamp);

Summary

Pointer to a PLC PAL Transmission Confirm event handler function.

Description

This data type defines the required function signature for the PLC PAL transmission confirm 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
statusMAC RT status corresponding to the transmission result.
updateTimestampFlag to indicate if timestamp should be updated.

Returns

None.

Example

static void _plcTxConfirm(MAC_RT_STATUS status, bool updateTimestamp)
{
    switch(status)
    {
        case MAC_RT_STATUS_SUCCESS:
            // Transmission result: already in process
            break;   
        case MAC_RT_STATUS_CHANNEL_ACCESS_FAILURE:
            // Transmission result: CSMA failure
            break;   
        case MAC_RT_STATUS_NO_ACK:
            // Transmission result: ACK failure
            break;
    }
}

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

If the status is MAC_RT_STATUS_SUCCESS, it means that the data was transferred successfully. Otherwise, it means that the data was not transferred successfully.