1.1.4.4.22 DRV_RF215_SET_CHANNEL_CALLBACK Typedef

C

typedef void ( *DRV_RF215_SET_CHANNEL_CALLBACK ) (
    DRV_RF215_TX_RESULT result,
    uintptr_t context
);

Summary

Pointer to a RF215 set channel notification callback function.

Description

This data type defines the required function signature for the RF215 driver set channel event handling callback function. A client uses DRV_RF215_SetChannelCallbackRegister to register a pointer to a function which must match the signature (parameter and return value types) specified by this data type.

Parameters

ParamDescription
resultResult of setting frequency channel through DRV_RF215_SetChannelRequest.
contextValue identifying the context of the application that registered the callback function.

Returns

None.

Example

static void APP_SetChannelCb(DRV_RF215_TX_RESULT result, uintptr_t ctxt)
{
    // The context handle was set to an application specific object
    // It is now retrievable easily in the event handler
    MY_APP_OBJ myAppObj = (MY_APP_OBJ *) ctxt;

    // Set channel handling here.
}

DRV_HANDLE drvRf215Handle; // Returned from DRV_RF215_Open
MY_APP_OBJ myAppObj; // Application specific data object

DRV_RF215_SetChannelCallbackRegister(drvRf215Handle, APP_SetChannelCb,
    (uintptr_t) myAppObj);

Remarks

The context parameter contains a handle to the client context, provided at the time the callback function was registered using DRV_RF215_SetChannelCallbackRegister. This context value is passed back to the client as 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 registered the callback.

This data type is only available if "Frequency hopping support" is enabled via MCC.