forked from rjwats/esp8266-react
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce IPUtils for checking if IPAddresses are set or not (rjwats#231
- Loading branch information
Showing
5 changed files
with
26 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#ifndef IPUtils_h | ||
#define IPUtils_h | ||
|
||
#include <IPAddress.h> | ||
|
||
const IPAddress IP_NOT_SET = IPAddress(INADDR_NONE); | ||
|
||
class IPUtils { | ||
public: | ||
static bool isSet(const IPAddress& ip) { | ||
return ip != IP_NOT_SET; | ||
} | ||
static bool isNotSet(const IPAddress& ip) { | ||
return ip == IP_NOT_SET; | ||
} | ||
}; | ||
|
||
#endif // end IPUtils_h |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters