|
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) override |
| Connect the interface to the network. More...
|
|
nsapi_error_t | bringdown () override |
| Disconnect interface from the network. More...
|
|
char * | get_mac_address (char *buf, nsapi_size_t buflen) override |
| Return MAC address of the network interface. More...
|
|
char * | get_interface_name (char *buf) override |
| Returns interface name. More...
|
|
nsapi_error_t | get_ip_address (SocketAddress *address) final |
| Get the local IP address. More...
|
|
nsapi_error_t | get_netmask (SocketAddress *address) final |
| Writes the netmask of the network interface into a user-supplied SocketAddress. More...
|
|
nsapi_error_t | get_gateway (SocketAddress *address) override |
| Writes the gateway address of the network interface into a user-supplied SocketAddress. More...
|
|
void | attach (mbed::Callback< void(nsapi_event_t, intptr_t)> status_cb) final |
| Register callback for status reporting. More...
|
|
nsapi_connection_status_t | get_connection_status () const final |
| Get the connection status. More...
|
|
void | network_handler (mesh_connection_status_t status) |
| Callback from C-layer. More...
|
|
virtual nsapi_error_t | set_ip_address (const char *ip, const char *netmask, const char *gw, uint8_t ipv6_flag) |
| Set IP address. More...
|
|
virtual nsapi_error_t | get_ipv6_link_local_address (SocketAddress *address) |
| Get the IPv6 link local address. More...
|
|
◆ bringup()
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 |
|
) |
| |
|
overridevirtual |
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
Implements OnboardNetworkStack::Interface.
◆ bringdown()
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
Implements OnboardNetworkStack::Interface.
◆ get_mac_address()
Return MAC address of the network interface.
- Returns
- MAC address as "V:W:X:Y:Z"
Reimplemented from Nanostack::Interface.
◆ get_interface_name()
char * get_interface_name |
( |
char * |
buf | ) |
|
|
overridevirtual |
◆ get_ip_address()
Get the local IP address.
- Parameters
-
- 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 |
Implements OnboardNetworkStack::Interface.
◆ get_netmask()
◆ get_gateway()
◆ attach()
void attach |
( |
mbed::Callback< void(nsapi_event_t, intptr_t)> |
status_cb | ) |
|
|
finalvirtualinherited |
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 |
Implements OnboardNetworkStack::Interface.
◆ get_connection_status()
nsapi_connection_status_t get_connection_status |
( |
| ) |
const |
|
finalvirtualinherited |
◆ network_handler()
void network_handler |
( |
mesh_connection_status_t |
status | ) |
|
|
inherited |
Callback from C-layer.
- Parameters
-
status | state of the network |
◆ set_ip_address()
virtual nsapi_error_t set_ip_address |
( |
const char * |
ip, |
|
|
const char * |
netmask, |
|
|
const char * |
gw, |
|
|
uint8_t |
ipv6_flag |
|
) |
| |
|
virtualinherited |
Set IP address.
bringup() can only take one IP address and in dual stack case another IP address can be set using this function.
Must be called before bringup().
- Parameters
-
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 |
ipv6_flag | Provide this flag for IPv6 state flag override. For example, you can set IP6_ADDR_PREFERRED. For IPv4, this value will be ignored. |
- Returns
- NSAPI_ERROR_OK on success, or error code
Definition at line 69 of file OnboardNetworkStack.h.
◆ get_ipv6_link_local_address()
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 140 of file OnboardNetworkStack.h.