Skip to content

Commit a460cb7

Browse files
authored
Add clear method to IPAddress (#7586)
1 parent 08f1705 commit a460cb7

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

cores/esp8266/IPAddress.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,10 @@ bool IPAddress::isValid(const char* arg) {
183183
const IPAddress INADDR_ANY; // generic "0.0.0.0" for IPv4 & IPv6
184184
const IPAddress INADDR_NONE(255,255,255,255);
185185

186+
void IPAddress::clear() {
187+
(*this) = INADDR_ANY;
188+
}
189+
186190
/**************************************/
187191

188192
#if LWIP_IPV6

cores/esp8266/IPAddress.h

+2
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,8 @@ class IPAddress: public Printable {
125125
virtual size_t printTo(Print& p) const;
126126
String toString() const;
127127

128+
void clear();
129+
128130
/*
129131
check if input string(arg) is a valid IPV4 address or not.
130132
return true on valid.

0 commit comments

Comments
 (0)