Created
July 10, 2022 15:35
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String processor2(const String& var) | |
{ | |
//index2.h | |
String url; | |
if (!LittleFS.begin()) | |
{ | |
Serial.println("LittleFS failed to mount !"); | |
} | |
File root = LittleFS.open("/"); | |
File file = root.openNextFile(); | |
while(file) | |
{ | |
String file_name = file.name(); | |
if (file_name.startsWith("LOG")) | |
{ | |
url += "<a href=\""; | |
url += file.name(); | |
url += "\">"; | |
url += file.name(); | |
url += "</a>"; | |
url += " "; | |
url += file.size(); | |
url += "<br>\r\n"; | |
} | |
file = root.openNextFile(); | |
} | |
root.close(); | |
if (var == F("URLLINK")) | |
return url; | |
if (var == F("LINK")) | |
return linkAddress; | |
if (var == F("FILENAME")) | |
return file.name(); | |
return String(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment