This interface should be used to abstract low level access to networking hardware All operations receive a void *
hardware pointer which an ppp device provides when it is registered with a stack.
More...
#include <ppp_service.h>
Public Types | |
typedef mbed::Callback< void(net_stack_mem_buf_t *buf)> | ppp_link_input_cb_t |
Callback to be registered with PPP interface and to be called for received packets. More... | |
typedef mbed::Callback< void(bool up)> | ppp_link_state_change_cb_t |
Callback to be registered with PPP interface and to be called for link status changes. More... | |
Public Member Functions | |
virtual uint32_t | get_mtu_size () |
Return maximum transmission unit. More... | |
virtual uint32_t | get_align_preference () const |
Gets memory buffer alignment preference. More... | |
virtual void | get_ifname (char *name, uint8_t size) const |
Return interface name. More... | |
virtual bool | link_out (net_stack_mem_buf_t *buf, nsapi_ip_stack_t ip_stack) |
Sends the packet over the link. More... | |
virtual bool | power_up () |
Initializes the hardware. More... | |
virtual void | power_down () |
Deinitializes the hardware. More... | |
virtual void | set_link_input_cb (ppp_link_input_cb_t input_cb) |
Sets a callback that needs to be called for packets received for that interface. More... | |
virtual void | set_link_state_cb (ppp_link_state_change_cb_t state_cb) |
Sets a callback that needs to be called on link status changes for given interface. More... | |
virtual void | set_memory_manager (NetStackMemoryManager &mem_mngr) |
Sets memory manager that is used to handle memory buffers. More... | |
virtual void | set_stream (mbed::FileHandle *stream) |
Sets file stream used to communicate with modem. More... | |
virtual void | set_ip_stack (nsapi_ip_stack_t ip_stack) |
Sets IP protocol versions of IP stack. More... | |
virtual void | set_credentials (const char *uname, const char *password) |
Sets user name and password for PPP protocol. More... | |
virtual const nsapi_addr_t * | get_ip_address (nsapi_version_t version) |
Gets local IP address. More... | |
virtual const nsapi_addr_t * | get_netmask () |
Get the local network mask. More... | |
virtual const nsapi_addr_t * | get_gateway () |
Get the local gateway. More... | |
virtual const nsapi_addr_t * | get_dns_server (uint8_t index) |
Gets DNS server address. More... | |
virtual void | link_state (bool up) |
Link state indication from PPP. More... | |
virtual void | link_input (net_stack_mem_buf_t *buf) |
Received IP packet from PPP to stack. More... | |
virtual events::EventQueue * | event_queue_get () |
Handle to PPP event queue. More... | |
virtual void | resource_lock () |
Lock PPP resource. More... | |
virtual void | resource_unlock () |
Unlock PPP resource. More... | |
Static Public Member Functions | |
static PPP & | get_default_instance () |
Return the default on-board PPP. More... | |
This interface should be used to abstract low level access to networking hardware All operations receive a void *
hardware pointer which an ppp device provides when it is registered with a stack.
Definition at line 34 of file ppp_service.h.
typedef mbed::Callback<void (net_stack_mem_buf_t *buf)> ppp_link_input_cb_t |
Callback to be registered with PPP interface and to be called for received packets.
buf | Received data |
Definition at line 46 of file ppp_service.h.
typedef mbed::Callback<void (bool up)> ppp_link_state_change_cb_t |
Callback to be registered with PPP interface and to be called for link status changes.
up | Link status |
Definition at line 54 of file ppp_service.h.
|
virtual |
Handle to PPP event queue.
|
virtual |
Gets memory buffer alignment preference.
Gets preferred memory buffer alignment of the ppp device.
Implements PPP.
|
staticinherited |
|
virtual |
|
virtual |
Get the local gateway.
Implements PPP.
|
virtual |
Return interface name.
name | Pointer to where the name should be written |
size | Maximum number of characters to copy |
Implements PPP.
|
virtual |
|
virtual |
|
virtual |
Get the local network mask.
Implements PPP.
|
virtual |
Received IP packet from PPP to stack.
buf | Received packet |
|
virtual |
Sends the packet over the link.
That cannot be called from an interrupt context.
buf | Packet to be send |
Implements PPP.
|
virtual |
Link state indication from PPP.
up | Link status |
|
virtual |
Deinitializes the hardware.
Implements PPP.
|
virtual |
|
virtual |
Lock PPP resource.
|
virtual |
Unlock PPP resource.
|
virtual |
|
virtual |
|
virtual |
Sets a callback that needs to be called for packets received for that interface.
input_cb | Function to be register as a callback |
Implements PPP.
|
virtual |
Sets a callback that needs to be called on link status changes for given interface.
state_cb | Function to be register as a callback |
Implements PPP.
|
virtual |
Sets memory manager that is used to handle memory buffers.
mem_mngr | Pointer to memory manager |
Implements PPP.
|
virtual |
Sets file stream used to communicate with modem.
stream | Pointer to file handle |
Implements PPP.