[En-Nut-Discussion] Problem with closing ppp sesion

Grzegorz Płoński grzegorz.plonski at numeron.pl
Tue Apr 20 21:12:16 CEST 2004


Hi,

 

I'm a beginner in Ethernut. I wanted to use it to obtain a connection with the Web by means of the ppp protocol. Basing on the example included in the 'pppc' file I wrote down my functions providing the connection and disconnection with the Web.  I don't use GPRS and because of that I connect to PSNT from time to time - I send a portion of data and I have to get disconnected. I noticed that simple disconnecting a ppp session, such as fclose() or _close() causes that the next sessions cannot be initiated properly. I can't find out why it should be so, and the solution of the type  

 

 

EnableWatchdog(); 

while(1);

 

is not satisfactory. 

So far I have established the fact that the  dcb blok included in  ppp is set to 'zero' before each opening of  ppp, and the state machine of  ppp is also initiated with the starting values. In spite of all this, a subsequent session cannot be opened.  h.

 

I suppose that the problem is connected with closing the session otherwise than by the simple close().

 

In the example I refer to the session is opened 

 

pppcom = _open("ppp:" PPPCOM "/" PPPUSER "/" PPPPASS, _O_RDWR | _O_BINARY))

 

and then the interface is configured 

 

rc = NutNetIfConfig("ppp", 0, 0, 0);

 

Probably, before 

 

_close(pppcom);

 

something else has to be done.

 

But what? How to disconnect the ppp session correctly?

 

I also noticed that the function NutDnsGetHostByName operates only for the second time.  Its first calling always returns IP = 0.0.0.0. , also with Ethernet interface. 

 

I'm looking forward to an answer to my questions

 

Greg Plonski

Poland

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.egnite.de/pipermail/en-nut-discussion/attachments/20040420/67bfbc93/attachment.html>


More information about the En-Nut-Discussion mailing list