From e0837683fef1500ea2954f5307927e90432d979e Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 8 Sep 2022 16:26:47 +0200 Subject: [PATCH] start instantiating CFDP components --- bsp_hosted/core/CfdpHandler.cpp | 5 +++-- bsp_hosted/core/CfdpHandler.h | 11 +++++++---- bsp_hosted/core/ObjectFactory.cpp | 22 +++++++++++++++++----- example_common | 2 +- fsfw | 2 +- 5 files changed, 29 insertions(+), 13 deletions(-) diff --git a/bsp_hosted/core/CfdpHandler.cpp b/bsp_hosted/core/CfdpHandler.cpp index 3d76007..ee0849b 100644 --- a/bsp_hosted/core/CfdpHandler.cpp +++ b/bsp_hosted/core/CfdpHandler.cpp @@ -11,8 +11,9 @@ using namespace cfdp; CfdpHandler::CfdpHandler(const FsfwHandlerParams& fsfwParams, const CfdpHandlerCfg& cfdpCfg) : SystemObject(fsfwParams.objectId), UserBase(fsfwParams.vfs), - destHandler(DestHandlerParams(cfdpCfg.cfg, *this, cfdpCfg.remoteCfgProvider, - cfdpCfg.packetInfoList, cfdpCfg.lostSegmentsList), + destHandler(DestHandlerParams(LocalEntityCfg(cfdpCfg.id, cfdpCfg.indicCfg, *this), *this, + cfdpCfg.remoteCfgProvider, cfdpCfg.packetInfoList, + cfdpCfg.lostSegmentsList), FsfwParams(fsfwParams.packetDest, nullptr, this, fsfwParams.tcStore, fsfwParams.tmStore)) { // TODO: Make queue params configurable, or better yet, expect it to be passed externally diff --git a/bsp_hosted/core/CfdpHandler.h b/bsp_hosted/core/CfdpHandler.h index 38dc8b6..b9bb706 100644 --- a/bsp_hosted/core/CfdpHandler.h +++ b/bsp_hosted/core/CfdpHandler.h @@ -21,15 +21,17 @@ struct FsfwHandlerParams { }; struct CfdpHandlerCfg { - CfdpHandlerCfg(cfdp::LocalEntityCfg cfg, cfdp::PacketInfoListBase& packetInfo, - cfdp::LostSegmentsListBase& lostSegmentsList, + CfdpHandlerCfg(cfdp::EntityId localId, cfdp::IndicationCfg indicationCfg, + cfdp::PacketInfoListBase& packetInfo, cfdp::LostSegmentsListBase& lostSegmentsList, cfdp::RemoteConfigTableIF& remoteCfgProvider) - : cfg(std::move(cfg)), + : id(std::move(localId)), + indicCfg(indicationCfg), packetInfoList(packetInfo), lostSegmentsList(lostSegmentsList), remoteCfgProvider(remoteCfgProvider) {} - cfdp::LocalEntityCfg cfg; + cfdp::EntityId id; + cfdp::IndicationCfg indicCfg; cfdp::PacketInfoListBase& packetInfoList; cfdp::LostSegmentsListBase& lostSegmentsList; cfdp::RemoteConfigTableIF& remoteCfgProvider; @@ -37,6 +39,7 @@ struct CfdpHandlerCfg { class CfdpHandler : public SystemObject, public cfdp::UserBase, + public cfdp::FaultHandlerBase, public ExecutableObjectIF, public AcceptsTelecommandsIF { public: diff --git a/bsp_hosted/core/ObjectFactory.cpp b/bsp_hosted/core/ObjectFactory.cpp index ce7e7e5..b2d592d 100644 --- a/bsp_hosted/core/ObjectFactory.cpp +++ b/bsp_hosted/core/ObjectFactory.cpp @@ -1,14 +1,15 @@ #include "ObjectFactory.h" +#include "CfdpHandler.h" #include "OBSWConfig.h" #include "bsp_hosted/fsfwconfig/objects/systemObjectList.h" -#include "bsp_hosted/fsfwconfig/tmtc/apid.h" #include "commonConfig.h" #include "example/core/GenericFactory.h" #include "example/test/FsfwTestTask.h" #include "example/utility/TmFunnel.h" #include "fsfw/storagemanager/PoolManager.h" #include "fsfw/tmtcservices/CommandingServiceBase.h" +#include "fsfw_hal/host/HostFilesystem.h" #if OBSW_USE_TCP_SERVER == 0 #include @@ -20,18 +21,19 @@ void ObjectFactory::produce(void* args) { Factory::setStaticFrameworkObjectIds(); - + StorageManagerIF* tcStore = nullptr; + StorageManagerIF* tmStore = nullptr; #if OBSW_ADD_CORE_COMPONENTS == 1 { LocalPool::LocalPoolConfig poolCfg = {{16, 100}, {32, 50}, {64, 40}, {128, 30}, {1024, 20}, {2048, 10}}; - new PoolManager(objects::TC_STORE, poolCfg); + tcStore = new PoolManager(objects::TC_STORE, poolCfg); } { LocalPool::LocalPoolConfig poolCfg = {{16, 100}, {32, 50}, {64, 40}, {128, 30}, {1024, 20}, {2048, 10}}; - new PoolManager(objects::TM_STORE, poolCfg); + tmStore = new PoolManager(objects::TM_STORE, poolCfg); } { @@ -39,7 +41,8 @@ void ObjectFactory::produce(void* args) { {128, 30}, {1024, 20}, {2048, 10}}; new PoolManager(objects::IPC_STORE, poolCfg); } - ObjectFactory::produceGenericObjects(); + TmFunnel* funnel; + ObjectFactory::produceGenericObjects(&funnel); // TMTC Reception via TCP/IP socket #if OBSW_USE_TCP_SERVER == 0 auto tmtcBridge = new UdpTmTcBridge(objects::TCPIP_TMTC_BRIDGE, objects::CCSDS_DISTRIBUTOR); @@ -60,4 +63,13 @@ void ObjectFactory::produce(void* args) { periodicEvent = true; #endif new FsfwTestTask(objects::TEST_TASK, periodicEvent); + auto* hostFs = new HostFilesystem(); + FsfwHandlerParams params(objects::CFDP_HANDLER, *hostFs, *funnel, *tcStore, *tmStore); + cfdp::IndicationCfg indicationCfg; + UnsignedByteField apid(COMMON_APID); + cfdp::EntityId localId(apid); + cfdp::RemoteEntityCfg cfg; + cfdp::OneRemoteConfigProvider remoteCfgProvider(cfg); + // CfdpHandlerCfg cfg(localId, indicationCfg); + // new CfdpHandler(); } diff --git a/example_common b/example_common index bf36e7f..a36d951 160000 --- a/example_common +++ b/example_common @@ -1 +1 @@ -Subproject commit bf36e7f8f987e9c244dfd67f527b4c178fb37643 +Subproject commit a36d951209568bc750bb78e314ea4dcd14b74c62 diff --git a/fsfw b/fsfw index b73754d..34dd478 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit b73754dfd62ec61410160beca8562a558c6e89cc +Subproject commit 34dd478848cc43bf9520d366207f20bdfe2c4962