1.3.2.3.4 MAC_WRP_SetCallbacks Function

C

void MAC_WRP_SetCallbacks
(
    MAC_WRP_HANDLE handle,
    MAC_WRP_HANDLERS* handlers
);

Summary

Sets the MAC Wrapper module callback handlers for a given instance.

Description

This routine sets the MAC Wrapper callback handlers for a given instance.

Precondition

A valid handle has to be obtained before calling this function, by means of MAC_WRP_Open function.

Parameters

ParamDescription
handleA valid handle which identifies the Mac Wrapper instance
handlersPointer to the callback handlers to set

Returns

None.

Example

// ...
MAC_WRP_HANDLE handle;
handle = MAC_WRP_Open(G3_MAC_WRP_INDEX_0, MAC_WRP_BAND_CENELEC_A);
// ...

MAC_WRP_HANDLERS macWrpHandlers = {
    .dataConfirmCallback = appDataConfirm,
    .dataIndicationCallback = appDataIndication,
    .resetConfirmCallback = appResetConfirm,
    .beaconNotifyIndicationCallback = appBeaconIndication,
    .scanConfirmCallback = appScanConfirm,
    .startConfirmCallback = NULL, // Start primitive not used
    .commStatusIndicationCallback = appCommStatus,
    .snifferIndicationCallback = NULL, // MAC Sniffer not used
};

MAC_WRP_SetCallbacks(handle, &macWrpHandlers);

Remarks

None.