1.3.2.3.10 MAC_WRP_DataIndication Typedef

C

typedef void (*MAC_WRP_DataIndication)(MAC_WRP_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 Wrapper 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.

Returns

None.

Example

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

Remarks

None.