eive-obsw/mission/tmtc/TmFunnelBase.h

56 lines
1.8 KiB
C
Raw Normal View History

#ifndef MISSION_TMTC_TMFUNNELBASE_H_
#define MISSION_TMTC_TMFUNNELBASE_H_
#include <fsfw/objectmanager/SystemObject.h>
#include <fsfw/storagemanager/StorageManagerIF.h>
2022-12-14 13:19:14 +01:00
#include <fsfw/tmstorage/TmStoreFrontendSimpleIF.h>
#include <fsfw/tmtcservices/AcceptsTelemetryIF.h>
2022-12-19 14:40:27 +01:00
#include <fsfw/tmtcservices/TmTcMessage.h>
#include <vector>
2023-02-21 20:43:16 +01:00
class TmFunnelBase : public AcceptsTelemetryIF, public SystemObject {
public:
struct FunnelCfg {
2023-03-02 17:35:36 +01:00
FunnelCfg(object_id_t objId, const char* name, StorageManagerIF& tmStore,
StorageManagerIF& ipcStore, uint32_t tmMsgDepth)
: objectId(objId),
name(name),
tmStore(tmStore),
ipcStore(ipcStore),
tmMsgDepth(tmMsgDepth) {}
object_id_t objectId;
2023-03-02 17:35:36 +01:00
const char* name;
StorageManagerIF& tmStore;
StorageManagerIF& ipcStore;
uint32_t tmMsgDepth;
};
2023-02-21 20:43:16 +01:00
explicit TmFunnelBase(FunnelCfg cfg);
2023-02-07 17:18:13 +01:00
void addDestination(const char* name, const AcceptsTelemetryIF& downlinkDestination,
uint8_t vcid = 0);
2022-12-19 14:40:27 +01:00
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;
2023-02-21 20:43:16 +01:00
~TmFunnelBase() override;
protected:
2023-03-02 17:35:36 +01:00
const char* name;
StorageManagerIF& tmStore;
2022-12-19 13:57:05 +01:00
StorageManagerIF& ipcStore;
2023-02-07 17:18:13 +01:00
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_ */