diff --git a/bsp_hosted/core/CMakeLists.txt b/bsp_hosted/core/CMakeLists.txt index 5edc79a..f8167bd 100644 --- a/bsp_hosted/core/CMakeLists.txt +++ b/bsp_hosted/core/CMakeLists.txt @@ -1 +1,2 @@ -target_sources(${TARGET_NAME} PRIVATE InitMission.cpp ObjectFactory.cpp) +target_sources(${TARGET_NAME} PRIVATE InitMission.cpp ObjectFactory.cpp + CfdpHandler.cpp) diff --git a/bsp_hosted/core/CfdpHandler.cpp b/bsp_hosted/core/CfdpHandler.cpp new file mode 100644 index 0000000..61d0b9b --- /dev/null +++ b/bsp_hosted/core/CfdpHandler.cpp @@ -0,0 +1,29 @@ +#include "CfdpHandler.h" + +#include "fsfw/ipc/QueueFactory.h" + +using namespace returnvalue; +CfdpHandler::CfdpHandler(object_id_t objectId, AcceptsTelemetryIF& packetDest, + const cfdp::DestHandlerParams& destParams) + : SystemObject(objectId), destHandler(destParams, cfdp::FsfwParams(packetDest, nullptr, this)) { + // TODO: Make configurable? + msgQueue = QueueFactory::instance()->createMessageQueue(); + destHandler.setMsgQueue(*msgQueue); +} + +[[nodiscard]] const char* CfdpHandler::getName() const { return "CFDP Handler"; } + +[[nodiscard]] uint32_t CfdpHandler::getIdentifier() const { return 0; } + +[[nodiscard]] MessageQueueId_t CfdpHandler::getRequestQueue() const { + // TODO: return TC queue here + return 0; +} + +ReturnValue_t CfdpHandler::initialize() { + ReturnValue_t result = destHandler.initialize(); + if (result != OK) { + return result; + } + return SystemObject::initialize(); +} diff --git a/bsp_hosted/core/CfdpHandler.h b/bsp_hosted/core/CfdpHandler.h new file mode 100644 index 0000000..e3e4297 --- /dev/null +++ b/bsp_hosted/core/CfdpHandler.h @@ -0,0 +1,23 @@ +#ifndef FSFW_EXAMPLE_HOSTED_CFDPHANDLER_H +#define FSFW_EXAMPLE_HOSTED_CFDPHANDLER_H + +#include "fsfw/cfdp/handler/DestHandler.h" +#include "fsfw/objectmanager/SystemObject.h" +#include "fsfw/tmtcservices/AcceptsTelecommandsIF.h" + +class CfdpHandler : public SystemObject, public AcceptsTelecommandsIF { + public: + CfdpHandler(object_id_t objectId, AcceptsTelemetryIF& packetDest, + const cfdp::DestHandlerParams& destParams); + [[nodiscard]] const char* getName() const override; + [[nodiscard]] uint32_t getIdentifier() const override; + [[nodiscard]] MessageQueueId_t getRequestQueue() const override; + + ReturnValue_t initialize() override; + + private: + MessageQueueIF* msgQueue = nullptr; + cfdp::DestHandler destHandler; +}; + +#endif // FSFW_EXAMPLE_HOSTED_CFDPHANDLER_H diff --git a/example_common b/example_common index 4ae9f5c..bf36e7f 160000 --- a/example_common +++ b/example_common @@ -1 +1 @@ -Subproject commit 4ae9f5c74622ded292dd9f5e8ad130fb2e8c7a2f +Subproject commit bf36e7f8f987e9c244dfd67f527b4c178fb37643 diff --git a/fsfw b/fsfw index 8971eb3..11a4b27 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 8971eb386ed8985fcfb5eb6aa1dc157b20c2d897 +Subproject commit 11a4b276423ac287f5522cdbf913a81e1ee3d347