Delta / NNN50_WIFI_API

Dependents:   NNN50_CE_Test_UDP NNN50_linux_firmware NNN50_SoftAP_HelloWorld NNN50_BLEWIFISensor ... more

Embed: (wiki syntax)

« Back to documentation index

EthernetInterface Class Reference

EthernetInterface Class Reference

Interface using Ethernet to connect to an IP-based network. More...

#include <EthernetInterface.h>

Static Public Member Functions

static int init ()
 Initialize the interface with DHCP.
static int init (const char *ip, const char *mask, const char *gateway)
 Initialize the interface with a static IP address.
static int connect (unsigned int timeout_ms=5000)
 Connect Bring the interface up, start DHCP if needed.
static int disconnect ()
 Disconnect Bring the interface down.
static char * getMACAddress ()
 Get the MAC address of your Ethernet interface.
static char * getIPAddress ()
 Get the IP address of your Ethernet interface.
static char * getGateway ()
 Get the Gateway address of your Ethernet interface.
static char * getNetworkMask ()
 Get the Network mask of your Ethernet interface.

Detailed Description

Interface using Ethernet to connect to an IP-based network.

Definition at line 35 of file EthernetInterface.h.


Member Function Documentation

static int connect ( unsigned int  timeout_ms = 5000 ) [static]

Connect Bring the interface up, start DHCP if needed.

Parameters:
timeout_mstimeout in ms (default: 5s).
Returns:
0 on success, a negative number on failure
static int disconnect (  ) [static]

Disconnect Bring the interface down.

Returns:
0 on success, a negative number on failure
static char* getGateway (  ) [static]

Get the Gateway address of your Ethernet interface.

Returns:
a pointer to a string containing the Gateway address
static char* getIPAddress (  ) [static]

Get the IP address of your Ethernet interface.

Returns:
a pointer to a string containing the IP address
static char* getMACAddress (  ) [static]

Get the MAC address of your Ethernet interface.

Returns:
a pointer to a string containing the MAC address
static char* getNetworkMask (  ) [static]

Get the Network mask of your Ethernet interface.

Returns:
a pointer to a string containing the Network mask
static int init (  ) [static]

Initialize the interface with DHCP.

Initialize the interface and configure it to use DHCP (no connection at this point).

Returns:
0 on success, a negative number on failure
static int init ( const char *  ip,
const char *  mask,
const char *  gateway 
) [static]

Initialize the interface with a static IP address.

Initialize the interface and configure it with the following static configuration (no connection at this point).

Parameters:
ipthe IP address to use
maskthe IP address mask
gatewaythe gateway to use
Returns:
0 on success, a negative number on failure