From 081836621790614f3b44cf10fa8c7186d28eb2cf Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 8 Sep 2022 17:39:16 +0200 Subject: [PATCH] create and schedule CFDP components --- config/commonConfig.h.in | 1 + example/core/GenericFactory.cpp | 10 +++++++++- example/core/GenericFactory.h | 4 +++- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/config/commonConfig.h.in b/config/commonConfig.h.in index fa5f6aa..79e6db3 100644 --- a/config/commonConfig.h.in +++ b/config/commonConfig.h.in @@ -18,6 +18,7 @@ //! Add core components for the FSFW and for TMTC communication #define OBSW_ADD_CORE_COMPONENTS 1 +#define OBSW_ADD_CFDP_COMPONENTS 1 //! Add the PUS service stack #define OBSW_ADD_PUS_STACK 1 diff --git a/example/core/GenericFactory.cpp b/example/core/GenericFactory.cpp index e671799..7497442 100644 --- a/example/core/GenericFactory.cpp +++ b/example/core/GenericFactory.cpp @@ -6,10 +6,12 @@ #include "example/test/FsfwReaderTask.h" #include "example/utility/TmFunnel.h" #include "fsfw/FSFW.h" +#include "fsfw/cfdp/CfdpDistributor.h" #include "fsfw/devicehandlers/CookieIF.h" #include "fsfw/events/EventManager.h" #include "fsfw/health/HealthTable.h" #include "fsfw/internalerror/InternalErrorReporter.h" +#include "fsfw/ipc/QueueFactory.h" #include "fsfw/pus/CService200ModeCommanding.h" #include "fsfw/pus/Service11TelecommandScheduling.h" #include "fsfw/pus/Service17Test.h" @@ -34,7 +36,7 @@ #include "objects/systemObjectList.h" #include "tmtc/apid.h" -void ObjectFactory::produceGenericObjects(TmFunnel **tmFunnel) { +void ObjectFactory::produceGenericObjects(TmFunnel **tmFunnel, StorageManagerIF &tcStore) { #if OBSW_ADD_CORE_COMPONENTS == 1 /* Framework objects */ new EventManager(objects::EVENT_MANAGER); @@ -72,6 +74,12 @@ void ObjectFactory::produceGenericObjects(TmFunnel **tmFunnel) { pus::PUS_SERVICE_200); #endif /* OBSW_ADD_PUS_STACK == 1 */ +#if OBSW_ADD_CFDP_COMPONENTS == 1 + MessageQueueIF *cfdpMsgQueue = QueueFactory::instance()->createMessageQueue(5); + CfdpDistribCfg cfg(objects::CFDP_DISTRIBUTOR, tcStore, cfdpMsgQueue); + new CfdpDistributor(cfg); +#endif + #if OBSW_ADD_TASK_EXAMPLE == 1 /* Demo objects */ new FsfwExampleTask(objects::TEST_DUMMY_1); diff --git a/example/core/GenericFactory.h b/example/core/GenericFactory.h index dfbfbf0..f51b20e 100644 --- a/example/core/GenericFactory.h +++ b/example/core/GenericFactory.h @@ -3,6 +3,8 @@ #include +#include "fsfw/storagemanager/StorageManagerIF.h" + class TmFunnel; namespace ObjectFactory { @@ -11,7 +13,7 @@ namespace ObjectFactory { * @brief Produce hardware independant objects. Called by bsp specific * object factory. */ -void produceGenericObjects(TmFunnel** funnel); +void produceGenericObjects(TmFunnel** funnel, StorageManagerIF& tcStore); } // namespace ObjectFactory