2022-10-21 11:51:44 +02:00
|
|
|
#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>
|
2023-03-09 11:46:13 +01:00
|
|
|
#include <mission/tmtc/PusTmRouteByFilterHelper.h>
|
2022-11-02 10:26:45 +01:00
|
|
|
#include <mission/tmtc/TmFunnelBase.h>
|
|
|
|
|
2023-06-25 12:41:20 +02:00
|
|
|
#include <atomic>
|
|
|
|
#include <map>
|
2022-11-02 10:26:45 +01:00
|
|
|
#include <vector>
|
2022-10-21 11:51:44 +02:00
|
|
|
|
2023-02-07 12:23:00 +01:00
|
|
|
#include "PersistentTmStore.h"
|
2023-02-20 16:12:56 +01:00
|
|
|
#include "fsfw/ipc/CommandMessage.h"
|
2022-10-21 11:51:44 +02:00
|
|
|
#include "fsfw/timemanager/TimeReaderIF.h"
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief TM Recipient.
|
|
|
|
* @details
|
2022-12-14 10:54:18 +01:00
|
|
|
* Main telemetry receiver. All generated telemetry is funneled into this object.
|
2022-10-21 11:51:44 +02:00
|
|
|
* @ingroup utility
|
2022-10-21 11:54:14 +02:00
|
|
|
* @author J. Meier, R. Mueller
|
2022-10-21 11:51:44 +02:00
|
|
|
*/
|
2022-11-02 10:26:45 +01:00
|
|
|
class PusTmFunnel : public TmFunnelBase {
|
2022-10-21 11:51:44 +02:00
|
|
|
public:
|
2023-03-10 16:49:12 +01:00
|
|
|
PusTmFunnel(TmFunnelBase::FunnelCfg cfg, StorageManagerIF &ramToFileStore,
|
2023-06-25 12:41:20 +02:00
|
|
|
TimeReaderIF &timeReader);
|
2022-10-21 11:51:44 +02:00
|
|
|
[[nodiscard]] const char *getName() const override;
|
|
|
|
~PusTmFunnel() override;
|
|
|
|
|
|
|
|
ReturnValue_t performOperation(uint8_t operationCode);
|
2023-03-09 01:32:27 +01:00
|
|
|
void addPersistentTmStoreRouting(PusPacketFilter filter, MessageQueueId_t dest);
|
2022-10-21 11:51:44 +02:00
|
|
|
|
|
|
|
private:
|
2022-12-13 15:35:39 +01:00
|
|
|
// Update TV stamp every 5 minutes
|
|
|
|
static constexpr dur_millis_t TV_UPDATE_INTERVAL_SECS = 60 * 5;
|
|
|
|
|
2023-06-25 12:41:20 +02:00
|
|
|
std::map<uint8_t, uint16_t> msgCounterMap;
|
2023-03-10 16:49:12 +01:00
|
|
|
StorageManagerIF &ramToFileStore;
|
2022-10-21 11:51:44 +02:00
|
|
|
TimeReaderIF &timeReader;
|
2022-12-13 14:38:30 +01:00
|
|
|
bool storesInitialized = false;
|
2023-03-09 11:46:13 +01:00
|
|
|
PusTmRouteByFilterHelper persistentTmMap;
|
2022-11-02 10:26:45 +01:00
|
|
|
|
2023-02-08 17:43:43 +01:00
|
|
|
ReturnValue_t handleTmPacket(TmTcMessage &message);
|
2022-10-21 11:51:44 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // FSFW_EXAMPLE_COMMON_PUSTMFUNNEL_H
|