From c4e18cc2f33c12d637d19d66c7ba731cb457a7a2 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 6 Sep 2023 11:45:02 +0200 Subject: [PATCH] what was i thinking here? --- src/fsfw/cfdp/handler/SourceHandler.cpp | 4 ++-- src/fsfw/tmtcservices/TmTcBridge.cpp | 14 ++------------ src/fsfw/tmtcservices/TmTcBridge.h | 7 +++---- 3 files changed, 7 insertions(+), 18 deletions(-) diff --git a/src/fsfw/cfdp/handler/SourceHandler.cpp b/src/fsfw/cfdp/handler/SourceHandler.cpp index dcb5d68a..351359c2 100644 --- a/src/fsfw/cfdp/handler/SourceHandler.cpp +++ b/src/fsfw/cfdp/handler/SourceHandler.cpp @@ -325,7 +325,7 @@ ReturnValue_t cfdp::SourceHandler::sendGenericPdu(const SerializeIF& pdu) { if (result != OK) { addError(result); fsmResult.callStatus = CallStatus::CALL_AFTER_DELAY; - if(result == StorageManagerIF::DATA_STORAGE_FULL) { + if (result == StorageManagerIF::DATA_STORAGE_FULL) { return TM_STORE_FULL; } return result; @@ -339,7 +339,7 @@ ReturnValue_t cfdp::SourceHandler::sendGenericPdu(const SerializeIF& pdu) { TmTcMessage tmMsg(storeId); result = fsfwParams.msgQueue->sendMessage(fsfwParams.packetDest.getReportReceptionQueue(), &tmMsg); - if(result != OK) { + if (result != OK) { fsmResult.callStatus = CallStatus::CALL_AFTER_DELAY; } if (result == MessageQueueIF::FULL) { diff --git a/src/fsfw/tmtcservices/TmTcBridge.cpp b/src/fsfw/tmtcservices/TmTcBridge.cpp index f098103e..5c819222 100644 --- a/src/fsfw/tmtcservices/TmTcBridge.cpp +++ b/src/fsfw/tmtcservices/TmTcBridge.cpp @@ -23,18 +23,8 @@ TmTcBridge::TmTcBridge(const char* name, object_id_t objectId, object_id_t tcDes TmTcBridge::~TmTcBridge() { QueueFactory::instance()->deleteMessageQueue(tmTcReceptionQueue); } -ReturnValue_t TmTcBridge::setNumberOfSentPacketsPerCycle(uint8_t sentPacketsPerCycle) { - if (sentPacketsPerCycle <= LIMIT_STORED_DATA_SENT_PER_CYCLE) { - this->sentPacketsPerCycle = sentPacketsPerCycle; - return returnvalue::OK; - } else { -#if FSFW_CPP_OSTREAM_ENABLED == 1 - sif::warning << "TmTcBridge::setNumberOfSentPacketsPerCycle: Number of " - << "packets sent per cycle exceeds limits. " - << "Keeping default value." << std::endl; -#endif - return returnvalue::FAILED; - } +void TmTcBridge::setNumberOfSentPacketsPerCycle(uint32_t sentPacketsPerCycle_) { + this->sentPacketsPerCycle = sentPacketsPerCycle_; } ReturnValue_t TmTcBridge::setMaxNumberOfPacketsStored(unsigned int maxNumberOfPacketsStored) { diff --git a/src/fsfw/tmtcservices/TmTcBridge.h b/src/fsfw/tmtcservices/TmTcBridge.h index 858793cc..c87be45c 100644 --- a/src/fsfw/tmtcservices/TmTcBridge.h +++ b/src/fsfw/tmtcservices/TmTcBridge.h @@ -15,10 +15,9 @@ class TmTcBridge : public AcceptsTelemetryIF, public ExecutableObjectIF, public SystemObject { public: - static constexpr uint8_t LIMIT_STORED_DATA_SENT_PER_CYCLE = 15; static constexpr unsigned int LIMIT_DOWNLINK_PACKETS_STORED = 500; - static constexpr uint8_t DEFAULT_STORED_DATA_SENT_PER_CYCLE = 5; + static constexpr uint8_t DEFAULT_STORED_DATA_SENT_PER_CYCLE = 20; static constexpr uint8_t DEFAULT_DOWNLINK_PACKETS_STORED = 10; TmTcBridge(const char* name, object_id_t objectId, object_id_t tcDestination, @@ -32,7 +31,7 @@ class TmTcBridge : public AcceptsTelemetryIF, * @return -@c returnvalue::OK if value was set successfully * -@c returnvalue::FAILED otherwise, stored value stays the same */ - ReturnValue_t setNumberOfSentPacketsPerCycle(uint8_t sentPacketsPerCycle); + void setNumberOfSentPacketsPerCycle(uint32_t sentPacketsPerCycle); /** * Set number of packets sent per performOperation().Please note that this @@ -151,7 +150,7 @@ class TmTcBridge : public AcceptsTelemetryIF, * This FIFO can be used to store downlink data which can not be sent at the moment. */ DynamicFIFO* tmFifo = nullptr; - uint8_t sentPacketsPerCycle = DEFAULT_STORED_DATA_SENT_PER_CYCLE; + uint32_t sentPacketsPerCycle = DEFAULT_STORED_DATA_SENT_PER_CYCLE; unsigned int maxNumberOfPacketsStored = DEFAULT_DOWNLINK_PACKETS_STORED; };