#ifndef FSFW_EXAMPLE_COMMON_PUSTMFUNNEL_H #define FSFW_EXAMPLE_COMMON_PUSTMFUNNEL_H #include #include #include #include #include #include #include #include "TmStore.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: explicit PusTmFunnel(object_id_t objectId, TimeReaderIF &timeReader, StorageManagerIF &tmStore, SdCardMountedIF &sdcMan, uint32_t tmMsgDepth, uint32_t tcMsgDepth, StorageManagerIF &ipcStore); [[nodiscard]] const char *getName() const override; ~PusTmFunnel() override; ReturnValue_t performOperation(uint8_t operationCode); private: // Update TV stamp every 5 minutes static constexpr dur_millis_t TV_UPDATE_INTERVAL_SECS = 60 * 5; uint16_t sourceSequenceCount = 0; TimeReaderIF &timeReader; bool storesInitialized = false; timeval currentTv{}; timeval lastTvUpdate{}; TmStore miscStore; TmStore okStore; TmStore notOkStore; TmStore hkStore; SdCardMountedIF &sdcMan; ReturnValue_t handlePacket(TmTcMessage &message); void initStoresIfPossible(bool sdCardUsable); ReturnValue_t initialize() override; }; #endif // FSFW_EXAMPLE_COMMON_PUSTMFUNNEL_H