1.3.3.1.4 MAC_DataIndication Typedef

C

typedef void (*MAC_DataIndication)(MAC_DATA_INDICATION_PARAMS *diParams);

Summary

Pointer to a Data Indication Event handler function.

Description

This data type defines the required function signature for the MAC Data Indication event handling callback function. A client must register a pointer using the event handling function whose function signature (parameter and return value types) matches the types specified by this function pointer in order to receive Data Indication events back from module.

Parameters

ParamDescription
diParamsPointer to structure containing parameters related to Indication. See MAC_DATA_INDICATION_PARAMS

Returns

None.

Example

App_DataIndication(MAC_DATA_INDICATION_PARAMS *params)
{
    // Check addressing
    if (params->destPanId == myPanId)
    {
        if (params->destAddress.addressMode == MAC_ADDRESS_MODE_SHORT)
        {
            if (params->destAddress.shortAddress == myShortAddress) {
                // Frame is for me
            }
        }
        else if (params->destAddress.addressMode == MAC_ADDRESS_MODE_EXTENDED)
        {
            if (params->destAddress.extendedAddress == myExtendedAddress) {
                // Frame is for me
            }
        }
    }
}

Remarks

None.