add parameter command to change the transmitter timeout

This commit is contained in:
Jakob Meier 2023-02-02 16:00:53 +01:00
parent 1ad30f33a5
commit c0f936b757
3 changed files with 14 additions and 5 deletions

View File

@ -24,7 +24,7 @@ enum class CcsdsSubmode : uint8_t {
DATARATE_HIGH = 2, DATARATE_HIGH = 2,
DATARATE_DEFAULT = 3 DATARATE_DEFAULT = 3
}; };
enum class ParameterId : uint8_t { DATARATE = 0 }; enum class ParameterId : uint8_t { DATARATE = 0, TRANSMITTER_TIMEOUT = 1 };
} // namespace com } // namespace com

View File

@ -47,6 +47,16 @@ ReturnValue_t ComSubsystem::getParameter(uint8_t domainId, uint8_t uniqueIdentif
com::setCurrentDatarate(static_cast<com::Datarate>(newVal)); com::setCurrentDatarate(static_cast<com::Datarate>(newVal));
return returnvalue::OK; return returnvalue::OK;
} }
else if ((domainId == 0) and (uniqueIdentifier == static_cast<uint8_t>(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; return returnvalue::OK;
} }

View File

@ -47,16 +47,15 @@ class ComSubsystem : public Subsystem, public ReceivesParameterMessagesIF {
void startRxAndTxDefaultSeq(); void startRxAndTxDefaultSeq();
uint8_t datarateCfg = static_cast<uint8_t>(com::Datarate::LOW_RATE_MODULATION_BPSK); uint8_t datarateCfg = static_cast<uint8_t>(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; ParameterHelper paramHelper;
MessageQueueIF* eventQueue = nullptr; MessageQueueIF* eventQueue = nullptr;
bool enableTxWhenCarrierLock = false; 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 will be started as soon as the transmitter was enabled
Countdown transmitterCountdown; Countdown transmitterCountdown;
}; };