diff --git a/linux/fsfwconfig/FSFWConfig.h.in b/linux/fsfwconfig/FSFWConfig.h.in index 25772ce7..f3d3f0f4 100644 --- a/linux/fsfwconfig/FSFWConfig.h.in +++ b/linux/fsfwconfig/FSFWConfig.h.in @@ -42,7 +42,7 @@ //! When using the newlib nano library, C99 support for stdio facilities //! will not be provided. This define should be set to 1 if this is the case. -#define FSFW_NO_C99_IO 1 +#define FSFW_NO_C99_IO 0 //! Specify whether a special mode store is used for Subsystem components. #define FSFW_USE_MODESTORE 0 diff --git a/mission/tmtc/TmStore.cpp b/mission/tmtc/TmStore.cpp index f0940ef0..12e1f4d3 100644 --- a/mission/tmtc/TmStore.cpp +++ b/mission/tmtc/TmStore.cpp @@ -1,32 +1,14 @@ #include "TmStore.h" +#include + using namespace returnvalue; -const char* TmStore::getName() const { return "TM Store Backend"; } +TmStore::TmStore(object_id_t objectId, SdCardMountedIF& sdcMan) + : SystemObject(objectId), sdcMan(sdcMan) {} -MessageQueueId_t TmStore::getReportReceptionQueue(uint8_t virtualChannel) const { - return MessageQueueIF::NO_QUEUE; +ReturnValue_t TmStore::passPacket(PusTmReader& reader) { + return returnvalue::OK; } -MessageQueueId_t TmStore::getCommandQueue() const { return MessageQueueIF::NO_QUEUE; } - -TmStoreBackendIF* TmStore::getBackend() const { return nullptr; } - -ReturnValue_t TmStore::packetRetrieved(PusTmReader* packet, uint32_t address) { return OK; } - -void TmStore::noMorePacketsInStore() {} - -void TmStore::handleRetrievalFailed(ReturnValue_t errorCode, uint32_t parameter1, - uint32_t parameter2) {} - -ReturnValue_t TmStore::fetchPackets(ApidSsc start, ApidSsc end) { return OK; } - -ReturnValue_t TmStore::deletePackets(ApidSsc upTo) { return OK; } - -ReturnValue_t TmStore::checkPacket(SpacePacketReader* tmPacket) { return OK; } - -void TmStore::setEnabled(bool enabled) {} - -void TmStore::resetDownlinkedPacketCount() {} - -ReturnValue_t TmStore::setDumpTarget(object_id_t dumpTarget) { return OK; } +MessageQueueId_t TmStore::getCommandQueue() { return MessageQueueIF::NO_QUEUE; } diff --git a/mission/tmtc/TmStore.h b/mission/tmtc/TmStore.h index 870072d1..015feef6 100644 --- a/mission/tmtc/TmStore.h +++ b/mission/tmtc/TmStore.h @@ -1,44 +1,38 @@ #ifndef MISSION_TMTC_TMSTOREBACKEND_H_ #define MISSION_TMTC_TMSTOREBACKEND_H_ +#include + +#include #include +#include #include -class TmStore : public TmStoreFrontendIF, public AcceptsTelemetryIF { +struct PacketFilter { + std::optional apid; + std::optional service; + std::optional> serviceSubservice; +}; + +class TmStore : public SystemObject { public: - [[nodiscard]] const char* getName() const override; - [[nodiscard]] MessageQueueId_t getReportReceptionQueue(uint8_t virtualChannel) const override; + TmStore(object_id_t objectId, SdCardMountedIF& sdcMan); + + ReturnValue_t passPacket(PusTmReader& reader); private: /** * To get the queue where commands shall be sent. * @return Id of command queue. */ - MessageQueueId_t getCommandQueue() const override; + MessageQueueId_t getCommandQueue(); - TmStoreBackendIF* getBackend() const override; + SdCardMountedIF& sdcMan; - /** - * Callback from the back-end to indicate a certain packet was received. - * front-end takes care of discarding/downloading the packet. - * @param packet Pointer to the newly received Space Packet. - * @param address Start address of the packet found - * @param isLastPacket Indicates if no more packets can be fetched. - * @return If more packets shall be fetched, returnvalue::OK must be returned. - * Any other code stops fetching packets. - */ - ReturnValue_t packetRetrieved(PusTmReader* packet, uint32_t address) override; - void noMorePacketsInStore() override; - void handleRetrievalFailed(ReturnValue_t errorCode, uint32_t parameter1 = 0, - uint32_t parameter2 = 0) override; - ReturnValue_t fetchPackets(ApidSsc start, ApidSsc end) override; - ReturnValue_t deletePackets(ApidSsc upTo) override; - ReturnValue_t checkPacket(SpacePacketReader* tmPacket) override; - bool isEnabled() const = 0; - void setEnabled(bool enabled) override; - void resetDownlinkedPacketCount() override; - ReturnValue_t setDumpTarget(object_id_t dumpTarget) override; + std::vector apidToStore; + std::vector servicesToStore; + std::vector> serviceSubserviceCombinationToStore; }; #endif /* MISSION_TMTC_TMSTOREBACKEND_H_ */