8000 quick fix for ip address issue under esp32 with latest espressif (#230) · adityathakekar/esp8266-react@dc34ef0 · GitHub
[go: up one dir, main page]

Skip to conten 8000 t

Commit dc34ef0

Browse files
authored
quick fix for ip address issue under esp32 with latest espressif (rjwats#230)
1 parent ebd4b76 commit dc34ef0

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/framework/WiFiSettingsService.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424

2525
#define WIFI_RECONNECTION_DELAY 1000 * 30
2626

27+
const IPAddress IP_NOT_SET = IPAddress(INADDR_NONE);
28+
2729
class 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;

0 commit comments

Comments
 (0)
0