add misc store
Some checks failed
EIVE/eive-obsw/pipeline/pr-develop There was a failure building this commit
Some checks failed
EIVE/eive-obsw/pipeline/pr-develop There was a failure building this commit
This commit is contained in:
parent
eddc620307
commit
3965c08bfb
@ -18,7 +18,8 @@ void ObjectFactory::produce(void* args) {
|
|||||||
HealthTableIF* healthTable = nullptr;
|
HealthTableIF* healthTable = nullptr;
|
||||||
PusTmFunnel* pusFunnel = nullptr;
|
PusTmFunnel* pusFunnel = nullptr;
|
||||||
CfdpTmFunnel* cfdpFunnel = nullptr;
|
CfdpTmFunnel* cfdpFunnel = nullptr;
|
||||||
ObjectFactory::produceGenericObjects(&healthTable, &pusFunnel, &cfdpFunnel);
|
ObjectFactory::produceGenericObjects(&healthTable, &pusFunnel, &cfdpFunnel,
|
||||||
|
*SdCardManager::instance());
|
||||||
|
|
||||||
LinuxLibgpioIF* gpioComIF = nullptr;
|
LinuxLibgpioIF* gpioComIF = nullptr;
|
||||||
SerialComIF* uartComIF = nullptr;
|
SerialComIF* uartComIF = nullptr;
|
||||||
|
@ -146,6 +146,7 @@ enum commonObjects : uint32_t {
|
|||||||
CFDP_TM_FUNNEL = 0x73000102,
|
CFDP_TM_FUNNEL = 0x73000102,
|
||||||
CFDP_HANDLER = 0x73000205,
|
CFDP_HANDLER = 0x73000205,
|
||||||
CFDP_DISTRIBUTOR = 0x73000206,
|
CFDP_DISTRIBUTOR = 0x73000206,
|
||||||
|
MISC_STORE = 0x73020001,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -68,7 +68,7 @@ EiveFaultHandler EIVE_FAULT_HANDLER;
|
|||||||
} // namespace cfdp
|
} // namespace cfdp
|
||||||
|
|
||||||
void ObjectFactory::produceGenericObjects(HealthTableIF** healthTable_, PusTmFunnel** pusFunnel,
|
void ObjectFactory::produceGenericObjects(HealthTableIF** healthTable_, PusTmFunnel** pusFunnel,
|
||||||
CfdpTmFunnel** cfdpFunnel) {
|
CfdpTmFunnel** cfdpFunnel, SdCardMountedIF& sdcMan) {
|
||||||
// Framework objects
|
// Framework objects
|
||||||
new EventManager(objects::EVENT_MANAGER);
|
new EventManager(objects::EVENT_MANAGER);
|
||||||
auto healthTable = new HealthTable(objects::HEALTH_TABLE);
|
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);
|
new PusDistributor(config::EIVE_PUS_APID, objects::PUS_PACKET_DISTRIBUTOR, ccsdsDistrib);
|
||||||
|
|
||||||
*cfdpFunnel = new CfdpTmFunnel(objects::CFDP_TM_FUNNEL, config::EIVE_CFDP_APID, *tmStore, 50);
|
*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_TCPIP_SERVERS == 1
|
||||||
#if OBSW_ADD_TMTC_UDP_SERVER == 1
|
#if OBSW_ADD_TMTC_UDP_SERVER == 1
|
||||||
(*cfdpFunnel)->addDestination(*udpBridge, 0);
|
(*cfdpFunnel)->addDestination(*udpBridge, 0);
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
#ifndef MISSION_CORE_GENERICFACTORY_H_
|
#ifndef MISSION_CORE_GENERICFACTORY_H_
|
||||||
#define MISSION_CORE_GENERICFACTORY_H_
|
#define MISSION_CORE_GENERICFACTORY_H_
|
||||||
|
|
||||||
|
#include <mission/memory/SdCardMountedIF.h>
|
||||||
|
|
||||||
class HealthTableIF;
|
class HealthTableIF;
|
||||||
class PusTmFunnel;
|
class PusTmFunnel;
|
||||||
class CfdpTmFunnel;
|
class CfdpTmFunnel;
|
||||||
@ -8,7 +10,7 @@ class CfdpTmFunnel;
|
|||||||
namespace ObjectFactory {
|
namespace ObjectFactory {
|
||||||
|
|
||||||
void produceGenericObjects(HealthTableIF** healthTable, PusTmFunnel** pusFunnel,
|
void produceGenericObjects(HealthTableIF** healthTable, PusTmFunnel** pusFunnel,
|
||||||
CfdpTmFunnel** cfdpFunnel);
|
CfdpTmFunnel** cfdpFunnel, SdCardMountedIF& sdcMan);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,12 +1,15 @@
|
|||||||
#include "PusTmFunnel.h"
|
#include "PusTmFunnel.h"
|
||||||
|
|
||||||
|
#include "eive/objects.h"
|
||||||
#include "fsfw/ipc/QueueFactory.h"
|
#include "fsfw/ipc/QueueFactory.h"
|
||||||
#include "fsfw/objectmanager.h"
|
#include "fsfw/objectmanager.h"
|
||||||
#include "fsfw/tmtcpacket/pus/tm/PusTmZcWriter.h"
|
#include "fsfw/tmtcpacket/pus/tm/PusTmZcWriter.h"
|
||||||
|
|
||||||
PusTmFunnel::PusTmFunnel(object_id_t objectId, TimeReaderIF &timeReader, StorageManagerIF &tmStore,
|
PusTmFunnel::PusTmFunnel(object_id_t objectId, TimeReaderIF &timeReader, StorageManagerIF &tmStore,
|
||||||
uint32_t messageDepth)
|
SdCardMountedIF &sdcMan, uint32_t messageDepth)
|
||||||
: TmFunnelBase(objectId, tmStore, messageDepth), timeReader(timeReader) {}
|
: TmFunnelBase(objectId, tmStore, messageDepth),
|
||||||
|
timeReader(timeReader),
|
||||||
|
miscStore(objects::MISC_STORE, "misc", RolloverInterval::HOURLY, 8, sdcMan) {}
|
||||||
|
|
||||||
PusTmFunnel::~PusTmFunnel() = default;
|
PusTmFunnel::~PusTmFunnel() = default;
|
||||||
|
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
|
#include "TmStore.h"
|
||||||
#include "fsfw/timemanager/TimeReaderIF.h"
|
#include "fsfw/timemanager/TimeReaderIF.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -26,7 +27,7 @@
|
|||||||
class PusTmFunnel : public TmFunnelBase {
|
class PusTmFunnel : public TmFunnelBase {
|
||||||
public:
|
public:
|
||||||
explicit PusTmFunnel(object_id_t objectId, TimeReaderIF &timeReader, StorageManagerIF &tmStore,
|
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;
|
[[nodiscard]] const char *getName() const override;
|
||||||
~PusTmFunnel() override;
|
~PusTmFunnel() override;
|
||||||
|
|
||||||
@ -35,6 +36,7 @@ class PusTmFunnel : public TmFunnelBase {
|
|||||||
private:
|
private:
|
||||||
uint16_t sourceSequenceCount = 0;
|
uint16_t sourceSequenceCount = 0;
|
||||||
TimeReaderIF &timeReader;
|
TimeReaderIF &timeReader;
|
||||||
|
TmStore miscStore;
|
||||||
|
|
||||||
ReturnValue_t handlePacket(TmTcMessage &message);
|
ReturnValue_t handlePacket(TmTcMessage &message);
|
||||||
};
|
};
|
||||||
|
@ -10,8 +10,8 @@
|
|||||||
using namespace returnvalue;
|
using namespace returnvalue;
|
||||||
|
|
||||||
TmStore::TmStore(object_id_t objectId, std::string baseName, RolloverInterval intervalUnit,
|
TmStore::TmStore(object_id_t objectId, std::string baseName, RolloverInterval intervalUnit,
|
||||||
uint32_t intervalCount, PacketFilter filter, SdCardMountedIF& sdcMan)
|
uint32_t intervalCount, SdCardMountedIF& sdcMan)
|
||||||
: SystemObject(objectId), filter(filter), baseName(std::move(baseName)), sdcMan(sdcMan) {
|
: SystemObject(objectId), baseName(std::move(baseName)), sdcMan(sdcMan) {
|
||||||
calcDiffSeconds(intervalUnit, intervalCount);
|
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);
|
||||||
|
}
|
||||||
|
@ -20,7 +20,10 @@ enum class RolloverInterval { HOURLY, DAILY };
|
|||||||
class TmStore : public SystemObject {
|
class TmStore : public SystemObject {
|
||||||
public:
|
public:
|
||||||
TmStore(object_id_t objectId, std::string baseName, RolloverInterval intervalUnit,
|
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();
|
void updateBaseDir();
|
||||||
ReturnValue_t updateCurrentTimestamp();
|
ReturnValue_t updateCurrentTimestamp();
|
||||||
@ -48,7 +51,6 @@ class TmStore : public SystemObject {
|
|||||||
|
|
||||||
void calcDiffSeconds(RolloverInterval intervalUnit, uint32_t intervalCount);
|
void calcDiffSeconds(RolloverInterval intervalUnit, uint32_t intervalCount);
|
||||||
void assignAndOrCreateMostRecentFile();
|
void assignAndOrCreateMostRecentFile();
|
||||||
ReturnValue_t storePacketInternal(PusTmReader& reader);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* MISSION_TMTC_TMSTOREBACKEND_H_ */
|
#endif /* MISSION_TMTC_TMSTOREBACKEND_H_ */
|
||||||
|
Loading…
Reference in New Issue
Block a user