eive-obsw/mission/tmtc/PusTmFunnel.h

51 lines
1.5 KiB
C++

#ifndef FSFW_EXAMPLE_COMMON_PUSTMFUNNEL_H
#define FSFW_EXAMPLE_COMMON_PUSTMFUNNEL_H
#include <fsfw/ipc/MessageQueueIF.h>
#include <fsfw/objectmanager/SystemObject.h>
#include <fsfw/tasks/ExecutableObjectIF.h>
#include <fsfw/tmtcservices/AcceptsTelemetryIF.h>
#include <fsfw/tmtcservices/TmTcMessage.h>
#include <mission/tmtc/PusTmRouteByFilterHelper.h>
#include <mission/tmtc/TmFunnelBase.h>
#include <atomic>
#include <map>
#include <vector>
#include "PersistentTmStore.h"
#include "fsfw/ipc/CommandMessage.h"
#include "fsfw/timemanager/TimeReaderIF.h"
/**
* @brief TM Recipient.
* @details
* Main telemetry receiver. All generated telemetry is funneled into this object.
* @ingroup utility
* @author J. Meier, R. Mueller
*/
class PusTmFunnel : public TmFunnelBase {
public:
PusTmFunnel(TmFunnelBase::FunnelCfg cfg, StorageManagerIF &ramToFileStore,
TimeReaderIF &timeReader);
[[nodiscard]] const char *getName() const override;
~PusTmFunnel() override;
ReturnValue_t performOperation(uint8_t operationCode);
void addPersistentTmStoreRouting(PusPacketFilter filter, MessageQueueId_t dest);
private:
// Update TV stamp every 5 minutes
static constexpr dur_millis_t TV_UPDATE_INTERVAL_SECS = 60 * 5;
std::map<uint8_t, uint16_t> msgCounterMap;
StorageManagerIF &ramToFileStore;
TimeReaderIF &timeReader;
bool storesInitialized = false;
PusTmRouteByFilterHelper persistentTmMap;
ReturnValue_t handleTmPacket(TmTcMessage &message);
};
#endif // FSFW_EXAMPLE_COMMON_PUSTMFUNNEL_H