This commit is contained in:
@ -10,7 +10,6 @@
|
||||
|
||||
#include <utility>
|
||||
|
||||
|
||||
ComSubsystem::ComSubsystem(object_id_t setObjectId, uint32_t maxNumberOfSequences,
|
||||
uint32_t maxNumberOfTables, uint32_t transmitterTimeout)
|
||||
: Subsystem(setObjectId, maxNumberOfSequences, maxNumberOfTables), paramHelper(this) {
|
||||
@ -116,11 +115,11 @@ void ComSubsystem::startTransition(Mode_t mode, Submode_t submode) {
|
||||
transmitterCountdown.timeOut();
|
||||
countdownActive = false;
|
||||
} else if (isTxMode(mode)) {
|
||||
// Only start transmitter countdown if transmitter is not already on
|
||||
if (not isTxMode(this->mode)) {
|
||||
transmitterCountdown.resetTimer();
|
||||
countdownActive = true;
|
||||
}
|
||||
// Only start transmitter countdown if transmitter is not already on
|
||||
if (not isTxMode(this->mode)) {
|
||||
transmitterCountdown.resetTimer();
|
||||
countdownActive = true;
|
||||
}
|
||||
}
|
||||
Subsystem::startTransition(mode, submode);
|
||||
}
|
||||
@ -190,10 +189,10 @@ void ComSubsystem::checkTransmitterCountdown() {
|
||||
}
|
||||
|
||||
bool ComSubsystem::isTxMode(Mode_t mode) {
|
||||
if ((mode == com::Submode::RX_AND_TX_DEFAULT_DATARATE) ||
|
||||
(mode == com::Submode::RX_AND_TX_LOW_DATARATE) ||
|
||||
(mode == com::Submode::RX_AND_TX_HIGH_DATARATE)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
if ((mode == com::Submode::RX_AND_TX_DEFAULT_DATARATE) ||
|
||||
(mode == com::Submode::RX_AND_TX_LOW_DATARATE) ||
|
||||
(mode == com::Submode::RX_AND_TX_HIGH_DATARATE)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@ -1,24 +1,25 @@
|
||||
#ifndef MISSION_SYSTEM_COMSUBSYSTEM_H_
|
||||
#define MISSION_SYSTEM_COMSUBSYSTEM_H_
|
||||
|
||||
#include <fsfw/events/EventMessage.h>
|
||||
#include <fsfw/parameters/HasParametersIF.h>
|
||||
#include <fsfw/parameters/ParameterHelper.h>
|
||||
#include <fsfw/subsystem/Subsystem.h>
|
||||
#include <fsfw/events/EventMessage.h>
|
||||
|
||||
#include "mission/comDefs.h"
|
||||
|
||||
class ComSubsystem : public Subsystem, public ReceivesParameterMessagesIF {
|
||||
public:
|
||||
/**
|
||||
* @brief Constructor
|
||||
*
|
||||
* @param setObjectId
|
||||
* @param maxNumberOfSequences
|
||||
* @param maxNumberOfTables
|
||||
* @param transmitterTimeout Maximum time the transmitter of the syrlinks
|
||||
* will be enabled
|
||||
*/
|
||||
/**
|
||||
* @brief Constructor
|
||||
*
|
||||
* @param setObjectId
|
||||
* @param maxNumberOfSequences
|
||||
* @param maxNumberOfTables
|
||||
* @param transmitterTimeout Maximum time the transmitter of the syrlinks
|
||||
* will be
|
||||
* enabled
|
||||
*/
|
||||
ComSubsystem(object_id_t setObjectId, uint32_t maxNumberOfSequences, uint32_t maxNumberOfTables,
|
||||
uint32_t transmitterTimeout);
|
||||
virtual ~ComSubsystem() = default;
|
||||
@ -30,7 +31,6 @@ class ComSubsystem : public Subsystem, public ReceivesParameterMessagesIF {
|
||||
virtual void performChildOperation() override;
|
||||
|
||||
private:
|
||||
|
||||
static const Mode_t INITIAL_MODE = 0;
|
||||
|
||||
ReturnValue_t handleCommandMessage(CommandMessage *message) override;
|
||||
@ -40,7 +40,7 @@ class ComSubsystem : public Subsystem, public ReceivesParameterMessagesIF {
|
||||
void startTransition(Mode_t mode, Submode_t submode) override;
|
||||
|
||||
void readEventQueue();
|
||||
void handleEventMessage(EventMessage* eventMessage);
|
||||
void handleEventMessage(EventMessage *eventMessage);
|
||||
void handleBitLockEvent();
|
||||
void handleCarrierLockEvent();
|
||||
void checkTransmitterCountdown();
|
||||
@ -56,11 +56,11 @@ class ComSubsystem : public Subsystem, public ReceivesParameterMessagesIF {
|
||||
|
||||
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;
|
||||
// protection mechanism due prevent the syrlinks from overheating
|
||||
uint32_t transmitterTimeout = 0;
|
||||
ParameterHelper paramHelper;
|
||||
|
||||
MessageQueueIF* eventQueue = nullptr;
|
||||
MessageQueueIF *eventQueue = nullptr;
|
||||
|
||||
bool enableTxWhenCarrierLock = false;
|
||||
|
||||
|
Reference in New Issue
Block a user