eive-obsw/mission/tmtc/PusLiveDemux.h
Robin Mueller 6771d656bb
Some checks failed
EIVE/eive-obsw/pipeline/pr-main There was a failure building this commit
beautiful
2023-09-11 20:16:54 +02:00

41 lines
1.3 KiB
C++

#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 <fsfw/tmtcservices/TmTcMessage.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);
uint32_t addDestinationByRawId(const char* name, MessageQueueId_t downlinkDestination,
uint8_t vcid = 0);
uint32_t addDestination(const char* name, const AcceptsTelemetryIF& downlinkDestination,
uint8_t vcid = 0);
void setDestFull(uint32_t listIndex);
void setDestAvailable(uint32_t listIndex);
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;
bool isFull = false;
uint8_t virtualChannel = 0;
};
MessageQueueIF& ownerQueue;
TmTcMessage message;
std::vector<Destination> destinations;
};
#endif /* MISSION_TMTC_PUSLIVEDEMUX_H_ */