Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add clear method to IPAddress #7586

Merged
merged 2 commits into from
Sep 9, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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