diff --git a/mission/tmtc/PersistentTmStore.cpp b/mission/tmtc/PersistentTmStore.cpp index 931102fc..ddd53b93 100644 --- a/mission/tmtc/PersistentTmStore.cpp +++ b/mission/tmtc/PersistentTmStore.cpp @@ -179,6 +179,9 @@ ReturnValue_t PersistentTmStore::startDumpFromUpTo(uint32_t fromUnixSeconds, return returnvalue::FAILED; } dumpParams.dirIter = directory_iterator(basePath); + if(dumpParams.dirIter == directory_iterator()) { + return returnvalue::FAILED; + } dumpParams.fromUnixTime = fromUnixSeconds; dumpParams.untilUnixTime = upToUnixSeconds; state = State::DUMPING; @@ -193,6 +196,7 @@ ReturnValue_t PersistentTmStore::loadNextDumpFile() { using namespace std::filesystem; dumpParams.currentSize = 0; std::error_code e; + dumpParams.dirIter++; for (; dumpParams.dirIter != directory_iterator(); dumpParams.dirIter++) { dumpParams.dirEntry = *dumpParams.dirIter; if (dumpParams.dirEntry.is_directory(e)) { diff --git a/mission/tmtc/TmStoreTaskBase.cpp b/mission/tmtc/TmStoreTaskBase.cpp index 6fcbd7fc..008735c4 100644 --- a/mission/tmtc/TmStoreTaskBase.cpp +++ b/mission/tmtc/TmStoreTaskBase.cpp @@ -24,7 +24,6 @@ bool TmStoreTaskBase::handleOneStore(PersistentTmStoreWithTmQueue& store, Countd if (not channel.isBusy()) { // TODO: Maybe do a bit of a delay every 100-200 packets? // TODO: We could continously dump until a file swap during active downlink.. - // TODO: handle returnvalue? result = store.dumpNextPacket(channel, dumpedLen, fileHasSwapped); if (result == returnvalue::OK) { dumpsPerformed = true;