lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-users] question about PPP shutdown


From: yueyue papa
Subject: [lwip-users] question about PPP shutdown
Date: Thu, 20 Nov 2008 16:20:07 +0800

Hi All,
 
I am using lwIP + PPP on GPRS module, I use this API to detect whehter PPP is on/off
 
/**
 * return 1 means PPP on.
*/
int pppStatus(void)
{
 int status;

 status=0;

 if(pppIOCtl(gpppInfo.hppp,PPPCTLG_UPSTATUS,&status)==0)
 {
  if(status)
  {
   return 1;
  }
 }
 return -1;

}
 
 
It could be detect the PPP is on, but I shutdown the PPP.
 

int main(void)
{
 int status;
  /* no stdio-buffering, please! */
  setvbuf(stdout, NULL,_IONBF, 0);

  main_loop();

#if PPP_SUPPORT
  {
 int rc;
 rc=pppClose(gpppInfo.hppp);
 printf("pppClose %d\n", rc);
 pppLinkTerminated(gpppInfo.hppp);
 printf("pppLinkTerminated\n");
 pppLinkDown(gpppInfo.hppp);
 printf("pppLinkDown\n");
  }
   while( pppStatus() == 1)
   {
    printf("wait PPP shutdown\n");
    OSTimeDlyMillisec(1000);
   }
   printf("PPP really shutdown, i make shutdown gprs module +++, ath\n");
   sio_close(gpppInfo.ppp_sio);
#endif
  return 0;
}

 But the pppStauts() always give me 1.

Where is the problem for I shutdown the PPP link?

 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]