18#ifndef EMAC_INTERFACE_H
19#define EMAC_INTERFACE_H
23#include "OnboardNetworkStack.h"
157 bool _blocking = true;
158 bool _hostname_set = false;
160 bool _hw_mac_addr_set = false;
166 mbed::Callback<void(nsapi_event_t, intptr_t)> _connection_status_cb;
This interface should be used to abstract low level access to networking hardware All operations rece...
static EMAC & get_default_instance()
Return the default on-board EMAC.
EMACInterface class Implementation of the NetworkInterface for an EMAC-based driver.
EMACInterface(EMAC &emac=EMAC::get_default_instance(), OnboardNetworkStack &stack=OnboardNetworkStack::get_default_instance())
Create an EMAC-based network interface.
nsapi_error_t disconnect() override
Disconnect from the network.
char * get_interface_name(char *interface_name) override
Get the network interface name.
nsapi_error_t set_mac_address(uint8_t *mac_addr, nsapi_size_t addr_len) override
Set the MAC address to the interface.
EMACInterface * emacInterface() final
Return pointer to an EMACInterface.
const char * get_mac_address() override
Get the local MAC address.
nsapi_error_t get_ipv6_link_local_address(SocketAddress *address) override
Get the IPv6 link local address.
NetworkStack * get_stack() final
Provide access to the underlying stack.
nsapi_connection_status_t get_connection_status() const override
Get the connection status.
nsapi_error_t connect() override
Connect to a network.
void set_as_default() override
Set network interface as default one.
EMAC & get_emac() const
Provide access to the EMAC.
nsapi_error_t get_gateway(SocketAddress *address) override
Get the local gateway.
const char * get_hostname() override
Get hostname.
nsapi_error_t get_ip_address(SocketAddress *address) override
Get the local IP address.
nsapi_error_t set_dhcp(bool dhcp) override
Enable or disable DHCP on the network.
void attach(mbed::Callback< void(nsapi_event_t, intptr_t)> status_cb) override
Register callback for status reporting.
nsapi_error_t set_network(const SocketAddress &ip_address, const SocketAddress &netmask, const SocketAddress &gateway) override
Set a static IP address.
nsapi_error_t set_blocking(bool blocking) override
Set asynchronous operation of connect() and disconnect() calls.
nsapi_error_t set_hostname(const char *hostname) override
Set hostname.
nsapi_error_t get_netmask(SocketAddress *address) override
Get the local network mask.
Common interface that is shared between network devices.
mbed OS API for onboard IP stack abstraction
static OnboardNetworkStack & get_default_instance()
Return the default on-board network stack.
Callback class based on template specialization.
#define NSAPI_MAC_BYTES
Maximum number of bytes for MAC address.
signed int nsapi_error_t
Type used to represent error codes.
#define NSAPI_MAC_SIZE
Maximum size of MAC address representation.
#define NSAPI_IPv4_SIZE
Size of IPv4 representation.
#define NSAPI_IPv6_SIZE
Size of IPv6 representation.
#define NSAPI_HOSTNAME_SIZE
Maximum size of hostname.
unsigned int nsapi_size_t
Type used to represent the size of data passed through sockets.