add misc 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:19:43 +01:00
parent eddc620307
commit 3965c08bfb
No known key found for this signature in database
GPG Key ID: 11D4952C8CCEF814
8 changed files with 36 additions and 12 deletions

View File

@ -18,7 +18,8 @@ void ObjectFactory::produce(void* args) {
HealthTableIF* healthTable = nullptr;
PusTmFunnel* pusFunnel = nullptr;
CfdpTmFunnel* cfdpFunnel = nullptr;
ObjectFactory::produceGenericObjects(&healthTable, &pusFunnel, &cfdpFunnel);
ObjectFactory::produceGenericObjects(&healthTable, &pusFunnel, &cfdpFunnel,
*SdCardManager::instance());
LinuxLibgpioIF* gpioComIF = nullptr;
SerialComIF* uartComIF = nullptr;

View File

@ -146,6 +146,7 @@ enum commonObjects : uint32_t {
CFDP_TM_FUNNEL = 0x73000102,
CFDP_HANDLER = 0x73000205,
CFDP_DISTRIBUTOR = 0x73000206,
MISC_STORE = 0x73020001,
};
}

View File

@ -68,7 +68,7 @@ EiveFaultHandler EIVE_FAULT_HANDLER;
} // namespace cfdp
void ObjectFactory::produceGenericObjects(HealthTableIF** healthTable_, PusTmFunnel** pusFunnel,
CfdpTmFunnel** cfdpFunnel) {
CfdpTmFunnel** cfdpFunnel, SdCardMountedIF& sdcMan) {
// Framework objects
new EventManager(objects::EVENT_MANAGER);
auto healthTable = new HealthTable(objects::HEALTH_TABLE);
@ -122,7 +122,7 @@ void ObjectFactory::produceGenericObjects(HealthTableIF** healthTable_, PusTmFun
new PusDistributor(config::EIVE_PUS_APID, objects::PUS_PACKET_DISTRIBUTOR, ccsdsDistrib);
*cfdpFunnel = new CfdpTmFunnel(objects::CFDP_TM_FUNNEL, config::EIVE_CFDP_APID, *tmStore, 50);
*pusFunnel = new PusTmFunnel(objects::PUS_TM_FUNNEL, *timeStamper, *tmStore, 80);
*pusFunnel = new PusTmFunnel(objects::PUS_TM_FUNNEL, *timeStamper, *tmStore, sdcMan, 80);
#if OBSW_ADD_TCPIP_SERVERS == 1
#if OBSW_ADD_TMTC_UDP_SERVER == 1
(*cfdpFunnel)->addDestination(*udpBridge, 0);

View File

@ -1,6 +1,8 @@
#ifndef MISSION_CORE_GENERICFACTORY_H_
#define MISSION_CORE_GENERICFACTORY_H_
#include <mission/memory/SdCardMountedIF.h>
class HealthTableIF;
class PusTmFunnel;
class CfdpTmFunnel;
@ -8,7 +10,7 @@ class CfdpTmFunnel;
namespace ObjectFactory {
void produceGenericObjects(HealthTableIF** healthTable, PusTmFunnel** pusFunnel,
CfdpTmFunnel** cfdpFunnel);
CfdpTmFunnel** cfdpFunnel, SdCardMountedIF& sdcMan);
}

View File

@ -1,12 +1,15 @@
#include "PusTmFunnel.h"
#include "eive/objects.h"
#include "fsfw/ipc/QueueFactory.h"
#include "fsfw/objectmanager.h"
#include "fsfw/tmtcpacket/pus/tm/PusTmZcWriter.h"
PusTmFunnel::PusTmFunnel(object_id_t objectId, TimeReaderIF &timeReader, StorageManagerIF &tmStore,
uint32_t messageDepth)
: TmFunnelBase(objectId, tmStore, messageDepth), timeReader(timeReader) {}
SdCardMountedIF &sdcMan, uint32_t messageDepth)
: TmFunnelBase(objectId, tmStore, messageDepth),
timeReader(timeReader),
miscStore(objects::MISC_STORE, "misc", RolloverInterval::HOURLY, 8, sdcMan) {}
PusTmFunnel::~PusTmFunnel() = default;

View File

@ -10,6 +10,7 @@
#include <vector>
#include "TmStore.h"
#include "fsfw/timemanager/TimeReaderIF.h"
/**
@ -26,7 +27,7 @@
class PusTmFunnel : public TmFunnelBase {
public:
explicit PusTmFunnel(object_id_t objectId, TimeReaderIF &timeReader, StorageManagerIF &tmStore,
uint32_t messageDepth = 10);
SdCardMountedIF &sdcMan, uint32_t messageDepth = 10);
[[nodiscard]] const char *getName() const override;
~PusTmFunnel() override;
@ -35,6 +36,7 @@ class PusTmFunnel : public TmFunnelBase {
private:
uint16_t sourceSequenceCount = 0;
TimeReaderIF &timeReader;
TmStore miscStore;
ReturnValue_t handlePacket(TmTcMessage &message);
};

View File

@ -10,8 +10,8 @@
using namespace returnvalue;
TmStore::TmStore(object_id_t objectId, std::string baseName, RolloverInterval intervalUnit,
uint32_t intervalCount, PacketFilter filter, SdCardMountedIF& sdcMan)
: SystemObject(objectId), filter(filter), baseName(std::move(baseName)), sdcMan(sdcMan) {
uint32_t intervalCount, SdCardMountedIF& sdcMan)
: SystemObject(objectId), baseName(std::move(baseName)), sdcMan(sdcMan) {
calcDiffSeconds(intervalUnit, intervalCount);
}
@ -150,4 +150,17 @@ void TmStore::assignAndOrCreateMostRecentFile() {
}
}
ReturnValue_t TmStore::storePacketInternal(PusTmReader& reader) { return returnvalue::OK; }
void TmStore::addApid(uint16_t apid) {
if (not filter.apid) {
filter.apid = std::vector<uint16_t>(apid);
return;
}
filter.apid.value().push_back(apid);
}
void TmStore::addService(uint8_t service) {
if (not filter.services) {
filter.services = std::vector<uint8_t>(service);
}
filter.services.value().push_back(service);
}

View File

@ -20,7 +20,10 @@ enum class RolloverInterval { HOURLY, DAILY };
class TmStore : public SystemObject {
public:
TmStore(object_id_t objectId, std::string baseName, RolloverInterval intervalUnit,
uint32_t intervalCount, PacketFilter filter, SdCardMountedIF& sdcMan);
uint32_t intervalCount, SdCardMountedIF& sdcMan);
void addApid(uint16_t apid);
void addService(uint8_t service);
void updateBaseDir();
ReturnValue_t updateCurrentTimestamp();
@ -48,7 +51,6 @@ class TmStore : public SystemObject {
void calcDiffSeconds(RolloverInterval intervalUnit, uint32_t intervalCount);
void assignAndOrCreateMostRecentFile();
ReturnValue_t storePacketInternal(PusTmReader& reader);
};
#endif /* MISSION_TMTC_TMSTOREBACKEND_H_ */