Browse Source

Force reconfiguration of software access point when updating config or initializing APSettingsService instance.

master
Rick Watson 6 years ago
parent
commit
81d594f899
  1. 4
      src/APSettingsService.cpp
  2. 1
      src/WiFiSettingsService.h

4
src/APSettingsService.cpp

@ -32,7 +32,6 @@ void APSettingsService::manageAP() {
void APSettingsService::startAP() {
Serial.println("Starting software access point");
WiFi.softAP(_ssid.c_str(), _password.c_str());
if (!_dnsServer) {
IPAddress apIp = WiFi.softAPIP();
Serial.print("Starting captive portal on ");
@ -81,4 +80,7 @@ void APSettingsService::writeToJsonObject(JsonObject& root) {
void APSettingsService::onConfigUpdated() {
_lastManaged = millis() - MANAGE_NETWORK_DELAY;
// stop softAP - forces reconfiguration in loop()
stopAP();
}

1
src/WiFiSettingsService.h

@ -21,7 +21,6 @@ class WiFiSettingsService : public SettingsService {
void readFromJsonObject(JsonObject& root);
void writeToJsonObject(JsonObject& root);
void onConfigUpdated();
void reconfigureWiFiConnection();
private:

Loading…
Cancel
Save