PPP, CORE, ppp_close() and ppp_sighup() ended up sharing almost everything, merged

Merged ppp_sighup() to ppp_close() using an optional argument  "nocarrier"
on ppp_close().
This commit is contained in:
Sylvain Rochet
2015-02-22 14:25:36 +01:00
parent b040ace4c2
commit 4be7fccad3
5 changed files with 38 additions and 76 deletions

View File

@@ -256,7 +256,8 @@ ppp_set_default(ppp);
* Initiate PPP negotiation, without waiting (holdoff=0), can only be called
* if PPP session is in the dead state (i.e. disconnected).
*/
ppp_open(ppp, 0);
u16_t holdoff = 0;
ppp_open(ppp, holdoff);
/*
@@ -264,8 +265,13 @@ ppp_open(ppp, 0);
* ======================
*/
/* You can call this function anytime */
ppp_close(ppp);
/*
* Initiate the end of the PPP session, without carrier lost signal
* (nocarrier=0), meaning a clean shutdown of PPP protocols.
* You can call this function at anytime.
*/
u8_t nocarrier = 0;
ppp_close(ppp, nocarrier);
/*
* Then you must wait your status_cb() to be called, it may takes from a few
* seconds to several tens of seconds depending on the current PPP state.
@@ -354,3 +360,6 @@ from previous lwIP version is pretty easy:
* If you used tcpip_callback_with_block() on ppp_ functions you may wish to use
the PPPAPI API instead.
* ppp_sighup and ppp_close functions were merged using an optional argument
"nocarrier" on ppp_close.