19.08.2013 Views

AN2120: Connecting an M68HC08 Family Microcontroller to an ...

AN2120: Connecting an M68HC08 Family Microcontroller to an ...

AN2120: Connecting an M68HC08 Family Microcontroller to an ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

This will force the server <strong>to</strong> reply with his options <strong>to</strong><br />

negotiate. Some ISPs require scripts <strong>to</strong> stablish a connection thus<br />

a void LCP packet will try <strong>to</strong> force the server <strong>to</strong> negotiate PPP.<br />

***********************************************************************/<br />

void PPPSendVoidLCP (void) {<br />

WORD Checksum;<br />

}<br />

<strong>AN2120</strong><br />

Move (PPPData, OutBuffer, PPPData[7] + 6);<br />

ProcPPPSend ((BYTE *)OutBuffer, OutBuffer[7] + 6);<br />

/***********************************************************************<br />

Function : PPPTerminate<br />

Parameters : None<br />

Date : September 2000<br />

Desc : Terminates a PPP link by sending a terminate LCP packet<br />

***********************************************************************/<br />

void PPPTerminate (void) {<br />

Move ((BYTE *)LCPTerminate, OutBuffer, 10);<br />

ProcPPPSend (OutBuffer, 10);<br />

}<br />

/***********************************************************************<br />

Function : PPPEntry<br />

Parameters : None<br />

Date : August 2000<br />

Desc : PPP Module Entry, Applications should call PPPEntry<br />

frequently in the main loop or in portions of the app<br />

code.<br />

***********************************************************************/<br />

void PPPEntry (void) {<br />

if (PPPStatus & IsFrame) {<br />

switch (*(WORD *)(&InBuffer [2])) {<br />

case LCP_PACKET:<br />

H<strong>an</strong>dleLCPOptions ();<br />

break;<br />

case PAP_PACKET:<br />

if (InBuffer [4] == 0x02) {// Authentication OK<br />

NoOperation;<br />

}<br />

break;<br />

case IPCP_PACKET: // IPCP H<strong>an</strong>dler<br />

H<strong>an</strong>dleIPCPOptions ();<br />

break;<br />

Application Note<br />

Code Implementation<br />

MOTOROLA 71

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!