EthernetNetIf Compatibility.
Dependents: XBeeWiFi_SPI_example
Fork of NetServicesSource by
Diff: if/ppp/PPPNetIf.cpp
- Revision:
- 4:fd826cad83c0
- Parent:
- 0:632c9925f013
- Child:
- 5:dd63a1e02b1b
--- a/if/ppp/PPPNetIf.cpp Fri Jun 18 10:38:57 2010 +0000 +++ b/if/ppp/PPPNetIf.cpp Fri Jul 09 14:46:47 2010 +0000 @@ -33,7 +33,7 @@ #include "netCfg.h" #if NET_PPP -#define PPP_TIMEOUT 60000 +#define PPP_TIMEOUT 30000//60000 #define BUF_SIZE 128 @@ -88,10 +88,14 @@ DBG("\r\nPPPNetIf: Set Auth.\r\n"); - m_pIf->flushBuffer(); //Flush buffer before passing serial port to PPP - + //wait(1.); + + //m_pIf->flushBuffer(); //Flush buffer before passing serial port to PPP + m_status = PPP_CONNECTING; + DBG("m_pIf = %p\n", m_pIf); int res = pppOverSerialOpen((void*)m_pIf, sPppCallback, (void*)this); + DBG("\r\nPPP connected\r\n"); if(res<0) { disconnect(); @@ -119,6 +123,7 @@ if( m_status == PPP_DISCONNECTED ) { + disconnect(); return PPP_PROTOCOL; } @@ -140,7 +145,7 @@ m_pIf->flushBuffer(); m_pIf->printf("+++"); - wait(.1); + wait(.5); m_pIf->flushBuffer(); GPRSErr gprsErr; @@ -194,7 +199,6 @@ //Link Callback void PPPNetIf::pppCallback(int errCode, void *arg) { - //DBG("\r\nPPPNetIf: Callback errCode = %d.\r\n", errCode); switch ( errCode ) { //No error @@ -203,6 +207,7 @@ break; default: //Disconnected + DBG("\r\nPPPNetIf: Callback errCode = %d.\r\n", errCode); m_status = PPP_DISCONNECTED; break; }