|
TinyPPP
PPP networking over any Arduino Stream
|
TCP client over PPP: used like WiFiClient or EthernetClient. More...
#include <PPPSockets.h>
Public Member Functions | |
| PPPClient ()=default | |
| Client on the default stack (the first TinyPPP instance) | |
| PPPClient (IPStack &stack) | |
| Client on the indicated stack. | |
| PPPClient (IPStack *stack, int sock) | |
| Client for an existing socket (used by PPPServer) | |
| int | available () override |
| Number of received bytes that can be read. | |
| int | connect (const char *host, uint16_t port) override |
| Resolves the host via DNS and connects: returns 1 on success. | |
| int | connect (IPAddress ip, uint16_t port) override |
| Connects to the address and port: returns 1 on success. | |
| uint8_t | connected () override |
| true while connected or while received data is available | |
| void | flush () override |
| Waits until all written data was acknowledged by the peer. | |
| uint16_t | localPort () |
| Our port. | |
| operator bool () override | |
| true if the client refers to an open socket | |
| bool | operator!= (const PPPClient &other) const |
| true if they refer to different connections | |
| bool | operator== (const PPPClient &other) const |
| true if both refer to the same connection | |
| int | peek () override |
| Next byte without removing it (-1 if none) | |
| int | read () override |
| Reads one byte (-1 if none available) | |
| int | read (uint8_t *buf, size_t size) override |
| Reads up to size bytes: returns the number read or -1. | |
| IPAddress | remoteIP () |
| Address of the peer. | |
| uint16_t | remotePort () |
| Port of the peer. | |
| void | setConnectionTimeout (uint32_t ms) |
| Timeout in ms for connect, write and flush. | |
| void | stop () override |
| Closes the connection. | |
| size_t | write (const uint8_t *buf, size_t size) override |
| Sends data (waits while the send buffer is full) | |
| size_t | write (uint8_t b) override |
| Sends one byte. | |
Protected Member Functions | |
| IPStack * | stack () const |
| bool | valid () const |
Protected Attributes | |
| uint8_t | _gen = 0 |
| int | _sock = -1 |
| IPStack * | _stack = nullptr |
| uint32_t | _timeout = 5000 |
TCP client over PPP: used like WiFiClient or EthernetClient.
Copies refer to the same connection; it is closed by stop() only.
|
default |
Client on the default stack (the first TinyPPP instance)
|
inlineoverride |
Number of received bytes that can be read.
Resolves the host via DNS and connects: returns 1 on success.
Connects to the address and port: returns 1 on success.
|
inlineoverride |
true while connected or while received data is available
|
inlineoverride |
Waits until all written data was acknowledged by the peer.
|
inline |
Our port.
|
inlineoverride |
Next byte without removing it (-1 if none)
|
inlineoverride |
Reads one byte (-1 if none available)
Reads up to size bytes: returns the number read or -1.
|
inline |
Address of the peer.
|
inline |
Port of the peer.
|
inlineprotected |
|
inlineoverride |
Closes the connection.
|
inlineprotected |
Sends data (waits while the send buffer is full)
|
protected |
|
protected |
|
protected |