From 9860061fc6909f2a4b57465c2268ce6b49792949 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 20 Jul 2022 11:45:50 +0200 Subject: [PATCH] create new TmSendHelper --- src/fsfw/tmtcservices/TmStoreHelper.h | 31 ++++++++++++++++----------- 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/src/fsfw/tmtcservices/TmStoreHelper.h b/src/fsfw/tmtcservices/TmStoreHelper.h index bada3b7d4..61ef93f4f 100644 --- a/src/fsfw/tmtcservices/TmStoreHelper.h +++ b/src/fsfw/tmtcservices/TmStoreHelper.h @@ -6,27 +6,34 @@ #include "fsfw/storagemanager/StorageManagerIF.h" #include "fsfw/tmtcpacket/pus/tm/PusTmCreator.h" +class TmStoreAndSendWrapper { + +}; + +class TmSendHelper { + public: + TmSendHelper(MessageQueueId_t tmtcMsgDest, + MessageQueueId_t tmtcMsgSrc, InternalErrorReporterIF* reporter); + void setMsgDestination(MessageQueueId_t msgDest); + void setMsgSource(MessageQueueId_t msgSrc); + void setInternalErrorReporter(InternalErrorReporterIF* reporter); + ReturnValue_t sendPacket(); + private: + MessageQueueId_t tmtcMsgDest; + MessageQueueId_t tmtcMsgSrc; + InternalErrorReporterIF* errReporter; +}; + // TODO: Serializing a packet into a store and sending the message are two different tasks // Move them into separate classes class TmStoreHelper { public: - TmStoreHelper(StorageManagerIF* tmStore, MessageQueueId_t tmtcMsgDest, - MessageQueueId_t tmtcMsgSrc, InternalErrorReporterIF* reporter); + TmStoreHelper(StorageManagerIF* tmStore); - void setInternalErrorReporter(InternalErrorReporterIF* reporter); - void setMsgDestination(MessageQueueId_t msgDest); - void setMsgSource(MessageQueueId_t msgSrc); void preparePacket(uint16_t apid, uint8_t service, uint8_t subservice, uint16_t counter); - ReturnValue_t sendPacket(); - private: PusTmParams params{}; PusTmCreator creator; - - bool doErrorReporting = true; - MessageQueueId_t tmtcMsgDest; - MessageQueueId_t tmtcMsgSrc; - InternalErrorReporterIF* errReporter; store_address_t currentAddr{}; StorageManagerIF* tmStore; };