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