Hostname Attempt
Dependencies: Socket lwip-eth lwip-sys lwip
Fork of EthernetInterface by
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=15000) |
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. | |
static int | setName (const char *myname) |
setName |
Detailed Description
Interface using Ethernet to connect to an IP-based network.
Definition at line 35 of file EthernetInterface.h.
Member Function Documentation
int connect | ( | unsigned int | timeout_ms = 15000 ) |
[static] |
Connect Bring the interface up, start DHCP if needed.
- Parameters:
-
timeout_ms timeout in ms (default: (15)s).
- Returns:
- 0 on success, a negative number on failure
Definition at line 127 of file EthernetInterface.cpp.
int disconnect | ( | ) | [static] |
Disconnect Bring the interface down.
- Returns:
- 0 on success, a negative number on failure
Definition at line 147 of file EthernetInterface.cpp.
char * getGateway | ( | ) | [static] |
Get the Gateway address of your Ethernet interface.
- Returns:
- a pointer to a string containing the Gateway address
Definition at line 168 of file EthernetInterface.cpp.
char * getIPAddress | ( | ) | [static] |
Get the IP address of your Ethernet interface.
- Returns:
- a pointer to a string containing the IP address
Definition at line 164 of file EthernetInterface.cpp.
char * getMACAddress | ( | ) | [static] |
Get the MAC address of your Ethernet interface.
- Returns:
- a pointer to a string containing the MAC address
Definition at line 160 of file EthernetInterface.cpp.
char * getNetworkMask | ( | ) | [static] |
Get the Network mask of your Ethernet interface.
- Returns:
- a pointer to a string containing the Network mask
Definition at line 172 of file EthernetInterface.cpp.
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:
-
ip the IP address to use mask the IP address mask gateway the gateway to use
- Returns:
- 0 on success, a negative number on failure
Definition at line 102 of file EthernetInterface.cpp.
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
Definition at line 95 of file EthernetInterface.cpp.
int setName | ( | const char * | myname ) | [static] |
setName
Set the network name for this device. Apply this before calling 'connect'.
- Parameters:
-
myname is the name to assign for this node. Only the first 32 characters will be used if the name is longer. Only '0'-'9', 'A'-'Z', 'a'-'z' are accepted, any others are converted to '-'.
- Returns:
- 0 on success, a negative number on failure.
Definition at line 176 of file EthernetInterface.cpp.
Generated on Tue Jul 12 2022 21:33:04 by 1.7.2