[En-Nut-Discussion] Pausing PPP session?
Brett Abbott
Brett.Abbott at digital-telemetry.com
Thu Jun 23 00:44:26 CEST 2005
Vesa
I was one of these optimistic people. I spent some time looking at this
but have be working on paying customer needs..... ;)
A good solution involves preventing inwards and outwards packet flow and
signalling to the PPP layer to pause at the end of the next frame (or
now if silent) for both sending and receiving of packets. There are
various short cuts but these were unlikely to be robust enough for what
I needed. The trick is keeping the code compact.
I include possible code (untested) below for a shortcut version (hack)
that may solve your problem in a simple way.
Possible simple pause:
----------------------------
dev/ahdlcavr.c: AhdlcRx thread:
note:: ppp_hackup defined as global u_char, default value=0
while (dcb->dcb_rd_idx == dcb->dcb_rx_idx) {
if (dev->dev_icb == 0 || ppp_hackup ==1 ) // THIS
LINE CHANGED
break;
// PPP hackish PAUSE CHANGE STARTS HERE
if ppp_hackup==1
{
NutSleep(100); // This may not be needed ,
perhaps a yield is better?
continue;
}
// END OF CHANGE
/* TODO: Check for idle timeout. */
if (NutEventWait(&dcb->dcb_rx_rdy, dcb->dcb_rtimeout)) {
continue;
}
}
/*
* Leave loop if network interface is detached
*/
if (dev->dev_icb == 0)
break;
I use the variable named ppp_hackup as this was the equivalent name used
by Harald for a similar purpose in early nutos ppp.
The above assumes that the ppp connection is already established. There
may need to be extra code added to cope with a better implementation. I
hope this helps.
Cheers
Brett
Vesa Jääskeläinen wrote:
> Hi,
>
> Couple months ago there were people talking about pausing PPP session
> to enter AT commands and then resuming PPP session. There would now be
> a need for such functionality so I was wondering what is status of
> this feature, and is anyone working on it?
>
> Thanks,
> Vesa Jääskeläinen
> _______________________________________________
> En-Nut-Discussion mailing list
> En-Nut-Discussion at egnite.de
> http://www.egnite.de/mailman/listinfo.cgi/en-nut-discussion
>
>
--
-----------------------------------------------------------------
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