eive-obsw/mission/tmtc/PusLiveDemux.h

35 lines
1.0 KiB
C
Raw Normal View History

2023-03-09 11:46:13 +01:00
#ifndef MISSION_TMTC_PUSLIVEDEMUX_H_
#define MISSION_TMTC_PUSLIVEDEMUX_H_
#include <fsfw/ipc/messageQueueDefinitions.h>
#include <fsfw/storagemanager/StorageManagerIF.h>
#include <fsfw/tmtcservices/AcceptsTelemetryIF.h>
#include <vector>
class PusLiveDemux {
public:
PusLiveDemux(MessageQueueIF& ownerQueue);
ReturnValue_t demultiplexPackets(StorageManagerIF& tmStore, store_address_t origStoreId,
const uint8_t* tmData, size_t tmSize);
void addDestination(const char* name, const AcceptsTelemetryIF& downlinkDestination,
uint8_t vcid = 0);
private:
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;
};
MessageQueueIF& ownerQueue;
TmTcMessage message;
std::vector<Destination> destinations;
};
#endif /* MISSION_TMTC_PUSLIVEDEMUX_H_ */