@@ -128,7 +128,7 @@ void EvilPortal::setupServer() {
128128}
129129
130130void EvilPortal::setHtmlFromSerial () {
131- Serial.println (" Setting HTML from serial..." );
131+ Serial.println (F ( " Setting HTML from serial..." ) );
132132 const char *htmlStr = Serial.readString ().c_str ();
133133 #ifdef HAS_PSRAM
134134 index_html = (char *) ps_malloc (MAX_HTML_SIZE);
@@ -215,18 +215,18 @@ bool EvilPortal::setAP(LinkedList<ssid>* ssids, LinkedList<AccessPoint>* access_
215215 // Could not open config file. return false
216216 if (!ap_config_file) {
217217 #ifdef HAS_SCREEN
218- this ->sendToDisplay (" Could not find /ap.config.txt." );
219- this ->sendToDisplay (" Touch to exit..." );
218+ this ->sendToDisplay (F ( " Could not find /ap.config.txt." ) );
219+ this ->sendToDisplay (F ( " Touch to exit..." ) );
220220 #endif
221- Serial.println (" Could not find /ap.config.txt. Use stopscan..." );
221+ Serial.println (F ( " Could not find /ap.config.txt. Use stopscan..." ) );
222222 return false ;
223223 }
224224 // Config file good. Proceed
225225 else {
226226 // ap name too long. return false
227227 if (ap_config_file.size () > MAX_AP_NAME_SIZE) {
228228 #ifdef HAS_SCREEN
229- this ->sendToDisplay (" The given AP name is too large." );
229+ this ->sendToDisplay (F ( " The given AP name is too large." ) );
230230 this ->sendToDisplay (" The Byte limit is " + (String)MAX_AP_NAME_SIZE);
231231 this ->sendToDisplay (" Touch to exit..." );
232232 #endif
@@ -242,7 +242,7 @@ bool EvilPortal::setAP(LinkedList<ssid>* ssids, LinkedList<AccessPoint>* access_
242242 }
243243 }
244244 #ifdef HAS_SCREEN
245- this ->sendToDisplay (" AP name from config file" );
245+ this ->sendToDisplay (F ( " AP name from config file" ) );
246246 this ->sendToDisplay (" AP name: " + ap_config);
247247 #endif
248248 Serial.println (" AP name from config file: " + ap_config);
@@ -255,23 +255,23 @@ bool EvilPortal::setAP(LinkedList<ssid>* ssids, LinkedList<AccessPoint>* access_
255255 ap_config = ssids->get (0 ).essid ;
256256 if (ap_config.length () > MAX_AP_NAME_SIZE) {
257257 #ifdef HAS_SCREEN
258- this ->sendToDisplay (" The given AP name is too large." );
258+ this ->sendToDisplay (F ( " The given AP name is too large." ) );
259259 this ->sendToDisplay (" The Byte limit is " + (String)MAX_AP_NAME_SIZE);
260260 this ->sendToDisplay (" Touch to exit..." );
261261 #endif
262262 Serial.println (" The provided AP name is too large. Byte limit is " + (String)MAX_AP_NAME_SIZE + " \n Use stopscan..." );
263263 return false ;
264264 }
265265 #ifdef HAS_SCREEN
266- this ->sendToDisplay (" AP name from SSID list" );
266+ this ->sendToDisplay (F ( " AP name from SSID list" ) );
267267 this ->sendToDisplay (" AP name: " + ap_config);
268268 #endif
269269 Serial.println (" AP name from SSID list: " + ap_config);
270270 }
271271 else if (temp_ap_name != " " ) {
272272 if (temp_ap_name.length () > MAX_AP_NAME_SIZE) {
273273 #ifdef HAS_SCREEN
274- this ->sendToDisplay (" The given AP name is too large." );
274+ this ->sendToDisplay (F ( " The given AP name is too large." ) );
275275 this ->sendToDisplay (" The Byte limit is " + (String)MAX_AP_NAME_SIZE);
276276 this ->sendToDisplay (" Touch to exit..." );
277277 #endif
@@ -280,24 +280,24 @@ bool EvilPortal::setAP(LinkedList<ssid>* ssids, LinkedList<AccessPoint>* access_
280280 else {
281281 ap_config = temp_ap_name;
282282 #ifdef HAS_SCREEN
283- this ->sendToDisplay (" AP name from AP list" );
283+ this ->sendToDisplay (F ( " AP name from AP list" ) );
284284 this ->sendToDisplay (" AP name: " + ap_config);
285285 #endif
286286 Serial.println (" AP name from AP list: " + ap_config);
287287 }
288288 }
289289 else {
290- Serial.println (" Could not configure Access Point. Use stopscan..." );
290+ Serial.println (F ( " Could not configure Access Point. Use stopscan..." ) );
291291 #ifdef HAS_SCREEN
292- this ->sendToDisplay (" Could not configure Access Point." );
293- this ->sendToDisplay (" Touch to exit..." );
292+ this ->sendToDisplay (F ( " Could not configure Access Point." ) );
293+ this ->sendToDisplay (F ( " Touch to exit..." ) );
294294 #endif
295295 }
296296
297297 if (ap_config != " " ) {
298298 strncpy (apName, ap_config.c_str (), MAX_AP_NAME_SIZE);
299299 this ->has_ap = true ;
300- Serial.println (" ap config set" );
300+ Serial.println (F ( " ap config set" ) );
301301 this ->ap_index = targ_ap_index;
302302 return true ;
303303 }
@@ -331,7 +331,7 @@ void EvilPortal::startAP() {
331331 WiFi.softAP (apName);
332332
333333 #ifdef HAS_SCREEN
334- this ->sendToDisplay (" AP started" );
334+ this ->sendToDisplay (F ( " AP started" ) );
335335 #endif
336336
337337 Serial.print (F (" ap ip address: " ));
@@ -348,7 +348,7 @@ void EvilPortal::startAP() {
348348 server.begin ();
349349 Serial.println (F (" Server started" ));
350350 #ifdef HAS_SCREEN
351- this ->sendToDisplay (" Evil Portal READY" );
351+ this ->sendToDisplay (F ( " Evil Portal READY" ) );
352352 #endif
353353}
354354
0 commit comments