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 2424
2525#define WIFI_RECONNECTION_DELAY 1000 * 30
2626
27+ const IPAddress IP_NOT_SET = IPAddress(INADDR_NONE);
28+
2729class WiFiSettings {
2830 public:
2931 // core wifi configuration
@@ -68,7 +70,7 @@ class WiFiSettings {
6870 JsonUtils::readIP (root, " dns_ip_2" , settings.dnsIP2 );
6971
7072 // 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 ) {
7274 settings.dnsIP1 = settings.dnsIP2 ;
7375 settings.dnsIP2 = INADDR_NONE;
7476 }
@@ -77,7 +79,7 @@ class WiFiSettings {
7779 // of ipAddress, gateway and subnet. This may change to static ip only
7880 // as sensible defaults can be assumed for gateway and subnet
7981 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 )) {
8183 settings.staticIPConfig = false ;
8284 }
8385 return StateUpdateResult::CHANGED;
You can’t perform that action at this time.
0 commit comments