mirror of
https://github.com/meshtastic/firmware.git
synced 2025-02-01 10:19:59 +00:00
Clear vector after complete config state (#4194)
* Clear after complete config * Don't collect . entries * Log file name and size
This commit is contained in:
parent
ce58a23f9b
commit
0016e747e9
@ -124,7 +124,9 @@ std::vector<meshtastic_FileInfo> getFiles(const char *dirname, uint8_t levels)
|
||||
#else
|
||||
strcpy(fileInfo.file_name, file.name());
|
||||
#endif
|
||||
if (!String(fileInfo.file_name).endsWith(".")) {
|
||||
filenames.push_back(fileInfo);
|
||||
}
|
||||
file.close();
|
||||
}
|
||||
file = root.openNextFile();
|
||||
|
@ -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,9 +357,11 @@ 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);
|
||||
LOG_DEBUG("File: %s (%d) bytes\n", fromRadioScratch.fileInfo.file_name, fromRadioScratch.fileInfo.size_bytes);
|
||||
config_state++;
|
||||
}
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user