use new packet store
Some checks failed
EIVE/eive-obsw/pipeline/pr-develop There was a failure building this commit

This commit is contained in:
Robin Müller 2022-12-13 14:30:16 +01:00
parent 828d791da5
commit fcc9858b66
No known key found for this signature in database
GPG Key ID: 11D4952C8CCEF814
3 changed files with 12 additions and 3 deletions

View File

@ -11,8 +11,8 @@ PusTmFunnel::PusTmFunnel(object_id_t objectId, TimeReaderIF &timeReader, Storage
: TmFunnelBase(objectId, tmStore, messageDepth), : TmFunnelBase(objectId, tmStore, messageDepth),
timeReader(timeReader), timeReader(timeReader),
miscStore(objects::MISC_STORE, "misc", RolloverInterval::HOURLY, 8, sdcMan) { miscStore(objects::MISC_STORE, "misc", RolloverInterval::HOURLY, 8, sdcMan) {
miscStore.addApid(config::EIVE_PUS_APID); miscStore.addApid(config::EIVE_PUS_APID);
miscStore.addService(17); miscStore.addService(17);
} }
PusTmFunnel::~PusTmFunnel() = default; PusTmFunnel::~PusTmFunnel() = default;
@ -55,6 +55,8 @@ ReturnValue_t PusTmFunnel::handlePacket(TmTcMessage &message) {
sourceSequenceCount = sourceSequenceCount % ccsds::LIMIT_SEQUENCE_COUNT; sourceSequenceCount = sourceSequenceCount % ccsds::LIMIT_SEQUENCE_COUNT;
packet.updateErrorControl(); packet.updateErrorControl();
miscStore.passPacket(packet);
for (unsigned int idx = 0; idx < destinations.size(); idx++) { for (unsigned int idx = 0; idx < destinations.size(); idx++) {
const auto &destVcidPair = destinations[idx]; const auto &destVcidPair = destinations[idx];
if (destinations.size() > 1) { if (destinations.size() > 1) {
@ -87,3 +89,9 @@ ReturnValue_t PusTmFunnel::handlePacket(TmTcMessage &message) {
} }
const char *PusTmFunnel::getName() const { return "PUS TM Funnel"; } const char *PusTmFunnel::getName() const { return "PUS TM Funnel"; }
ReturnValue_t PusTmFunnel::initialize() {
miscStore.updateBaseDir();
miscStore.updateCurrentTimestamp();
return returnvalue::OK;
}

View File

@ -39,6 +39,7 @@ class PusTmFunnel : public TmFunnelBase {
TmStore miscStore; TmStore miscStore;
ReturnValue_t handlePacket(TmTcMessage &message); ReturnValue_t handlePacket(TmTcMessage &message);
ReturnValue_t initialize() override;
}; };
#endif // FSFW_EXAMPLE_COMMON_PUSTMFUNNEL_H #endif // FSFW_EXAMPLE_COMMON_PUSTMFUNNEL_H

View File

@ -28,7 +28,6 @@ class TmStore : public SystemObject {
void updateBaseDir(); void updateBaseDir();
ReturnValue_t updateCurrentTimestamp(); ReturnValue_t updateCurrentTimestamp();
ReturnValue_t passPacket(PusTmReader& reader); ReturnValue_t passPacket(PusTmReader& reader);
ReturnValue_t storePacket(PusTmReader& reader);
private: private:
static constexpr size_t MAX_FILESIZE = 8192; static constexpr size_t MAX_FILESIZE = 8192;
@ -51,6 +50,7 @@ class TmStore : public SystemObject {
void calcDiffSeconds(RolloverInterval intervalUnit, uint32_t intervalCount); void calcDiffSeconds(RolloverInterval intervalUnit, uint32_t intervalCount);
void assignAndOrCreateMostRecentFile(); void assignAndOrCreateMostRecentFile();
ReturnValue_t storePacket(PusTmReader& reader);
}; };
#endif /* MISSION_TMTC_TMSTOREBACKEND_H_ */ #endif /* MISSION_TMTC_TMSTOREBACKEND_H_ */