Use references & flash strings where approperate (#110)

* pass originId as const reference
* store strings for serial logging in flash
* Use string references where approperate.
This commit is contained in:
rjwats
2020-05-21 08:42:21 +01:00
committed by GitHub
parent 4e6823ceec
commit 0e2124062f
16 changed files with 85 additions and 90 deletions

View File

@ -31,7 +31,7 @@ WiFiSettingsService::WiFiSettingsService(AsyncWebServer* server, FS* fs, Securit
std::bind(&WiFiSettingsService::onStationModeDisconnected, this, std::placeholders::_1));
#endif
addUpdateHandler([&](String originId) { reconfigureWiFiConnection(); }, false);
addUpdateHandler([&](const String& originId) { reconfigureWiFiConnection(); }, false);
}
void WiFiSettingsService::begin() {
@ -68,7 +68,7 @@ void WiFiSettingsService::manageSTA() {
}
// Connect or reconnect as required
if ((WiFi.getMode() & WIFI_STA) == 0) {
Serial.println("Connecting to WiFi.");
Serial.println(F("Connecting to WiFi."));
if (_state.staticIPConfig) {
// configure for static IP
WiFi.config(_state.localIP, _state.gatewayIP, _state.subnetMask, _state.dnsIP1, _state.dnsIP2);