From 9a967525fd12c4d2fe519757ffa927e65b49a786 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Fri, 28 Jun 2024 07:09:35 -0500 Subject: [PATCH 1/3] Clear after complete config --- src/mesh/PhoneAPI.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mesh/PhoneAPI.cpp b/src/mesh/PhoneAPI.cpp index 399715f6142..350500c09a2 100644 --- a/src/mesh/PhoneAPI.cpp +++ b/src/mesh/PhoneAPI.cpp @@ -330,7 +330,6 @@ size_t PhoneAPI::getFromRadio(uint8_t *buf) // Clients sending special nonce don't want to see other nodeinfos state = config_nonce == SPECIAL_NONCE ? STATE_SEND_FILEMANIFEST : STATE_SEND_OTHER_NODEINFOS; config_state = 0; - filesManifest.clear(); } break; @@ -358,6 +357,7 @@ size_t PhoneAPI::getFromRadio(uint8_t *buf) if (config_state == filesManifest.size()) { // also handles an empty filesManifest state = STATE_SEND_COMPLETE_ID; config_state = 0; + filesManifest.clear(); } else { fromRadioScratch.which_payload_variant = meshtastic_FromRadio_fileInfo_tag; fromRadioScratch.fileInfo = filesManifest.at(config_state); From 631d74a454f3d3bafec3f2942272623106975f1a Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Fri, 28 Jun 2024 07:37:50 -0500 Subject: [PATCH 2/3] Don't collect . entries --- src/FSCommon.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/FSCommon.cpp b/src/FSCommon.cpp index f9e9f1a8266..7d3788c4d9c 100644 --- a/src/FSCommon.cpp +++ b/src/FSCommon.cpp @@ -124,7 +124,9 @@ std::vector getFiles(const char *dirname, uint8_t levels) #else strcpy(fileInfo.file_name, file.name()); #endif - filenames.push_back(fileInfo); + if (!String(fileInfo.file_name).endsWith(".")) { + filenames.push_back(fileInfo); + } file.close(); } file = root.openNextFile(); From 9dd51a5add44829401af26124feb2e790a8e63ed Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Fri, 28 Jun 2024 08:22:59 -0500 Subject: [PATCH 3/3] Log file name and size --- src/mesh/PhoneAPI.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/mesh/PhoneAPI.cpp b/src/mesh/PhoneAPI.cpp index 350500c09a2..d6721b018ed 100644 --- a/src/mesh/PhoneAPI.cpp +++ b/src/mesh/PhoneAPI.cpp @@ -361,6 +361,7 @@ size_t PhoneAPI::getFromRadio(uint8_t *buf) } else { fromRadioScratch.which_payload_variant = meshtastic_FromRadio_fileInfo_tag; fromRadioScratch.fileInfo = filesManifest.at(config_state); + LOG_DEBUG("File: %s (%d) bytes\n", fromRadioScratch.fileInfo.file_name, fromRadioScratch.fileInfo.size_bytes); config_state++; } break;