add new submode for default datarate handling
All checks were successful
EIVE/eive-obsw/pipeline/pr-develop This commit looks good
All checks were successful
EIVE/eive-obsw/pipeline/pr-develop This commit looks good
This commit is contained in:
parent
9410902454
commit
4dca9f21d4
10
mission/comDefs.h
Normal file
10
mission/comDefs.h
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
#ifndef MISSION_COMDEFS_H_
|
||||||
|
#define MISSION_COMDEFS_H_
|
||||||
|
|
||||||
|
namespace com {
|
||||||
|
|
||||||
|
enum class Datarate { LOW_RATE_MODULATION_BPSK, HIGH_RATE_MODULATION_0QPSK };
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* MISSION_COMDEFS_H_ */
|
@ -19,17 +19,17 @@ SyrlinksHandler::SyrlinksHandler(object_id_t objectId, object_id_t comIF, Cookie
|
|||||||
SyrlinksHandler::~SyrlinksHandler() = default;
|
SyrlinksHandler::~SyrlinksHandler() = default;
|
||||||
|
|
||||||
void SyrlinksHandler::doStartUp() {
|
void SyrlinksHandler::doStartUp() {
|
||||||
if(internalState != InternalState::OFF) {
|
if (internalState != InternalState::OFF) {
|
||||||
sif::error << "SyrlinksHandler::doStartUp: Not in internal OFF mode, possible config error"
|
sif::error << "SyrlinksHandler::doStartUp: Not in internal OFF mode, possible config error"
|
||||||
<< std::endl;
|
<< std::endl;
|
||||||
internalState = InternalState::OFF;
|
internalState = InternalState::OFF;
|
||||||
}
|
}
|
||||||
if(internalState == InternalState::OFF) {
|
if (internalState == InternalState::OFF) {
|
||||||
internalState = InternalState::ENABLE_TEMPERATURE_PROTECTION;
|
internalState = InternalState::ENABLE_TEMPERATURE_PROTECTION;
|
||||||
commandExecuted = false;
|
commandExecuted = false;
|
||||||
}
|
}
|
||||||
if(internalState == InternalState::ENABLE_TEMPERATURE_PROTECTION) {
|
if (internalState == InternalState::ENABLE_TEMPERATURE_PROTECTION) {
|
||||||
if(commandExecuted) {
|
if (commandExecuted) {
|
||||||
// Got to normal mode immediately.
|
// Got to normal mode immediately.
|
||||||
setMode(_MODE_TO_NORMAL);
|
setMode(_MODE_TO_NORMAL);
|
||||||
internalState = InternalState::IDLE;
|
internalState = InternalState::IDLE;
|
||||||
@ -222,10 +222,10 @@ void SyrlinksHandler::fillCommandAndReplyMap() {
|
|||||||
true, syrlinks::ACK_REPLY);
|
true, syrlinks::ACK_REPLY);
|
||||||
this->insertInCommandAndReplyMap(syrlinks::WRITE_LCL_CONFIG, 1, nullptr, syrlinks::ACK_SIZE,
|
this->insertInCommandAndReplyMap(syrlinks::WRITE_LCL_CONFIG, 1, nullptr, syrlinks::ACK_SIZE,
|
||||||
false, true, syrlinks::ACK_REPLY);
|
false, true, syrlinks::ACK_REPLY);
|
||||||
this->insertInCommandAndReplyMap(syrlinks::SET_WAVEFORM_BPSK, 1, nullptr, syrlinks::ACK_SIZE, false,
|
this->insertInCommandAndReplyMap(syrlinks::SET_WAVEFORM_BPSK, 1, nullptr, syrlinks::ACK_SIZE,
|
||||||
true, syrlinks::ACK_REPLY);
|
false, true, syrlinks::ACK_REPLY);
|
||||||
this->insertInCommandAndReplyMap(syrlinks::SET_WAVEFORM_0QPSK, 1, nullptr, syrlinks::ACK_SIZE, false,
|
this->insertInCommandAndReplyMap(syrlinks::SET_WAVEFORM_0QPSK, 1, nullptr, syrlinks::ACK_SIZE,
|
||||||
true, syrlinks::ACK_REPLY);
|
false, true, syrlinks::ACK_REPLY);
|
||||||
this->insertInCommandMap(syrlinks::ENABLE_DEBUG);
|
this->insertInCommandMap(syrlinks::ENABLE_DEBUG);
|
||||||
this->insertInCommandMap(syrlinks::DISABLE_DEBUG);
|
this->insertInCommandMap(syrlinks::DISABLE_DEBUG);
|
||||||
this->insertInCommandAndReplyMap(syrlinks::READ_LCL_CONFIG, 1, nullptr,
|
this->insertInCommandAndReplyMap(syrlinks::READ_LCL_CONFIG, 1, nullptr,
|
||||||
@ -661,8 +661,8 @@ ReturnValue_t SyrlinksHandler::handleAckReply(const uint8_t* packet) {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case(syrlinks::SET_WAVEFORM_BPSK):
|
case (syrlinks::SET_WAVEFORM_BPSK):
|
||||||
case(syrlinks::SET_WAVEFORM_0QPSK):
|
case (syrlinks::SET_WAVEFORM_0QPSK):
|
||||||
case (syrlinks::SET_TX_MODE_STANDBY):
|
case (syrlinks::SET_TX_MODE_STANDBY):
|
||||||
case (syrlinks::SET_TX_MODE_MODULATION):
|
case (syrlinks::SET_TX_MODE_MODULATION):
|
||||||
case (syrlinks::SET_TX_MODE_CW): {
|
case (syrlinks::SET_TX_MODE_CW): {
|
||||||
@ -700,47 +700,54 @@ void SyrlinksHandler::doTransition(Mode_t modeFrom, Submode_t subModeFrom) {
|
|||||||
setMode(tgtMode);
|
setMode(tgtMode);
|
||||||
internalState = InternalState::IDLE;
|
internalState = InternalState::IDLE;
|
||||||
};
|
};
|
||||||
|
auto txOnHandler = [&](InternalState selMod) {
|
||||||
|
if (internalState == InternalState::IDLE) {
|
||||||
|
commandExecuted = false;
|
||||||
|
internalState = selMod;
|
||||||
|
}
|
||||||
|
// Select modulation first (BPSK or 0QPSK).
|
||||||
|
if (internalState == selMod) {
|
||||||
|
if (commandExecuted) {
|
||||||
|
internalState = InternalState::SET_TX_MODULATION;
|
||||||
|
commandExecuted = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Now go into modulation mode.
|
||||||
|
if (internalState == InternalState::SET_TX_MODULATION) {
|
||||||
|
if (commandExecuted) {
|
||||||
|
commandDone();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
};
|
||||||
if (tgtMode == HasModesIF::MODE_ON or tgtMode == DeviceHandlerIF::MODE_NORMAL) {
|
if (tgtMode == HasModesIF::MODE_ON or tgtMode == DeviceHandlerIF::MODE_NORMAL) {
|
||||||
switch (getSubmode()) {
|
switch (getSubmode()) {
|
||||||
case (syrlinks::Submode::TX_MODULATION_LOW_DATARATE): {
|
case (syrlinks::Submode::RX_AND_TX_DEFAULT_DATARATE): {
|
||||||
if (internalState == InternalState::IDLE) {
|
if (datarateCfg == com::Datarate::LOW_RATE_MODULATION_BPSK) {
|
||||||
commandExecuted = false;
|
if (txOnHandler(InternalState::SELECT_MODULATION_BPSK)) {
|
||||||
internalState = InternalState::SELECT_MODULATION_BPSK;
|
return;
|
||||||
}
|
|
||||||
if (internalState == InternalState::SELECT_MODULATION_BPSK) {
|
|
||||||
if (commandExecuted) {
|
|
||||||
internalState = InternalState::SET_TX_MODULATION;
|
|
||||||
commandExecuted = false;
|
|
||||||
}
|
}
|
||||||
}
|
} else if (datarateCfg == com::Datarate::HIGH_RATE_MODULATION_0QPSK) {
|
||||||
if (internalState == InternalState::SET_TX_MODULATION) {
|
if (txOnHandler(InternalState::SELECT_MODULATION_0QPSK)) {
|
||||||
if (commandExecuted) {
|
|
||||||
commandDone();
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case (syrlinks::Submode::TX_MODULATION_HIGH_DATARATE): {
|
case (syrlinks::Submode::RX_AND_TX_LOW_DATARATE): {
|
||||||
if (internalState == InternalState::IDLE) {
|
if (txOnHandler(InternalState::SELECT_MODULATION_BPSK)) {
|
||||||
commandExecuted = false;
|
return;
|
||||||
internalState = InternalState::SELECT_MODULATION_0QPSK;
|
|
||||||
}
|
|
||||||
if (internalState == InternalState::SELECT_MODULATION_0QPSK) {
|
|
||||||
if (commandExecuted) {
|
|
||||||
internalState = InternalState::SET_TX_MODULATION;
|
|
||||||
commandExecuted = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (internalState == InternalState::SET_TX_MODULATION) {
|
|
||||||
if (commandExecuted) {
|
|
||||||
commandDone();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case (syrlinks::Submode::TX_STANDBY): {
|
case (syrlinks::Submode::RX_AND_TX_HIGH_DATARATE): {
|
||||||
|
if (txOnHandler(InternalState::SELECT_MODULATION_0QPSK)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case (syrlinks::Submode::RX_ONLY): {
|
||||||
if (internalState == InternalState::IDLE) {
|
if (internalState == InternalState::IDLE) {
|
||||||
internalState = InternalState::SET_TX_STANDBY;
|
internalState = InternalState::SET_TX_STANDBY;
|
||||||
commandExecuted = false;
|
commandExecuted = false;
|
||||||
@ -753,7 +760,7 @@ void SyrlinksHandler::doTransition(Mode_t modeFrom, Submode_t subModeFrom) {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case (syrlinks::Submode::TX_CW): {
|
case (syrlinks::Submode::RX_AND_TX_CW): {
|
||||||
if (internalState == InternalState::IDLE) {
|
if (internalState == InternalState::IDLE) {
|
||||||
internalState = InternalState::SET_TX_STANDBY;
|
internalState = InternalState::SET_TX_STANDBY;
|
||||||
commandExecuted = false;
|
commandExecuted = false;
|
||||||
|
@ -7,6 +7,7 @@
|
|||||||
#include "fsfw/devicehandlers/DeviceHandlerBase.h"
|
#include "fsfw/devicehandlers/DeviceHandlerBase.h"
|
||||||
#include "fsfw/timemanager/Countdown.h"
|
#include "fsfw/timemanager/Countdown.h"
|
||||||
#include "fsfw_hal/linux/gpio/Gpio.h"
|
#include "fsfw_hal/linux/gpio/Gpio.h"
|
||||||
|
#include "mission/comDefs.h"
|
||||||
#include "mission/devices/devicedefinitions/SyrlinksDefinitions.h"
|
#include "mission/devices/devicedefinitions/SyrlinksDefinitions.h"
|
||||||
#include "returnvalues/classIds.h"
|
#include "returnvalues/classIds.h"
|
||||||
|
|
||||||
@ -99,6 +100,7 @@ class SyrlinksHandler : public DeviceHandlerBase {
|
|||||||
syrlinks::TemperatureSet temperatureSet;
|
syrlinks::TemperatureSet temperatureSet;
|
||||||
|
|
||||||
const power::Switch_t powerSwitch = power::NO_SWITCH;
|
const power::Switch_t powerSwitch = power::NO_SWITCH;
|
||||||
|
com::Datarate datarateCfg = com::Datarate::LOW_RATE_MODULATION_BPSK;
|
||||||
|
|
||||||
bool debugMode = false;
|
bool debugMode = false;
|
||||||
uint8_t agcValueHighByte = 0;
|
uint8_t agcValueHighByte = 0;
|
||||||
|
@ -8,10 +8,11 @@ namespace syrlinks {
|
|||||||
|
|
||||||
enum Submode {
|
enum Submode {
|
||||||
DEFAULT,
|
DEFAULT,
|
||||||
TX_STANDBY,
|
RX_ONLY,
|
||||||
TX_MODULATION_LOW_DATARATE,
|
RX_AND_TX_DEFAULT_DATARATE,
|
||||||
TX_MODULATION_HIGH_DATARATE,
|
RX_AND_TX_LOW_DATARATE,
|
||||||
TX_CW,
|
RX_AND_TX_HIGH_DATARATE,
|
||||||
|
RX_AND_TX_CW,
|
||||||
NUM_SUBMODES
|
NUM_SUBMODES
|
||||||
};
|
};
|
||||||
|
|
||||||
|
2
tmtc
2
tmtc
@ -1 +1 @@
|
|||||||
Subproject commit c36c7ca5bbe12b74f096414383eedfc16576a9d2
|
Subproject commit 99d5ed014bc3264b621c066ba0fb035b1037a637
|
Loading…
Reference in New Issue
Block a user