bugfixes in pdec handler parameter commands

This commit is contained in:
Jakob Meier 2023-02-23 15:19:48 +01:00
commit 513dcf9be1
29 changed files with 307 additions and 149 deletions

View File

@ -8,16 +8,33 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/).
The [milestone](https://egit.irs.uni-stuttgart.de/eive/eive-obsw/milestones) The [milestone](https://egit.irs.uni-stuttgart.de/eive/eive-obsw/milestones)
list yields a list of all related PRs for each release. list yields a list of all related PRs for each release.
Starting at v2.0.0, the following changes will consitute of a breaking Starting at v2.0.0, this project will adhere to semantic versioning and the the following changes
change warranting a new major release: will consitute of a breaking change warranting a new major release:
- The TMTC interface changes in any shape of form. - The TMTC interface changes in any shape of form.
- The behavour of the OBSW changes in a major shape or form relevant - The behavour of the OBSW changes in a major shape or form relevant for operations
for operations
# [unreleased] # [unreleased]
## Added ## Changed
COM PR: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/pulls/364
* Moved transmitter timer and handling of carrier and bitlock event from CCSDS handler to COM
subsystem
* Added parameter command to be able to change the transmitter timeout
* Solves [#362](https://egit.irs.uni-stuttgart.de/eive/eive-obsw/issues/362)
* Solves [#360](https://egit.irs.uni-stuttgart.de/eive/eive-obsw/issues/360)
* Solves [#361](https://egit.irs.uni-stuttgart.de/eive/eive-obsw/issues/361)
* Solves [#386](https://egit.irs.uni-stuttgart.de/eive/eive-obsw/issues/386)
# [v1.30.0]
eive-tmtc: v2.14.0
Event IDs for PDEC handler have changed in a breaking manner.
## Added and Fixed
- PDEC: Added basic FDIR to limit the number of allowed TC interrupts and to allow complete task - PDEC: Added basic FDIR to limit the number of allowed TC interrupts and to allow complete task
lockups in the case an IRQ is immediately re-raised by the PDEC module. This is done by only lockups in the case an IRQ is immediately re-raised by the PDEC module. This is done by only

View File

@ -10,8 +10,8 @@
cmake_minimum_required(VERSION 3.13) cmake_minimum_required(VERSION 3.13)
set(OBSW_VERSION_MAJOR 1) set(OBSW_VERSION_MAJOR 1)
set(OBSW_VERSION_MINOR 29) set(OBSW_VERSION_MINOR 30)
set(OBSW_VERSION_REVISION 1) set(OBSW_VERSION_REVISION 0)
# set(CMAKE_VERBOSE TRUE) # set(CMAKE_VERBOSE TRUE)

View File

@ -1,7 +1,7 @@
/** /**
* @brief Auto-generated event translation file. Contains 257 translations. * @brief Auto-generated event translation file. Contains 258 translations.
* @details * @details
* Generated on: 2023-02-21 10:44:59 * Generated on: 2023-02-22 15:00:34
*/ */
#include "translateEvents.h" #include "translateEvents.h"
@ -151,6 +151,7 @@ const char *CARRIER_LOCK_STRING = "CARRIER_LOCK";
const char *BIT_LOCK_PDEC_STRING = "BIT_LOCK_PDEC"; const char *BIT_LOCK_PDEC_STRING = "BIT_LOCK_PDEC";
const char *LOST_CARRIER_LOCK_PDEC_STRING = "LOST_CARRIER_LOCK_PDEC"; const char *LOST_CARRIER_LOCK_PDEC_STRING = "LOST_CARRIER_LOCK_PDEC";
const char *LOST_BIT_LOCK_PDEC_STRING = "LOST_BIT_LOCK_PDEC"; const char *LOST_BIT_LOCK_PDEC_STRING = "LOST_BIT_LOCK_PDEC";
const char *TOO_MANY_IRQS_STRING = "TOO_MANY_IRQS";
const char *POLL_SYSCALL_ERROR_PDEC_STRING = "POLL_SYSCALL_ERROR_PDEC"; const char *POLL_SYSCALL_ERROR_PDEC_STRING = "POLL_SYSCALL_ERROR_PDEC";
const char *WRITE_SYSCALL_ERROR_PDEC_STRING = "WRITE_SYSCALL_ERROR_PDEC"; const char *WRITE_SYSCALL_ERROR_PDEC_STRING = "WRITE_SYSCALL_ERROR_PDEC";
const char *IMAGE_UPLOAD_FAILED_STRING = "IMAGE_UPLOAD_FAILED"; const char *IMAGE_UPLOAD_FAILED_STRING = "IMAGE_UPLOAD_FAILED";
@ -553,8 +554,10 @@ const char *translateEvents(Event event) {
case (12406): case (12406):
return LOST_BIT_LOCK_PDEC_STRING; return LOST_BIT_LOCK_PDEC_STRING;
case (12407): case (12407):
return POLL_SYSCALL_ERROR_PDEC_STRING; return TOO_MANY_IRQS_STRING;
case (12408): case (12408):
return POLL_SYSCALL_ERROR_PDEC_STRING;
case (12409):
return WRITE_SYSCALL_ERROR_PDEC_STRING; return WRITE_SYSCALL_ERROR_PDEC_STRING;
case (12500): case (12500):
return IMAGE_UPLOAD_FAILED_STRING; return IMAGE_UPLOAD_FAILED_STRING;

View File

@ -2,7 +2,7 @@
* @brief Auto-generated object translation file. * @brief Auto-generated object translation file.
* @details * @details
* Contains 148 translations. * Contains 148 translations.
* Generated on: 2023-02-21 10:44:59 * Generated on: 2023-02-22 15:00:34
*/ */
#include "translateObjects.h" #include "translateObjects.h"

View File

@ -389,7 +389,7 @@ ReturnValue_t CoreController::sdStateMachine() {
sdInfo.cycleCount = 0; sdInfo.cycleCount = 0;
return true; return true;
} else if (sdInfo.cycleCount > 4) { } else if (sdInfo.cycleCount > 4) {
sif::warning << "CoreController::sdInitStateMachine: " << opPrintout << " takes too long" sif::warning << "CoreController::sdStateMachine: " << opPrintout << " takes too long"
<< std::endl; << std::endl;
return false; return false;
} }
@ -401,7 +401,7 @@ ReturnValue_t CoreController::sdStateMachine() {
// Create updated status file // Create updated status file
result = sdcMan->updateSdCardStateFile(); result = sdcMan->updateSdCardStateFile();
if (result != returnvalue::OK) { if (result != returnvalue::OK) {
sif::warning << "CoreController::initialize: Updating SD card state file failed" sif::warning << "CoreController::sdStateMachine: Updating SD card state file failed"
<< std::endl; << std::endl;
} }
sdInfo.commandExecuted = true; sdInfo.commandExecuted = true;

View File

@ -575,7 +575,6 @@ void ObjectFactory::createSyrlinksComponents(PowerSwitchIF* pwrSwitcher) {
new SyrlinksHandler(objects::SYRLINKS_HANDLER, objects::UART_COM_IF, syrlinksUartCookie, new SyrlinksHandler(objects::SYRLINKS_HANDLER, objects::UART_COM_IF, syrlinksUartCookie,
pcdu::PDU1_CH1_SYRLINKS_12V, syrlinksFdir); pcdu::PDU1_CH1_SYRLINKS_12V, syrlinksFdir);
syrlinksHandler->setPowerSwitcher(pwrSwitcher); syrlinksHandler->setPowerSwitcher(pwrSwitcher);
syrlinksHandler->setStartUpImmediately();
syrlinksHandler->connectModeTreeParent(satsystem::com::SUBSYSTEM); syrlinksHandler->connectModeTreeParent(satsystem::com::SUBSYSTEM);
#if OBSW_DEBUG_SYRLINKS == 1 #if OBSW_DEBUG_SYRLINKS == 1
syrlinksHandler->setDebugMode(true); syrlinksHandler->setDebugMode(true);
@ -759,9 +758,9 @@ ReturnValue_t ObjectFactory::createCcsdsComponents(LinuxLibgpioIF* gpioComIF,
new AxiPtmeConfig(objects::AXI_PTME_CONFIG, q7s::UIO_PTME, q7s::uiomapids::PTME_CONFIG); new AxiPtmeConfig(objects::AXI_PTME_CONFIG, q7s::UIO_PTME, q7s::uiomapids::PTME_CONFIG);
PtmeConfig* ptmeConfig = new PtmeConfig(objects::PTME_CONFIG, axiPtmeConfig); PtmeConfig* ptmeConfig = new PtmeConfig(objects::PTME_CONFIG, axiPtmeConfig);
*ipCoreHandler = new CcsdsIpCoreHandler( *ipCoreHandler = new CcsdsIpCoreHandler(objects::CCSDS_HANDLER, objects::PTME,
objects::CCSDS_HANDLER, objects::PTME, objects::CCSDS_PACKET_DISTRIBUTOR, ptmeConfig, objects::CCSDS_PACKET_DISTRIBUTOR, ptmeConfig, gpioComIF,
gpioComIF, gpioIds::RS485_EN_TX_CLOCK, gpioIds::RS485_EN_TX_DATA); gpioIds::RS485_EN_TX_CLOCK, gpioIds::RS485_EN_TX_DATA);
VirtualChannel* vc = nullptr; VirtualChannel* vc = nullptr;
vc = new VirtualChannel(ccsds::VC0, config::VC0_QUEUE_SIZE, objects::CCSDS_HANDLER); vc = new VirtualChannel(ccsds::VC0, config::VC0_QUEUE_SIZE, objects::CCSDS_HANDLER);
(*ipCoreHandler)->addVirtualChannel(ccsds::VC0, vc); (*ipCoreHandler)->addVirtualChannel(ccsds::VC0, vc);

View File

@ -8,6 +8,26 @@ LocalParameterHandler::~LocalParameterHandler() {
} }
ReturnValue_t LocalParameterHandler::initialize() { ReturnValue_t LocalParameterHandler::initialize() {
ReturnValue_t result = updateFullName();
if (result != returnvalue::OK) {
return result;
}
result = readJsonFile();
if (result != returnvalue::OK) {
return result;
}
return returnvalue::OK;
}
ReturnValue_t LocalParameterHandler::writeJsonFile() {
ReturnValue_t result = updateFullName();
if (result != returnvalue::OK) {
return result;
}
return NVMParameterBase::writeJsonFile();
}
ReturnValue_t LocalParameterHandler::updateFullName() {
std::string mountPrefix; std::string mountPrefix;
auto activeSd = sdcMan->getActiveSdCard(); auto activeSd = sdcMan->getActiveSdCard();
if (activeSd and sdcMan->isSdCardUsable(activeSd.value())) { if (activeSd and sdcMan->isSdCardUsable(activeSd.value())) {
@ -15,13 +35,8 @@ ReturnValue_t LocalParameterHandler::initialize() {
} else { } else {
return SD_NOT_READY; return SD_NOT_READY;
} }
mountPrefix = sdcMan->getCurrentMountPrefix();
std::string fullname = mountPrefix + "/" + sdRelativeName; std::string fullname = mountPrefix + "/" + sdRelativeName;
setFullName(fullname); NVMParameterBase::setFullName(fullname);
ReturnValue_t result = readJsonFile();
if (result != returnvalue::OK) {
return result;
}
return returnvalue::OK; return returnvalue::OK;
} }

View File

@ -65,6 +65,16 @@ class LocalParameterHandler : public NVMParameterBase {
std::string sdRelativeName; std::string sdRelativeName;
SdCardMountedIF* sdcMan; SdCardMountedIF* sdcMan;
virtual ReturnValue_t writeJsonFile();
/**
* @brief This function sets the name of the json file dependent on the
* currently active SD card
*
* @return OK if successful, otherwise error return value
*/
ReturnValue_t updateFullName();
}; };
template<typename T> inline ReturnValue_t LocalParameterHandler::addParameter(std::string key, T value) { template<typename T> inline ReturnValue_t LocalParameterHandler::addParameter(std::string key, T value) {

2
fsfw

@ -1 +1 @@
Subproject commit 2efff4d2c5ef82b5b62567ab1bb0ee53aeed6a5a Subproject commit bd208038dd85a94dce8c763397ad5ac7eae76402

View File

@ -145,8 +145,9 @@ Event ID (dec); Event ID (hex); Name; Severity; Description; File Path
12404;0x3074;BIT_LOCK_PDEC;INFO;Bit lock detected (data valid);linux/ipcore/PdecHandler.h 12404;0x3074;BIT_LOCK_PDEC;INFO;Bit lock detected (data valid);linux/ipcore/PdecHandler.h
12405;0x3075;LOST_CARRIER_LOCK_PDEC;INFO;Lost carrier lock;linux/ipcore/PdecHandler.h 12405;0x3075;LOST_CARRIER_LOCK_PDEC;INFO;Lost carrier lock;linux/ipcore/PdecHandler.h
12406;0x3076;LOST_BIT_LOCK_PDEC;INFO;Lost bit lock;linux/ipcore/PdecHandler.h 12406;0x3076;LOST_BIT_LOCK_PDEC;INFO;Lost bit lock;linux/ipcore/PdecHandler.h
12407;0x3077;POLL_SYSCALL_ERROR_PDEC;MEDIUM;No description;linux/ipcore/PdecHandler.h 12407;0x3077;TOO_MANY_IRQS;MEDIUM;Too many IRQs over the time window of one second. P1: Allowed TCs;linux/ipcore/PdecHandler.h
12408;0x3078;WRITE_SYSCALL_ERROR_PDEC;MEDIUM;No description;linux/ipcore/PdecHandler.h 12408;0x3078;POLL_SYSCALL_ERROR_PDEC;MEDIUM;No description;linux/ipcore/PdecHandler.h
12409;0x3079;WRITE_SYSCALL_ERROR_PDEC;MEDIUM;No description;linux/ipcore/PdecHandler.h
12500;0x30d4;IMAGE_UPLOAD_FAILED;LOW;Image upload failed;linux/devices/startracker/StrHelper.h 12500;0x30d4;IMAGE_UPLOAD_FAILED;LOW;Image upload failed;linux/devices/startracker/StrHelper.h
12501;0x30d5;IMAGE_DOWNLOAD_FAILED;LOW;Image download failed;linux/devices/startracker/StrHelper.h 12501;0x30d5;IMAGE_DOWNLOAD_FAILED;LOW;Image download failed;linux/devices/startracker/StrHelper.h
12502;0x30d6;IMAGE_UPLOAD_SUCCESSFUL;LOW;Uploading image to star tracker was successfulop;linux/devices/startracker/StrHelper.h 12502;0x30d6;IMAGE_UPLOAD_SUCCESSFUL;LOW;Uploading image to star tracker was successfulop;linux/devices/startracker/StrHelper.h

1 Event ID (dec) Event ID (hex) Name Severity Description File Path
145 12404 0x3074 BIT_LOCK_PDEC INFO Bit lock detected (data valid) linux/ipcore/PdecHandler.h
146 12405 0x3075 LOST_CARRIER_LOCK_PDEC INFO Lost carrier lock linux/ipcore/PdecHandler.h
147 12406 0x3076 LOST_BIT_LOCK_PDEC INFO Lost bit lock linux/ipcore/PdecHandler.h
148 12407 0x3077 POLL_SYSCALL_ERROR_PDEC TOO_MANY_IRQS MEDIUM No description Too many IRQs over the time window of one second. P1: Allowed TCs linux/ipcore/PdecHandler.h
149 12408 0x3078 WRITE_SYSCALL_ERROR_PDEC POLL_SYSCALL_ERROR_PDEC MEDIUM No description linux/ipcore/PdecHandler.h
150 12409 0x3079 WRITE_SYSCALL_ERROR_PDEC MEDIUM No description linux/ipcore/PdecHandler.h
151 12500 0x30d4 IMAGE_UPLOAD_FAILED LOW Image upload failed linux/devices/startracker/StrHelper.h
152 12501 0x30d5 IMAGE_DOWNLOAD_FAILED LOW Image download failed linux/devices/startracker/StrHelper.h
153 12502 0x30d6 IMAGE_UPLOAD_SUCCESSFUL LOW Uploading image to star tracker was successfulop linux/devices/startracker/StrHelper.h

View File

@ -145,8 +145,9 @@ Event ID (dec); Event ID (hex); Name; Severity; Description; File Path
12404;0x3074;BIT_LOCK_PDEC;INFO;Bit lock detected (data valid);linux/ipcore/PdecHandler.h 12404;0x3074;BIT_LOCK_PDEC;INFO;Bit lock detected (data valid);linux/ipcore/PdecHandler.h
12405;0x3075;LOST_CARRIER_LOCK_PDEC;INFO;Lost carrier lock;linux/ipcore/PdecHandler.h 12405;0x3075;LOST_CARRIER_LOCK_PDEC;INFO;Lost carrier lock;linux/ipcore/PdecHandler.h
12406;0x3076;LOST_BIT_LOCK_PDEC;INFO;Lost bit lock;linux/ipcore/PdecHandler.h 12406;0x3076;LOST_BIT_LOCK_PDEC;INFO;Lost bit lock;linux/ipcore/PdecHandler.h
12407;0x3077;POLL_SYSCALL_ERROR_PDEC;MEDIUM;No description;linux/ipcore/PdecHandler.h 12407;0x3077;TOO_MANY_IRQS;MEDIUM;Too many IRQs over the time window of one second. P1: Allowed TCs;linux/ipcore/PdecHandler.h
12408;0x3078;WRITE_SYSCALL_ERROR_PDEC;MEDIUM;No description;linux/ipcore/PdecHandler.h 12408;0x3078;POLL_SYSCALL_ERROR_PDEC;MEDIUM;No description;linux/ipcore/PdecHandler.h
12409;0x3079;WRITE_SYSCALL_ERROR_PDEC;MEDIUM;No description;linux/ipcore/PdecHandler.h
12500;0x30d4;IMAGE_UPLOAD_FAILED;LOW;Image upload failed;linux/devices/startracker/StrHelper.h 12500;0x30d4;IMAGE_UPLOAD_FAILED;LOW;Image upload failed;linux/devices/startracker/StrHelper.h
12501;0x30d5;IMAGE_DOWNLOAD_FAILED;LOW;Image download failed;linux/devices/startracker/StrHelper.h 12501;0x30d5;IMAGE_DOWNLOAD_FAILED;LOW;Image download failed;linux/devices/startracker/StrHelper.h
12502;0x30d6;IMAGE_UPLOAD_SUCCESSFUL;LOW;Uploading image to star tracker was successfulop;linux/devices/startracker/StrHelper.h 12502;0x30d6;IMAGE_UPLOAD_SUCCESSFUL;LOW;Uploading image to star tracker was successfulop;linux/devices/startracker/StrHelper.h

1 Event ID (dec) Event ID (hex) Name Severity Description File Path
145 12404 0x3074 BIT_LOCK_PDEC INFO Bit lock detected (data valid) linux/ipcore/PdecHandler.h
146 12405 0x3075 LOST_CARRIER_LOCK_PDEC INFO Lost carrier lock linux/ipcore/PdecHandler.h
147 12406 0x3076 LOST_BIT_LOCK_PDEC INFO Lost bit lock linux/ipcore/PdecHandler.h
148 12407 0x3077 POLL_SYSCALL_ERROR_PDEC TOO_MANY_IRQS MEDIUM No description Too many IRQs over the time window of one second. P1: Allowed TCs linux/ipcore/PdecHandler.h
149 12408 0x3078 WRITE_SYSCALL_ERROR_PDEC POLL_SYSCALL_ERROR_PDEC MEDIUM No description linux/ipcore/PdecHandler.h
150 12409 0x3079 WRITE_SYSCALL_ERROR_PDEC MEDIUM No description linux/ipcore/PdecHandler.h
151 12500 0x30d4 IMAGE_UPLOAD_FAILED LOW Image upload failed linux/devices/startracker/StrHelper.h
152 12501 0x30d5 IMAGE_DOWNLOAD_FAILED LOW Image download failed linux/devices/startracker/StrHelper.h
153 12502 0x30d6 IMAGE_UPLOAD_SUCCESSFUL LOW Uploading image to star tracker was successfulop linux/devices/startracker/StrHelper.h

View File

@ -1,7 +1,7 @@
/** /**
* @brief Auto-generated event translation file. Contains 257 translations. * @brief Auto-generated event translation file. Contains 258 translations.
* @details * @details
* Generated on: 2023-02-21 10:44:59 * Generated on: 2023-02-22 15:00:34
*/ */
#include "translateEvents.h" #include "translateEvents.h"
@ -151,6 +151,7 @@ const char *CARRIER_LOCK_STRING = "CARRIER_LOCK";
const char *BIT_LOCK_PDEC_STRING = "BIT_LOCK_PDEC"; const char *BIT_LOCK_PDEC_STRING = "BIT_LOCK_PDEC";
const char *LOST_CARRIER_LOCK_PDEC_STRING = "LOST_CARRIER_LOCK_PDEC"; const char *LOST_CARRIER_LOCK_PDEC_STRING = "LOST_CARRIER_LOCK_PDEC";
const char *LOST_BIT_LOCK_PDEC_STRING = "LOST_BIT_LOCK_PDEC"; const char *LOST_BIT_LOCK_PDEC_STRING = "LOST_BIT_LOCK_PDEC";
const char *TOO_MANY_IRQS_STRING = "TOO_MANY_IRQS";
const char *POLL_SYSCALL_ERROR_PDEC_STRING = "POLL_SYSCALL_ERROR_PDEC"; const char *POLL_SYSCALL_ERROR_PDEC_STRING = "POLL_SYSCALL_ERROR_PDEC";
const char *WRITE_SYSCALL_ERROR_PDEC_STRING = "WRITE_SYSCALL_ERROR_PDEC"; const char *WRITE_SYSCALL_ERROR_PDEC_STRING = "WRITE_SYSCALL_ERROR_PDEC";
const char *IMAGE_UPLOAD_FAILED_STRING = "IMAGE_UPLOAD_FAILED"; const char *IMAGE_UPLOAD_FAILED_STRING = "IMAGE_UPLOAD_FAILED";
@ -553,8 +554,10 @@ const char *translateEvents(Event event) {
case (12406): case (12406):
return LOST_BIT_LOCK_PDEC_STRING; return LOST_BIT_LOCK_PDEC_STRING;
case (12407): case (12407):
return POLL_SYSCALL_ERROR_PDEC_STRING; return TOO_MANY_IRQS_STRING;
case (12408): case (12408):
return POLL_SYSCALL_ERROR_PDEC_STRING;
case (12409):
return WRITE_SYSCALL_ERROR_PDEC_STRING; return WRITE_SYSCALL_ERROR_PDEC_STRING;
case (12500): case (12500):
return IMAGE_UPLOAD_FAILED_STRING; return IMAGE_UPLOAD_FAILED_STRING;

View File

@ -2,7 +2,7 @@
* @brief Auto-generated object translation file. * @brief Auto-generated object translation file.
* @details * @details
* Contains 153 translations. * Contains 153 translations.
* Generated on: 2023-02-21 10:44:59 * Generated on: 2023-02-22 15:00:34
*/ */
#include "translateObjects.h" #include "translateObjects.h"

View File

@ -3,8 +3,9 @@ if(EIVE_BUILD_GPSD_GPS_HANDLER)
endif() endif()
target_sources( target_sources(
${OBSW_NAME} PRIVATE Max31865RtdPolling.cpp ScexUartReader.cpp ImtqPollingTask.cpp ${OBSW_NAME}
ScexDleParser.cpp ScexHelper.cpp RwPollingTask.cpp) PRIVATE Max31865RtdPolling.cpp ScexUartReader.cpp ImtqPollingTask.cpp
ScexDleParser.cpp ScexHelper.cpp RwPollingTask.cpp)
add_subdirectory(ploc) add_subdirectory(ploc)

View File

@ -1,7 +1,7 @@
/** /**
* @brief Auto-generated event translation file. Contains 257 translations. * @brief Auto-generated event translation file. Contains 258 translations.
* @details * @details
* Generated on: 2023-02-21 10:44:59 * Generated on: 2023-02-22 15:00:34
*/ */
#include "translateEvents.h" #include "translateEvents.h"
@ -151,6 +151,7 @@ const char *CARRIER_LOCK_STRING = "CARRIER_LOCK";
const char *BIT_LOCK_PDEC_STRING = "BIT_LOCK_PDEC"; const char *BIT_LOCK_PDEC_STRING = "BIT_LOCK_PDEC";
const char *LOST_CARRIER_LOCK_PDEC_STRING = "LOST_CARRIER_LOCK_PDEC"; const char *LOST_CARRIER_LOCK_PDEC_STRING = "LOST_CARRIER_LOCK_PDEC";
const char *LOST_BIT_LOCK_PDEC_STRING = "LOST_BIT_LOCK_PDEC"; const char *LOST_BIT_LOCK_PDEC_STRING = "LOST_BIT_LOCK_PDEC";
const char *TOO_MANY_IRQS_STRING = "TOO_MANY_IRQS";
const char *POLL_SYSCALL_ERROR_PDEC_STRING = "POLL_SYSCALL_ERROR_PDEC"; const char *POLL_SYSCALL_ERROR_PDEC_STRING = "POLL_SYSCALL_ERROR_PDEC";
const char *WRITE_SYSCALL_ERROR_PDEC_STRING = "WRITE_SYSCALL_ERROR_PDEC"; const char *WRITE_SYSCALL_ERROR_PDEC_STRING = "WRITE_SYSCALL_ERROR_PDEC";
const char *IMAGE_UPLOAD_FAILED_STRING = "IMAGE_UPLOAD_FAILED"; const char *IMAGE_UPLOAD_FAILED_STRING = "IMAGE_UPLOAD_FAILED";
@ -553,8 +554,10 @@ const char *translateEvents(Event event) {
case (12406): case (12406):
return LOST_BIT_LOCK_PDEC_STRING; return LOST_BIT_LOCK_PDEC_STRING;
case (12407): case (12407):
return POLL_SYSCALL_ERROR_PDEC_STRING; return TOO_MANY_IRQS_STRING;
case (12408): case (12408):
return POLL_SYSCALL_ERROR_PDEC_STRING;
case (12409):
return WRITE_SYSCALL_ERROR_PDEC_STRING; return WRITE_SYSCALL_ERROR_PDEC_STRING;
case (12500): case (12500):
return IMAGE_UPLOAD_FAILED_STRING; return IMAGE_UPLOAD_FAILED_STRING;

View File

@ -2,7 +2,7 @@
* @brief Auto-generated object translation file. * @brief Auto-generated object translation file.
* @details * @details
* Contains 153 translations. * Contains 153 translations.
* Generated on: 2023-02-21 10:44:59 * Generated on: 2023-02-22 15:00:34
*/ */
#include "translateObjects.h" #include "translateObjects.h"

View File

@ -82,6 +82,11 @@ ReturnValue_t PdecHandler::initialize() {
return result; return result;
} }
result = paramHelper.initialize();
if (result != returnvalue::OK) {
return result;
}
return returnvalue::OK; return returnvalue::OK;
} }
@ -128,15 +133,25 @@ ReturnValue_t PdecHandler::polledOperation() {
readCommandQueue(); readCommandQueue();
switch (state) { switch (state) {
case State::INIT: case State::INIT: {
handleInitState(); handleInitState();
break; break;
case State::RUNNING: }
case State::RUNNING: {
if (newTcReceived()) { if (newTcReceived()) {
handleNewTc(); handleNewTc();
} }
checkLocks(); checkLocks();
break; break;
}
case State::PDEC_RESET: {
ReturnValue_t result = pdecToReset();
if (result != returnvalue::OK) {
triggerEvent(PDEC_RESET_FAILED);
}
state = State::INIT;
break;
}
case State::WAIT_FOR_RECOVERY: case State::WAIT_FOR_RECOVERY:
break; break;
default: default:
@ -170,9 +185,19 @@ ReturnValue_t PdecHandler::irqOperation() {
info = 1; info = 1;
readCommandQueue(); readCommandQueue();
switch (state) { switch (state) {
case State::INIT: case State::INIT: {
handleInitState(); handleInitState();
checkLocks();
break; break;
}
case State::PDEC_RESET: {
ReturnValue_t result = pdecToReset();
if (result != returnvalue::OK) {
triggerEvent(PDEC_RESET_FAILED);
}
state = State::INIT;
break;
}
case State::RUNNING: { case State::RUNNING: {
checkAndHandleIrqs(fd, info); checkAndHandleIrqs(fd, info);
break; break;
@ -337,6 +362,8 @@ ReturnValue_t PdecHandler::getParameter(uint8_t domainId, uint8_t uniqueIdentifi
sif::warning << "PdecHandler::getParameter: Failed to set positive window" << std::endl; sif::warning << "PdecHandler::getParameter: Failed to set positive window" << std::endl;
return returnvalue::FAILED; return returnvalue::FAILED;
} }
// PDEC needs reset to apply this parameter change
state = State::PDEC_RESET;
return returnvalue::OK; return returnvalue::OK;
} else if ((domainId == 0) and (uniqueIdentifier == ParameterId::NEGATIVE_WINDOW)) { } else if ((domainId == 0) and (uniqueIdentifier == ParameterId::NEGATIVE_WINDOW)) {
uint8_t newVal = 0; uint8_t newVal = 0;
@ -352,11 +379,13 @@ ReturnValue_t PdecHandler::getParameter(uint8_t domainId, uint8_t uniqueIdentifi
return returnvalue::FAILED; return returnvalue::FAILED;
} }
parameterWrapper->set(negativeWindow); parameterWrapper->set(negativeWindow);
result = pdecConfig.setNegativeWindow(negativeWindow); result = pdecConfig.setNegativeWindow(newVal);
if (result != returnvalue::OK) { if (result != returnvalue::OK) {
sif::warning << "PdecHandler::getParameter: Failed to set negative window" << std::endl; sif::warning << "PdecHandler::getParameter: Failed to set negative window" << std::endl;
return returnvalue::FAILED; return returnvalue::FAILED;
} }
// PDEC needs reset to apply this parameter change
state = State::PDEC_RESET;
return returnvalue::OK; return returnvalue::OK;
} }
return returnvalue::OK; return returnvalue::OK;
@ -388,6 +417,16 @@ ReturnValue_t PdecHandler::releasePdec() {
return result; return result;
} }
ReturnValue_t PdecHandler::pdecToReset() {
ReturnValue_t result = returnvalue::OK;
result = gpioComIF->pullLow(pdecReset);
if (result != returnvalue::OK) {
sif::error << "PdecHandler::pdecToReset: Failed to pull PDEC reset line"
" to low" << std::endl;
}
return result;
}
bool PdecHandler::newTcReceived() { bool PdecHandler::newTcReceived() {
uint32_t pdecFar = readFar(); uint32_t pdecFar = readFar();

View File

@ -99,9 +99,12 @@ class PdecHandler : public SystemObject,
//! [EXPORT] : [COMMENT] Too many IRQs over the time window of one second. P1: Allowed TCs //! [EXPORT] : [COMMENT] Too many IRQs over the time window of one second. P1: Allowed TCs
static constexpr Event TOO_MANY_IRQS = MAKE_EVENT(7, severity::MEDIUM); static constexpr Event TOO_MANY_IRQS = MAKE_EVENT(7, severity::MEDIUM);
static constexpr Event POLL_SYSCALL_ERROR_PDEC = static constexpr Event POLL_SYSCALL_ERROR_PDEC =
event::makeEvent(SUBSYSTEM_ID, 7, severity::MEDIUM);
static constexpr Event WRITE_SYSCALL_ERROR_PDEC =
event::makeEvent(SUBSYSTEM_ID, 8, severity::MEDIUM); event::makeEvent(SUBSYSTEM_ID, 8, severity::MEDIUM);
static constexpr Event WRITE_SYSCALL_ERROR_PDEC =
event::makeEvent(SUBSYSTEM_ID, 9, severity::MEDIUM);
//! [EXPORT] : [COMMENT] Failed to pull PDEC reset to low
static constexpr Event PDEC_RESET_FAILED =
event::makeEvent(SUBSYSTEM_ID, 10, severity::HIGH);
private: private:
static const uint8_t INTERFACE_ID = CLASS_ID::PDEC_HANDLER; static const uint8_t INTERFACE_ID = CLASS_ID::PDEC_HANDLER;
@ -203,7 +206,7 @@ class PdecHandler : public SystemObject,
INCORRECT_BC_CC INCORRECT_BC_CC
}; };
enum class State : uint8_t { INIT, RUNNING, WAIT_FOR_RECOVERY }; enum class State : uint8_t { INIT, PDEC_RESET, RUNNING, WAIT_FOR_RECOVERY };
static uint32_t CURRENT_FAR; static uint32_t CURRENT_FAR;
@ -303,6 +306,14 @@ class PdecHandler : public SystemObject,
*/ */
ReturnValue_t releasePdec(); ReturnValue_t releasePdec();
/**
* @brief Will set PDEC in reset state. Use releasePdec() to release PDEC
* from reset state
*
* @return OK if successful, otherwise error return value
*/
ReturnValue_t pdecToReset();
/** /**
* @brief Reads the FAR register and checks if a new TC has been received. * @brief Reads the FAR register and checks if a new TC has been received.
*/ */

View File

@ -256,7 +256,7 @@ ReturnValue_t ImtqHandler::scanForReply(const uint8_t* start, size_t remainingSi
ReturnValue_t ImtqHandler::interpretDeviceReply(DeviceCommandId_t id, const uint8_t* packet) { ReturnValue_t ImtqHandler::interpretDeviceReply(DeviceCommandId_t id, const uint8_t* packet) {
ReturnValue_t result; ReturnValue_t result;
ReturnValue_t status = returnvalue::OK; ReturnValue_t status = returnvalue::OK;
if(getMode() != MODE_NORMAL) { if (getMode() != MODE_NORMAL) {
// Ignore replies during transitions. // Ignore replies during transitions.
return returnvalue::OK; return returnvalue::OK;
} }

View File

@ -31,7 +31,7 @@ class NVMParameterBase {
virtual ReturnValue_t writeJsonFile(); virtual ReturnValue_t writeJsonFile();
void setFullName(std::string fullName); virtual void setFullName(std::string fullName);
std::string getFullName() const; std::string getFullName() const;
template <typename T> template <typename T>
@ -69,7 +69,7 @@ inline ReturnValue_t NVMParameterBase::insertValue(std::string key, T value) {
template <typename T> template <typename T>
inline ReturnValue_t NVMParameterBase::setValue(std::string key, T value) { inline ReturnValue_t NVMParameterBase::setValue(std::string key, T value) {
json[key] = value; json[key] = value;
return returnvalue::OK; return returnvalue::OK;
} }

View File

@ -1,5 +1,3 @@
#include <utility>
#include "ComSubsystem.h" #include "ComSubsystem.h"
#include <fsfw/events/EventManagerIF.h> #include <fsfw/events/EventManagerIF.h>
@ -7,12 +5,10 @@
#include <fsfw/ipc/QueueFactory.h> #include <fsfw/ipc/QueueFactory.h>
#include <fsfw/serviceinterface/ServiceInterface.h> #include <fsfw/serviceinterface/ServiceInterface.h>
#include <linux/ipcore/PdecHandler.h> #include <linux/ipcore/PdecHandler.h>
#include <mission/comDefs.h>
#include <mission/config/comCfg.h> #include <mission/config/comCfg.h>
extern std::pair<uint8_t, FixedArrayList<ModeListEntry, 3>> COM_SEQUENCE_RX_ONLY; #include <utility>
extern std::pair<uint8_t, FixedArrayList<ModeListEntry, 3>> COM_SEQUENCE_RX_AND_TX_DEFAULT_RATE;
extern std::pair<uint8_t, FixedArrayList<ModeListEntry, 3>> COM_SEQUENCE_RX_AND_TX_LOW_RATE;
extern std::pair<uint8_t, FixedArrayList<ModeListEntry, 3>> COM_SEQUENCE_RX_AND_TX_HIGH_RATE;
ComSubsystem::ComSubsystem(object_id_t setObjectId, uint32_t maxNumberOfSequences, ComSubsystem::ComSubsystem(object_id_t setObjectId, uint32_t maxNumberOfSequences,
uint32_t maxNumberOfTables, uint32_t transmitterTimeout) uint32_t maxNumberOfTables, uint32_t transmitterTimeout)
@ -26,7 +22,15 @@ ComSubsystem::ComSubsystem(object_id_t setObjectId, uint32_t maxNumberOfSequence
void ComSubsystem::performChildOperation() { void ComSubsystem::performChildOperation() {
readEventQueue(); readEventQueue();
checkTransmitterCountdown(); // Execute default rate sequence after transition has been completed
if (rememberBitLock and not isInTransition) {
startRxAndTxLowRateSeq();
rememberBitLock = false;
}
if (countdownActive) {
checkTransmitterCountdown();
}
Subsystem::performChildOperation();
} }
MessageQueueId_t ComSubsystem::getCommandQueue() const { return Subsystem::getCommandQueue(); } MessageQueueId_t ComSubsystem::getCommandQueue() const { return Subsystem::getCommandQueue(); }
@ -46,17 +50,17 @@ ReturnValue_t ComSubsystem::getParameter(uint8_t domainId, uint8_t uniqueIdentif
parameterWrapper->set(datarateCfg); parameterWrapper->set(datarateCfg);
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
else if ((domainId == 0) and (uniqueIdentifier == static_cast<uint8_t>(com::ParameterId::TRANSMITTER_TIMEOUT))) { (uniqueIdentifier == static_cast<uint8_t>(com::ParameterId::TRANSMITTER_TIMEOUT))) {
uint8_t newVal = 0; uint32_t newVal = 0;
ReturnValue_t result = newValues->getElement(&newVal); ReturnValue_t result = newValues->getElement(&newVal);
if (result != returnvalue::OK) { if (result != returnvalue::OK) {
return result; return result;
} }
parameterWrapper->set(transmitterTimeout); parameterWrapper->set(transmitterTimeout);
transmitterTimeout = newVal; transmitterTimeout = newVal;
transmitterCountdown.setTimeout(transmitterTimeout); transmitterCountdown.setTimeout(transmitterTimeout);
return returnvalue::OK; return returnvalue::OK;
} }
return returnvalue::OK; return returnvalue::OK;
} }
@ -74,44 +78,48 @@ ReturnValue_t ComSubsystem::initialize() {
if (result != returnvalue::OK) { if (result != returnvalue::OK) {
return result; return result;
} }
EventManagerIF* manager = ObjectManager::instance()->get<EventManagerIF>(objects::EVENT_MANAGER); EventManagerIF *manager = ObjectManager::instance()->get<EventManagerIF>(objects::EVENT_MANAGER);
if (manager == nullptr) { if (manager == nullptr) {
#if FSFW_CPP_OSTREAM_ENABLED == 1 #if FSFW_CPP_OSTREAM_ENABLED == 1
sif::error << "ComSubsystem::initialize: Invalid event manager" << std::endl; sif::error << "ComSubsystem::initialize: Invalid event manager" << std::endl;
#endif #endif
return ObjectManagerIF::CHILD_INIT_FAILED; return ObjectManagerIF::CHILD_INIT_FAILED;
} }
result = manager->registerListener(eventQueue->getId()); result = manager->registerListener(eventQueue->getId());
if (result != returnvalue::OK) { if (result != returnvalue::OK) {
#if FSFW_CPP_OSTREAM_ENABLED == 1 #if FSFW_CPP_OSTREAM_ENABLED == 1
sif::warning << "ComSubsystem::initialize: Failed to register Com Subsystem as event " sif::warning << "ComSubsystem::initialize: Failed to register Com Subsystem as event "
"listener" << std::endl; "listener"
<< std::endl;
#endif #endif
return ObjectManagerIF::CHILD_INIT_FAILED; return ObjectManagerIF::CHILD_INIT_FAILED;
} }
result = manager->subscribeToEventRange(eventQueue->getId(), result = manager->subscribeToEventRange(eventQueue->getId(),
event::getEventId(PdecHandler::CARRIER_LOCK), event::getEventId(PdecHandler::CARRIER_LOCK),
event::getEventId(PdecHandler::BIT_LOCK_PDEC)); event::getEventId(PdecHandler::BIT_LOCK_PDEC));
if (result != returnvalue::OK) { if (result != returnvalue::OK) {
#if FSFW_CPP_OSTREAM_ENABLED == 1 #if FSFW_CPP_OSTREAM_ENABLED == 1
sif::error << "ComSubsystem::initialize: Failed to subscribe to events from PDEC " sif::error << "ComSubsystem::initialize: Failed to subscribe to events from PDEC "
"handler" "handler"
<< std::endl; << std::endl;
#endif #endif
return result; return result;
} }
return Subsystem::initialize(); return Subsystem::initialize();
} }
void ComSubsystem::startTransition(Mode_t mode, Submode_t submode) { void ComSubsystem::startTransition(Mode_t mode, Submode_t submode) {
// Depending on the mode the transmitter timeout is enabled or // Depending on the submode the transmitter timeout is enabled or
// disabled here // disabled here
if (mode == COM_SEQUENCE_RX_ONLY.first) { if (mode == com::Submode::RX_ONLY) {
transmitterCountdown.timeOut(); transmitterCountdown.timeOut();
} else if ((mode == COM_SEQUENCE_RX_AND_TX_DEFAULT_RATE.first) || countdownActive = false;
(mode == COM_SEQUENCE_RX_AND_TX_LOW_RATE.first) || } else if (isTxMode(mode)) {
(mode == COM_SEQUENCE_RX_AND_TX_HIGH_RATE.first)) { // Only start transmitter countdown if transmitter is not already on
transmitterCountdown.resetTimer(); if (not isTxMode(this->mode)) {
transmitterCountdown.resetTimer();
countdownActive = true;
}
} }
Subsystem::startTransition(mode, submode); Subsystem::startTransition(mode, submode);
} }
@ -149,22 +157,42 @@ void ComSubsystem::handleEventMessage(EventMessage *eventMessage) {
} }
} }
void ComSubsystem::handleBitLockEvent() { startRxAndTxDefaultSeq(); } void ComSubsystem::handleBitLockEvent() {
if (isTxMode(mode)) {
// Tx already on
return;
}
if (isInTransition) {
rememberBitLock = true;
return;
}
startRxAndTxLowRateSeq();
}
void ComSubsystem::handleCarrierLockEvent() { void ComSubsystem::handleCarrierLockEvent() {
if (!enableTxWhenCarrierLock) { if (!enableTxWhenCarrierLock) {
return; return;
} }
startRxAndTxDefaultSeq(); startRxAndTxLowRateSeq();
} }
void ComSubsystem::startRxAndTxDefaultSeq() { void ComSubsystem::startRxAndTxLowRateSeq() {
// Turns transmitter on // Turns transmitter on
startTransition(COM_SEQUENCE_RX_AND_TX_DEFAULT_RATE.first, SUBMODE_NONE); startTransition(com::Submode::RX_AND_TX_LOW_DATARATE, SUBMODE_NONE);
} }
void ComSubsystem::checkTransmitterCountdown() { void ComSubsystem::checkTransmitterCountdown() {
if (transmitterCountdown.hasTimedOut()) { if (transmitterCountdown.hasTimedOut()) {
startTransition(COM_SEQUENCE_RX_ONLY.first, SUBMODE_NONE); startTransition(com::Submode::RX_ONLY, SUBMODE_NONE);
countdownActive = false;
} }
} }
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;
}

View File

@ -1,24 +1,25 @@
#ifndef MISSION_SYSTEM_COMSUBSYSTEM_H_ #ifndef MISSION_SYSTEM_COMSUBSYSTEM_H_
#define MISSION_SYSTEM_COMSUBSYSTEM_H_ #define MISSION_SYSTEM_COMSUBSYSTEM_H_
#include <fsfw/events/EventMessage.h>
#include <fsfw/parameters/HasParametersIF.h> #include <fsfw/parameters/HasParametersIF.h>
#include <fsfw/parameters/ParameterHelper.h> #include <fsfw/parameters/ParameterHelper.h>
#include <fsfw/subsystem/Subsystem.h> #include <fsfw/subsystem/Subsystem.h>
#include <fsfw/events/EventMessage.h>
#include "mission/comDefs.h" #include "mission/comDefs.h"
class ComSubsystem : public Subsystem, public ReceivesParameterMessagesIF { class ComSubsystem : public Subsystem, public ReceivesParameterMessagesIF {
public: public:
/** /**
* @brief Constructor * @brief Constructor
* *
* @param setObjectId * @param setObjectId
* @param maxNumberOfSequences * @param maxNumberOfSequences
* @param maxNumberOfTables * @param maxNumberOfTables
* @param transmitterTimeout Maximum time the transmitter of the syrlinks * @param transmitterTimeout Maximum time the transmitter of the syrlinks
* will be enabled * will be
*/ * enabled
*/
ComSubsystem(object_id_t setObjectId, uint32_t maxNumberOfSequences, uint32_t maxNumberOfTables, ComSubsystem(object_id_t setObjectId, uint32_t maxNumberOfSequences, uint32_t maxNumberOfTables,
uint32_t transmitterTimeout); uint32_t transmitterTimeout);
virtual ~ComSubsystem() = default; virtual ~ComSubsystem() = default;
@ -30,6 +31,8 @@ class ComSubsystem : public Subsystem, public ReceivesParameterMessagesIF {
virtual void performChildOperation() override; virtual void performChildOperation() override;
private: private:
static const Mode_t INITIAL_MODE = 0;
ReturnValue_t handleCommandMessage(CommandMessage *message) override; ReturnValue_t handleCommandMessage(CommandMessage *message) override;
ReturnValue_t initialize() override; ReturnValue_t initialize() override;
@ -37,28 +40,42 @@ class ComSubsystem : public Subsystem, public ReceivesParameterMessagesIF {
void startTransition(Mode_t mode, Submode_t submode) override; void startTransition(Mode_t mode, Submode_t submode) override;
void readEventQueue(); void readEventQueue();
void handleEventMessage(EventMessage* eventMessage); void handleEventMessage(EventMessage *eventMessage);
void handleBitLockEvent(); void handleBitLockEvent();
void handleCarrierLockEvent(); void handleCarrierLockEvent();
void checkTransmitterCountdown(); void checkTransmitterCountdown();
/** /**
* @brief Enables transmitter in default (low) rate mode * @brief Enables transmitter in low rate mode
*/ */
void startRxAndTxDefaultSeq(); void startRxAndTxLowRateSeq();
/**
* @brief Returns true if mode is a mode where the transmitter is on
*/
bool isTxMode(Mode_t mode);
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;
// 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;
// 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;
// Transmitter countdown only active when sysrlinks transmitter is on (modes:
// rx and tx low rate, rx and tx high rate, rx and tx default rate)
bool countdownActive = false;
// True when bit lock occurred while COM subsystem is in a transition. This
// variable is used to remember the bit lock and execute the default rate
// sequence after the active transition has been completed
bool rememberBitLock = false;
}; };
#endif /* MISSION_SYSTEM_COMSUBSYSTEM_H_ */ #endif /* MISSION_SYSTEM_COMSUBSYSTEM_H_ */

View File

@ -10,7 +10,8 @@
const auto check = subsystem::checkInsert; const auto check = subsystem::checkInsert;
ComSubsystem satsystem::com::SUBSYSTEM = ComSubsystem(objects::COM_SUBSYSTEM, 12, 24, TRANSMITTER_TIMEOUT); ComSubsystem satsystem::com::SUBSYSTEM =
ComSubsystem(objects::COM_SUBSYSTEM, 12, 24, TRANSMITTER_TIMEOUT);
static const auto OFF = HasModesIF::MODE_OFF; static const auto OFF = HasModesIF::MODE_OFF;
static const auto ON = HasModesIF::MODE_ON; static const auto ON = HasModesIF::MODE_ON;
@ -18,39 +19,48 @@ static const auto NML = DeviceHandlerIF::MODE_NORMAL;
auto COM_SEQUENCE_RX_ONLY = auto COM_SEQUENCE_RX_ONLY =
std::make_pair(::com::Submode::RX_ONLY, FixedArrayList<ModeListEntry, 3>()); std::make_pair(::com::Submode::RX_ONLY, FixedArrayList<ModeListEntry, 3>());
auto COM_TABLE_RX_ONLY_TGT = auto COM_TABLE_RX_ONLY_TGT = std::make_pair(
std::make_pair((::com::Submode::RX_ONLY << 24) | 1, FixedArrayList<ModeListEntry, 3>()); static_cast<uint32_t>(::com::Submode::RX_ONLY << 24) | 1, FixedArrayList<ModeListEntry, 3>());
auto COM_TABLE_RX_ONLY_TRANS_0 = auto COM_TABLE_RX_ONLY_TRANS_0 = std::make_pair(
std::make_pair((::com::Submode::RX_ONLY << 24) | 2, FixedArrayList<ModeListEntry, 3>()); static_cast<uint32_t>(::com::Submode::RX_ONLY << 24) | 2, FixedArrayList<ModeListEntry, 3>());
auto COM_TABLE_RX_ONLY_TRANS_1 = auto COM_TABLE_RX_ONLY_TRANS_1 = std::make_pair(
std::make_pair((::com::Submode::RX_ONLY << 24) | 3, FixedArrayList<ModeListEntry, 3>()); static_cast<uint32_t>(::com::Submode::RX_ONLY << 24) | 3, FixedArrayList<ModeListEntry, 3>());
auto COM_SEQUENCE_RX_AND_TX_LOW_RATE = auto COM_SEQUENCE_RX_AND_TX_LOW_RATE =
std::make_pair(::com::Submode::RX_AND_TX_LOW_DATARATE, FixedArrayList<ModeListEntry, 3>()); std::make_pair(::com::Submode::RX_AND_TX_LOW_DATARATE, FixedArrayList<ModeListEntry, 3>());
auto COM_TABLE_RX_AND_TX_LOW_RATE_TGT = std::make_pair( auto COM_TABLE_RX_AND_TX_LOW_RATE_TGT =
(::com::Submode::RX_AND_TX_LOW_DATARATE << 24) | 1, FixedArrayList<ModeListEntry, 3>()); std::make_pair(static_cast<uint32_t>(::com::Submode::RX_AND_TX_LOW_DATARATE << 24) | 1,
auto COM_TABLE_RX_AND_TX_LOW_RATE_TRANS_0 = std::make_pair( FixedArrayList<ModeListEntry, 3>());
(::com::Submode::RX_AND_TX_LOW_DATARATE << 24) | 2, FixedArrayList<ModeListEntry, 3>()); auto COM_TABLE_RX_AND_TX_LOW_RATE_TRANS_0 =
auto COM_TABLE_RX_AND_TX_LOW_RATE_TRANS_1 = std::make_pair( std::make_pair(static_cast<uint32_t>(::com::Submode::RX_AND_TX_LOW_DATARATE << 24) | 2,
(::com::Submode::RX_AND_TX_LOW_DATARATE << 24) | 3, FixedArrayList<ModeListEntry, 3>()); FixedArrayList<ModeListEntry, 3>());
auto COM_TABLE_RX_AND_TX_LOW_RATE_TRANS_1 =
std::make_pair(static_cast<uint32_t>(::com::Submode::RX_AND_TX_LOW_DATARATE << 24) | 3,
FixedArrayList<ModeListEntry, 3>());
auto COM_SEQUENCE_RX_AND_TX_HIGH_RATE = auto COM_SEQUENCE_RX_AND_TX_HIGH_RATE =
std::make_pair(::com::Submode::RX_AND_TX_HIGH_DATARATE, FixedArrayList<ModeListEntry, 3>()); std::make_pair(::com::Submode::RX_AND_TX_HIGH_DATARATE, FixedArrayList<ModeListEntry, 3>());
auto COM_TABLE_RX_AND_TX_HIGH_RATE_TGT = std::make_pair( auto COM_TABLE_RX_AND_TX_HIGH_RATE_TGT =
(::com::Submode::RX_AND_TX_HIGH_DATARATE << 24) | 1, FixedArrayList<ModeListEntry, 3>()); std::make_pair(static_cast<uint32_t>(::com::Submode::RX_AND_TX_HIGH_DATARATE << 24) | 1,
auto COM_TABLE_RX_AND_TX_HIGH_RATE_TRANS_0 = std::make_pair( FixedArrayList<ModeListEntry, 3>());
(::com::Submode::RX_AND_TX_HIGH_DATARATE << 24) | 2, FixedArrayList<ModeListEntry, 3>()); auto COM_TABLE_RX_AND_TX_HIGH_RATE_TRANS_0 =
auto COM_TABLE_RX_AND_TX_HIGH_RATE_TRANS_1 = std::make_pair( std::make_pair(static_cast<uint32_t>(::com::Submode::RX_AND_TX_HIGH_DATARATE << 24) | 2,
(::com::Submode::RX_AND_TX_HIGH_DATARATE << 24) | 3, FixedArrayList<ModeListEntry, 3>()); FixedArrayList<ModeListEntry, 3>());
auto COM_TABLE_RX_AND_TX_HIGH_RATE_TRANS_1 =
std::make_pair(static_cast<uint32_t>(::com::Submode::RX_AND_TX_HIGH_DATARATE << 24) | 3,
FixedArrayList<ModeListEntry, 3>());
auto COM_SEQUENCE_RX_AND_TX_DEFAULT_RATE = auto COM_SEQUENCE_RX_AND_TX_DEFAULT_RATE =
std::make_pair(::com::Submode::RX_AND_TX_DEFAULT_DATARATE, FixedArrayList<ModeListEntry, 3>()); std::make_pair(::com::Submode::RX_AND_TX_DEFAULT_DATARATE, FixedArrayList<ModeListEntry, 3>());
auto COM_TABLE_RX_AND_TX_DEFAULT_RATE_TGT = std::make_pair( auto COM_TABLE_RX_AND_TX_DEFAULT_RATE_TGT =
(::com::Submode::RX_AND_TX_DEFAULT_DATARATE << 24) | 1, FixedArrayList<ModeListEntry, 3>()); std::make_pair(static_cast<uint32_t>(::com::Submode::RX_AND_TX_DEFAULT_DATARATE << 24) | 1,
auto COM_TABLE_RX_AND_TX_DEFAULT_RATE_TRANS_0 = std::make_pair( FixedArrayList<ModeListEntry, 3>());
(::com::Submode::RX_AND_TX_DEFAULT_DATARATE << 24) | 2, FixedArrayList<ModeListEntry, 3>()); auto COM_TABLE_RX_AND_TX_DEFAULT_RATE_TRANS_0 =
auto COM_TABLE_RX_AND_TX_DEFAULT_RATE_TRANS_1 = std::make_pair( std::make_pair(static_cast<uint32_t>(::com::Submode::RX_AND_TX_DEFAULT_DATARATE << 24) | 2,
(::com::Submode::RX_AND_TX_DEFAULT_DATARATE << 24) | 3, FixedArrayList<ModeListEntry, 3>()); FixedArrayList<ModeListEntry, 3>());
auto COM_TABLE_RX_AND_TX_DEFAULT_RATE_TRANS_1 =
std::make_pair(static_cast<uint32_t>(::com::Submode::RX_AND_TX_DEFAULT_DATARATE << 24) | 3,
FixedArrayList<ModeListEntry, 3>());
namespace { namespace {
@ -67,7 +77,7 @@ Subsystem& satsystem::com::init() {
buildTxAndRxLowRateSequence(SUBSYSTEM, entry); buildTxAndRxLowRateSequence(SUBSYSTEM, entry);
buildTxAndRxHighRateSequence(SUBSYSTEM, entry); buildTxAndRxHighRateSequence(SUBSYSTEM, entry);
buildTxAndRxDefaultRateSequence(SUBSYSTEM, entry); buildTxAndRxDefaultRateSequence(SUBSYSTEM, entry);
SUBSYSTEM.setInitialMode(NML, ::com::Submode::RX_ONLY); SUBSYSTEM.setInitialMode(COM_SEQUENCE_RX_ONLY.first);
return SUBSYSTEM; return SUBSYSTEM;
} }

View File

@ -1,8 +1,8 @@
#ifndef MISSION_SYSTEM_TREE_COMMODETREE_H_ #ifndef MISSION_SYSTEM_TREE_COMMODETREE_H_
#define MISSION_SYSTEM_TREE_COMMODETREE_H_ #define MISSION_SYSTEM_TREE_COMMODETREE_H_
#include <mission/system/objects/ComSubsystem.h>
#include <fsfw/devicehandlers/DeviceHandlerIF.h> #include <fsfw/devicehandlers/DeviceHandlerIF.h>
#include <mission/system/objects/ComSubsystem.h>
namespace satsystem { namespace satsystem {
@ -11,7 +11,9 @@ extern ComSubsystem SUBSYSTEM;
// The syrlinks must not transmitting longer then 15 minutes otherwise the // The syrlinks must not transmitting longer then 15 minutes otherwise the
// transceiver might be damaged due to overheating // transceiver might be damaged due to overheating
static const uint32_t TRANSMITTER_TIMEOUT = 900000; // 15 minutes // 15 minutes in milliseconds
static const uint32_t TRANSMITTER_TIMEOUT = 900000;
Subsystem& init(); Subsystem& init();
} // namespace com } // namespace com

View File

@ -7,6 +7,7 @@
#include "acsModeTree.h" #include "acsModeTree.h"
#include "comModeTree.h" #include "comModeTree.h"
#include "eive/objects.h" #include "eive/objects.h"
#include "mission/comDefs.h"
#include "payloadModeTree.h" #include "payloadModeTree.h"
#include "tcsModeTree.h" #include "tcsModeTree.h"
#include "util.h" #include "util.h"
@ -85,6 +86,7 @@ void buildSafeSequence(Subsystem& ss, ModeListEntry& eh) {
// Build SAFE transition 0. Two transitions to reduce number of consecutive events and because // Build SAFE transition 0. Two transitions to reduce number of consecutive events and because
// consecutive commanding of TCS and ACS can lead to SPI issues. // consecutive commanding of TCS and ACS can lead to SPI issues.
iht(objects::TCS_SUBSYSTEM, NML, 0, EIVE_TABLE_SAFE_TRANS_0.second); iht(objects::TCS_SUBSYSTEM, NML, 0, EIVE_TABLE_SAFE_TRANS_0.second);
iht(objects::COM_SUBSYSTEM, com::RX_ONLY, 0, EIVE_TABLE_SAFE_TRANS_0.second);
check(ss.addTable(TableEntry(EIVE_TABLE_SAFE_TRANS_0.first, &EIVE_TABLE_SAFE_TRANS_0.second)), check(ss.addTable(TableEntry(EIVE_TABLE_SAFE_TRANS_0.first, &EIVE_TABLE_SAFE_TRANS_0.second)),
ctxc); ctxc);

View File

@ -97,10 +97,6 @@ ReturnValue_t CcsdsIpCoreHandler::initialize() {
return ObjectManagerIF::CHILD_INIT_FAILED; return ObjectManagerIF::CHILD_INIT_FAILED;
} }
if (result != returnvalue::OK) {
return ObjectManagerIF::CHILD_INIT_FAILED;
}
#if OBSW_SYRLINKS_SIMULATED == 1 #if OBSW_SYRLINKS_SIMULATED == 1
// Update data on rising edge // Update data on rising edge
ptmeConfig->invertTxClock(false); ptmeConfig->invertTxClock(false);

View File

@ -21,7 +21,7 @@ ReturnValue_t CfdpTmFunnel::performOperation(uint8_t) {
break; break;
} }
count++; count++;
if(count == 500) { if (count == 500) {
sif::error << "CfdpTmFunnel: Possible message storm detected" << std::endl; sif::error << "CfdpTmFunnel: Possible message storm detected" << std::endl;
break; break;
} }

View File

@ -21,7 +21,7 @@ ReturnValue_t PusTmFunnel::performOperation(uint8_t) {
break; break;
} }
count++; count++;
if(count == 500) { if (count == 500) {
sif::error << "PusTmFunnel: Possible message storm detected" << std::endl; sif::error << "PusTmFunnel: Possible message storm detected" << std::endl;
break; break;
} }

View File

@ -50,7 +50,7 @@ ReturnValue_t VirtualChannel::performOperation() {
} }
count++; count++;
if(count == 500) { if (count == 500) {
sif::error << "VirtualChannel: Possible message storm detected" << std::endl; sif::error << "VirtualChannel: Possible message storm detected" << std::endl;
break; break;
} }