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