1.1.2.4.8 DRV_G3_MACRT_InitCallbackRegister Function

C

void DRV_G3_MACRT_InitCallbackRegister( 
    const SYS_MODULE_INDEX index, 
    const DRV_G3_MACRT_INIT_CALLBACK callback
);

Summary

Allows a client to set a G3 MAC RT initialization event handling function for the driver to call back when the PLC binary file has been loaded into the PLC transceiver.

Description

This function allows a client to register a G3 MAC RT initialization event handling function for the driver to call back when the loading of the PLC binary file has finished.

This routine should be called before calling DRV_G3_MACRT_Open function.

The callback once set, persists until the client closes the driver or sets another callback (which could be a NULL pointer to indicate no callback).

Parameters

ParamDescription
indexIdentifier for the object instance to be opened
callbackPointer to the callback function

Returns

None.

Example

void APP_PLC_Init_callback(bool initResult)
{
    if (initResult == True)
    {

    }
    else
    {

    }
}
    
DRV_HANDLE handle;

DRV_G3_MACRT_initCallbackRegister( DRV_G3_MACRT_INDEX_0, APP_PLC_Init_callback );

handle = DRV_G3_MACRT_Open(DRV_G3_MACRT_INDEX_0, NULL);
if (handle == DRV_HANDLE_INVALID)
{

}

Remarks

None.