From 75e0ef60ce3f3e9bdeef89577a25c3467d9e1fe1 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 8 Sep 2022 15:49:18 +0200 Subject: [PATCH] hmm this is tricky from an architecture standpoint --- bsp_hosted/core/CfdpHandler.cpp | 10 +++------- bsp_hosted/core/CfdpHandler.h | 13 +++++++------ 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/bsp_hosted/core/CfdpHandler.cpp b/bsp_hosted/core/CfdpHandler.cpp index 97127a0..3d76007 100644 --- a/bsp_hosted/core/CfdpHandler.cpp +++ b/bsp_hosted/core/CfdpHandler.cpp @@ -11,8 +11,8 @@ using namespace cfdp; CfdpHandler::CfdpHandler(const FsfwHandlerParams& fsfwParams, const CfdpHandlerCfg& cfdpCfg) : SystemObject(fsfwParams.objectId), UserBase(fsfwParams.vfs), - destHandler(DestHandlerParams(cfdpCfg.cfg, *this, *this, cfdpCfg.packetInfoList, - cfdpCfg.lostSegmentsList), + destHandler(DestHandlerParams(cfdpCfg.cfg, *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 @@ -75,10 +75,6 @@ void CfdpHandler::abandonedIndication(const cfdp::TransactionId& id, cfdp::Condi size_t progress) {} void CfdpHandler::eofRecvIndication(const cfdp::TransactionId& id) {} -bool CfdpHandler::getRemoteCfg(const cfdp::EntityId& remoteId, cfdp::RemoteEntityCfg** cfg) { - return false; -} - ReturnValue_t CfdpHandler::handleCfdpPacket(TmTcMessage& msg) { auto accessorPair = tcStore->getData(msg.getStorageId()); PduHeaderReader reader(accessorPair.second.data(), accessorPair.second.size()); @@ -134,7 +130,7 @@ ReturnValue_t CfdpHandler::handleCfdpPacket(TmTcMessage& msg) { // the source handler, for a Finished PDU, it is passed to the destination handler. FileDirectives ackedDirective; if (not AckPduReader::checkAckedDirectiveField(pduDataField[1], ackedDirective)) { - // TODO: appropriate error + return INVALID_ACK_DIRECTIVE_FIELDS; } if (ackedDirective == FileDirectives::EOF_DIRECTIVE) { passToSourceHandler(); diff --git a/bsp_hosted/core/CfdpHandler.h b/bsp_hosted/core/CfdpHandler.h index d409964..38dc8b6 100644 --- a/bsp_hosted/core/CfdpHandler.h +++ b/bsp_hosted/core/CfdpHandler.h @@ -22,17 +22,21 @@ struct FsfwHandlerParams { struct CfdpHandlerCfg { CfdpHandlerCfg(cfdp::LocalEntityCfg cfg, cfdp::PacketInfoListBase& packetInfo, - cfdp::LostSegmentsListBase& lostSegmentsList) - : cfg(std::move(cfg)), packetInfoList(packetInfo), lostSegmentsList(lostSegmentsList) {} + cfdp::LostSegmentsListBase& lostSegmentsList, + cfdp::RemoteConfigTableIF& remoteCfgProvider) + : cfg(std::move(cfg)), + packetInfoList(packetInfo), + lostSegmentsList(lostSegmentsList), + remoteCfgProvider(remoteCfgProvider) {} cfdp::LocalEntityCfg cfg; cfdp::PacketInfoListBase& packetInfoList; cfdp::LostSegmentsListBase& lostSegmentsList; + cfdp::RemoteConfigTableIF& remoteCfgProvider; }; class CfdpHandler : public SystemObject, public cfdp::UserBase, - public cfdp::RemoteConfigTableIF, public ExecutableObjectIF, public AcceptsTelecommandsIF { public: @@ -45,9 +49,6 @@ class CfdpHandler : public SystemObject, ReturnValue_t initialize() override; ReturnValue_t performOperation(uint8_t operationCode) override; - // CFDP remote table interface - bool getRemoteCfg(const cfdp::EntityId& remoteId, cfdp::RemoteEntityCfg** cfg) override; - // CFDP user overrides void transactionIndication(const cfdp::TransactionId& id) override; void eofSentIndication(const cfdp::TransactionId& id) override;