Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: TYBLE16_simple_data_logger TYBLE16_MP3_Air
OnboardNetworkStack::Interface Class Reference
Representation of a stack's view of an interface. More...
#include <OnboardNetworkStack.h>
Inherited by LWIP::Interface, and Nanostack::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)=0 |
| Connect the interface to the network. | |
| virtual nsapi_error_t | bringdown ()=0 |
| Disconnect interface from the network. | |
| virtual void | attach (mbed::Callback< void(nsapi_event_t, intptr_t)> status_cb)=0 |
| Register callback for status reporting. | |
| virtual nsapi_connection_status_t | get_connection_status () const =0 |
| Get the connection status. | |
| virtual char * | get_interface_name (char *buf) |
| Returns interface name. | |
| virtual char * | get_mac_address (char *buf, nsapi_size_t buflen)=0 |
| Return MAC address of the network interface. | |
| virtual nsapi_error_t | get_ip_address (SocketAddress *address)=0 |
| virtual nsapi_error_t | get_ipv6_link_local_address (SocketAddress *address) |
| virtual nsapi_error_t | get_netmask (SocketAddress *address)=0 |
| virtual nsapi_error_t | get_gateway (SocketAddress *address)=0 |
Detailed Description
Representation of a stack's view of an interface.
Provides facilities required by a driver to implement the application NetworkInterface API.
Definition at line 49 of file OnboardNetworkStack.h.
Member Function Documentation
| virtual void attach | ( | mbed::Callback< void(nsapi_event_t, intptr_t)> | status_cb ) | [pure 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_cb The callback for status changes
| virtual nsapi_error_t bringdown | ( | ) | [pure virtual] |
Disconnect interface from the network.
After this call the network interface is inactive, to use it again user needs to call
bringup again.
- Returns:
- NSAPI_ERROR_OK on success, or error code
| 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 |
||
| ) | [pure 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:
-
dhcp true if the network details should be acquired using DHCP ip IP address to be used for the interface as "W:X:Y:Z" or NULL netmask Net mask to be used for the interface as "W:X:Y:Z" or NULL gw Gateway address to be used for the interface as "W:X:Y:Z" or NULL stack Allow manual selection of IPv4 and/or IPv6. blocking Specify whether bringup blocks for connection completion.
- Returns:
- NSAPI_ERROR_OK on success, or error code
| virtual nsapi_connection_status_t get_connection_status | ( | ) | const [pure virtual] |
Get the connection status.
- Returns:
- The connection status according to ConnectionStatusType
| virtual nsapi_error_t get_gateway | ( | SocketAddress * | address ) | [pure virtual] |
| virtual char* get_interface_name | ( | char * | buf ) | [virtual] |
Returns interface name.
- Returns:
- string containing name of network interface for example "en0"
Definition at line 101 of file OnboardNetworkStack.h.
| virtual nsapi_error_t get_ip_address | ( | SocketAddress * | address ) | [pure virtual] |
Get the local IP address.
- Parameters:
-
address SocketAddress representation of the local IP address
- Return values:
-
NSAPI_ERROR_OK on success NSAPI_ERROR_UNSUPPORTED if this feature is not supported NSAPI_ERROR_PARAMETER if the provided pointer is invalid NSAPI_ERROR_NO_ADDRESS if the address cannot be obtained from stack
| virtual nsapi_error_t get_ipv6_link_local_address | ( | SocketAddress * | address ) | [virtual] |
Get the IPv6 link local address.
- Parameters:
-
address SocketAddress representation of the link local IPv6 address
- Return values:
-
NSAPI_ERROR_OK on success NSAPI_ERROR_UNSUPPORTED if this feature is not supported NSAPI_ERROR_PARAMETER if the provided pointer is invalid
Definition at line 119 of file OnboardNetworkStack.h.
| virtual char* get_mac_address | ( | char * | buf, |
| nsapi_size_t | buflen | ||
| ) | [pure virtual] |
Return MAC address of the network interface.
- Returns:
- MAC address as "V:W:X:Y:Z"
| virtual nsapi_error_t get_netmask | ( | SocketAddress * | address ) | [pure virtual] |
Generated on Tue Jul 12 2022 13:55:34 by
1.7.2