1.2.5.8.15 PPP_EventHandlerRegister Function

C

PPP_EVENT_HANDLE PPP_EventHandlerRegister(DRV_HANDLE hMac, PPP_EVENT_HANDLER handler, const void* hParam);

Returns

Returns a valid handle if the call succeeds, or a null handle if the call failed (out of memory, for example).

Description

This function registers a PPP event handler.

The PPP module will call the registered handler when a PPP event occurs.

Remarks

The handler has to be short and fast. It is meant for setting an event flag, not for lengthy processing!

The hParam is passed by the client and will be used by the PPP when the notification is made. It is used for per-thread content or if more modules, for example, share the same handler and need a way to differentiate the callback.

This API exists only when the build symbol PPP_NOTIFICATIONS_ENABLE != 0

Preconditions

The PPP module must be initialized.

Parameters

hMac - driver handle (obtained by calling TCPIP_MAC_Open/DRV_PPP_MAC_Open)

handler - Handler to be called when a PPP event occurs.

hParam - Parameter to be used in the handler call. This is user supplied and is not used by the PPP module.

Example