public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] Re: cyg_ppp_wait_up sometimes never returns?
@ 2012-11-01 18:27 Ken Yee
  2012-11-09  9:32 ` [ECOS] ecos for STM32F4-discovery problem tangwei
  0 siblings, 1 reply; 4+ messages in thread
From: Ken Yee @ 2012-11-01 18:27 UTC (permalink / raw)
  To: ecos-discuss

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-12-25 11:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-01 18:27 [ECOS] Re: cyg_ppp_wait_up sometimes never returns? Ken Yee
2012-11-09  9:32 ` [ECOS] ecos for STM32F4-discovery problem tangwei
2012-12-24  8:45   ` tangwei
     [not found]     ` <BAY163-W3746611AD0F3EF36DA8F0FC03A0@phx.gbl>
2012-12-25 11:49       ` tangwei

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).