From 8186a3ef4fe2b2287d8e85752a9c63adb83a9dd5 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 16 Aug 2023 13:22:05 +0200 Subject: [PATCH] proxy request should now arrive at the handler --- mission/cfdp/CfdpHandler.cpp | 7 ++++++- mission/cfdp/CfdpHandler.h | 6 +++++- mission/genericFactory.cpp | 2 +- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/mission/cfdp/CfdpHandler.cpp b/mission/cfdp/CfdpHandler.cpp index 7545aa11..b2121022 100644 --- a/mission/cfdp/CfdpHandler.cpp +++ b/mission/cfdp/CfdpHandler.cpp @@ -1,5 +1,6 @@ #include "CfdpHandler.h" +#include #include #include "fsfw/cfdp/pdu/AckPduReader.h" @@ -22,7 +23,8 @@ CfdpHandler::CfdpHandler(const FsfwHandlerParams& fsfwHandlerParams, const CfdpH cfdpCfg.packetInfoList, cfdpCfg.lostSegmentsList), this->fsfwParams), srcHandler(SourceHandlerParams(localCfg, cfdpCfg.userHandler, seqCntProvider), - this->fsfwParams) {} + this->fsfwParams), + ipcStore(fsfwHandlerParams.ipcStore) {} [[nodiscard]] const char* CfdpHandler::getName() const { return "CFDP Handler"; } @@ -143,6 +145,9 @@ ReturnValue_t CfdpHandler::handleCfdpRequest(CommandMessage& msg) { // TODO: Handle CFDP requests here, most importantly put requests. If a put request is received, // check whether one is pending. If none are, start a transaction with the put request, otherwise // store for put request inside a FIFO for later processing. + auto accessorPair = ipcStore.getData(CfdpMessage::getStoreId(&msg)); + + sif::info << "received CFDP request" << std::endl; return OK; } diff --git a/mission/cfdp/CfdpHandler.h b/mission/cfdp/CfdpHandler.h index 4bea5b95..45314d40 100644 --- a/mission/cfdp/CfdpHandler.h +++ b/mission/cfdp/CfdpHandler.h @@ -15,13 +15,15 @@ struct FsfwHandlerParams { FsfwHandlerParams(object_id_t objectId, HasFileSystemIF& vfs, AcceptsTelemetryIF& packetDest, - StorageManagerIF& tcStore, StorageManagerIF& tmStore, MessageQueueIF& tmtcQueue, + StorageManagerIF& tcStore, StorageManagerIF& tmStore, + StorageManagerIF& ipcStore, MessageQueueIF& tmtcQueue, MessageQueueIF& cfdpQueue) : objectId(objectId), vfs(vfs), packetDest(packetDest), tcStore(tcStore), tmStore(tmStore), + ipcStore(ipcStore), tmtcQueue(tmtcQueue), cfdpQueue(cfdpQueue) {} object_id_t objectId{}; @@ -29,6 +31,7 @@ struct FsfwHandlerParams { AcceptsTelemetryIF& packetDest; StorageManagerIF& tcStore; StorageManagerIF& tmStore; + StorageManagerIF& ipcStore; MessageQueueIF& tmtcQueue; MessageQueueIF& cfdpQueue; }; @@ -75,6 +78,7 @@ class CfdpHandler : public SystemObject, public ExecutableObjectIF, public Accep cfdp::DestHandler destHandler; cfdp::SourceHandler srcHandler; + StorageManagerIF& ipcStore; StorageManagerIF* tcStore = nullptr; StorageManagerIF* tmStore = nullptr; diff --git a/mission/genericFactory.cpp b/mission/genericFactory.cpp index 73645f79..e2c4511e 100644 --- a/mission/genericFactory.cpp +++ b/mission/genericFactory.cpp @@ -279,7 +279,7 @@ void ObjectFactory::produceGenericObjects(HealthTableIF** healthTable_, PusTmFun auto* cfdpQueue = QueueFactory::instance()->createMessageQueue(16); auto eiveUserHandler = new cfdp::EiveUserHandler(HOST_FS, **ipcStore, cfdpQueue->getId()); FsfwHandlerParams params(objects::CFDP_HANDLER, HOST_FS, **cfdpFunnel, *tcStore, **tmStore, - *tmtcQueue, *cfdpQueue); + **ipcStore, *tmtcQueue, *cfdpQueue); cfdp::IndicationCfg indicationCfg; UnsignedByteField apid(config::EIVE_LOCAL_CFDP_ENTITY_ID); cfdp::EntityId localId(apid);