now only scheduling is left
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:
35
mission/tmtc/TmStoreTaskBase.cpp
Normal file
35
mission/tmtc/TmStoreTaskBase.cpp
Normal file
@ -0,0 +1,35 @@
|
||||
#include "TmStoreTaskBase.h"
|
||||
|
||||
TmStoreTaskBase::TmStoreTaskBase(object_id_t objectId, StorageManagerIF& ipcStore,
|
||||
VirtualChannel& channel)
|
||||
: SystemObject(objectId), ipcStore(ipcStore), channel(channel) {}
|
||||
|
||||
bool TmStoreTaskBase::handleOneStore(PersistentTmStoreWithTmQueue& store) {
|
||||
bool tmToStoreReceived = true;
|
||||
bool tcRequestReceived = true;
|
||||
bool dumpsPerformed = false;
|
||||
// Store TM persistently
|
||||
ReturnValue_t result = store.handleNextTm();
|
||||
if (result == MessageQueueIF::NO_QUEUE) {
|
||||
tmToStoreReceived = false;
|
||||
}
|
||||
// Handle TC requests, for example deletion or retrieval requests.
|
||||
result = store.handleCommandQueue(ipcStore);
|
||||
if (result == MessageQueueIF::NO_QUEUE) {
|
||||
tcRequestReceived = false;
|
||||
}
|
||||
// Dump TMs when applicable
|
||||
if (store.getState() == PersistentTmStore::State::DUMPING) {
|
||||
size_t dumpedLen;
|
||||
// TODO: Maybe do a bit of a delay every 100-200 packets?
|
||||
// TODO: handle returnvalue?
|
||||
result = store.dumpNextPacket(channel, dumpedLen);
|
||||
if (result == returnvalue::OK) {
|
||||
dumpsPerformed = true;
|
||||
}
|
||||
}
|
||||
if (tcRequestReceived or tmToStoreReceived or dumpsPerformed) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
Reference in New Issue
Block a user