eive-obsw/mission/tmtc/TmFunnelBase.cpp
Robin Mueller e5636f0b6c
Some checks failed
EIVE/eive-obsw/pipeline/head There was a failure building this commit
continue rework
2023-03-09 11:46:13 +01:00

30 lines
1.0 KiB
C++

#include "TmFunnelBase.h"
#include <fsfw/tmtcservices/TmTcMessage.h>
#include "fsfw/ipc/QueueFactory.h"
TmFunnelBase::TmFunnelBase(FunnelCfg cfg)
: SystemObject(cfg.objectId),
name(cfg.name),
tmStore(cfg.tmStore),
ipcStore(cfg.ipcStore),
tmQueue(QueueFactory::instance()->createMessageQueue(cfg.tmMsgDepth)),
liveDemux(*tmQueue) {}
ReturnValue_t TmFunnelBase::demultiplexLivePackets(store_address_t origStoreId,
const uint8_t *tmData, size_t tmSize) {
return liveDemux.demultiplexPackets(tmStore, origStoreId, tmData, tmSize);
}
TmFunnelBase::~TmFunnelBase() { QueueFactory::instance()->deleteMessageQueue(tmQueue); }
MessageQueueId_t TmFunnelBase::getReportReceptionQueue(uint8_t virtualChannel) const {
return tmQueue->getId();
}
void TmFunnelBase::addLiveDestination(const char *name,
const AcceptsTelemetryIF &downlinkDestination, uint8_t vcid) {
liveDemux.addDestination(name, downlinkDestination, vcid);
}