diff --git a/cores/esp8266/IPAddress.cpp b/cores/esp8266/IPAddress.cpp index 5b502d8730..c269d00506 100644 --- a/cores/esp8266/IPAddress.cpp +++ b/cores/esp8266/IPAddress.cpp @@ -183,6 +183,10 @@ bool IPAddress::isValid(const char* arg) { const IPAddress INADDR_ANY; // generic "0.0.0.0" for IPv4 & IPv6 const IPAddress INADDR_NONE(255,255,255,255); +void IPAddress::clear() { + (*this) = INADDR_ANY; +} + /**************************************/ #if LWIP_IPV6 diff --git a/cores/esp8266/IPAddress.h b/cores/esp8266/IPAddress.h index d2170017e8..33305f4246 100644 --- a/cores/esp8266/IPAddress.h +++ b/cores/esp8266/IPAddress.h @@ -125,6 +125,8 @@ class IPAddress: public Printable { virtual size_t printTo(Print& p) const; String toString() const; + void clear(); + /* check if input string(arg) is a valid IPV4 address or not. return true on valid.