23 #ifndef NETWORK_INTERFACE_H 24 #define NETWORK_INTERFACE_H 26 #include "netsocket/nsapi_types.h" 244 const char *interface_name = NULL);
345 MBED_DEPRECATED_SINCE(
"mbed-os-5.12",
"CellularBase migrated to CellularInterface - use cellularInterface()")
359 #if !defined(DOXYGEN_ONLY) 367 template <
typename IF>
Socket implementation that uses IP network stack.
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.
NetworkStack * nsapi_create_stack(nsapi_stack_t *stack)
Convert a raw nsapi_stack_t object into a C++ NetworkStack object.
virtual EMACInterface * emacInterface()
Return pointer to an EMACInterface.
virtual char * get_interface_name(char *interface_name)
Get the network interface name.
virtual const char * get_gateway()
Get the local gateway.
virtual nsapi_error_t disconnect()=0
Disconnect from the network.
UDP socket implementation.
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 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.
virtual nsapi_error_t set_network(const char *ip_address, const char *netmask, const char *gateway)
Configure this network interface to use a static IP address.
virtual const char * get_ip_address()
Get the local IP address.
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 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.
void remove_event_listener(mbed::Callback< void(nsapi_event_t, intptr_t)> status_cb)
Remove event listener from 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 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_blocking(bool blocking)
Set asynchronous operation of connect() and disconnect() calls.
virtual CellularInterface * cellularInterface()
Return pointer to a CellularInterface.
virtual const char * get_netmask()
Get the local network mask.
mbed::Callback< void(nsapi_error_t result, SocketAddress *address)> hostbyname_cb_t
Hostname translation callback (for use with gethostbyname_async()).
Callback class based on template specialization.
Common interface between Ethernet hardware.
virtual CellularInterface * cellularBase()
Return pointer to a CellularInterface.
static NetworkInterface * get_default_instance()
Return the default network interface.
virtual EthInterface * ethInterface()
Return pointer to an EthInterface.