From 8aa412e865393c8342d96b74cef5752448f05043 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 16 Sep 2022 18:10:23 +0200 Subject: [PATCH] add CFDP APID to TCP parse list --- bsp_hosted/ObjectFactory.cpp | 2 +- .../fsfwconfig/events/subsystemIdRanges.h | 4 ++-- .../fsfwconfig/objects/systemObjectList.h | 4 ++-- bsp_q7s/core/InitMission.cpp | 6 +++++- common/config/commonConfig.cpp | 5 ++++- common/config/commonConfig.h.in | 1 + common/config/eive/objects.h | 1 + fsfw | 2 +- mission/cfdp/CMakeLists.txt | 1 + mission/cfdp/Config.h | 2 +- mission/core/GenericFactory.cpp | 18 +++++++++++------- tmtc | 2 +- 12 files changed, 31 insertions(+), 17 deletions(-) diff --git a/bsp_hosted/ObjectFactory.cpp b/bsp_hosted/ObjectFactory.cpp index 6172f3ed..6c85b04d 100644 --- a/bsp_hosted/ObjectFactory.cpp +++ b/bsp_hosted/ObjectFactory.cpp @@ -6,10 +6,10 @@ #include #include #include -#include "eive/definitions.h" #include #include "OBSWConfig.h" +#include "eive/definitions.h" #include "fsfw_tests/integration/task/TestTask.h" #if OBSW_USE_TMTC_TCP_BRIDGE == 0 diff --git a/bsp_hosted/fsfwconfig/events/subsystemIdRanges.h b/bsp_hosted/fsfwconfig/events/subsystemIdRanges.h index 592c3624..b99164db 100644 --- a/bsp_hosted/fsfwconfig/events/subsystemIdRanges.h +++ b/bsp_hosted/fsfwconfig/events/subsystemIdRanges.h @@ -1,10 +1,10 @@ #ifndef CONFIG_EVENTS_SUBSYSTEMIDRANGES_H_ #define CONFIG_EVENTS_SUBSYSTEMIDRANGES_H_ -#include "eive/eventSubsystemIds.h" - #include +#include "eive/eventSubsystemIds.h" + /** * These IDs are part of the ID for an event thrown by a subsystem. * Numbers 0-80 are reserved for FSFW Subsystem IDs (framework/events/) diff --git a/bsp_hosted/fsfwconfig/objects/systemObjectList.h b/bsp_hosted/fsfwconfig/objects/systemObjectList.h index add077d4..8b264882 100644 --- a/bsp_hosted/fsfwconfig/objects/systemObjectList.h +++ b/bsp_hosted/fsfwconfig/objects/systemObjectList.h @@ -1,10 +1,10 @@ #ifndef HOSTED_CONFIG_OBJECTS_SYSTEMOBJECTLIST_H_ #define HOSTED_CONFIG_OBJECTS_SYSTEMOBJECTLIST_H_ -#include "eive/objects.h" - #include +#include "eive/objects.h" + // The objects will be instantiated in the ID order namespace objects { enum sourceObjects : uint32_t { diff --git a/bsp_q7s/core/InitMission.cpp b/bsp_q7s/core/InitMission.cpp index 22ae8d40..75738905 100644 --- a/bsp_q7s/core/InitMission.cpp +++ b/bsp_q7s/core/InitMission.cpp @@ -84,6 +84,10 @@ void initmission::initTasks() { if (result != returnvalue::OK) { initmission::printAddObjectError("PUS_PACKET_DISTRIB", objects::PUS_PACKET_DISTRIBUTOR); } + result = tmTcDistributor->addComponent(objects::CFDP_DISTRIBUTOR); + if (result != returnvalue::OK) { + initmission::printAddObjectError("CFDP_DISTRIBUTOR", objects::CFDP_DISTRIBUTOR); + } result = tmTcDistributor->addComponent(objects::TM_FUNNEL); if (result != returnvalue::OK) { initmission::printAddObjectError("TM_FUNNEL", objects::TM_FUNNEL); @@ -126,7 +130,7 @@ void initmission::initTasks() { #if OBSW_ADD_CFDP_COMPONENTS == 1 PeriodicTaskIF* cfdpTask = factory->createPeriodicTask( - "CFDP Handler", 45, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.4, missedDeadlineFunc); + "CFDP Handler", 45, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.4, missedDeadlineFunc); result = cfdpTask->addComponent(objects::CFDP_HANDLER); if (result != returnvalue::OK) { initmission::printAddObjectError("CFDP Handler", objects::CFDP_HANDLER); diff --git a/common/config/commonConfig.cpp b/common/config/commonConfig.cpp index 56388f8b..cdc4e23f 100644 --- a/common/config/commonConfig.cpp +++ b/common/config/commonConfig.cpp @@ -5,4 +5,7 @@ const fsfw::Version common::OBSW_VERSION{OBSW_VERSION_MAJOR, OBSW_VERSION_MINOR, OBSW_VERSION_REVISION, OBSW_VERSION_CST_GIT_SHA1}; -const uint16_t common::PUS_PACKET_ID = ccsds::getTcSpacePacketIdFromApid(config::EIVE_PUS_APID); +const uint16_t common::PUS_PACKET_ID = + ccsds::getTcSpacePacketIdFromApid(config::EIVE_PUS_APID, true); +const uint16_t common::CFDP_PACKET_ID = + ccsds::getTcSpacePacketIdFromApid(config::EIVE_CFDP_APID, false); diff --git a/common/config/commonConfig.h.in b/common/config/commonConfig.h.in index 1b0111e1..83e1aaac 100644 --- a/common/config/commonConfig.h.in +++ b/common/config/commonConfig.h.in @@ -41,6 +41,7 @@ static constexpr uint32_t OBSW_MAX_SCHEDULED_TCS = @OBSW_MAX_SCHEDULED_TCS@; extern const fsfw::Version OBSW_VERSION; extern const uint16_t PUS_PACKET_ID; +extern const uint16_t CFDP_PACKET_ID; static constexpr uint32_t CCSDS_HANDLER_QUEUE_SIZE = 50; static constexpr uint8_t NUMBER_OF_VIRTUAL_CHANNELS = 4; diff --git a/common/config/eive/objects.h b/common/config/eive/objects.h index 89e4b8d3..4f89dd0a 100644 --- a/common/config/eive/objects.h +++ b/common/config/eive/objects.h @@ -123,6 +123,7 @@ enum commonObjects : uint32_t { TCS_BOARD_ASS = 0x73000003, RW_ASS = 0x73000004, CFDP_HANDLER = 0x73000005, + CFDP_DISTRIBUTOR = 0x73000006 }; } diff --git a/fsfw b/fsfw index e2c11583..c5b24f25 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit e2c115833762f1887804fef76baebedf914e36d2 +Subproject commit c5b24f2516227ad84d92f34b12e386c7e0945a09 diff --git a/mission/cfdp/CMakeLists.txt b/mission/cfdp/CMakeLists.txt index e69de29b..8b137891 100644 --- a/mission/cfdp/CMakeLists.txt +++ b/mission/cfdp/CMakeLists.txt @@ -0,0 +1 @@ + diff --git a/mission/cfdp/Config.h b/mission/cfdp/Config.h index d4ea3d2b..45f84155 100644 --- a/mission/cfdp/Config.h +++ b/mission/cfdp/Config.h @@ -52,6 +52,6 @@ class EiveFaultHandler : public cfdp::FaultHandlerBase { } }; -} +} // namespace cfdp #endif /* MISSION_CFDP_CONFIG_H_ */ diff --git a/mission/core/GenericFactory.cpp b/mission/core/GenericFactory.cpp index c58895f5..748aa02e 100644 --- a/mission/core/GenericFactory.cpp +++ b/mission/core/GenericFactory.cpp @@ -1,5 +1,6 @@ #include "GenericFactory.h" +#include #include #include #include @@ -24,9 +25,9 @@ #include #include "OBSWConfig.h" -#include "mission/cfdp/Config.h" #include "eive/definitions.h" #include "fsfw/pus/Service11TelecommandScheduling.h" +#include "mission/cfdp/Config.h" #include "objects/systemObjectList.h" #include "tmtc/pusIds.h" @@ -61,8 +62,7 @@ HostFilesystem HOST_FS; EiveUserHandler USER_HANDLER(HOST_FS); EiveFaultHandler EIVE_FAULT_HANDLER; -} - +} // namespace cfdp void ObjectFactory::produceGenericObjects(HealthTableIF** healthTable_) { // Framework objects @@ -141,7 +141,7 @@ void ObjectFactory::produceGenericObjects(HealthTableIF** healthTable_) { auto tmtcBridge = new TcpTmTcBridge(objects::TMTC_BRIDGE, objects::CCSDS_PACKET_DISTRIBUTOR); auto tcpServer = new TcpTmTcServer(objects::TMTC_POLLING_TASK, objects::TMTC_BRIDGE); // TCP is stream based. Use packet ID as start marker when parsing for space packets - tcpServer->setSpacePacketParsingOptions({common::PUS_PACKET_ID}); + tcpServer->setSpacePacketParsingOptions({common::PUS_PACKET_ID, common::CFDP_PACKET_ID}); sif::info << "Created TCP server for TMTC commanding with listener port " << tcpServer->getTcpPort() << std::endl; #if OBSW_TCP_SERVER_WIRETAPPING == 1 @@ -153,15 +153,19 @@ void ObjectFactory::produceGenericObjects(HealthTableIF** healthTable_) { #if OBSW_ADD_CFDP_COMPONENTS == 1 using namespace cfdp; + MessageQueueIF* cfdpMsgQueue = QueueFactory::instance()->createMessageQueue(32); + CfdpDistribCfg distribCfg(objects::CFDP_DISTRIBUTOR, *tcStore, cfdpMsgQueue); + new CfdpDistributor(distribCfg); + auto* msgQueue = QueueFactory::instance()->createMessageQueue(32); FsfwHandlerParams params(objects::CFDP_HANDLER, HOST_FS, *funnel, *tcStore, *tmStore, *msgQueue); cfdp::IndicationCfg indicationCfg; UnsignedByteField apid(config::EIVE_LOCAL_CFDP_ENTITY_ID); cfdp::EntityId localId(apid); GROUND_REMOTE_CFG.defaultChecksum = cfdp::ChecksumType::CRC_32; - CfdpHandlerCfg cfg(localId, indicationCfg, USER_HANDLER, EIVE_FAULT_HANDLER, PACKET_LIST, - LOST_SEGMENTS, REMOTE_CFG_PROVIDER); - auto* cfdpHandler = new CfdpHandler(params, cfg); + CfdpHandlerCfg cfdpCfg(localId, indicationCfg, USER_HANDLER, EIVE_FAULT_HANDLER, PACKET_LIST, + LOST_SEGMENTS, REMOTE_CFG_PROVIDER); + auto* cfdpHandler = new CfdpHandler(params, cfdpCfg); // All CFDP packets arrive wrapped inside CCSDS space packets CcsdsDistributorIF::DestInfo info("CFDP Destination", config::EIVE_CFDP_APID, cfdpHandler->getRequestQueue(), true); diff --git a/tmtc b/tmtc index 91f85537..2210ddb1 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 91f85537ce9903514c411c02654410bc7489d6f4 +Subproject commit 2210ddb168508f0c2c1426a783725ccb78dadf3a