@@ -74,7 +74,7 @@ ESPAsync_WMParameter::ESPAsync_WMParameter(const char *id, const char *placehold
74
74
}
75
75
76
76
// KH, using struct
77
- ESPAsync_WMParameter::ESPAsync_WMParameter (WMParam_Data WMParam_data)
77
+ ESPAsync_WMParameter::ESPAsync_WMParameter (const WMParam_Data& WMParam_data)
78
78
{
79
79
init (WMParam_data._id , WMParam_data._placeholder , WMParam_data._value , WMParam_data._length , " " , WMParam_data._labelPlacement );
80
80
}
@@ -111,7 +111,7 @@ ESPAsync_WMParameter::~ESPAsync_WMParameter()
111
111
}
112
112
113
113
// Using Struct to get/set whole data at once
114
- void ESPAsync_WMParameter::setWMParam_Data (WMParam_Data WMParam_data)
114
+ void ESPAsync_WMParameter::setWMParam_Data (const WMParam_Data& WMParam_data)
115
115
{
116
116
LOGINFO (F (" setWMParam_Data" ));
117
117
@@ -1011,7 +1011,7 @@ int ESPAsync_WiFiManager::reconnectWifi()
1011
1011
1012
1012
// ////////////////////////////////////////
1013
1013
1014
- int ESPAsync_WiFiManager::connectWifi (String ssid, String pass)
1014
+ int ESPAsync_WiFiManager::connectWifi (const String& ssid, const String& pass)
1015
1015
{
1016
1016
// Add option if didn't input/update SSID/PW => Use the previous saved Credentials.
1017
1017
// But update the Static/DHCP options if changed.
@@ -1251,7 +1251,7 @@ int ESPAsync_WiFiManager::setConfigPortalChannel(int channel)
1251
1251
1252
1252
// ////////////////////////////////////////
1253
1253
1254
- void ESPAsync_WiFiManager::setAPStaticIPConfig (IPAddress ip, IPAddress gw, IPAddress sn)
1254
+ void ESPAsync_WiFiManager::setAPStaticIPConfig (const IPAddress& ip, const IPAddress& gw, const IPAddress& sn)
1255
1255
{
1256
1256
LOGINFO (F (" setAPStaticIPConfig" ));
1257
1257
_WiFi_AP_IPconfig._ap_static_ip = ip;
@@ -1262,7 +1262,7 @@ void ESPAsync_WiFiManager::setAPStaticIPConfig(IPAddress ip, IPAddress gw, IPAdd
1262
1262
// ////////////////////////////////////////
1263
1263
1264
1264
// KH, new using struct
1265
- void ESPAsync_WiFiManager::setAPStaticIPConfig (WiFi_AP_IPConfig WM_AP_IPconfig)
1265
+ void ESPAsync_WiFiManager::setAPStaticIPConfig (const WiFi_AP_IPConfig& WM_AP_IPconfig)
1266
1266
{
1267
1267
LOGINFO (F (" setAPStaticIPConfig" ));
1268
1268
@@ -1280,7 +1280,7 @@ void ESPAsync_WiFiManager::getAPStaticIPConfig(WiFi_AP_IPConfig &WM_AP_IPconfig
1280
1280
1281
1281
// ////////////////////////////////////////
1282
1282
1283
- void ESPAsync_WiFiManager::setSTAStaticIPConfig (IPAddress ip, IPAddress gw, IPAddress sn)
1283
+ void ESPAsync_WiFiManager::setSTAStaticIPConfig (const IPAddress& ip, const IPAddress& gw, const IPAddress& sn)
1284
1284
{
1285
1285
LOGINFO (F (" setSTAStaticIPConfig" ));
1286
1286
_WiFi_STA_IPconfig._sta_static_ip = ip;
@@ -1290,7 +1290,7 @@ void ESPAsync_WiFiManager::setSTAStaticIPConfig(IPAddress ip, IPAddress gw, IPAd
1290
1290
1291
1291
// ////////////////////////////////////////
1292
1292
1293
- void ESPAsync_WiFiManager::setSTAStaticIPConfig (WiFi_STA_IPConfig WM_STA_IPconfig)
1293
+ void ESPAsync_WiFiManager::setSTAStaticIPConfig (const WiFi_STA_IPConfig& WM_STA_IPconfig)
1294
1294
{
1295
1295
LOGINFO (F (" setSTAStaticIPConfig" ));
1296
1296
@@ -1310,7 +1310,8 @@ void ESPAsync_WiFiManager::getSTAStaticIPConfig(WiFi_STA_IPConfig &WM_STA_IPconf
1310
1310
// ////////////////////////////////////////
1311
1311
1312
1312
#if USE_CONFIGURABLE_DNS
1313
- void ESPAsync_WiFiManager::setSTAStaticIPConfig (IPAddress ip, IPAddress gw, IPAddress sn, IPAddress dns_address_1, IPAddress dns_address_2)
1313
+ void ESPAsync_WiFiManager::setSTAStaticIPConfig (const IPAddress& ip, const IPAddress& gw, const IPAddress& sn,
1314
+ const IPAddress& dns_address_1, const IPAddress& dns_address_2)
1314
1315
{
1315
1316
LOGINFO (F (" setSTAStaticIPConfig for USE_CONFIGURABLE_DNS" ));
1316
1317
_WiFi_STA_IPconfig._sta_static_ip = ip;
@@ -2283,7 +2284,7 @@ int ESPAsync_WiFiManager::getRSSIasQuality(int RSSI)
2283
2284
// ////////////////////////////////////////
2284
2285
2285
2286
// Is this an IP?
2286
- bool ESPAsync_WiFiManager::isIp (String str)
2287
+ bool ESPAsync_WiFiManager::isIp (const String& str)
2287
2288
{
2288
2289
for (unsigned int i = 0 ; i < str.length (); i++)
2289
2290
{
@@ -2294,15 +2295,17 @@ bool ESPAsync_WiFiManager::isIp(String str)
2294
2295
return false ;
2295
2296
}
2296
2297
}
2298
+
2297
2299
return true ;
2298
2300
}
2299
2301
2300
2302
// ////////////////////////////////////////
2301
2303
2302
2304
// IP to String
2303
- String ESPAsync_WiFiManager::toStringIp (IPAddress ip)
2305
+ String ESPAsync_WiFiManager::toStringIp (const IPAddress& ip)
2304
2306
{
2305
2307
String res = " " ;
2308
+
2306
2309
for (int i = 0 ; i < 3 ; i++)
2307
2310
{
2308
2311
res += String ((ip >> (8 * i)) & 0xFF ) + " ." ;
0 commit comments