18 #ifndef PPP_INTERFACE_H 19 #define PPP_INTERFACE_H 22 #include "OnboardNetworkStack.h" 138 bool _blocking =
true;
145 nsapi_ip_stack_t _ip_stack = DEFAULT_STACK;
146 const char *_uname =
nullptr;
147 const char *_password =
nullptr;
void set_credentials(const char *uname, const char *password)
Sets user name and password for PPP protocol.
PPPInterface class Implementation of the NetworkInterface for an PPP-service.
nsapi_error_t disconnect() override
Disconnect from the network.
Network Interface base class.
Representation of a stack's view of an interface.
PPP & getppp() const
Provide access to the PPP.
NetworkStack * get_stack() final
Provide access to the underlying stack.
signed int nsapi_error_t
Type used to represent error codes.
char * get_interface_name(char *interface_name) override
Get the network interface name.
mbed OS API for onboard IP stack abstraction
nsapi_error_t connect() override
Connect to a network.
void attach(mbed::Callback< void(nsapi_event_t, intptr_t)> status_cb) override
Register callback for status reporting.
void set_stream(mbed::FileHandle *stream)
Sets file stream used to communicate with modem.
nsapi_error_t set_blocking(bool blocking) override
Set asynchronous operation of connect() and disconnect() calls.
void set_ip_stack(nsapi_ip_stack_t ip_stack)
Sets IP protocol versions of IP stack.
#define NSAPI_IPv4_SIZE
Size of IPv4 representation.
Common interface that is shared between network devices.
nsapi_error_t get_gateway(SocketAddress *address) override
Get the local gateway.
static PPP & get_default_instance()
Return the default on-board PPP.
nsapi_error_t set_network(const SocketAddress &ip_address, const SocketAddress &netmask, const SocketAddress &gateway) override
Configure this network interface to use a static IP address.
nsapi_error_t get_ip_address(SocketAddress *address) override
Get the local IP address.
#define NSAPI_IPv6_SIZE
Size of IPv6 representation.
void set_as_default() override
Set network interface as default one.
PPPInterface(PPP &ppp=PPP::get_default_instance(), OnboardNetworkStack &stack=OnboardNetworkStack::get_default_instance())
Create an PPP-based network interface.
nsapi_error_t get_netmask(SocketAddress *address) override
Get the local network mask.
nsapi_connection_status_t get_connection_status() const override
Get the connection status.
static OnboardNetworkStack & get_default_instance()
Return the default on-board network stack.
Callback class based on template specialization.