51 lines
1.7 KiB
C++
51 lines
1.7 KiB
C++
#ifndef MISSION_TMTC_TMFUNNELBASE_H_
|
|
#define MISSION_TMTC_TMFUNNELBASE_H_
|
|
|
|
#include <fsfw/objectmanager/SystemObject.h>
|
|
#include <fsfw/storagemanager/StorageManagerIF.h>
|
|
#include <fsfw/tmstorage/TmStoreFrontendSimpleIF.h>
|
|
#include <fsfw/tmtcservices/AcceptsTelemetryIF.h>
|
|
#include <fsfw/tmtcservices/TmTcMessage.h>
|
|
|
|
#include <vector>
|
|
|
|
class TmFunnelBase : public AcceptsTelemetryIF, public SystemObject {
|
|
public:
|
|
struct FunnelCfg {
|
|
FunnelCfg(object_id_t objId, StorageManagerIF& tmStore, StorageManagerIF& ipcStore,
|
|
uint32_t tmMsgDepth)
|
|
: objectId(objId), tmStore(tmStore), ipcStore(ipcStore), tmMsgDepth(tmMsgDepth) {}
|
|
object_id_t objectId;
|
|
StorageManagerIF& tmStore;
|
|
StorageManagerIF& ipcStore;
|
|
uint32_t tmMsgDepth;
|
|
};
|
|
explicit TmFunnelBase(FunnelCfg cfg);
|
|
void addDestination(const char* name, const AcceptsTelemetryIF& downlinkDestination,
|
|
uint8_t vcid = 0);
|
|
ReturnValue_t sendPacketToDestinations(store_address_t origStoreId, TmTcMessage& message,
|
|
const uint8_t* packetData, size_t size);
|
|
[[nodiscard]] MessageQueueId_t getReportReceptionQueue(uint8_t virtualChannel) const override;
|
|
|
|
~TmFunnelBase() override;
|
|
|
|
protected:
|
|
StorageManagerIF& tmStore;
|
|
StorageManagerIF& ipcStore;
|
|
|
|
struct Destination {
|
|
Destination(const char* name, MessageQueueId_t queueId, uint8_t virtualChannel)
|
|
: name(name), queueId(queueId), virtualChannel(virtualChannel) {}
|
|
|
|
const char* name;
|
|
MessageQueueId_t queueId;
|
|
uint8_t virtualChannel = 0;
|
|
};
|
|
|
|
std::vector<Destination> destinations;
|
|
|
|
MessageQueueIF* tmQueue = nullptr;
|
|
};
|
|
|
|
#endif /* MISSION_TMTC_TMFUNNELBASE_H_ */
|