[En-Nut-Discussion] PPP/AHDLC logic problems...

Matej Kupljen matej.kupljen at gmail.com
Thu May 5 22:53:51 CEST 2005


Hi

Did some more testing about proper closing of the PPP session and then
reopening it. I followed Brett suggestion to try the solution proposed by
Eduardo Serantes, which he posted  14th Jan 2005.

However I doesn't seem to work :-(

I added the code to ahdlcavr.c proposed in the patch, and also the
printf("....") on the start of the AhdlcRx thread and on the end of the 
thread. It seems that the thread starts as soon as you register the 
device, BUT IT NEVER EXITS!

I tried to end the PPP session with the following:

		printf("Closing the PPP connection...");
		_ioctl(pppcom, HDLC_SETIFNET, 0);
		printf("Done.\n");

		NutSleep(2000);

		/* Hanging up */
                ....
		NutSleep(1000);

		_close(pppcom);

And then I reopen the port, set the baud rate, timeout, ...

Here is my results from the CHAT script.
1.) The first time when it works
Send 'AT'
Expect 'OK', got 'AT\x0D\x0D\x0AOK'
.....

2.) The second time, after closing and reopening, I get:
Send 'AT'
Expect 'OK', got 'AO\x0D\x0A' TIMEOUT


????
What could be the problem (Ahdlc thread "eating" half of the
characters,maybe??) and how it can be solved?

BR,
Matej



More information about the En-Nut-Discussion mailing list