24 #ifndef NETWORK_INTERFACE_H 25 #define NETWORK_INTERFACE_H 27 #include "netsocket/nsapi_types.h" 285 const char *interface_name = NULL);
368 #if MBED_CONF_PLATFORM_CALLBACK_COMPARABLE 375 void remove_event_listener(
mbed::Callback<
void(nsapi_event_t, intptr_t)> status_cb);
436 #if !defined(DOXYGEN_ONLY) 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...
Common interface between Wi-Fi devices.
virtual void attach(mbed::Callback< void(nsapi_event_t, intptr_t)> status_cb)
Register callback for status reporting.
virtual MeshInterface * meshInterface()
Return pointer to a MeshInterface.
Base class for DNS provider.
virtual EMACInterface * emacInterface()
Return pointer to an EMACInterface.
PPPInterface class Implementation of the NetworkInterface for an PPP-service.
virtual char * get_interface_name(char *interface_name)
Get the network interface name.
virtual nsapi_error_t disconnect()=0
Disconnect from the network.
virtual nsapi_error_t gethostbyname_async_cancel(int id)
Cancel asynchronous hostname translation.
EMACInterface class Implementation of the NetworkInterface for an EMAC-based driver.
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 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 void set_as_default()
Set network interface as default one.
signed int nsapi_error_t
Type used to represent error codes.
virtual void set_default_parameters()
defined(DOXYGEN_ONLY)
Common interface that is shared between mesh hardware.
virtual const char * get_mac_address()
Get the local MAC address.
mbed::Callback< void(nsapi_value_or_error_t result, SocketAddress *address)> hostbyname_cb_t
Hostname translation callback (for use with gethostbyname_async()).
signed int nsapi_value_or_error_t
Type used to represent either a value or error.
virtual nsapi_connection_status_t get_connection_status() const
Get the connection status.
virtual WiFiInterface * wifiInterface()
Return pointer to a WiFiInterface.
Common interface that is shared between network devices.
virtual nsapi_error_t set_dhcp(bool dhcp)
Enable or disable DHCP on connecting the network.
void add_event_listener(mbed::Callback< void(nsapi_event_t, intptr_t)> status_cb)
Add event listener for interface.
virtual nsapi_error_t get_gateway(SocketAddress *address)
Get the local gateway.
virtual nsapi_error_t connect()=0
Connect to a network.
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 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 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.
Common interface that is shared between cellular interfaces.
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 set_blocking(bool blocking)
Set asynchronous operation of connect() and disconnect() calls.
virtual nsapi_error_t get_netmask(SocketAddress *address)
Get the local network mask.
virtual CellularInterface * cellularInterface()
Return pointer to a CellularInterface.
Callback class based on template specialization.
Common interface between Ethernet hardware.
virtual nsapi_error_t get_ipv6_link_local_address(SocketAddress *address)
Get the IPv6 link local address.
static NetworkInterface * get_default_instance()
Return the default network interface.
virtual EthInterface * ethInterface()
Return pointer to an EthInterface.
virtual nsapi_error_t get_ip_address(SocketAddress *address)
Get the local IP address.