this should be the complete impl for new submodes
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
b879533d41
commit
744f689556
@ -19,18 +19,21 @@ SyrlinksHandler::SyrlinksHandler(object_id_t objectId, object_id_t comIF, Cookie
|
|||||||
SyrlinksHandler::~SyrlinksHandler() = default;
|
SyrlinksHandler::~SyrlinksHandler() = default;
|
||||||
|
|
||||||
void SyrlinksHandler::doStartUp() {
|
void SyrlinksHandler::doStartUp() {
|
||||||
switch (internalState) {
|
if(internalState != InternalState::OFF) {
|
||||||
case InternalState::OFF: {
|
sif::error << "SyrlinksHandler::doStartUp: Not in internal OFF mode, possible config error"
|
||||||
|
<< std::endl;
|
||||||
|
internalState = InternalState::OFF;
|
||||||
|
}
|
||||||
|
if(internalState == InternalState::OFF) {
|
||||||
internalState = InternalState::ENABLE_TEMPERATURE_PROTECTION;
|
internalState = InternalState::ENABLE_TEMPERATURE_PROTECTION;
|
||||||
break;
|
|
||||||
}
|
|
||||||
case InternalState::IDLE: {
|
|
||||||
setMode(_MODE_TO_ON);
|
|
||||||
commandExecuted = false;
|
commandExecuted = false;
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
default:
|
if(internalState == InternalState::ENABLE_TEMPERATURE_PROTECTION) {
|
||||||
break;
|
if(commandExecuted) {
|
||||||
|
setMode(_MODE_TO_ON);
|
||||||
|
internalState = InternalState::IDLE;
|
||||||
|
commandExecuted = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -97,6 +100,14 @@ ReturnValue_t SyrlinksHandler::buildTransitionDeviceCommand(DeviceCommandId_t* i
|
|||||||
*id = syrlinks::SET_TX_MODE_MODULATION;
|
*id = syrlinks::SET_TX_MODE_MODULATION;
|
||||||
return buildCommandFromCommand(*id, nullptr, 0);
|
return buildCommandFromCommand(*id, nullptr, 0);
|
||||||
}
|
}
|
||||||
|
case InternalState::SELECT_MODULATION_BPSK: {
|
||||||
|
*id = syrlinks::SET_WAVEFORM_BPSK;
|
||||||
|
return buildCommandFromCommand(*id, nullptr, 0);
|
||||||
|
}
|
||||||
|
case InternalState::SELECT_MODULATION_0QPSK: {
|
||||||
|
*id = syrlinks::SET_WAVEFORM_0QPSK;
|
||||||
|
return buildCommandFromCommand(*id, nullptr, 0);
|
||||||
|
}
|
||||||
case InternalState::SET_TX_CW: {
|
case InternalState::SET_TX_CW: {
|
||||||
*id = syrlinks::SET_TX_MODE_CW;
|
*id = syrlinks::SET_TX_MODE_CW;
|
||||||
return buildCommandFromCommand(*id, nullptr, 0);
|
return buildCommandFromCommand(*id, nullptr, 0);
|
||||||
@ -175,11 +186,11 @@ ReturnValue_t SyrlinksHandler::buildCommandFromCommand(DeviceCommandId_t deviceC
|
|||||||
prepareCommand(tempBasebandBoardLowByte, deviceCommand);
|
prepareCommand(tempBasebandBoardLowByte, deviceCommand);
|
||||||
return returnvalue::OK;
|
return returnvalue::OK;
|
||||||
}
|
}
|
||||||
case (syrlinks::CONFIG_BPSK): {
|
case (syrlinks::SET_WAVEFORM_BPSK): {
|
||||||
prepareCommand(configBPSK, deviceCommand);
|
prepareCommand(configBPSK, deviceCommand);
|
||||||
return returnvalue::OK;
|
return returnvalue::OK;
|
||||||
}
|
}
|
||||||
case (syrlinks::CONFIG_OQPSK): {
|
case (syrlinks::SET_WAVEFORM_0QPSK): {
|
||||||
prepareCommand(configOQPSK, deviceCommand);
|
prepareCommand(configOQPSK, deviceCommand);
|
||||||
return returnvalue::OK;
|
return returnvalue::OK;
|
||||||
}
|
}
|
||||||
@ -210,9 +221,9 @@ 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::CONFIG_BPSK, 1, nullptr, syrlinks::ACK_SIZE, false,
|
this->insertInCommandAndReplyMap(syrlinks::SET_WAVEFORM_BPSK, 1, nullptr, syrlinks::ACK_SIZE, false,
|
||||||
true, syrlinks::ACK_REPLY);
|
true, syrlinks::ACK_REPLY);
|
||||||
this->insertInCommandAndReplyMap(syrlinks::CONFIG_OQPSK, 1, nullptr, syrlinks::ACK_SIZE, false,
|
this->insertInCommandAndReplyMap(syrlinks::SET_WAVEFORM_0QPSK, 1, nullptr, syrlinks::ACK_SIZE, false,
|
||||||
true, syrlinks::ACK_REPLY);
|
true, syrlinks::ACK_REPLY);
|
||||||
this->insertInCommandMap(syrlinks::ENABLE_DEBUG);
|
this->insertInCommandMap(syrlinks::ENABLE_DEBUG);
|
||||||
this->insertInCommandMap(syrlinks::DISABLE_DEBUG);
|
this->insertInCommandMap(syrlinks::DISABLE_DEBUG);
|
||||||
@ -645,27 +656,16 @@ ReturnValue_t SyrlinksHandler::handleAckReply(const uint8_t* packet) {
|
|||||||
if (result != returnvalue::OK) {
|
if (result != returnvalue::OK) {
|
||||||
internalState = InternalState::OFF;
|
internalState = InternalState::OFF;
|
||||||
} else if (result == returnvalue::OK) {
|
} else if (result == returnvalue::OK) {
|
||||||
internalState = InternalState::IDLE;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case (syrlinks::SET_TX_MODE_STANDBY): {
|
|
||||||
if (result == returnvalue::OK) {
|
|
||||||
internalState = InternalState::IDLE;
|
|
||||||
commandExecuted = true;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case (syrlinks::SET_TX_MODE_MODULATION): {
|
|
||||||
if (result == returnvalue::OK) {
|
|
||||||
internalState = InternalState::IDLE;
|
|
||||||
commandExecuted = true;
|
commandExecuted = true;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case(syrlinks::SET_WAVEFORM_BPSK):
|
||||||
|
case(syrlinks::SET_WAVEFORM_0QPSK):
|
||||||
|
case (syrlinks::SET_TX_MODE_STANDBY):
|
||||||
|
case (syrlinks::SET_TX_MODE_MODULATION):
|
||||||
case (syrlinks::SET_TX_MODE_CW): {
|
case (syrlinks::SET_TX_MODE_CW): {
|
||||||
if (result == returnvalue::OK) {
|
if (result == returnvalue::OK and isTransitionalMode()) {
|
||||||
internalState = InternalState::IDLE;
|
|
||||||
commandExecuted = true;
|
commandExecuted = true;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -704,9 +704,9 @@ void SyrlinksHandler::doTransition(Mode_t modeFrom, Submode_t subModeFrom) {
|
|||||||
case (syrlinks::Submode::TX_MODULATION_LOW_DATARATE): {
|
case (syrlinks::Submode::TX_MODULATION_LOW_DATARATE): {
|
||||||
if (internalState == InternalState::IDLE) {
|
if (internalState == InternalState::IDLE) {
|
||||||
commandExecuted = false;
|
commandExecuted = false;
|
||||||
internalState = InternalState::SELECT_MODULATION_QPSK;
|
internalState = InternalState::SELECT_MODULATION_BPSK;
|
||||||
}
|
}
|
||||||
if (internalState == InternalState::SELECT_MODULATION_QPSK) {
|
if (internalState == InternalState::SELECT_MODULATION_BPSK) {
|
||||||
if (commandExecuted) {
|
if (commandExecuted) {
|
||||||
internalState = InternalState::SET_TX_MODULATION;
|
internalState = InternalState::SET_TX_MODULATION;
|
||||||
commandExecuted = false;
|
commandExecuted = false;
|
||||||
@ -723,9 +723,9 @@ void SyrlinksHandler::doTransition(Mode_t modeFrom, Submode_t subModeFrom) {
|
|||||||
case (syrlinks::Submode::TX_MODULATION_HIGH_DATARATE): {
|
case (syrlinks::Submode::TX_MODULATION_HIGH_DATARATE): {
|
||||||
if (internalState == InternalState::IDLE) {
|
if (internalState == InternalState::IDLE) {
|
||||||
commandExecuted = false;
|
commandExecuted = false;
|
||||||
internalState = InternalState::SELECT_MODULATION_0BPSK;
|
internalState = InternalState::SELECT_MODULATION_0QPSK;
|
||||||
}
|
}
|
||||||
if (internalState == InternalState::SELECT_MODULATION_0BPSK) {
|
if (internalState == InternalState::SELECT_MODULATION_0QPSK) {
|
||||||
if (commandExecuted) {
|
if (commandExecuted) {
|
||||||
internalState = InternalState::SET_TX_MODULATION;
|
internalState = InternalState::SET_TX_MODULATION;
|
||||||
commandExecuted = false;
|
commandExecuted = false;
|
||||||
|
@ -113,8 +113,8 @@ class SyrlinksHandler : public DeviceHandlerBase {
|
|||||||
enum class InternalState {
|
enum class InternalState {
|
||||||
OFF,
|
OFF,
|
||||||
ENABLE_TEMPERATURE_PROTECTION,
|
ENABLE_TEMPERATURE_PROTECTION,
|
||||||
SELECT_MODULATION_0BPSK,
|
SELECT_MODULATION_BPSK,
|
||||||
SELECT_MODULATION_QPSK,
|
SELECT_MODULATION_0QPSK,
|
||||||
SET_TX_MODULATION,
|
SET_TX_MODULATION,
|
||||||
SET_TX_CW,
|
SET_TX_CW,
|
||||||
SET_TX_STANDBY,
|
SET_TX_STANDBY,
|
||||||
|
@ -40,9 +40,9 @@ static const DeviceCommandId_t TEMP_POWER_AMPLIFIER_HIGH_BYTE = 13;
|
|||||||
static const DeviceCommandId_t TEMP_POWER_AMPLIFIER_LOW_BYTE = 14;
|
static const DeviceCommandId_t TEMP_POWER_AMPLIFIER_LOW_BYTE = 14;
|
||||||
static const DeviceCommandId_t TEMP_BASEBAND_BOARD_HIGH_BYTE = 15;
|
static const DeviceCommandId_t TEMP_BASEBAND_BOARD_HIGH_BYTE = 15;
|
||||||
static const DeviceCommandId_t TEMP_BASEBAND_BOARD_LOW_BYTE = 16;
|
static const DeviceCommandId_t TEMP_BASEBAND_BOARD_LOW_BYTE = 16;
|
||||||
static const DeviceCommandId_t CONFIG_OQPSK = 17;
|
static const DeviceCommandId_t SET_WAVEFORM_0QPSK = 17;
|
||||||
// After startup syrlinks always in BSPK configuration
|
// After startup syrlinks always in BSPK configuration
|
||||||
static const DeviceCommandId_t CONFIG_BPSK = 18;
|
static const DeviceCommandId_t SET_WAVEFORM_BPSK = 18;
|
||||||
static const DeviceCommandId_t ENABLE_DEBUG = 20;
|
static const DeviceCommandId_t ENABLE_DEBUG = 20;
|
||||||
static const DeviceCommandId_t DISABLE_DEBUG = 21;
|
static const DeviceCommandId_t DISABLE_DEBUG = 21;
|
||||||
|
|
||||||
|
2
tmtc
2
tmtc
@ -1 +1 @@
|
|||||||
Subproject commit 8a7880bc35d1069577b7e0427c1f45c54ac5241c
|
Subproject commit c36c7ca5bbe12b74f096414383eedfc16576a9d2
|
Loading…
Reference in New Issue
Block a user