Hi
Your help is deeply appreciated.
I am using the PJRC Ethernet v2.0 library, trying to retrieve the DHCP server IP address after a successfully DHCP call.
I notice the DHCPServer code was in the library but seems not exposed to user API.
So , I did follow:
* file Ethernet.cpp
Ardound line# 186: add section below
IPAddress EthernetClass::dhcpServerIP()
{
IPAddress ret;
SPI.beginTransaction(SPI_ETHERNET_SETTINGS);
W5100.getDhcpServerIp(ret.raw_address());
SPI.endTransaction();
return ret;
}
* file Ethernet.h
Ardound line# 97: add line below
static IPAddress dhcpServerIP();
* to call the function in Arduino .ino file
Serial.println(Ethernet.dhcpServerIP() );
Result: Error said,
Ethernet.cpp:191:8: error: 'class W5100Class' has no member named 'getDhcpServerIp'
Thanks in advance for advice.
Your help is deeply appreciated.
I am using the PJRC Ethernet v2.0 library, trying to retrieve the DHCP server IP address after a successfully DHCP call.
I notice the DHCPServer code was in the library but seems not exposed to user API.
So , I did follow:
* file Ethernet.cpp
Ardound line# 186: add section below
IPAddress EthernetClass::dhcpServerIP()
{
IPAddress ret;
SPI.beginTransaction(SPI_ETHERNET_SETTINGS);
W5100.getDhcpServerIp(ret.raw_address());
SPI.endTransaction();
return ret;
}
* file Ethernet.h
Ardound line# 97: add line below
static IPAddress dhcpServerIP();
* to call the function in Arduino .ino file
Serial.println(Ethernet.dhcpServerIP() );
Result: Error said,
Ethernet.cpp:191:8: error: 'class W5100Class' has no member named 'getDhcpServerIp'
Thanks in advance for advice.