ccsds handler sending command to enable transmitter

This commit is contained in:
Jakob Meier
2022-05-12 18:32:19 +02:00
parent 3c3884476b
commit 919141ae10
12 changed files with 118 additions and 178 deletions

View File

@ -17,6 +17,8 @@
#include "fsfw/tmtcservices/AcceptsTelemetryIF.h"
#include "fsfw_hal/common/gpio/GpioIF.h"
#include "fsfw_hal/common/gpio/gpioDefinitions.h"
#include "fsfw/action/CommandActionHelper.h"
#include "fsfw/action/CommandsActionsIF.h"
#include "linux/obc/PtmeConfig.h"
/**
@ -34,7 +36,8 @@ class CCSDSHandler : public SystemObject,
public AcceptsTelecommandsIF,
public HasReturnvaluesIF,
public ReceivesParameterMessagesIF,
public HasActionsIF {
public HasActionsIF,
public CommandsActionsIF {
public:
using VcId_t = uint8_t;
@ -79,8 +82,19 @@ class CCSDSHandler : public SystemObject,
virtual ReturnValue_t executeAction(ActionId_t actionId, MessageQueueId_t commandedBy,
const uint8_t* data, size_t size);
MessageQueueIF* getCommandQueuePtr() override;
void stepSuccessfulReceived(ActionId_t actionId, uint8_t step) override;
void stepFailedReceived(ActionId_t actionId, uint8_t step, ReturnValue_t returnCode) override;
void dataReceived(ActionId_t actionId, const uint8_t* data, uint32_t size) override;
void completionSuccessfulReceived(ActionId_t actionId) override;
void completionFailedReceived(ActionId_t actionId, ReturnValue_t returnCode) override;
private:
static const uint8_t INTERFACE_ID = CLASS_ID::CCSDS_HANDLER;
static const uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::PLOC_MPSOC_HANDLER;
//! [EXPORT] : [COMMENT] Syrlinks transmitter is enabled
static const Event TRANSMITTER_ENABLED = MAKE_EVENT(1, severity::LOW);
static const uint32_t QUEUE_SIZE = common::CCSDS_HANDLER_QUEUE_SIZE;
@ -120,6 +134,7 @@ class CCSDSHandler : public SystemObject,
MessageQueueIF* commandQueue = nullptr;
MessageQueueIF* eventQueue = nullptr;
MessageQueueIF* commandActionHelperQueue = nullptr;
ParameterHelper parameterHelper;
@ -140,12 +155,15 @@ class CCSDSHandler : public SystemObject,
// Countdown to disable transmitter after 15 minutes
Countdown transmitterCountdown;
CommandActionHelper commandActionHelper;
// When true transmitting is started as soon as carrier lock has been detected
bool enableTxWhenCarrierLock = false;
bool linkState = DOWN;
void readCommandQueue(void);
void readCommandActionHelperQueue(void);
void handleTelemetry();
void handleTelecommands();
void checkEvents();