Jump to main content

# 1.1.2.4.13 DRV_G3_MACRT_CommStatusCallbackRegister Function

## C

    void DRV_G3_MACRT_CommStatusCallbackRegister (
        const DRV_HANDLE handle,
        const DRV_G3_MACRT_COMM_STATUS_IND_CALLBACK callback
    );

## Summary

Allows a client to set a G3-PLC MAC Communication Status indication event handling function for the driver to call back when a Communication Status event has to be reported.

## Description

This function allows a client to register a G3-PLC MAC Communication Status indication event handling function for the driver to call back when a Communication Status event occurs. Communication Status events are defined in IEEE 802.15.4 standard.

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).

## Precondition

DRV_G3_MACRT_Open must have been called to obtain a valid opened device handle.

## Parameters

Param | Description
--- | ---
handle | A valid instance handle, returned from the driver DRV_G3_MACRT_Open routine.
callback | Pointer to the callback function.

## Returns

None.

## Example

    void APP_G3_MAC_RT_Comm_Status_callback(uint8_t *pData)
    {
        // Extract Comm Status Data from packet.
    }

    // myAppObj is an application specific state data object.
    MY_APP_OBJ myAppObj;

    // Client registers a Comm Status indication callback with driver. This is done once
    // 'myHandle', returned from DRV_G3_MACRT_Open previously called
    DRV_G3_MACRT_CommStatusCallbackRegister( myAppObj.myHandle, APP_G3_MAC_RT_Comm_Status_callback );

## Remarks

None.

Rev: G