1.1.1.4.20 DRV_PLC_PHY_DATA_IND_CALLBACK Typedef

C

typedef void ( *DRV_PLC_PHY_DATA_IND_CALLBACK )( DRV_PLC_PHY_RECEPTION_OBJ *indObj, uintptr_t context );

Summary

Pointer to a PLC Driver Reception Event handler function.

Description

This data type defines the required function signature for the PLC driver reception event handling callback function. A client must register a pointer using the callback register function whose function signature (parameter and return value types) match the types specified by this function pointer in order to receive transfer related event calls back from the driver.

Parameters

ParamDescription
indObjPointer to the object containing any data necessary to describe the new received message
contextValue identifying the context of the application that registered the event handling function

Returns

None.

Example

void APP_MyRxEventHandler( DRV_PLC_PHY_RECEPTION_OBJ *indObj, uintptr_t context )
{
    MY_APP_DATA_STRUCT* pAppData = (MY_APP_DATA_STRUCT*) context;

    // Check length of the new message
    if (indObj->dataLength != 0)
    {
        // extract data from received message
        memcpy(appData.pDataRx, indObj->pReceivedData, indObj->dataLength);
    }
}

Remarks

Check DRV_PLC_PHY_RECEPTION_OBJ structure to identify other intereseting parameters about reception such as LQI, Tonemap, Modulation scheme, etc.

The context parameter contains a handle to the client context, provided at the time the event handling function was registered using the DRV_PLC_PHY_DataIndCallbackRegister function. This context handle value is passed back to the client as the context parameter. It can be any value necessary to identify the client context or instance (such as a pointer to the client's data) of the client that made the transfer add request.