add static IP for W5500

This commit is contained in:
technyon
2023-03-05 11:19:02 +01:00
parent 2dcbf919c8
commit 6070884f74
6 changed files with 27 additions and 15 deletions

View File

@@ -117,8 +117,19 @@ ReconnectStatus W5500Device::reconnect()
{
_hasDHCPAddress = true;
dhcpRetryCnt = 1000;
Log->print(F(" DHCP assigned IP "));
Log->println(Ethernet.localIP());
if(_ipConfiguration->dhcpEnabled())
{
Log->print(F(" DHCP assigned IP "));
Log->println(Ethernet.localIP());
}
}
if(!_ipConfiguration->dhcpEnabled())
{
Ethernet.setLocalIP(_ipConfiguration->ipAddress());
Ethernet.setSubnetMask(_ipConfiguration->subnet());
Ethernet.setGatewayIP(_ipConfiguration->defaultGateway());
Ethernet.setDnsServerIP(_ipConfiguration->dnsServer());
}
}