Kenji Arai / mbed-os_TYBLE16

Dependents:   TYBLE16_simple_data_logger TYBLE16_MP3_Air

Embed: (wiki syntax)

« Back to documentation index

L3IP Class Reference

This interface should be used to abstract low level access to networking hardware All operations receive a `void *` hardware pointer which an l3ip device provides when it is registered with a stack. More...

#include <L3IP.h>

Public Types

typedef mbed::Callback< void(net_stack_mem_buf_t
*buf) 
l3ip_link_input_cb_t )
 Callback to be registered with L3IP interface and to be called for received packets.
typedef mbed::Callback< void(bool
up)> 
l3ip_link_state_change_cb_t
 Callback to be registered with L3IP interface and to be called for link status changes.

Public Member Functions

virtual uint32_t get_mtu_size () const =0
 Return maximum transmission unit.
virtual uint32_t get_align_preference () const =0
 Gets memory buffer alignment preference.
virtual void get_ifname (char *name, uint8_t size) const =0
 Return interface name.
virtual bool link_out (net_stack_mem_buf_t *buf)=0
 Sends the packet over the link.
virtual bool power_up ()=0
 Initializes the hardware.
virtual void power_down ()=0
 Deinitializes the hardware.
virtual void set_link_input_cb (l3ip_link_input_cb_t input_cb)=0
 Sets a callback that needs to be called for packets received for that interface.
virtual void set_link_state_cb (l3ip_link_state_change_cb_t state_cb)=0
 Sets a callback that needs to be called on link status changes for given interface.
virtual void add_ipv4_multicast_group (const SocketAddress &address)=0
 Add device to an IP4 multicast group.
virtual void add_ipv6_multicast_group (const SocketAddress &address)=0
 Add device to an IP6 multicast group.
virtual void remove_ipv4_multicast_group (const SocketAddress &address)=0
 Remove device from an IPV4 multicast group.
virtual void remove_ipv6_multicast_group (const SocketAddress &address)=0
 Remove device from an IPV6 multicast group.
virtual void set_all_multicast (bool all)=0
 Request reception of all multicast packets.
virtual void set_memory_manager (NetStackMemoryManager &mem_mngr)=0
 Sets memory manager that is used to handle memory buffers.

Static Public Member Functions

static L3IPget_default_instance ()
 Return the default on-board L3IP.

Detailed Description

This interface should be used to abstract low level access to networking hardware All operations receive a `void *` hardware pointer which an l3ip device provides when it is registered with a stack.

Definition at line 31 of file L3IP.h.


Member Typedef Documentation

typedef mbed::Callback<void (net_stack_mem_buf_t *buf) l3ip_link_input_cb_t)

Callback to be registered with L3IP interface and to be called for received packets.

Parameters:
bufReceived data

Definition at line 47 of file L3IP.h.

typedef mbed::Callback<void (bool up)> l3ip_link_state_change_cb_t

Callback to be registered with L3IP interface and to be called for link status changes.

Parameters:
upLink status

Definition at line 55 of file L3IP.h.


Member Function Documentation

virtual void add_ipv4_multicast_group ( const SocketAddress address ) [pure virtual]

Add device to an IP4 multicast group.

Parameters:
addressAn IP4 multicast group address
virtual void add_ipv6_multicast_group ( const SocketAddress address ) [pure virtual]

Add device to an IP6 multicast group.

Parameters:
addressAn IP6 multicast group address
virtual uint32_t get_align_preference (  ) const [pure virtual]

Gets memory buffer alignment preference.

Gets preferred memory buffer alignment of the l3ip device.

Returns:
Memory alignment requirement in bytes
static L3IP& get_default_instance (  ) [static]

Return the default on-board L3IP.

Returns the default on-board L3IP - this will be target-specific, and may not be available on all targets.

virtual void get_ifname ( char *  name,
uint8_t  size 
) const [pure virtual]

Return interface name.

Parameters:
namePointer to where the name should be written
sizeMaximum number of characters to copy
virtual uint32_t get_mtu_size (  ) const [pure virtual]

Return maximum transmission unit.

Returns:
MTU in bytes
virtual bool link_out ( net_stack_mem_buf_t *  buf ) [pure virtual]

Sends the packet over the link.

That cannot be called from an interrupt context.

Parameters:
bufPacket to be send
Returns:
True if the packet was send successfully, false otherwise
virtual void power_down (  ) [pure virtual]

Deinitializes the hardware.

virtual bool power_up (  ) [pure virtual]

Initializes the hardware.

Returns:
True on success, False in case of an error.
virtual void remove_ipv4_multicast_group ( const SocketAddress address ) [pure virtual]

Remove device from an IPV4 multicast group.

Parameters:
addressAn IPV4 multicast group address
virtual void remove_ipv6_multicast_group ( const SocketAddress address ) [pure virtual]

Remove device from an IPV6 multicast group.

Parameters:
addressAn IPV6 multicast group address
virtual void set_all_multicast ( bool  all ) [pure virtual]

Request reception of all multicast packets.

Parameters:
allTrue to receive all multicasts False to receive only multicasts addressed to specified groups
virtual void set_link_input_cb ( l3ip_link_input_cb_t  input_cb ) [pure virtual]

Sets a callback that needs to be called for packets received for that interface.

Parameters:
input_cbFunction to be register as a callback
virtual void set_link_state_cb ( l3ip_link_state_change_cb_t  state_cb ) [pure virtual]

Sets a callback that needs to be called on link status changes for given interface.

Parameters:
state_cbFunction to be register as a callback
virtual void set_memory_manager ( NetStackMemoryManager &  mem_mngr ) [pure virtual]

Sets memory manager that is used to handle memory buffers.

Parameters:
mem_mngrPointer to memory manager