Enabled deletion of files created by the range-test module

This commit is contained in:
ford-jones 2025-08-21 11:55:53 +12:00 committed by Tom Fifield
parent fe3f14a63e
commit 35d9e68053
2 changed files with 23 additions and 1 deletions

View File

@ -298,4 +298,21 @@ bool RangeTestModuleRadio::appendFile(const meshtastic_MeshPacket &mp)
#endif
return 1;
}
}
bool RangeTestModuleRadio::removeFile()
{
#ifdef ARCH_ESP32
char *fp = "/static/rangetest.csv";
if (FSCom.exists(fp)) {
LOG_INFO("Deleting previous range test.");
bool result = FSCom.remove(fp);
if (!result) {
LOG_ERROR("Failed to delete rangeTest.csv");
return 0;
}
}
#endif
return 1;
};

View File

@ -44,6 +44,11 @@ class RangeTestModuleRadio : public SinglePortModule
*/
bool appendFile(const meshtastic_MeshPacket &mp);
/**
* Cleanup range test data from filesystem
*/
bool removeFile();
protected:
/** Called to handle a particular incoming message