diff --git a/CMakeLists.txt b/CMakeLists.txt index 43336bdd..831a7064 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -210,6 +210,7 @@ set(LIB_JSON_PATH ${THIRD_PARTY_FOLDER}/json) set(FSFW_WARNING_SHADOW_LOCAL_GCC OFF) set(EIVE_ADD_LINUX_FILES False) +set(FSFW_ADD_TMSTORAGE ON) # Analyse different OS and architecture/target options, determine BSP_PATH, # display information about compiler etc. diff --git a/fsfw b/fsfw index 56e8e5a8..096af44e 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 56e8e5a8b34dee6fcf240111618109e53b77841f +Subproject commit 096af44e39c4a94b17ee051fbdf907ddb3026a00 diff --git a/mission/tmtc/CMakeLists.txt b/mission/tmtc/CMakeLists.txt index d8dd4e1c..0f77efcd 100644 --- a/mission/tmtc/CMakeLists.txt +++ b/mission/tmtc/CMakeLists.txt @@ -6,4 +6,4 @@ target_sources( CfdpTmFunnel.cpp PusTmFunnel.cpp Service15TmStorage.cpp - TmStoreBackend.cpp) + TmStore.cpp) diff --git a/mission/tmtc/TmStore.cpp b/mission/tmtc/TmStore.cpp new file mode 100644 index 00000000..f0940ef0 --- /dev/null +++ b/mission/tmtc/TmStore.cpp @@ -0,0 +1,32 @@ +#include "TmStore.h" + +using namespace returnvalue; + +const char* TmStore::getName() const { return "TM Store Backend"; } + +MessageQueueId_t TmStore::getReportReceptionQueue(uint8_t virtualChannel) const { + return MessageQueueIF::NO_QUEUE; +} + +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; } diff --git a/mission/tmtc/TmStore.h b/mission/tmtc/TmStore.h new file mode 100644 index 00000000..870072d1 --- /dev/null +++ b/mission/tmtc/TmStore.h @@ -0,0 +1,44 @@ +#ifndef MISSION_TMTC_TMSTOREBACKEND_H_ +#define MISSION_TMTC_TMSTOREBACKEND_H_ + +#include +#include + +class TmStore : public TmStoreFrontendIF, public AcceptsTelemetryIF { + public: + [[nodiscard]] const char* getName() const override; + [[nodiscard]] MessageQueueId_t getReportReceptionQueue(uint8_t virtualChannel) const override; + + private: + /** + * To get the queue where commands shall be sent. + * @return Id of command queue. + */ + MessageQueueId_t getCommandQueue() const override; + + TmStoreBackendIF* getBackend() const override; + + /** + * 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; +}; + +#endif /* MISSION_TMTC_TMSTOREBACKEND_H_ */ diff --git a/mission/tmtc/TmStoreBackend.cpp b/mission/tmtc/TmStoreBackend.cpp deleted file mode 100644 index 4362609d..00000000 --- a/mission/tmtc/TmStoreBackend.cpp +++ /dev/null @@ -1,7 +0,0 @@ -#include "TmStoreBackend.h" - -const char* TmStoreBackend::getName() const { return "TM Store Backend"; } - -MessageQueueId_t TmStoreBackend::getReportReceptionQueue(uint8_t virtualChannel) const { - return MessageQueueIF::NO_QUEUE; -} diff --git a/mission/tmtc/TmStoreBackend.h b/mission/tmtc/TmStoreBackend.h deleted file mode 100644 index f53b5227..00000000 --- a/mission/tmtc/TmStoreBackend.h +++ /dev/null @@ -1,14 +0,0 @@ -#ifndef MISSION_TMTC_TMSTOREBACKEND_H_ -#define MISSION_TMTC_TMSTOREBACKEND_H_ - -#include - -class TmStoreBackend : public AcceptsTelemetryIF { - public: - [[nodiscard]] const char* getName() const override; - [[nodiscard]] MessageQueueId_t getReportReceptionQueue(uint8_t virtualChannel) const override; - - private: -}; - -#endif /* MISSION_TMTC_TMSTOREBACKEND_H_ */