#include <STM32Ethernet.h>
Public Member Functions | |
| int | begin (unsigned long timeout=60000, unsigned long responseTimeout=4000) |
| Initialises Ethernet with the built-in MAC address and gets the network configuration from a DHCP server. | |
| EthernetLinkStatus | linkStatus () |
| Returns the Ethernet link status. | |
| void | begin (IPAddress local_ip) |
| Initialises Ethernet with a static IP address. | |
| void | begin (IPAddress local_ip, IPAddress subnet) |
| Initialises Ethernet with a static IP address and subnet mask. | |
| void | begin (IPAddress local_ip, IPAddress subnet, IPAddress gateway) |
| Initialises Ethernet with static IP, subnet mask and gateway. | |
| void | begin (IPAddress local_ip, IPAddress subnet, IPAddress gateway, IPAddress dns_server) |
| Initialises Ethernet with a fully static network configuration. | |
| int | begin (uint8_t *mac_address, unsigned long timeout=60000, unsigned long responseTimeout=4000) |
| Initialises Ethernet with the given MAC address and gets the network configuration from a DHCP server. | |
| void | begin (uint8_t *mac_address, IPAddress local_ip) |
| Initialises Ethernet with a MAC address and a static IP address. | |
| void | begin (uint8_t *mac_address, IPAddress local_ip, IPAddress dns_server) |
| Initialises Ethernet with a MAC address, static IP and DNS server. | |
| void | begin (uint8_t *mac_address, IPAddress local_ip, IPAddress dns_server, IPAddress gateway) |
| Initialises Ethernet with a MAC address, static IP, DNS and gateway. | |
| void | begin (uint8_t *mac_address, IPAddress local_ip, IPAddress dns_server, IPAddress gateway, IPAddress subnet) |
| Initialises Ethernet with a MAC address and a fully static network configuration. | |
| int | maintain () |
| Checks the DHCP lease and reports the result of a renew or rebind. | |
| void | schedule (void) |
| Services the LwIP stack. | |
| void | MACAddress (uint8_t *mac_address) |
| Copies the current MAC address of the Ethernet interface. | |
| IPAddress | localIP () |
| Returns the local IP address of the interface. | |
| IPAddress | subnetMask () |
| Returns the subnet mask of the interface. | |
| IPAddress | gatewayIP () |
| Returns the default gateway address of the interface. | |
| IPAddress | dnsServerIP () |
| Returns the DNS server address. | |
| void | setMACAddress (const uint8_t *mac_address) |
| Sets the MAC address of the Ethernet interface. | |
| void | setDnsServerIP (const IPAddress dns_server) |
| Stores the DNS server address returned by dnsServerIP(). | |
Friends | |
| class | EthernetClient |
| class | EthernetServer |
| void EthernetClass::begin | ( | IPAddress | local_ip | ) |
Initialises Ethernet with a static IP address.
Uses the built-in MAC address and a subnet mask of 255.255.255.0.
| local_ip | Static IP address of the board. |
| void EthernetClass::begin | ( | IPAddress | local_ip, |
| IPAddress | subnet | ||
| ) |
Initialises Ethernet with a static IP address and subnet mask.
The gateway defaults to the .1 address of the local network.
| local_ip | Static IP address of the board. |
| subnet | Subnet mask. |
| void EthernetClass::begin | ( | IPAddress | local_ip, |
| IPAddress | subnet, | ||
| IPAddress | gateway | ||
| ) |
Initialises Ethernet with static IP, subnet mask and gateway.
The DNS server defaults to the gateway address.
| local_ip | Static IP address of the board. |
| subnet | Subnet mask. |
| gateway | Default gateway address. |
| void EthernetClass::begin | ( | IPAddress | local_ip, |
| IPAddress | subnet, | ||
| IPAddress | gateway, | ||
| IPAddress | dns_server | ||
| ) |
Initialises Ethernet with a fully static network configuration.
Uses the built-in MAC address and informs any local DHCP server of the static configuration to avoid IP conflicts. The DNS server is only stored and returned by dnsServerIP().
| local_ip | Static IP address of the board. |
| subnet | Subnet mask. |
| gateway | Default gateway address. |
| dns_server | DNS server address. |
| void EthernetClass::begin | ( | uint8_t * | mac_address, |
| IPAddress | local_ip | ||
| ) |
Initialises Ethernet with a MAC address and a static IP address.
Uses a subnet mask of 255.255.255.0. The DNS server and the gateway default to the .1 address of the local network.
| mac_address | Six-byte MAC address to use. |
| local_ip | Static IP address of the board. |
| void EthernetClass::begin | ( | uint8_t * | mac_address, |
| IPAddress | local_ip, | ||
| IPAddress | dns_server | ||
| ) |
Initialises Ethernet with a MAC address, static IP and DNS server.
Uses a subnet mask of 255.255.255.0. The gateway defaults to the .1 address of the local network.
| mac_address | Six-byte MAC address to use. |
| local_ip | Static IP address of the board. |
| dns_server | DNS server address. |
| void EthernetClass::begin | ( | uint8_t * | mac_address, |
| IPAddress | local_ip, | ||
| IPAddress | dns_server, | ||
| IPAddress | gateway | ||
| ) |
Initialises Ethernet with a MAC address, static IP, DNS and gateway.
Uses a subnet mask of 255.255.255.0.
| mac_address | Six-byte MAC address to use. |
| local_ip | Static IP address of the board. |
| dns_server | DNS server address. |
| gateway | Default gateway address. |
| void EthernetClass::begin | ( | uint8_t * | mac_address, |
| IPAddress | local_ip, | ||
| IPAddress | dns_server, | ||
| IPAddress | gateway, | ||
| IPAddress | subnet | ||
| ) |
Initialises Ethernet with a MAC address and a fully static network configuration.
Informs any local DHCP server of the static configuration to avoid IP conflicts. The DNS server is only stored and returned by dnsServerIP().
| mac_address | Six-byte MAC address to use. |
| local_ip | Static IP address of the board. |
| dns_server | DNS server address. |
| gateway | Default gateway address. |
| subnet | Subnet mask. |
| int EthernetClass::begin | ( | uint8_t * | mac_address, |
| unsigned long | timeout = 60000, |
||
| unsigned long | responseTimeout = 4000 |
||
| ) |
Initialises Ethernet with the given MAC address and gets the network configuration from a DHCP server.
The MAC address is only applied if the interface is not yet initialised. Blocks until a lease is obtained or the timeout expires. On success the DNS server is taken from DHCP.
| mac_address | Six-byte MAC address to use. |
| timeout | Maximum time to wait for the DHCP lease, in milliseconds. |
| responseTimeout | Unused; kept for compatibility. |
| int EthernetClass::begin | ( | unsigned long | timeout = 60000, |
| unsigned long | responseTimeout = 4000 |
||
| ) |
Initialises Ethernet with the built-in MAC address and gets the network configuration from a DHCP server.
Blocks until a lease is obtained or the timeout expires. On success the DNS server is taken from DHCP.
| timeout | Maximum time to wait for the DHCP lease, in milliseconds. |
| responseTimeout | Unused; kept for compatibility. |
| IPAddress EthernetClass::dnsServerIP | ( | ) |
Returns the DNS server address.
This is the value stored by begin() or setDnsServerIP().
| IPAddress EthernetClass::gatewayIP | ( | ) |
Returns the default gateway address of the interface.
| EthernetLinkStatus EthernetClass::linkStatus | ( | ) |
Returns the Ethernet link status.
| IPAddress EthernetClass::localIP | ( | ) |
Returns the local IP address of the interface.
| void EthernetClass::MACAddress | ( | uint8_t * | mac_address | ) |
Copies the current MAC address of the Ethernet interface.
| mac_address | Six-byte buffer that receives the MAC address. |
| int EthernetClass::maintain | ( | ) |
Checks the DHCP lease and reports the result of a renew or rebind.
Does nothing and returns DHCP_CHECK_NONE if DHCP was never started. When a renew or rebind succeeds, the DNS server is updated from DHCP.
| void EthernetClass::schedule | ( | void | ) |
Services the LwIP stack.
Triggers the stack scheduler, which handles packet input, the link check, timeouts and DHCP processing. Useful in long loops where the stack would otherwise not be updated.
| void EthernetClass::setDnsServerIP | ( | const IPAddress | dns_server | ) |
Stores the DNS server address returned by dnsServerIP().
Does not reconfigure the LwIP DNS resolver.
| dns_server | DNS server address. |
| void EthernetClass::setMACAddress | ( | const uint8_t * | mac_address | ) |
Sets the MAC address of the Ethernet interface.
The address is only applied while the interface is not yet initialised.
| mac_address | Six-byte MAC address to use. |
| IPAddress EthernetClass::subnetMask | ( | ) |
Returns the subnet mask of the interface.
|
friend |
|
friend |