ok im done
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
3e17de0127
commit
d37f48336b
@ -147,7 +147,8 @@ enum commonObjects : uint32_t {
|
|||||||
CFDP_HANDLER = 0x73000205,
|
CFDP_HANDLER = 0x73000205,
|
||||||
CFDP_DISTRIBUTOR = 0x73000206,
|
CFDP_DISTRIBUTOR = 0x73000206,
|
||||||
MISC_STORE = 0x73020001,
|
MISC_STORE = 0x73020001,
|
||||||
EVENT_STORE = 0x73020002,
|
OK_STORE = 0x73020002,
|
||||||
|
NOT_OK_STORE = 0x73020003,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -11,14 +11,15 @@ 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, currentTv, sdcMan),
|
miscStore(objects::MISC_STORE, "misc", RolloverInterval::HOURLY, 8, currentTv, sdcMan),
|
||||||
eventStore(objects::EVENT_STORE, "event", RolloverInterval::HOURLY, 1, currentTv, sdcMan),
|
okStore(objects::OK_STORE, "event", RolloverInterval::MINUTELY, 30, currentTv, sdcMan),
|
||||||
|
notOkStore(objects::NOT_OK_STORE, "event", RolloverInterval::MINUTELY, 30, currentTv, sdcMan),
|
||||||
sdcMan(sdcMan) {
|
sdcMan(sdcMan) {
|
||||||
Clock::getClock_timeval(¤tTv);
|
Clock::getClock_timeval(¤tTv);
|
||||||
Clock::getUptime(&lastTvUpdate);
|
Clock::getUptime(&lastTvUpdate);
|
||||||
miscStore.addApid(config::EIVE_PUS_APID);
|
miscStore.addApid(config::EIVE_PUS_APID);
|
||||||
miscStore.addService(17);
|
miscStore.addService(17);
|
||||||
eventStore.addApid(config::EIVE_PUS_APID);
|
okStore.addApid(config::EIVE_PUS_APID);
|
||||||
eventStore.addService(5);
|
okStore.addServiceSubservice(5, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
PusTmFunnel::~PusTmFunnel() = default;
|
PusTmFunnel::~PusTmFunnel() = default;
|
||||||
@ -72,11 +73,11 @@ ReturnValue_t PusTmFunnel::handlePacket(TmTcMessage &message) {
|
|||||||
if (sdcMan.isSdCardUsable(std::nullopt)) {
|
if (sdcMan.isSdCardUsable(std::nullopt)) {
|
||||||
if (not storesInitialized) {
|
if (not storesInitialized) {
|
||||||
miscStore.updateBaseDir();
|
miscStore.updateBaseDir();
|
||||||
eventStore.updateBaseDir();
|
okStore.updateBaseDir();
|
||||||
storesInitialized = true;
|
storesInitialized = true;
|
||||||
}
|
}
|
||||||
miscStore.passPacket(packet);
|
miscStore.passPacket(packet);
|
||||||
eventStore.passPacket(packet);
|
okStore.passPacket(packet);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (unsigned int idx = 0; idx < destinations.size(); idx++) {
|
for (unsigned int idx = 0; idx < destinations.size(); idx++) {
|
||||||
@ -115,7 +116,7 @@ const char *PusTmFunnel::getName() const { return "PUS TM Funnel"; }
|
|||||||
ReturnValue_t PusTmFunnel::initialize() {
|
ReturnValue_t PusTmFunnel::initialize() {
|
||||||
if (not storesInitialized and sdcMan.isSdCardUsable(std::nullopt)) {
|
if (not storesInitialized and sdcMan.isSdCardUsable(std::nullopt)) {
|
||||||
miscStore.updateBaseDir();
|
miscStore.updateBaseDir();
|
||||||
eventStore.updateBaseDir();
|
okStore.updateBaseDir();
|
||||||
storesInitialized = true;
|
storesInitialized = true;
|
||||||
}
|
}
|
||||||
return returnvalue::OK;
|
return returnvalue::OK;
|
||||||
|
@ -43,7 +43,8 @@ class PusTmFunnel : public TmFunnelBase {
|
|||||||
timeval currentTv{};
|
timeval currentTv{};
|
||||||
timeval lastTvUpdate{};
|
timeval lastTvUpdate{};
|
||||||
TmStore miscStore;
|
TmStore miscStore;
|
||||||
TmStore eventStore;
|
TmStore okStore;
|
||||||
|
TmStore notOkStore;
|
||||||
SdCardMountedIF &sdcMan;
|
SdCardMountedIF &sdcMan;
|
||||||
|
|
||||||
ReturnValue_t handlePacket(TmTcMessage &message);
|
ReturnValue_t handlePacket(TmTcMessage &message);
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
#include <cinttypes>
|
#include <cinttypes>
|
||||||
#include <filesystem>
|
#include <filesystem>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
|
#include <utility>
|
||||||
|
|
||||||
using namespace returnvalue;
|
using namespace returnvalue;
|
||||||
|
|
||||||
@ -151,7 +152,7 @@ void TmStore::assignAndOrCreateMostRecentFile() {
|
|||||||
|
|
||||||
void TmStore::addApid(uint16_t apid) {
|
void TmStore::addApid(uint16_t apid) {
|
||||||
if (not filter.apid) {
|
if (not filter.apid) {
|
||||||
filter.apid = std::vector<uint16_t>(apid);
|
filter.apid = std::vector<uint16_t>({apid});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
filter.apid.value().push_back(apid);
|
filter.apid.value().push_back(apid);
|
||||||
@ -159,7 +160,15 @@ void TmStore::addApid(uint16_t apid) {
|
|||||||
|
|
||||||
void TmStore::addService(uint8_t service) {
|
void TmStore::addService(uint8_t service) {
|
||||||
if (not filter.services) {
|
if (not filter.services) {
|
||||||
filter.services = std::vector<uint8_t>(service);
|
filter.services = std::vector<uint8_t>({service});
|
||||||
}
|
}
|
||||||
filter.services.value().push_back(service);
|
filter.services.value().push_back(service);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TmStore::addServiceSubservice(uint8_t service, uint8_t subservice) {
|
||||||
|
if (not filter.serviceSubservices) {
|
||||||
|
filter.serviceSubservices =
|
||||||
|
std::vector<std::pair<uint8_t, uint8_t>>({std::pair(service, subservice)});
|
||||||
|
}
|
||||||
|
filter.serviceSubservices.value().push_back({service, subservice});
|
||||||
|
}
|
||||||
|
@ -24,6 +24,7 @@ class TmStore : public SystemObject {
|
|||||||
|
|
||||||
void addApid(uint16_t apid);
|
void addApid(uint16_t apid);
|
||||||
void addService(uint8_t service);
|
void addService(uint8_t service);
|
||||||
|
void addServiceSubservice(uint8_t service, uint8_t subservice);
|
||||||
|
|
||||||
void updateBaseDir();
|
void updateBaseDir();
|
||||||
ReturnValue_t passPacket(PusTmReader& reader);
|
ReturnValue_t passPacket(PusTmReader& reader);
|
||||||
|
Loading…
Reference in New Issue
Block a user