#ifndef MISSION_TMTC_TMSTOREBACKEND_H_ #define MISSION_TMTC_TMSTOREBACKEND_H_ #include #include #include #include #include struct PacketFilter { std::optional> apid; std::optional> services; std::optional>> serviceSubservices; }; enum class RolloverInterval { HOURLY, DAILY }; class TmStore : public SystemObject { public: TmStore(object_id_t objectId, std::string baseName, RolloverInterval interval, uint8_t intervalFactor, PacketFilter filter, SdCardMountedIF& sdcMan); ReturnValue_t passPacket(PusTmReader& reader); ReturnValue_t storePacket(PusTmReader& reader); private: static constexpr size_t MAX_FILESIZE = 8192; /** * To get the queue where commands shall be sent. * @return Id of command queue. */ MessageQueueId_t getCommandQueue(); PacketFilter filter; std::string baseName; RolloverInterval interval; uint8_t intervalFactor; char NAME_BUF[524] = {}; std::array fileBuf{}; std::optional mostRecentFile; SdCardMountedIF& sdcMan; }; #endif /* MISSION_TMTC_TMSTOREBACKEND_H_ */