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

Brett Abbott Brett.Abbott at digital-telemetry.com
Fri May 6 06:01:23 CEST 2005


Matej

I have some scenarios where this occurs but the steps you list seem to 
work ok at my end.

The symptoms suggest ahdlc is in fact swallowing the characters.

Have you tried putting NutThreadYield's in after the _close and _ioctl 
steps.  I suspect you have but worth checking as ahdlc needs some free 
spin time.

I will send you my copy of the patched ahdlc.c code just in case of a typo.

Cheers
Brett
Matej Kupljen wrote:

>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
>
>
>  
>

-- 
-----------------------------------------------------------------
Brett Abbott, Managing Director, Digital Telemetry Limited
Email: Brett.Abbott at digital-telemetry.com
PO Box 24 036 Manners Street, Wellington, New Zealand
Phone +64 (4) 5666-860  Mobile +64 (21) 656-144
------------------- Commercial in confidence --------------------






More information about the En-Nut-Discussion mailing list