Persistent TM Store #320

Merged
muellerr merged 109 commits from mueller/pus-15-tm-storage into develop 2023-02-24 19:03:39 +01:00
2 changed files with 5 additions and 3 deletions
Showing only changes of commit 283b897ae7 - Show all commits

View File

@ -86,7 +86,9 @@ ReturnValue_t TmStore::storePacket(PusTmReader& reader) {
MessageQueueId_t TmStore::getCommandQueue() { return MessageQueueIF::NO_QUEUE; }
void TmStore::calcDiffSeconds(RolloverInterval intervalUnit, uint32_t intervalCount) {
if (intervalUnit == RolloverInterval::HOURLY) {
if (intervalUnit == RolloverInterval::MINUTELY) {
rolloverDiffSeconds = 60 * intervalCount;
} else if (intervalUnit == RolloverInterval::HOURLY) {
rolloverDiffSeconds = 60 * 60 * intervalCount;
} else if (intervalUnit == RolloverInterval::DAILY) {
rolloverDiffSeconds = 60 * 60 * 24 * intervalCount;

View File

@ -15,7 +15,7 @@ struct PacketFilter {
std::optional<std::vector<std::pair<uint8_t, uint8_t>>> serviceSubservices;
};
enum class RolloverInterval { HOURLY, DAILY };
enum class RolloverInterval { MINUTELY, HOURLY, DAILY };
class TmStore : public SystemObject {
public:
@ -41,7 +41,7 @@ class TmStore : public SystemObject {
std::string baseName;
std::filesystem::path baseDir;
uint32_t rolloverDiffSeconds = 0;
std::array<uint8_t, 8192> fileBuf{};
std::array<uint8_t, MAX_FILESIZE> fileBuf{};
timeval& currentTv;
std::optional<timeval> mostRecentTv;
std::optional<std::filesystem::path> mostRecentFile;