continue TM handling refactoring
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:
28
mission/tmtc/PersistentTmStoreWithTmQueue.cpp
Normal file
28
mission/tmtc/PersistentTmStoreWithTmQueue.cpp
Normal file
@ -0,0 +1,28 @@
|
||||
#include "PersistentTmStoreWithTmQueue.h"
|
||||
|
||||
#include <fsfw/ipc/QueueFactory.h>
|
||||
#include <fsfw/tmtcservices/TmTcMessage.h>
|
||||
|
||||
PersistentTmStoreWithTmQueue::PersistentTmStoreWithTmQueue(StorageManagerIF& tmStore,
|
||||
PersistentTmStore& persistentTmStore,
|
||||
uint32_t tmQueueDepth)
|
||||
: tmStore(tmStore), persistentTmStore(persistentTmStore) {
|
||||
tmQueue = QueueFactory::instance()->createMessageQueue(tmQueueDepth);
|
||||
}
|
||||
|
||||
ReturnValue_t PersistentTmStoreWithTmQueue::handleNextTm() {
|
||||
TmTcMessage msg;
|
||||
ReturnValue_t result = tmQueue->receiveMessage(&msg);
|
||||
if (result == MessageQueueIF::EMPTY) {
|
||||
return result;
|
||||
}
|
||||
auto accessor = tmStore.getData(msg.getStorageId());
|
||||
if (accessor.first != returnvalue::OK) {
|
||||
return result;
|
||||
}
|
||||
PusTmReader reader(accessor.second.data(), accessor.second.size());
|
||||
persistentTmStore.storePacket(reader);
|
||||
return returnvalue::OK;
|
||||
}
|
||||
|
||||
PersistentTmStore& PersistentTmStoreWithTmQueue::getTmStore() { return persistentTmStore; }
|
Reference in New Issue
Block a user