This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PPP disconnect script


Felix Nielsen <felix@dezign.dk> writes:

> Hi
> 
> I am trying to get a persistent connection up and running using a GRPS
> modem. After successful connection, at some point the connection is
> dropped from the ISP provider, and I need to re-connect automatically.
> 
> Have enabled (=1) :
> 
> "extern int    persist;    /* Reopen link after it goes down */"
> 
> But before I can launch the connection again, I need to fire "+++" to
> the modem, so the modem is ready again. I have been looking in the
> source, and found :
> 
> "extern char    *disconnector;    /* Script to disestablish physical
> link */"
> 
> But how do I initialize that script?
> 
> Any hints or examples would be appreciated.


I don't believe persistence has been extensively tested. Looking at
the code it should work, however I cannot guarantee that some part of
it was stripped out when porting to eCos.

All scripting support was also removed. eCos has no scripting
language. If all you want to do is send the modem some simple
commands, then use a chat script.

Alternatively, both of these things can be handled outside the current
stack. Just set up a thread to monitor the PPP connection and have it
run something like this:

void ppp_monitor( CYG_ADDRWORD arg )
{
        cyg_ppp_options_t options;
        cyg_ppp_handle_t ppp_handle;

        cyg_ppp_options_init( &options );

        /* Adjust the options here */

        while( ppp_persist )
        {
            /* Do any connection establishment processing here */

            ppp_handle = cyg_ppp_up( ppp_device, &options );

            cyg_ppp_wait_up( ppp_handle );

            cyg_ppp_wait_down( ppp_handle );

            /* Do any connection dis-establishment processing here */

        }
}

-- 
Nick Garnett                    eCos Kernel Architect
http://www.ecoscentric.com/     The eCos and RedBoot experts


-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]