From 7842739772fe8962f84c1ada2f11e7f658c56182 Mon Sep 17 00:00:00 2001 From: Ruggero Tomaselli Date: Tue, 8 Sep 2020 16:51:11 +0200 Subject: [PATCH] Add clear method to IPAddress --- cores/esp8266/IPAddress.cpp | 4 ++++ cores/esp8266/IPAddress.h | 2 ++ 2 files changed, 6 insertions(+) diff --git a/cores/esp8266/IPAddress.cpp b/cores/esp8266/IPAddress.cpp index 940f5c14d9..101a42182a 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.