|ttUserLinkLayer tfUseAsyncPpp||(ttUserLnkNotifyFuncPtr notifyFuncPtr);|
This function is used to initialize the asynchronous PPP client link layer. When link-up or link-down events occur, the stack will call the function passed in. If you do not need notification of events then the parameter should be set to TM_LNK_NOTIFY_FUNC_NULL_PTR.
The prototype of the notification function is:
void myPppNotifyFunction(ttUserInterface interfaceHandle, int flags);
Possible 'flags' values
- PPP Device is ready to accept data from the user.
- PPP Device has started to close this link.
- PPP Device has closed.
- LCP negotiation has completed.
- PAP authentication has completed.
- CHAP authentication has completed.
- IPCP negotiation has started.
- LQM is enabled on the link.
- LQM is disabled on the link.
- Link quality is bad, user recovery should be attempted.
These events may be used to monitor the status of the PPP connection. The PPP connection should not be used before a TM_LL_OPEN_COMPLETE event is received, and the device should not be restarted (after a tfCloseInterface()) before a TM_LL_CLOSE_COMPLETE event is received.
From these events, it is also possible to determine why PPP negotiation failed. For instance, if authentication fails, a TM_LL_LCP_UP event is first received indicating that the physical link has been negotiated.
However, if authentication fails, the next event will be TM_LL_CLOSE_STARTED and then TM_LL_CLOSE_COMPLETE since the link must be closed if negotiation fails. If authentication is successful the events that are received are TM_LL_LCP_UP, TM_LL_PAP_UP or TM_LL_CHAP_UP and then TM_LL_OPEN_COMPLETE.
- The function to call to notify the user of PPP events.