24#ifndef NETWORK_INTERFACE_H
25#define NETWORK_INTERFACE_H
27#include "netsocket/nsapi_types.h"
329 const char *interface_name = NULL);
400#if MBED_CONF_NSAPI_ADD_EVENT_LISTENER_RETURN_CHANGE
428 MBED_DEPRECATED_SINCE(
"mbed-os-6.12",
"This function return value will change to nsapi_error_t in the next major release. See documentation for details.")
432#if MBED_CONF_PLATFORM_CALLBACK_COMPARABLE
439 void remove_event_listener(
mbed::Callback<
void(nsapi_event_t, intptr_t)> status_cb);
500#if !defined(DOXYGEN_ONLY)
Common interface that is shared between cellular interfaces.
Base class for DNS provider.
EMACInterface class Implementation of the NetworkInterface for an EMAC-based driver.
Common interface between Ethernet hardware.
Common interface that is shared between mesh hardware.
Common interface that is shared between network devices.
static NetworkInterface * get_default_instance()
Return the default network interface.
virtual WiFiInterface * wifiInterface()
Return pointer to a WiFiInterface.
virtual nsapi_error_t get_dns_server(int index, SocketAddress *address, const char *interface_name=NULL)
Get a domain name server from a list of servers to query.
virtual void set_default_parameters()
defined(DOXYGEN_ONLY)
virtual char * get_interface_name(char *interface_name)
Get the network interface name.
virtual nsapi_error_t gethostbyname_async_cancel(int id)
Cancel asynchronous hostname translation.
virtual nsapi_error_t add_dns_server(const SocketAddress &address, const char *interface_name)
Add a domain name server to list of servers to query.
virtual nsapi_error_t set_hostname(const char *hostname)
Set hostname.
virtual void attach(mbed::Callback< void(nsapi_event_t, intptr_t)> status_cb)
Register callback for status reporting.
virtual nsapi_error_t set_dhcp(bool dhcp)
Enable or disable DHCP on connecting the network.
virtual nsapi_error_t get_ip_address(SocketAddress *address)
Get the local IP address.
virtual nsapi_error_t get_netmask(SocketAddress *address)
Get the local network mask.
virtual const char * get_hostname()
Get hostname.
virtual void set_as_default()
Set network interface as default one.
virtual nsapi_error_t set_mac_address(uint8_t *mac_addr, nsapi_size_t addr_len)
Set the MAC address to the interface.
virtual nsapi_error_t gethostbyname(const char *host, SocketAddress *address, nsapi_version_t version=NSAPI_UNSPEC, const char *interface_name=NULL)
Translate a hostname to an IP address with specific version using network interface name.
virtual MeshInterface * meshInterface()
Return pointer to a MeshInterface.
virtual nsapi_error_t get_ipv6_link_local_address(SocketAddress *address)
Get the IPv6 link local address.
virtual nsapi_connection_status_t get_connection_status() const
Get the connection status.
virtual nsapi_value_or_error_t getaddrinfo(const char *hostname, SocketAddress *hints, SocketAddress **res, const char *interface_name=NULL)
Translate a hostname to the multiple IP addresses with specific version using network interface name.
virtual nsapi_error_t set_blocking(bool blocking)
Set asynchronous operation of connect() and disconnect() calls.
virtual nsapi_value_or_error_t getaddrinfo_async(const char *hostname, SocketAddress *hints, hostbyname_cb_t callback, const char *interface_name=NULL)
Translate a hostname to the multiple IP addresses (asynchronous) using network interface name.
virtual const char * get_mac_address()
Get the local MAC address.
virtual nsapi_error_t connect()=0
Connect to a network.
virtual nsapi_value_or_error_t gethostbyname_async(const char *host, hostbyname_cb_t callback, nsapi_version_t version=NSAPI_UNSPEC, const char *interface_name=NULL)
Translate a hostname to an IP address (asynchronous) using network interface name.
void add_event_listener(mbed::Callback< void(nsapi_event_t, intptr_t)> status_cb)
Add event listener for interface.
mbed::Callback< void(nsapi_value_or_error_t result, SocketAddress *address)> hostbyname_cb_t
Hostname translation callback (for use with gethostbyname_async()).
virtual EthInterface * ethInterface()
Return pointer to an EthInterface.
virtual EMACInterface * emacInterface()
Return pointer to an EMACInterface.
virtual nsapi_error_t get_gateway(SocketAddress *address)
Get the local gateway.
virtual CellularInterface * cellularInterface()
Return pointer to a CellularInterface.
virtual nsapi_error_t set_network(const SocketAddress &ip_address, const SocketAddress &netmask, const SocketAddress &gateway)
Configure this network interface to use a static IP address.
virtual nsapi_error_t disconnect()=0
Disconnect from the network.
PPPInterface class Implementation of the NetworkInterface for an PPP-service.
Common interface between Wi-Fi devices.
Callback class based on template specialization.
signed int nsapi_value_or_error_t
Type used to represent either a value or error.
signed int nsapi_error_t
Type used to represent error codes.
unsigned int nsapi_size_t
Type used to represent the size of data passed through sockets.