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>
|
2023-03-09 12:20:13 +01:00
|
|
|
#include <fsfw/tmtcservices/TmTcMessage.h>
|
2023-03-09 11:46:13 +01:00
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
class PusLiveDemux {
|
|
|
|
public:
|
|
|
|
PusLiveDemux(MessageQueueIF& ownerQueue);
|
|
|
|
ReturnValue_t demultiplexPackets(StorageManagerIF& tmStore, store_address_t origStoreId,
|
|
|
|
const uint8_t* tmData, size_t tmSize);
|
|
|
|
|
2023-09-11 20:16:54 +02:00
|
|
|
uint32_t addDestinationByRawId(const char* name, MessageQueueId_t downlinkDestination,
|
|
|
|
uint8_t vcid = 0);
|
2023-09-11 19:23:48 +02:00
|
|
|
uint32_t addDestination(const char* name, const AcceptsTelemetryIF& downlinkDestination,
|
2023-09-11 19:27:39 +02:00
|
|
|
uint8_t vcid = 0);
|
2023-09-11 19:23:48 +02:00
|
|
|
void setDestFull(uint32_t listIndex);
|
|
|
|
void setDestAvailable(uint32_t listIndex);
|
2023-03-09 11:46:13 +01:00
|
|
|
|
|
|
|
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;
|
2023-09-11 19:23:48 +02:00
|
|
|
bool isFull = false;
|
2023-03-09 11:46:13 +01:00
|
|
|
uint8_t virtualChannel = 0;
|
|
|
|
};
|
|
|
|
|
|
|
|
MessageQueueIF& ownerQueue;
|
|
|
|
TmTcMessage message;
|
|
|
|
std::vector<Destination> destinations;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* MISSION_TMTC_PUSLIVEDEMUX_H_ */
|