Mistake on this page?
Report an issue in GitHub or email us
Public Member Functions
EmacTestNetworkStack::Interface Class Reference
Inheritance diagram for EmacTestNetworkStack::Interface:
OnboardNetworkStack::Interface

Public Member Functions

virtual nsapi_error_t bringup (bool dhcp, const char *ip, const char *netmask, const char *gw, nsapi_ip_stack_t stack=DEFAULT_STACK, bool blocking=true)
 Connect the interface to the network. More...
 
virtual nsapi_error_t bringdown ()
 Disconnect interface from the network. More...
 
virtual void attach (mbed::Callback< void(nsapi_event_t, intptr_t)> status_cb)
 Register callback for status reporting. More...
 
virtual nsapi_connection_status_t get_connection_status () const
 Get the connection status. More...
 
virtual char * get_mac_address (char *buf, nsapi_size_t buflen)
 Return MAC address of the network interface. More...
 
virtual nsapi_error_t get_ip_address (SocketAddress *address)
 Copies IP address of the network interface to user supplied buffer. More...
 
virtual nsapi_error_t get_netmask (SocketAddress *address)
 Copies netmask of the network interface to user supplied buffer. More...
 
virtual nsapi_error_t get_gateway (SocketAddress *address)
 Copies gateway address of the network interface to user supplied buffer. More...
 
virtual char * get_interface_name (char *buf)
 Returns interface name. More...
 
virtual nsapi_error_t get_ipv6_link_local_address (SocketAddress *address)
 Get the IPv6 link local address. More...
 
virtual nsapi_error_t get_ip_address_if (SocketAddress *address, const char *interface_name)
 Get the local IP address on interface name. More...
 

Detailed Description

Definition at line 35 of file emac_TestNetworkStack.h.

Member Function Documentation

virtual void attach ( mbed::Callback< void(nsapi_event_t, intptr_t)>  status_cb)
virtual

Register callback for status reporting.

The specified status callback function will be called on status changes on the network. The parameters on the callback are the event type and event-type dependent reason parameter.

Parameters
status_cbThe callback for status changes

Implements OnboardNetworkStack::Interface.

virtual nsapi_error_t bringdown ( )
virtual

Disconnect interface from the network.

After this call the network interface is inactive, to use it again user needs to call mbed_ipstack_bringup again.

Returns
NSAPI_ERROR_OK on success, or error code

Implements OnboardNetworkStack::Interface.

virtual nsapi_error_t bringup ( bool  dhcp,
const char *  ip,
const char *  netmask,
const char *  gw,
nsapi_ip_stack_t  stack = DEFAULT_STACK,
bool  blocking = true 
)
virtual

Connect the interface to the network.

Sets up a connection on specified network interface, using DHCP or provided network details. If the dhcp is set to true all the remaining parameters are ignored.

Parameters
dhcptrue if the network details should be acquired using DHCP
ipIP address to be used for the interface as "W:X:Y:Z" or NULL
netmaskNet mask to be used for the interface as "W:X:Y:Z" or NULL
gwGateway address to be used for the interface as "W:X:Y:Z" or NULL
stackAllow manual selection of IPv4 and/or IPv6.
blockingSpecify whether bringup blocks for connection completion.
Returns
NSAPI_ERROR_OK on success, or error code

Implements OnboardNetworkStack::Interface.

virtual nsapi_connection_status_t get_connection_status ( ) const
virtual

Get the connection status.

Returns
The connection status according to ConnectionStatusType

Implements OnboardNetworkStack::Interface.

virtual nsapi_error_t get_gateway ( SocketAddress address)
virtual

Copies gateway address of the network interface to user supplied buffer.

Parameters
bufbuffer to which gateway address will be copied as "W:X:Y:Z"
buflensize of supplied buffer
Returns
Pointer to a buffer, or NULL if the buffer is too small

Implements OnboardNetworkStack::Interface.

virtual char* get_interface_name ( char *  buf)
virtualinherited

Returns interface name.

Returns
string containing name of network interface for example "en0"

Reimplemented in Nanostack::MeshInterface, Nanostack::PPPInterface, and Nanostack::EthernetInterface.

Definition at line 101 of file OnboardNetworkStack.h.

virtual nsapi_error_t get_ip_address ( SocketAddress address)
virtual

Copies IP address of the network interface to user supplied buffer.

Parameters
bufbuffer to which IP address will be copied as "W:X:Y:Z"
buflensize of supplied buffer
Returns
Pointer to a buffer, or NULL if the buffer is too small

Implements OnboardNetworkStack::Interface.

virtual nsapi_error_t get_ip_address_if ( SocketAddress address,
const char *  interface_name 
)
virtualinherited

Get the local IP address on interface name.

Parameters
addressSocketAddress representation of the link local IPv6 address
interface_nameNetwork interface_name
Return values
NSAPI_ERROR_OKon success
NSAPI_ERROR_UNSUPPORTEDif this feature is not supported
NSAPI_ERROR_PARAMETERif the provided pointer is invalid
NSAPI_ERROR_NO_ADDRESSif the address cannot be obtained from stack

Definition at line 125 of file OnboardNetworkStack.h.

virtual nsapi_error_t get_ipv6_link_local_address ( SocketAddress address)
virtualinherited

Get the IPv6 link local address.

Parameters
addressSocketAddress representation of the link local IPv6 address
Return values
NSAPI_ERROR_OKon success
NSAPI_ERROR_UNSUPPORTEDif this feature is not supported
NSAPI_ERROR_PARAMETERif the provided pointer is invalid

Definition at line 119 of file OnboardNetworkStack.h.

virtual char* get_mac_address ( char *  buf,
nsapi_size_t  buflen 
)
virtual

Return MAC address of the network interface.

Returns
MAC address as "V:W:X:Y:Z"

Implements OnboardNetworkStack::Interface.

virtual nsapi_error_t get_netmask ( SocketAddress address)
virtual

Copies netmask of the network interface to user supplied buffer.

Parameters
bufbuffer to which netmask will be copied as "W:X:Y:Z"
buflensize of supplied buffer
Returns
Pointer to a buffer, or NULL if the buffer is too small

Implements OnboardNetworkStack::Interface.

Important Information for this Arm website

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies. If you are not happy with the use of these cookies, please review our Cookie Policy to learn how they can be disabled. By disabling cookies, some features of the site will not work.