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 */
}
}