Skip to content

Commit

Permalink
Merge pull request #4468 from tonhuisman/bugfix/IPAddress-issue-ardui…
Browse files Browse the repository at this point in the history
…no-workaround-and-taskexit-event

[WiFi] Workaround Arduino ESP8266 issue, correct TaskExit event generation
  • Loading branch information
TD-er authored Jan 20, 2023
2 parents 4fb32da + e451767 commit 4a01b4c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
10 changes: 5 additions & 5 deletions src/src/ESPEasyCore/ESPEasyWifi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1449,12 +1449,12 @@ void setupStaticIPconfig() {
setUseStaticIP(WiFiUseStaticIP());

if (!WiFiUseStaticIP()) { return; }
const IPAddress ip = Settings.IP;
const IPAddress gw = Settings.Gateway;
const IPAddress subnet = Settings.Subnet;
const IPAddress dns = Settings.DNS;
const IPAddress ip (Settings.IP);
const IPAddress gw (Settings.Gateway);
const IPAddress subnet (Settings.Subnet);
const IPAddress dns (Settings.DNS);

WiFiEventData.dns0_cache = Settings.DNS;
WiFiEventData.dns0_cache = dns;

WiFi.config(ip, gw, subnet, dns);

Expand Down
4 changes: 2 additions & 2 deletions src/src/WebServer/AccessControl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ bool getIPallowedRange(IPAddress& low, IPAddress& high)
}
return getSubnetRange(low, high);
case ONLY_IP_RANGE_ALLOWED:
low = SecuritySettings.AllowedIPrangeLow;
high = SecuritySettings.AllowedIPrangeHigh;
low = IPAddress(SecuritySettings.AllowedIPrangeLow);
high = IPAddress(SecuritySettings.AllowedIPrangeHigh);
break;
default:
low = IPAddress(0, 0, 0, 0);
Expand Down
7 changes: 5 additions & 2 deletions src/src/WebServer/DevicesPage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,10 @@ void handle_devices_CopySubmittedSettings(taskIndex_t taskIndex, pluginID_t task
}
ExtraTaskSettings.clearUnusedValueNames(valueCount);

// ExtraTaskSettings has changed.
// The content of it is needed for sending CPLUGIN_TASK_CHANGE_NOTIFICATION and TaskInit/TaskExit events
Cache.updateExtraTaskSettingsCache();

// allow the plugin to save plugin-specific form settings.
{
String dummy;
Expand All @@ -406,8 +410,7 @@ void handle_devices_CopySubmittedSettings(taskIndex_t taskIndex, pluginID_t task
}
}

// ExtraTaskSetting has changed.
// The content of it is needed for sending CPLUGIN_TASK_CHANGE_NOTIFICATION
// ExtraTaskSettings may have changed during PLUGIN_WEBFORM_SAVE, so again update the cache.
Cache.updateExtraTaskSettingsCache();

// notify controllers: CPlugin::Function::CPLUGIN_TASK_CHANGE_NOTIFICATION
Expand Down

0 comments on commit 4a01b4c

Please sign in to comment.