mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-14 19:59:53 +03:00
merge #2108
This commit is contained in:
22
src/ESP32React/IPUtils.h
Normal file
22
src/ESP32React/IPUtils.h
Normal file
@@ -0,0 +1,22 @@
|
||||
#ifndef IPUtils_h
|
||||
#define IPUtils_h
|
||||
|
||||
#include <IPAddress.h>
|
||||
|
||||
class IPUtils {
|
||||
public:
|
||||
static bool isSet(const IPAddress & ip) {
|
||||
return ip != getNotSetIP();
|
||||
}
|
||||
static bool isNotSet(const IPAddress & ip) {
|
||||
return ip == getNotSetIP();
|
||||
}
|
||||
|
||||
private:
|
||||
static const IPAddress & getNotSetIP() {
|
||||
static const IPAddress IP_NOT_SET = IPAddress(INADDR_NONE);
|
||||
return IP_NOT_SET;
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user