2023-03-09 01:32:27 +01:00
|
|
|
#ifndef MISSION_TMTC_PUSTMROUTER_H_
|
|
|
|
#define MISSION_TMTC_PUSTMROUTER_H_
|
|
|
|
|
|
|
|
#include <fsfw/ipc/messageQueueDefinitions.h>
|
|
|
|
#include <mission/tmtc/PusPacketFilter.h>
|
|
|
|
|
2023-03-09 11:46:13 +01:00
|
|
|
/**
|
|
|
|
* Simple composition of concrecte @PusPacketFilters which also maps them to
|
|
|
|
* a destination ID.
|
|
|
|
*/
|
|
|
|
class PusTmRouteByFilterHelper {
|
2023-03-09 01:32:27 +01:00
|
|
|
public:
|
2023-03-09 11:46:13 +01:00
|
|
|
PusTmRouteByFilterHelper();
|
2023-03-09 01:32:27 +01:00
|
|
|
|
2023-03-09 11:46:13 +01:00
|
|
|
/**
|
|
|
|
* Checks whether the packet matches any of the inserted filters and returns
|
|
|
|
* the destination if it does. Currently only supports one destination.
|
|
|
|
* @param reader
|
|
|
|
* @param destination
|
|
|
|
* @return
|
|
|
|
*/
|
2023-03-09 01:32:27 +01:00
|
|
|
bool packetMatches(PusTmReader& reader, MessageQueueId_t& destination);
|
|
|
|
void addRouting(PusPacketFilter filter, MessageQueueId_t destination);
|
|
|
|
|
|
|
|
private:
|
|
|
|
std::vector<std::pair<PusPacketFilter, MessageQueueId_t>> routerMap;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* MISSION_TMTC_PUSTMROUTER_H_ */
|