File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change 24
24
25
25
#define WIFI_RECONNECTION_DELAY 1000 * 30
26
26
27
+ const IPAddress IP_NOT_SET = IPAddress(INADDR_NONE);
28
+
27
29
class WiFiSettings {
28
30
public:
29
31
// core wifi configuration
@@ -68,7 +70,7 @@ class WiFiSettings {
68
70
JsonUtils::readIP (root, " dns_ip_2" , settings.dnsIP2 );
69
71
70
72
// Swap around the dns servers if 2 is populated but 1 is not
71
- if (settings.dnsIP1 == INADDR_NONE && settings.dnsIP2 != INADDR_NONE ) {
73
+ if (settings.dnsIP1 == IP_NOT_SET && settings.dnsIP2 != IP_NOT_SET ) {
72
74
settings.dnsIP1 = settings.dnsIP2 ;
73
75
settings.dnsIP2 = INADDR_NONE;
74
76
}
@@ -77,7 +79,7 @@ class WiFiSettings {
77
79
// of ipAddress, gateway and subnet. This may change to static ip only
78
80
// as sensible defaults can be assumed for gateway and subnet
79
81
if (settings.staticIPConfig &&
80
- (settings.localIP == INADDR_NONE || settings.gatewayIP == INADDR_NONE || settings.subnetMask == INADDR_NONE )) {
82
+ (settings.localIP == IP_NOT_SET || settings.gatewayIP == IP_NOT_SET || settings.subnetMask == IP_NOT_SET )) {
81
83
settings.staticIPConfig = false ;
82
84
}
83
85
return StateUpdateResult::CHANGED;
You can’t perform that action at this time.
0 commit comments