mirror of
https://github.com/meshtastic/firmware.git
synced 2025-04-24 09:26:52 +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
|
#else
|
||||||
strcpy(fileInfo.file_name, file.name());
|
strcpy(fileInfo.file_name, file.name());
|
||||||
#endif
|
#endif
|
||||||
filenames.push_back(fileInfo);
|
if (!String(fileInfo.file_name).endsWith(".")) {
|
||||||
|
filenames.push_back(fileInfo);
|
||||||
|
}
|
||||||
file.close();
|
file.close();
|
||||||
}
|
}
|
||||||
file = root.openNextFile();
|
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
|
// Clients sending special nonce don't want to see other nodeinfos
|
||||||
state = config_nonce == SPECIAL_NONCE ? STATE_SEND_FILEMANIFEST : STATE_SEND_OTHER_NODEINFOS;
|
state = config_nonce == SPECIAL_NONCE ? STATE_SEND_FILEMANIFEST : STATE_SEND_OTHER_NODEINFOS;
|
||||||
config_state = 0;
|
config_state = 0;
|
||||||
filesManifest.clear();
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -358,9 +357,11 @@ size_t PhoneAPI::getFromRadio(uint8_t *buf)
|
|||||||
if (config_state == filesManifest.size()) { // also handles an empty filesManifest
|
if (config_state == filesManifest.size()) { // also handles an empty filesManifest
|
||||||
state = STATE_SEND_COMPLETE_ID;
|
state = STATE_SEND_COMPLETE_ID;
|
||||||
config_state = 0;
|
config_state = 0;
|
||||||
|
filesManifest.clear();
|
||||||
} else {
|
} else {
|
||||||
fromRadioScratch.which_payload_variant = meshtastic_FromRadio_fileInfo_tag;
|
fromRadioScratch.which_payload_variant = meshtastic_FromRadio_fileInfo_tag;
|
||||||
fromRadioScratch.fileInfo = filesManifest.at(config_state);
|
fromRadioScratch.fileInfo = filesManifest.at(config_state);
|
||||||
|
LOG_DEBUG("File: %s (%d) bytes\n", fromRadioScratch.fileInfo.file_name, fromRadioScratch.fileInfo.size_bytes);
|
||||||
config_state++;
|
config_state++;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user