diff --git a/mission/tmtc/PusTmFunnel.cpp b/mission/tmtc/PusTmFunnel.cpp index 1eb59ba4..f34ffb2b 100644 --- a/mission/tmtc/PusTmFunnel.cpp +++ b/mission/tmtc/PusTmFunnel.cpp @@ -11,8 +11,8 @@ PusTmFunnel::PusTmFunnel(object_id_t objectId, TimeReaderIF &timeReader, Storage : TmFunnelBase(objectId, tmStore, messageDepth), timeReader(timeReader), miscStore(objects::MISC_STORE, "misc", RolloverInterval::HOURLY, 8, sdcMan) { - miscStore.addApid(config::EIVE_PUS_APID); - miscStore.addService(17); + miscStore.addApid(config::EIVE_PUS_APID); + miscStore.addService(17); } PusTmFunnel::~PusTmFunnel() = default; @@ -55,6 +55,8 @@ ReturnValue_t PusTmFunnel::handlePacket(TmTcMessage &message) { sourceSequenceCount = sourceSequenceCount % ccsds::LIMIT_SEQUENCE_COUNT; packet.updateErrorControl(); + miscStore.passPacket(packet); + for (unsigned int idx = 0; idx < destinations.size(); idx++) { const auto &destVcidPair = destinations[idx]; if (destinations.size() > 1) { @@ -87,3 +89,9 @@ ReturnValue_t PusTmFunnel::handlePacket(TmTcMessage &message) { } const char *PusTmFunnel::getName() const { return "PUS TM Funnel"; } + +ReturnValue_t PusTmFunnel::initialize() { + miscStore.updateBaseDir(); + miscStore.updateCurrentTimestamp(); + return returnvalue::OK; +} diff --git a/mission/tmtc/PusTmFunnel.h b/mission/tmtc/PusTmFunnel.h index 96a9d33d..f4285375 100644 --- a/mission/tmtc/PusTmFunnel.h +++ b/mission/tmtc/PusTmFunnel.h @@ -39,6 +39,7 @@ class PusTmFunnel : public TmFunnelBase { TmStore miscStore; ReturnValue_t handlePacket(TmTcMessage &message); + ReturnValue_t initialize() override; }; #endif // FSFW_EXAMPLE_COMMON_PUSTMFUNNEL_H diff --git a/mission/tmtc/TmStore.h b/mission/tmtc/TmStore.h index 4a873750..954c3944 100644 --- a/mission/tmtc/TmStore.h +++ b/mission/tmtc/TmStore.h @@ -28,7 +28,6 @@ class TmStore : public SystemObject { void updateBaseDir(); ReturnValue_t updateCurrentTimestamp(); ReturnValue_t passPacket(PusTmReader& reader); - ReturnValue_t storePacket(PusTmReader& reader); private: static constexpr size_t MAX_FILESIZE = 8192; @@ -51,6 +50,7 @@ class TmStore : public SystemObject { void calcDiffSeconds(RolloverInterval intervalUnit, uint32_t intervalCount); void assignAndOrCreateMostRecentFile(); + ReturnValue_t storePacket(PusTmReader& reader); }; #endif /* MISSION_TMTC_TMSTOREBACKEND_H_ */