This is the mail archive of the
ecos-discuss@sourceware.org
mailing list for the eCos project.
Re: cyg_ppp_wait_up sometimes never returns?
- From: "Ken Yee" <kenkyee at excite dot com>
- To: ecos-discuss at ecos dot sourceware dot org
- Cc:
- Date: Thu, 01 Nov 2012 14:01:56 -0400
- Subject: [ECOS] Re: cyg_ppp_wait_up sometimes never returns?
Sorry...this should also have included cyg_ppp_up(). That sometimes never returns as well..symptom is the same as with cyg_ppp_wait_up()....
The core ppp loop is fairly trivial, but it does bring the connection up/down a lot to minimize connection time costs:
cyg_ppp_handle_t pppHandle = cyg_ppp_up(PPP_PORT, &options);
if (pppHandle != 0) {
int pppStatus = cyg_ppp_wait_up(pppHandle);
if (pppStatus == 0) {
// wait for connection to come down
if (cyg_ppp_wait_up(pppHandle) == 0) {
while ((pppTimeout-- > 0) && (cyg_ppp_wait_up(pppHandle) == 0)) {
Thread::sleep(sec(1));
}
cyg_ppp_down(pppHandle);
}
}
}
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss