Persistent TM Store #320
@ -11,7 +11,7 @@ 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),
|
||||||
sdcMan(sdcMan) {
|
sdcMan(sdcMan) {
|
||||||
miscStore.addApid(config::EIVE_PUS_APID);
|
miscStore.addApid(config::EIVE_PUS_APID);
|
||||||
miscStore.addService(17);
|
miscStore.addService(17);
|
||||||
}
|
}
|
||||||
@ -56,8 +56,13 @@ ReturnValue_t PusTmFunnel::handlePacket(TmTcMessage &message) {
|
|||||||
sourceSequenceCount = sourceSequenceCount % ccsds::LIMIT_SEQUENCE_COUNT;
|
sourceSequenceCount = sourceSequenceCount % ccsds::LIMIT_SEQUENCE_COUNT;
|
||||||
packet.updateErrorControl();
|
packet.updateErrorControl();
|
||||||
|
|
||||||
if(sdcMan.isSdCardUsable(std::nullopt)) {
|
if (sdcMan.isSdCardUsable(std::nullopt)) {
|
||||||
miscStore.passPacket(packet);
|
if (not storesInitialized) {
|
||||||
|
miscStore.updateBaseDir();
|
||||||
|
miscStore.updateCurrentTimestamp();
|
||||||
|
storesInitialized = true;
|
||||||
|
}
|
||||||
|
miscStore.passPacket(packet);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (unsigned int idx = 0; idx < destinations.size(); idx++) {
|
for (unsigned int idx = 0; idx < destinations.size(); idx++) {
|
||||||
@ -94,7 +99,10 @@ 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() {
|
ReturnValue_t PusTmFunnel::initialize() {
|
||||||
miscStore.updateBaseDir();
|
if (not storesInitialized and sdcMan.isSdCardUsable(std::nullopt)) {
|
||||||
miscStore.updateCurrentTimestamp();
|
miscStore.updateBaseDir();
|
||||||
|
miscStore.updateCurrentTimestamp();
|
||||||
|
storesInitialized = true;
|
||||||
|
}
|
||||||
return returnvalue::OK;
|
return returnvalue::OK;
|
||||||
}
|
}
|
||||||
|
@ -36,8 +36,9 @@ class PusTmFunnel : public TmFunnelBase {
|
|||||||
private:
|
private:
|
||||||
uint16_t sourceSequenceCount = 0;
|
uint16_t sourceSequenceCount = 0;
|
||||||
TimeReaderIF &timeReader;
|
TimeReaderIF &timeReader;
|
||||||
|
bool storesInitialized = false;
|
||||||
TmStore miscStore;
|
TmStore miscStore;
|
||||||
SdCardMountedIF& sdcMan;
|
SdCardMountedIF &sdcMan;
|
||||||
|
|
||||||
ReturnValue_t handlePacket(TmTcMessage &message);
|
ReturnValue_t handlePacket(TmTcMessage &message);
|
||||||
ReturnValue_t initialize() override;
|
ReturnValue_t initialize() override;
|
||||||
|
Loading…
Reference in New Issue
Block a user