arduino-libraries / Ethernet

Ethernet Library for Arduino
http://arduino.cc/
257 stars 262 forks source link

Missing functions #155

Open per1234 opened 3 years ago

per1234 commented 3 years ago

Moved from https://github.com/arduino/Arduino/issues/5867 by @DieterBurandt

The Ethernet2 (and Ethernet) library supports reading the following parameters from the W5500 board:

Curiously the two other parameters are missing:

For maintenance purpose the two missing calls should be added. The W5500 driver already supports these calls, so it is very simple to do:

For the new Arduino Ethernet Shield V2 R1.0.3 ==>

Add to Ethernet2.h =>

IPAddress dhcpServerIP();
void MacAddr(uint8_t * Mac);

and to Ethernet2.cpp =>

IPAddress EthernetClass::dhcpServerIP()
{
  return _dhcp->getDhcpServerIp();
}
void EthernetClass::MacAddr(uint8_t * Mac)
{
  w5500.getMACAddress(Mac);
}
per1234 commented 3 years ago

From per1234 on 2018-07-26

Ethernet.MACAddress() has been added by https://github.com/arduino-libraries/Ethernet/commit/ac843291454f522cdef6bddbacce2c52028be943