1.2.5.2.10 TCPIP_MAC_EventF Type

C

typedef void (* TCPIP_MAC_EventF)(TCPIP_MAC_EVENT event, const void* eventParam);

Description

Event notification Function: typedef void (*TCPIP_MAC_EventF)(TCPIP_MAC_EVENT event, const void* eventParam);

This function describes the MAC event notification handler. This is a handler specified by the user of the MAC (the TCP/IP stack). The stack can use the handler to be notified of MAC events. Whenever a notification occurs the passed events have to be eventually processed:

  • Stack should process the TCPIP_EV_RX_PKTPEND/TCPIP_EV_RX_DONE, TCPIP_EV_TX_DONE events

  • Process the specific (error) condition

  • Acknowledge the events by calling TCPIP_MAC_EventAcknowledge() so that they can be re-enabled.

Members

MembersDescription
eventEvent that's reported (multiple events can be OR-ed).
eventParamUser parameter that's used in the notification handler.

Returns

None.

Remarks

The notification handler will be called from the ISR which detects the corresponding event. The event notification handler has to be kept as short as possible and non-blocking. Mainly useful for RTOS integration where this handler will wake-up a thread that waits for a MAC event to occur. The event notification system also enables the user of the TCPIP stack to call into the stack for processing only when there are relevant events rather than being forced to periodically call from within a loop at unknown moments. Without a notification handler the stack user can still call TCPIP_MAC_EventPendingGet() to see if processing by the stack needed. This is a default way of adding MAC interrupt processing to the TCP/IP stack.