From c0f936b757272356d9c375ce40dd2e48dbbea257 Mon Sep 17 00:00:00 2001 From: Jakob Meier Date: Thu, 2 Feb 2023 16:00:53 +0100 Subject: [PATCH] add parameter command to change the transmitter timeout --- mission/comDefs.h | 2 +- mission/system/objects/ComSubsystem.cpp | 10 ++++++++++ mission/system/objects/ComSubsystem.h | 7 +++---- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/mission/comDefs.h b/mission/comDefs.h index 5538b166..8bb3f329 100644 --- a/mission/comDefs.h +++ b/mission/comDefs.h @@ -24,7 +24,7 @@ enum class CcsdsSubmode : uint8_t { DATARATE_HIGH = 2, DATARATE_DEFAULT = 3 }; -enum class ParameterId : uint8_t { DATARATE = 0 }; +enum class ParameterId : uint8_t { DATARATE = 0, TRANSMITTER_TIMEOUT = 1 }; } // namespace com diff --git a/mission/system/objects/ComSubsystem.cpp b/mission/system/objects/ComSubsystem.cpp index 5c98dfd8..dc58a7a5 100644 --- a/mission/system/objects/ComSubsystem.cpp +++ b/mission/system/objects/ComSubsystem.cpp @@ -47,6 +47,16 @@ ReturnValue_t ComSubsystem::getParameter(uint8_t domainId, uint8_t uniqueIdentif com::setCurrentDatarate(static_cast(newVal)); return returnvalue::OK; } + else if ((domainId == 0) and (uniqueIdentifier == static_cast(com::ParameterId::TRANSMITTER_TIMEOUT))) { + uint8_t newVal = 0; + ReturnValue_t result = newValues->getElement(&newVal); + if (result != returnvalue::OK) { + return result; + } + parameterWrapper->set(transmitterTimeout); + transmitterTimeout = newVal; + return returnvalue::OK; + } return returnvalue::OK; } diff --git a/mission/system/objects/ComSubsystem.h b/mission/system/objects/ComSubsystem.h index 3f1ef5d2..ac8cc60f 100644 --- a/mission/system/objects/ComSubsystem.h +++ b/mission/system/objects/ComSubsystem.h @@ -47,16 +47,15 @@ class ComSubsystem : public Subsystem, public ReceivesParameterMessagesIF { void startRxAndTxDefaultSeq(); uint8_t datarateCfg = static_cast(com::Datarate::LOW_RATE_MODULATION_BPSK); + // Maximum time after which the transmitter will be turned of. This is a + // protection mechanism due prevent the syrlinks from overheating + uint32_t transmitterTimeout = 0; ParameterHelper paramHelper; MessageQueueIF* eventQueue = nullptr; bool enableTxWhenCarrierLock = false; - // Maximum time after which the transmitter will be turned of. This is a - // protection mechanism due prevent the syrlinks from overheating - uint32_t transmitterTimeout = 0; - // Countdown will be started as soon as the transmitter was enabled Countdown transmitterCountdown; };