diff --git a/bsp_hosted/core/CfdpHandler.cpp b/bsp_hosted/core/CfdpHandler.cpp index ee0849b..c2975a4 100644 --- a/bsp_hosted/core/CfdpHandler.cpp +++ b/bsp_hosted/core/CfdpHandler.cpp @@ -142,3 +142,8 @@ ReturnValue_t CfdpHandler::handleCfdpPacket(TmTcMessage& msg) { } return result; } + +void CfdpHandler::noticeOfSuspensionCb(cfdp::ConditionCode code) {} +void CfdpHandler::noticeOfCancellationCb(cfdp::ConditionCode code) {} +void CfdpHandler::abandonCb(cfdp::ConditionCode code) {} +void CfdpHandler::ignoreCb(cfdp::ConditionCode code) {} diff --git a/bsp_hosted/core/CfdpHandler.h b/bsp_hosted/core/CfdpHandler.h index b9bb706..21aef3f 100644 --- a/bsp_hosted/core/CfdpHandler.h +++ b/bsp_hosted/core/CfdpHandler.h @@ -66,6 +66,10 @@ class CfdpHandler : public SystemObject, void abandonedIndication(const cfdp::TransactionId& id, cfdp::ConditionCode code, size_t progress) override; void eofRecvIndication(const cfdp::TransactionId& id) override; + void noticeOfSuspensionCb(cfdp::ConditionCode code) override; + void noticeOfCancellationCb(cfdp::ConditionCode code) override; + void abandonCb(cfdp::ConditionCode code) override; + void ignoreCb(cfdp::ConditionCode code) override; private: MessageQueueIF* msgQueue = nullptr; diff --git a/bsp_hosted/core/InitMission.cpp b/bsp_hosted/core/InitMission.cpp index fabaafb..bed5d5d 100644 --- a/bsp_hosted/core/InitMission.cpp +++ b/bsp_hosted/core/InitMission.cpp @@ -48,11 +48,27 @@ void InitMission::createTasks() { if (result != returnvalue::OK) { task::printInitError("PUS distributor", objects::PUS_DISTRIBUTOR); } + result = distributerTask->addComponent(objects::CFDP_DISTRIBUTOR); + if (result != returnvalue::OK) { + task::printInitError("CFDP distributor", objects::CFDP_DISTRIBUTOR); + } result = distributerTask->addComponent(objects::TM_FUNNEL); if (result != returnvalue::OK) { task::printInitError("TM funnel", objects::TM_FUNNEL); } +#if OBSW_ADD_CFDP_COMPONENTS == 1 +#ifdef __unix__ + currPrio = 50; +#endif + PeriodicTaskIF* cfdpTask = taskFactory->createPeriodicTask( + "CFDP Handler", currPrio, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.4, deadlineMissedFunc); + result = cfdpTask->addComponent(objects::CFDP_HANDLER); + if (result != returnvalue::OK) { + task::printInitError("CFDP Handler", objects::CFDP_HANDLER); + } +#endif + #ifdef __unix__ currPrio = 50; #endif @@ -247,6 +263,10 @@ void InitMission::createTasks() { eventTask->startTask(); #endif /* OBSW_ADD_CORE_COMPONENTS == 1 */ +#if OBSW_ADD_CFDP_COMPONENTS == 1 + cfdpTask->startTask(); +#endif + #if OBSW_ADD_PUS_STACK == 1 pusVerification->startTask(); pusHighPrio->startTask(); diff --git a/bsp_hosted/core/ObjectFactory.cpp b/bsp_hosted/core/ObjectFactory.cpp index b2d592d..3a3d1d6 100644 --- a/bsp_hosted/core/ObjectFactory.cpp +++ b/bsp_hosted/core/ObjectFactory.cpp @@ -42,7 +42,7 @@ void ObjectFactory::produce(void* args) { new PoolManager(objects::IPC_STORE, poolCfg); } TmFunnel* funnel; - ObjectFactory::produceGenericObjects(&funnel); + ObjectFactory::produceGenericObjects(&funnel, *tcStore); // TMTC Reception via TCP/IP socket #if OBSW_USE_TCP_SERVER == 0 auto tmtcBridge = new UdpTmTcBridge(objects::TCPIP_TMTC_BRIDGE, objects::CCSDS_DISTRIBUTOR); @@ -63,13 +63,18 @@ void ObjectFactory::produce(void* args) { periodicEvent = true; #endif new FsfwTestTask(objects::TEST_TASK, periodicEvent); + +#if OBSW_ADD_CFDP_COMPONENTS == 1 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(); + cfdp::RemoteEntityCfg remoteCfg; + cfdp::OneRemoteConfigProvider remoteCfgProvider(remoteCfg); + cfdp::PacketInfoList<64> packetList; + cfdp::LostSegmentsList<128> lostSegments; + CfdpHandlerCfg cfg(localId, indicationCfg, packetList, lostSegments, remoteCfgProvider); + new CfdpHandler(params, cfg); +#endif } diff --git a/example_common b/example_common index a36d951..0818366 160000 --- a/example_common +++ b/example_common @@ -1 +1 @@ -Subproject commit a36d951209568bc750bb78e314ea4dcd14b74c62 +Subproject commit 081836621790614f3b44cf10fa8c7186d28eb2cf