Skip to content

Commit

Permalink
Add clear method to IPAddress (#7586)
Browse files Browse the repository at this point in the history
  • Loading branch information
ruggi99 authored Sep 9, 2020
1 parent 08f1705 commit a460cb7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cores/esp8266/IPAddress.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions cores/esp8266/IPAddress.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit a460cb7

Please sign in to comment.