add flush to filesystem before closing write file.

This commit is contained in:
Thomas Göttgens
2023-04-14 10:55:05 +02:00
parent b43a5bc4f8
commit 309d4fc7f2
5 changed files with 12 additions and 2 deletions

View File

@@ -226,7 +226,7 @@ bool RangeTestModuleRadio::appendFile(const meshtastic_MeshPacket &mp)
} else {
LOG_ERROR("File write failed\n");
}
fileToWrite.flush();
fileToWrite.close();
}
@@ -275,6 +275,7 @@ bool RangeTestModuleRadio::appendFile(const meshtastic_MeshPacket &mp)
// TODO: If quotes are found in the payload, it has to be escaped.
fileToAppend.printf("\"%s\"\n", p.payload.bytes);
fileToAppend.flush();
fileToAppend.close();
return 1;