Functions of the PPP interface. More...
Functions | |
netStatus | netPPP_Listen (const char *username, const char *password) |
Start PPP interface to accept incoming PPP connection. [thread-safe]. | |
netStatus | netPPP_Connect (const char *dial_num, const char *username, const char *password) |
Start a dial-up connection to remote PPP server. [thread-safe]. | |
netStatus | netPPP_Close (void) |
Disconnect PPP link between two modems. [thread-safe]. | |
bool | netPPP_LinkUp (void) |
Determine the state of PPP link. [thread-safe]. | |
Functions of the PPP interface.
To start a dial-up connection to a remote PPP server, use netPPP_Connect (client mode). If you want to wait for an incoming connection, use netPPP_Listen instead (server mode). To check the link status, use netPPP_LinkUp. This can be done in client and server mode and can be used to continuously monitor the PPP link. To disconnect the PPP link, use netPPP_Close (for client and server mode). Usually, this is done by the client. Note that the netPPP_Close function does not change the running mode of the PPP daemon. If the PPP daemon was in server mode, PPP daemon re-initializes the modem driver to accept further incoming calls.
netStatus netPPP_Close | ( | void | ) |
Disconnect PPP link between two modems. [thread-safe].
The function netPPP_Close disconnects the PPP link between two modems.
Possible netStatus return values:
Code Example
netStatus netPPP_Connect | ( | const char * | dial_num, |
const char * | username, | ||
const char * | password | ||
) |
Start a dial-up connection to remote PPP server. [thread-safe].
[in] | dial_num | phone number of remote PPP server. |
[in] | username | username for authentication. |
[in] | password | password for authentication. |
The function netPPP_Connect starts a dial-up connection to the remote PPP server by starting the PPP daemon in client mode.
The argument dial_num points to a null-terminated string containing the phone number of the remote PPP server.
The argument username points to the user name.
The argument password points to the password.
The Network Core authenticates the user credentials using the Password Authentication Protocol (PAP) or Challenge-Handshake Authentication Protocol (CHAP). Both arguments are null-terminated strings.
Possible netStatus return values:
Code Example
bool netPPP_LinkUp | ( | void | ) |
Determine the state of PPP link. [thread-safe].
The function netPPP_LinkUp determines the state of PPP link between the two modems. It returns true if the PPP link state is network and IP frames can be exchanged.
Code Example
netStatus netPPP_Listen | ( | const char * | username, |
const char * | password | ||
) |
Start PPP interface to accept incoming PPP connection. [thread-safe].
[in] | username | remote username for authentication. |
[in] | password | remote password for authentication. |
The function netPPP_Listen configures the PPP interface to accept incoming PPP connections by starting the PPP daemon in server mode.
The argument username points to the user name.
The argument password points to the password.
The Network Core authenticates the user credentials using the Password Authentication Protocol (PAP). Both arguments are null-terminated strings.
Possible netStatus return values:
Code Example