From d80ef280dd493f4df4a4b6461be86bdd45bdc213 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 28 Mar 2022 13:53:32 +0200 Subject: [PATCH 01/65] update power API --- fsfw | 2 +- mission/devices/HeaterHandler.cpp | 6 ++++-- mission/devices/HeaterHandler.h | 4 ++-- mission/devices/PCDUHandler.cpp | 13 ++++++++----- mission/devices/PCDUHandler.h | 4 ++-- tmtc | 2 +- 6 files changed, 18 insertions(+), 13 deletions(-) diff --git a/fsfw b/fsfw index e6130263..3ea9f999 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit e6130263ef144c5b1f6eafef734a0150a92d6cda +Subproject commit 3ea9f999b746963efad591517e80ccd904cb051f diff --git a/mission/devices/HeaterHandler.cpp b/mission/devices/HeaterHandler.cpp index 255ba6ec..53acf02e 100644 --- a/mission/devices/HeaterHandler.cpp +++ b/mission/devices/HeaterHandler.cpp @@ -134,7 +134,7 @@ ReturnValue_t HeaterHandler::executeAction(ActionId_t actionId, MessageQueueId_t return result; } -void HeaterHandler::sendSwitchCommand(uint8_t switchNr, ReturnValue_t onOff) const { +ReturnValue_t HeaterHandler::sendSwitchCommand(uint8_t switchNr, ReturnValue_t onOff) { ReturnValue_t result; store_address_t storeAddress; uint8_t commandData[2]; @@ -338,7 +338,9 @@ gpioId_t HeaterHandler::getGpioIdFromSwitchNr(int switchNr) { MessageQueueId_t HeaterHandler::getCommandQueue() const { return commandQueue->getId(); } -void HeaterHandler::sendFuseOnCommand(uint8_t fuseNr) const {} +ReturnValue_t HeaterHandler::sendFuseOnCommand(uint8_t fuseNr) { + return RETURN_OK; +} ReturnValue_t HeaterHandler::getSwitchState(uint8_t switchNr) const { return 0; } diff --git a/mission/devices/HeaterHandler.h b/mission/devices/HeaterHandler.h index 2a8ce555..18b821ec 100644 --- a/mission/devices/HeaterHandler.h +++ b/mission/devices/HeaterHandler.h @@ -43,8 +43,8 @@ class HeaterHandler : public ExecutableObjectIF, virtual ReturnValue_t performOperation(uint8_t operationCode = 0) override; - virtual void sendSwitchCommand(uint8_t switchNr, ReturnValue_t onOff) const override; - virtual void sendFuseOnCommand(uint8_t fuseNr) const override; + virtual ReturnValue_t sendSwitchCommand(uint8_t switchNr, ReturnValue_t onOff) override; + virtual ReturnValue_t sendFuseOnCommand(uint8_t fuseNr) override; /** * @brief This function will be called from the Heater object to check * the current switch state. diff --git a/mission/devices/PCDUHandler.cpp b/mission/devices/PCDUHandler.cpp index e54222b1..e59f2ab7 100644 --- a/mission/devices/PCDUHandler.cpp +++ b/mission/devices/PCDUHandler.cpp @@ -205,7 +205,7 @@ void PCDUHandler::updatePdu1SwitchStates() { LocalDataPoolManager* PCDUHandler::getHkManagerHandle() { return &poolManager; } -void PCDUHandler::sendSwitchCommand(uint8_t switchNr, ReturnValue_t onOff) const { +ReturnValue_t PCDUHandler::sendSwitchCommand(uint8_t switchNr, ReturnValue_t onOff) { using namespace pcduSwitches; ReturnValue_t result; uint16_t memoryAddress = 0; @@ -261,7 +261,7 @@ void PCDUHandler::sendSwitchCommand(uint8_t switchNr, ReturnValue_t onOff) const } // This is a dangerous command. Reject/Igore it for now case pcduSwitches::PDU2_CH0_Q7S: { - return; + return RETURN_FAILED; // memoryAddress = PDU2::CONFIG_ADDRESS_OUT_EN_Q7S; // pdu = ObjectManager::instance()->get(objects::PDU2_HANDLER); // break; @@ -309,7 +309,7 @@ void PCDUHandler::sendSwitchCommand(uint8_t switchNr, ReturnValue_t onOff) const default: { sif::error << "PCDUHandler::sendSwitchCommand: Invalid switch number " << std::endl; - return; + return RETURN_FAILED; } } @@ -322,7 +322,7 @@ void PCDUHandler::sendSwitchCommand(uint8_t switchNr, ReturnValue_t onOff) const break; default: sif::error << "PCDUHandler::sendSwitchCommand: Invalid state commanded" << std::endl; - return; + return RETURN_FAILED; } GomspaceSetParamMessage setParamMessage(memoryAddress, ¶meterValue, parameterValueSize); @@ -347,9 +347,12 @@ void PCDUHandler::sendSwitchCommand(uint8_t switchNr, ReturnValue_t onOff) const // Can't use trigger event because of const function constraint, but this hack seems to work this->forwardEvent(power::SWITCH_CMD_SENT, parameterValue, switchNr); } + return RETURN_OK; } -void PCDUHandler::sendFuseOnCommand(uint8_t fuseNr) const {} +ReturnValue_t PCDUHandler::sendFuseOnCommand(uint8_t fuseNr) { + return RETURN_OK; +} ReturnValue_t PCDUHandler::getSwitchState(uint8_t switchNr) const { if (switchNr >= pcduSwitches::NUMBER_OF_SWITCHES) { diff --git a/mission/devices/PCDUHandler.h b/mission/devices/PCDUHandler.h index 3d014205..c44052bb 100644 --- a/mission/devices/PCDUHandler.h +++ b/mission/devices/PCDUHandler.h @@ -33,8 +33,8 @@ class PCDUHandler : public PowerSwitchIF, store_address_t storeId = storeId::INVALID_STORE_ADDRESS, bool* clearMessage = nullptr) override; - virtual void sendSwitchCommand(uint8_t switchNr, ReturnValue_t onOff) const override; - virtual void sendFuseOnCommand(uint8_t fuseNr) const override; + virtual ReturnValue_t sendSwitchCommand(uint8_t switchNr, ReturnValue_t onOff) override; + virtual ReturnValue_t sendFuseOnCommand(uint8_t fuseNr) override; virtual ReturnValue_t getSwitchState(uint8_t switchNr) const override; virtual ReturnValue_t getFuseState(uint8_t fuseNr) const override; virtual uint32_t getSwitchDelayMs(void) const override; diff --git a/tmtc b/tmtc index 43a534db..e3743042 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 43a534db9cf8ee14e6c1296dac8b3e2c3c94b240 +Subproject commit e37430423e814b9e05f25d63970f2c2b5048cfb1 From 69ba11acc1c839ac4625e2dd35fc5c1745d80b37 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 29 Mar 2022 16:07:13 +0200 Subject: [PATCH 02/65] perform nReset handling in Assembly now --- mission/devices/HeaterHandler.cpp | 1 + mission/system/AcsBoardAssembly.cpp | 26 ++++++++++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/mission/devices/HeaterHandler.cpp b/mission/devices/HeaterHandler.cpp index 53acf02e..9e97f02a 100644 --- a/mission/devices/HeaterHandler.cpp +++ b/mission/devices/HeaterHandler.cpp @@ -164,6 +164,7 @@ ReturnValue_t HeaterHandler::sendSwitchCommand(uint8_t switchNr, ReturnValue_t o << "message" << std::endl; } } + return RETURN_OK; } void HeaterHandler::handleActiveCommands() { diff --git a/mission/system/AcsBoardAssembly.cpp b/mission/system/AcsBoardAssembly.cpp index 5a8f0956..6ea701d5 100644 --- a/mission/system/AcsBoardAssembly.cpp +++ b/mission/system/AcsBoardAssembly.cpp @@ -142,6 +142,18 @@ ReturnValue_t AcsBoardAssembly::handleNormalOrOnModeCmd(Mode_t mode, Submode_t s cmdSeq(helper.mgm0Lis3IdSideA, helper.mgm0SideAMode, ModeTableIdx::MGM_0_A); cmdSeq(helper.mgm1Rm3100IdSideA, helper.mgm1SideAMode, ModeTableIdx::MGM_1_A); if (gpsUsable) { + if (gpioIF->pullHigh(gpioIds::GNSS_0_NRESET) != HasReturnvaluesIF::RETURN_OK) { +#if OBSW_VERBOSE_LEVEL >= 1 + sif::error << "AcsBoardAssembly::handleNormalOrOnModeCmd: Could not pull nReset pin" + "of GNSS 0 high (used GNSS)" << std::endl; +#endif + } + if (gpioIF->pullLow(gpioIds::GNSS_1_NRESET) != HasReturnvaluesIF::RETURN_OK) { +#if OBSW_VERBOSE_LEVEL >= 1 + sif::error << "AcsBoardAssembly::handleNormalOrOnModeCmd: Could not pull nReset pin" + "of GNSS 1 low (unused GNSS)" << std::endl; +#endif + } if (gpioIF->pullLow(gpioIds::GNSS_SELECT) != HasReturnvaluesIF::RETURN_OK) { #if OBSW_VERBOSE_LEVEL >= 1 sif::error << "AcsBoardAssembly::handleNormalOrOnModeCmd: Could not pull GNSS select low" @@ -165,6 +177,18 @@ ReturnValue_t AcsBoardAssembly::handleNormalOrOnModeCmd(Mode_t mode, Submode_t s cmdSeq(helper.mgm2Lis3IdSideB, helper.mgm2SideBMode, ModeTableIdx::MGM_2_B); cmdSeq(helper.mgm3Rm3100IdSideB, helper.mgm3SideBMode, ModeTableIdx::MGM_3_B); if (gpsUsable) { + if (gpioIF->pullHigh(gpioIds::GNSS_1_NRESET) != HasReturnvaluesIF::RETURN_OK) { +#if OBSW_VERBOSE_LEVEL >= 1 + sif::error << "AcsBoardAssembly::handleNormalOrOnModeCmd: Could not pull nReset pin" + "of GNSS 1 high (used GNSS)" << std::endl; +#endif + } + if (gpioIF->pullLow(gpioIds::GNSS_0_NRESET) != HasReturnvaluesIF::RETURN_OK) { +#if OBSW_VERBOSE_LEVEL >= 1 + sif::error << "AcsBoardAssembly::handleNormalOrOnModeCmd: Could not pull nReset pin" + "of GNSS 0 low (unused GNSS)" << std::endl; +#endif + } if (gpioIF->pullHigh(gpioIds::GNSS_SELECT) != HasReturnvaluesIF::RETURN_OK) { #if OBSW_VERBOSE_LEVEL >= 1 sif::error << "AcsBoardAssembly::handleNormalOrOnModeCmd: Could not pull GNSS select high" @@ -186,6 +210,8 @@ ReturnValue_t AcsBoardAssembly::handleNormalOrOnModeCmd(Mode_t mode, Submode_t s cmdSeq(helper.mgm3Rm3100IdSideB, helper.mgm3SideBMode, ModeTableIdx::MGM_3_B); ReturnValue_t status = RETURN_OK; if (gpsUsable) { + gpioIF->pullHigh(gpioIds::GNSS_1_NRESET); + gpioIF->pullHigh(gpioIds::GNSS_0_NRESET); if (defaultSubmode == Submodes::A_SIDE) { status = gpioIF->pullLow(gpioIds::GNSS_SELECT); } else { From 9eaa73264441e37b673456caf3ae60a02d21ee41 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 29 Mar 2022 16:08:13 +0200 Subject: [PATCH 03/65] delete code which is not required anymore --- bsp_q7s/core/ObjectFactory.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/bsp_q7s/core/ObjectFactory.cpp b/bsp_q7s/core/ObjectFactory.cpp index 4c8ec3fc..80ac754a 100644 --- a/bsp_q7s/core/ObjectFactory.cpp +++ b/bsp_q7s/core/ObjectFactory.cpp @@ -278,10 +278,8 @@ void ObjectFactory::createPcduComponents(LinuxLibgpioIF* gpioComIF, PowerSwitchI new P60DockHandler(objects::P60DOCK_HANDLER, objects::CSP_COM_IF, p60DockCspCookie); PDU1Handler* pdu1handler = new PDU1Handler(objects::PDU1_HANDLER, objects::CSP_COM_IF, pdu1CspCookie); - pdu1handler->assignChannelHookFunction(&pcdu::switchCallback, gpioComIF); PDU2Handler* pdu2handler = new PDU2Handler(objects::PDU2_HANDLER, objects::CSP_COM_IF, pdu2CspCookie); - pdu2handler->assignChannelHookFunction(&pcdu::switchCallback, gpioComIF); ACUHandler* acuhandler = new ACUHandler(objects::ACU_HANDLER, objects::CSP_COM_IF, acuCspCookie); auto pcduHandler = new PCDUHandler(objects::PCDU_HANDLER, 50); From 0ba2caaf61428ce2e517fc5b17cb444810ef38ee Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 29 Mar 2022 16:53:05 +0200 Subject: [PATCH 04/65] set the time in the code directly now --- linux/devices/GPSHyperionLinuxController.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/linux/devices/GPSHyperionLinuxController.cpp b/linux/devices/GPSHyperionLinuxController.cpp index a811fbc5..7ebff478 100644 --- a/linux/devices/GPSHyperionLinuxController.cpp +++ b/linux/devices/GPSHyperionLinuxController.cpp @@ -9,6 +9,7 @@ #include #endif #include +#include GPSHyperionLinuxController::GPSHyperionLinuxController(object_id_t objectId, object_id_t parentId, bool debugHyperionGps) @@ -172,6 +173,8 @@ void GPSHyperionLinuxController::readGpsDataFromGpsd() { timeval time = {}; time.tv_sec = gpsSet.unixSeconds.value; time.tv_usec = gps->fix.time.tv_nsec / 1000; + // Update the system time here for now. NTP seems to be unable to do so for whatever reason + settimeofday(&time, nullptr); Clock::TimeOfDay_t timeOfDay = {}; Clock::convertTimevalToTimeOfDay(&time, &timeOfDay); gpsSet.year = timeOfDay.year; @@ -192,6 +195,9 @@ void GPSHyperionLinuxController::readGpsDataFromGpsd() { std::cout << "Longitude: " << gps->fix.longitude << std::endl; std::cout << "Altitude(MSL): " << gps->fix.altMSL << std::endl; std::cout << "Speed(m/s): " << gps->fix.speed << std::endl; + std::time_t t = std::time(nullptr); + std::tm tm = *std::gmtime(&t); + std::cout << "C Time: " << std::put_time(&tm, "%c") << std::endl; } } #endif From a8457d7966257907eb28fc00fe9dabe2e3bab99e Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 29 Mar 2022 16:59:48 +0200 Subject: [PATCH 05/65] small safety mechanism for time --- linux/devices/GPSHyperionLinuxController.cpp | 15 +++++++++++++-- linux/devices/GPSHyperionLinuxController.h | 1 + 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/linux/devices/GPSHyperionLinuxController.cpp b/linux/devices/GPSHyperionLinuxController.cpp index 7ebff478..821946c7 100644 --- a/linux/devices/GPSHyperionLinuxController.cpp +++ b/linux/devices/GPSHyperionLinuxController.cpp @@ -173,8 +173,19 @@ void GPSHyperionLinuxController::readGpsDataFromGpsd() { timeval time = {}; time.tv_sec = gpsSet.unixSeconds.value; time.tv_usec = gps->fix.time.tv_nsec / 1000; - // Update the system time here for now. NTP seems to be unable to do so for whatever reason - settimeofday(&time, nullptr); + std::time_t t = std::time(nullptr); + if (time.tv_sec == t) { + timeIsConstantCounter++; + } else { + timeIsConstantCounter = 0; + } + // If the received time does not change anymore for whatever reason, do not set it here + // to avoid stale times + if(timeIsConstantCounter < 3) { + // Update the system time here for now. NTP seems to be unable to do so for whatever reason + settimeofday(&time, nullptr); + } + Clock::TimeOfDay_t timeOfDay = {}; Clock::convertTimevalToTimeOfDay(&time, &timeOfDay); gpsSet.year = timeOfDay.year; diff --git a/linux/devices/GPSHyperionLinuxController.h b/linux/devices/GPSHyperionLinuxController.h index f0e4e6e0..d0157f9c 100644 --- a/linux/devices/GPSHyperionLinuxController.h +++ b/linux/devices/GPSHyperionLinuxController.h @@ -51,6 +51,7 @@ class GPSHyperionLinuxController : public ExtendedControllerBase { bool modeCommanded = true; gpsmm myGpsmm; bool debugHyperionGps = false; + uint32_t timeIsConstantCounter = 0; void readGpsDataFromGpsd(); }; From 9cfb2bad51626d90b40106c00685852368300d87 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 29 Mar 2022 17:47:40 +0200 Subject: [PATCH 06/65] only set time every 60 seconds --- linux/devices/GPSHyperionLinuxController.cpp | 9 ++++++--- linux/devices/GPSHyperionLinuxController.h | 1 + mission/devices/HeaterHandler.cpp | 4 +--- mission/devices/PCDUHandler.cpp | 4 +--- mission/system/AcsBoardAssembly.cpp | 12 ++++++++---- 5 files changed, 17 insertions(+), 13 deletions(-) diff --git a/linux/devices/GPSHyperionLinuxController.cpp b/linux/devices/GPSHyperionLinuxController.cpp index 821946c7..1a1f752e 100644 --- a/linux/devices/GPSHyperionLinuxController.cpp +++ b/linux/devices/GPSHyperionLinuxController.cpp @@ -16,7 +16,9 @@ GPSHyperionLinuxController::GPSHyperionLinuxController(object_id_t objectId, obj : ExtendedControllerBase(objectId, objects::NO_OBJECT), gpsSet(this), myGpsmm(GPSD_SHARED_MEMORY, nullptr), - debugHyperionGps(debugHyperionGps) {} + debugHyperionGps(debugHyperionGps) { + timeUpdateCd.resetTimer(); +} GPSHyperionLinuxController::~GPSHyperionLinuxController() {} @@ -180,10 +182,11 @@ void GPSHyperionLinuxController::readGpsDataFromGpsd() { timeIsConstantCounter = 0; } // If the received time does not change anymore for whatever reason, do not set it here - // to avoid stale times - if(timeIsConstantCounter < 3) { + // to avoid stale times. Also, don't do it too often often to avoid jumping times + if (timeIsConstantCounter < 3 and timeUpdateCd.hasTimedOut()) { // Update the system time here for now. NTP seems to be unable to do so for whatever reason settimeofday(&time, nullptr); + timeUpdateCd.resetTimer(); } Clock::TimeOfDay_t timeOfDay = {}; diff --git a/linux/devices/GPSHyperionLinuxController.h b/linux/devices/GPSHyperionLinuxController.h index d0157f9c..46acb5fc 100644 --- a/linux/devices/GPSHyperionLinuxController.h +++ b/linux/devices/GPSHyperionLinuxController.h @@ -52,6 +52,7 @@ class GPSHyperionLinuxController : public ExtendedControllerBase { gpsmm myGpsmm; bool debugHyperionGps = false; uint32_t timeIsConstantCounter = 0; + Countdown timeUpdateCd = Countdown(60); void readGpsDataFromGpsd(); }; diff --git a/mission/devices/HeaterHandler.cpp b/mission/devices/HeaterHandler.cpp index 9e97f02a..fcafefd8 100644 --- a/mission/devices/HeaterHandler.cpp +++ b/mission/devices/HeaterHandler.cpp @@ -339,9 +339,7 @@ gpioId_t HeaterHandler::getGpioIdFromSwitchNr(int switchNr) { MessageQueueId_t HeaterHandler::getCommandQueue() const { return commandQueue->getId(); } -ReturnValue_t HeaterHandler::sendFuseOnCommand(uint8_t fuseNr) { - return RETURN_OK; -} +ReturnValue_t HeaterHandler::sendFuseOnCommand(uint8_t fuseNr) { return RETURN_OK; } ReturnValue_t HeaterHandler::getSwitchState(uint8_t switchNr) const { return 0; } diff --git a/mission/devices/PCDUHandler.cpp b/mission/devices/PCDUHandler.cpp index e59f2ab7..ab35b52f 100644 --- a/mission/devices/PCDUHandler.cpp +++ b/mission/devices/PCDUHandler.cpp @@ -350,9 +350,7 @@ ReturnValue_t PCDUHandler::sendSwitchCommand(uint8_t switchNr, ReturnValue_t onO return RETURN_OK; } -ReturnValue_t PCDUHandler::sendFuseOnCommand(uint8_t fuseNr) { - return RETURN_OK; -} +ReturnValue_t PCDUHandler::sendFuseOnCommand(uint8_t fuseNr) { return RETURN_OK; } ReturnValue_t PCDUHandler::getSwitchState(uint8_t switchNr) const { if (switchNr >= pcduSwitches::NUMBER_OF_SWITCHES) { diff --git a/mission/system/AcsBoardAssembly.cpp b/mission/system/AcsBoardAssembly.cpp index 6ea701d5..e93d79b8 100644 --- a/mission/system/AcsBoardAssembly.cpp +++ b/mission/system/AcsBoardAssembly.cpp @@ -145,13 +145,15 @@ ReturnValue_t AcsBoardAssembly::handleNormalOrOnModeCmd(Mode_t mode, Submode_t s if (gpioIF->pullHigh(gpioIds::GNSS_0_NRESET) != HasReturnvaluesIF::RETURN_OK) { #if OBSW_VERBOSE_LEVEL >= 1 sif::error << "AcsBoardAssembly::handleNormalOrOnModeCmd: Could not pull nReset pin" - "of GNSS 0 high (used GNSS)" << std::endl; + "of GNSS 0 high (used GNSS)" + << std::endl; #endif } if (gpioIF->pullLow(gpioIds::GNSS_1_NRESET) != HasReturnvaluesIF::RETURN_OK) { #if OBSW_VERBOSE_LEVEL >= 1 sif::error << "AcsBoardAssembly::handleNormalOrOnModeCmd: Could not pull nReset pin" - "of GNSS 1 low (unused GNSS)" << std::endl; + "of GNSS 1 low (unused GNSS)" + << std::endl; #endif } if (gpioIF->pullLow(gpioIds::GNSS_SELECT) != HasReturnvaluesIF::RETURN_OK) { @@ -180,13 +182,15 @@ ReturnValue_t AcsBoardAssembly::handleNormalOrOnModeCmd(Mode_t mode, Submode_t s if (gpioIF->pullHigh(gpioIds::GNSS_1_NRESET) != HasReturnvaluesIF::RETURN_OK) { #if OBSW_VERBOSE_LEVEL >= 1 sif::error << "AcsBoardAssembly::handleNormalOrOnModeCmd: Could not pull nReset pin" - "of GNSS 1 high (used GNSS)" << std::endl; + "of GNSS 1 high (used GNSS)" + << std::endl; #endif } if (gpioIF->pullLow(gpioIds::GNSS_0_NRESET) != HasReturnvaluesIF::RETURN_OK) { #if OBSW_VERBOSE_LEVEL >= 1 sif::error << "AcsBoardAssembly::handleNormalOrOnModeCmd: Could not pull nReset pin" - "of GNSS 0 low (unused GNSS)" << std::endl; + "of GNSS 0 low (unused GNSS)" + << std::endl; #endif } if (gpioIF->pullHigh(gpioIds::GNSS_SELECT) != HasReturnvaluesIF::RETURN_OK) { From f1fe1154473102b31287c814b13a28f5ba0ecda4 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 30 Mar 2022 13:12:19 +0200 Subject: [PATCH 07/65] fsfw update --- fsfw | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fsfw b/fsfw index 3ea9f999..c2581ff4 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 3ea9f999b746963efad591517e80ccd904cb051f +Subproject commit c2581ff4f5fe9c5aacfa0905868d07959e90f29e From 413f5526395d75f0c63003d0bf25fb3738b620a2 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 31 Mar 2022 16:16:01 +0200 Subject: [PATCH 08/65] improvements from sus test --- bsp_q7s/core/InitMission.cpp | 6 ++++-- bsp_q7s/core/ObjectFactory.cpp | 19 ++++++++++--------- bsp_q7s/core/ObjectFactory.h | 3 +++ fsfw | 2 +- linux/fsfwconfig/OBSWConfig.h.in | 2 +- .../pollingSequenceFactory.cpp | 9 +-------- tmtc | 2 +- 7 files changed, 21 insertions(+), 22 deletions(-) diff --git a/bsp_q7s/core/InitMission.cpp b/bsp_q7s/core/InitMission.cpp index 1d502fef..ced1d12a 100644 --- a/bsp_q7s/core/InitMission.cpp +++ b/bsp_q7s/core/InitMission.cpp @@ -127,12 +127,14 @@ void initmission::initTasks() { "SYS_TASK", 40, PeriodicTaskIF::MINIMUM_STACK_SIZE * 2, 0.4, missedDeadlineFunc); result = sysTask->addComponent(objects::ACS_BOARD_ASS); if (result != HasReturnvaluesIF::RETURN_OK) { - initmission::printAddObjectError("ACS_ASS", objects::ACS_BOARD_ASS); + initmission::printAddObjectError("ACS_BOARD_ASS", objects::ACS_BOARD_ASS); } +#if OBSW_ADD_SUS_BOARD_ASS == 1 result = sysTask->addComponent(objects::SUS_BOARD_ASS); if (result != HasReturnvaluesIF::RETURN_OK) { - initmission::printAddObjectError("SUS_ASS", objects::SUS_BOARD_ASS); + initmission::printAddObjectError("SUS_BOARD_ASS", objects::SUS_BOARD_ASS); } +#endif result = sysTask->addComponent(objects::TCS_BOARD_ASS); if (result != HasReturnvaluesIF::RETURN_OK) { initmission::printAddObjectError("TCS_BOARD_ASS", objects::TCS_BOARD_ASS); diff --git a/bsp_q7s/core/ObjectFactory.cpp b/bsp_q7s/core/ObjectFactory.cpp index e7dbbe6e..5caa44f4 100644 --- a/bsp_q7s/core/ObjectFactory.cpp +++ b/bsp_q7s/core/ObjectFactory.cpp @@ -711,15 +711,6 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComI auto acsAss = new AcsBoardAssembly(objects::ACS_BOARD_ASS, objects::NO_OBJECT, pwrSwitcher, acsBoardHelper, gpioComIF); static_cast(acsAss); -#if OBSW_TEST_ACS_BOARD_ASS == 1 - CommandMessage msg; - ModeMessage::setModeMessage(&msg, ModeMessage::CMD_MODE_COMMAND, DeviceHandlerIF::MODE_NORMAL, - duallane::A_SIDE); - ReturnValue_t result = MessageQueueSenderIF::sendMessage(acsAss->getCommandQueue(), &msg); - if (result != HasReturnvaluesIF::RETURN_OK) { - sif::warning << "Sending mode command failed" << std::endl; - } -#endif #endif /* OBSW_ADD_ACS_HANDLERS == 1 */ } @@ -1222,3 +1213,13 @@ void ObjectFactory::createTestComponents(LinuxLibgpioIF* gpioComIF) { new UartTestClass(objects::UART_TEST); #endif } + +void ObjectFactory::testAcsBrdAss(AcsBoardAssembly* acsAss) { + CommandMessage msg; + ModeMessage::setModeMessage(&msg, ModeMessage::CMD_MODE_COMMAND, DeviceHandlerIF::MODE_NORMAL, + duallane::A_SIDE); + ReturnValue_t result = MessageQueueSenderIF::sendMessage(acsAss->getCommandQueue(), &msg); + if (result != HasReturnvaluesIF::RETURN_OK) { + sif::warning << "Sending mode command failed" << std::endl; + } +} diff --git a/bsp_q7s/core/ObjectFactory.h b/bsp_q7s/core/ObjectFactory.h index 958e8f86..37581170 100644 --- a/bsp_q7s/core/ObjectFactory.h +++ b/bsp_q7s/core/ObjectFactory.h @@ -6,6 +6,7 @@ class UartComIF; class SpiComIF; class I2cComIF; class PowerSwitchIF; +class AcsBoardAssembly; namespace ObjectFactory { @@ -31,6 +32,8 @@ void createReactionWheelComponents(LinuxLibgpioIF* gpioComIF); void createCcsdsComponents(LinuxLibgpioIF* gpioComIF); void createTestComponents(LinuxLibgpioIF* gpioComIF); +void testAcsBrdAss(AcsBoardAssembly* assAss); + }; // namespace ObjectFactory #endif /* BSP_Q7S_OBJECTFACTORY_H_ */ diff --git a/fsfw b/fsfw index c2581ff4..b3d2d440 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit c2581ff4f5fe9c5aacfa0905868d07959e90f29e +Subproject commit b3d2d440d790899cee60797c2dacae53812df279 diff --git a/linux/fsfwconfig/OBSWConfig.h.in b/linux/fsfwconfig/OBSWConfig.h.in index 69e6744b..1e7fc090 100644 --- a/linux/fsfwconfig/OBSWConfig.h.in +++ b/linux/fsfwconfig/OBSWConfig.h.in @@ -44,6 +44,7 @@ debugging. */ #define OBSW_ADD_PLOC_SUPERVISOR 0 #define OBSW_ADD_PLOC_MPSOC 0 #define OBSW_ADD_SUN_SENSORS 1 +#define OBSW_ADD_SUS_BOARD_ASS 1 #define OBSW_ADD_ACS_BOARD 1 #define OBSW_ADD_ACS_HANDLERS 1 #define OBSW_ADD_RW 0 @@ -115,7 +116,6 @@ debugging. */ #define OBSW_ADD_UART_TEST_CODE 0 #define OBSW_TEST_ACS 0 -#define OBSW_TEST_ACS_BOARD_ASS 0 #define OBSW_DEBUG_ACS 0 #define OBSW_TEST_SUS 0 #define OBSW_DEBUG_SUS 0 diff --git a/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp b/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp index fdd4897e..0f9232e0 100644 --- a/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp +++ b/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp @@ -177,14 +177,7 @@ ReturnValue_t pst::pstSpi(FixedTimeslotTaskIF *thisSequence) { bool addSus9 = true; bool addSus10 = true; bool addSus11 = true; - /** - * The sun sensor will be shutdown as soon as the chip select is pulled high. Thus all - * requests to a sun sensor must be performed consecutively. Another reason for calling multiple - * device handler cycles is that the ADC conversions take some time. Thus first the ADC - * conversions are initiated and in a next step the results can be read from the internal FIFO. - * One sun sensor communication sequence also blocks the SPI bus. So other devices can not be - * inserted between the device handler cycles of one SUS. - */ + if (addSus0) { /* Write setup */ thisSequence->addSlot(objects::SUS_0, length * 0, DeviceHandlerIF::PERFORM_OPERATION); diff --git a/tmtc b/tmtc index b5a9dac8..a1478466 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit b5a9dac8f6d3733779a67a72b14a20091069a346 +Subproject commit a14784666f6d8ce0e3d993ae60edd235363a95e1 From c55fafee484dc7d718796d41a1ea16662ea121b0 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 1 Apr 2022 14:11:41 +0200 Subject: [PATCH 09/65] fsfw update --- fsfw | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fsfw b/fsfw index b3d2d440..1bc7a918 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit b3d2d440d790899cee60797c2dacae53812df279 +Subproject commit 1bc7a918694030d1f49f1d2998a289d77b132849 From 189674a9bb1ddd750d85eca022ac8c19d8695653 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Sun, 3 Apr 2022 20:12:14 +0200 Subject: [PATCH 10/65] re-enable all suses --- .../pollingSequenceFactory.cpp | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp b/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp index dece29fe..0f9232e0 100644 --- a/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp +++ b/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp @@ -165,17 +165,17 @@ ReturnValue_t pst::pstSpi(FixedTimeslotTaskIF *thisSequence) { #if OBSW_ADD_SUN_SENSORS == 1 - bool addSus0 = false; - bool addSus1 = false; - bool addSus2 = false; - bool addSus3 = false; - bool addSus4 = false; - bool addSus5 = false; - bool addSus6 = false; - bool addSus7 = false; - bool addSus8 = false; - bool addSus9 = false; - bool addSus10 = false; + bool addSus0 = true; + bool addSus1 = true; + bool addSus2 = true; + bool addSus3 = true; + bool addSus4 = true; + bool addSus5 = true; + bool addSus6 = true; + bool addSus7 = true; + bool addSus8 = true; + bool addSus9 = true; + bool addSus10 = true; bool addSus11 = true; if (addSus0) { From 99f56a89af000324ada562ee8ff9913d4969a5de Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 4 Apr 2022 12:00:39 +0200 Subject: [PATCH 11/65] tmtc update --- tmtc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tmtc b/tmtc index a1478466..a39c7007 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit a14784666f6d8ce0e3d993ae60edd235363a95e1 +Subproject commit a39c7007c6aef8cac559b38cdf1b9c8815c346ee From b12ffb6f44c2bf120a9d82548afe8f658568faf9 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 4 Apr 2022 13:39:35 +0200 Subject: [PATCH 12/65] PL PCDU switch states like mode bitmask now --- bsp_q7s/core/ObjectFactory.cpp | 6 +- .../PlocSupervisorDefinitions.h | 2 +- linux/devices/ploc/PlocMPSoCHandler.cpp | 131 +++++++++--------- linux/devices/ploc/PlocSupervisorHandler.cpp | 21 ++- linux/devices/ploc/PlocUpdater.cpp | 23 ++- .../devices/startracker/StarTrackerHandler.h | 2 +- mission/devices/P60DockHandler.cpp | 3 + mission/devices/PayloadPcduHandler.cpp | 34 +++-- mission/devices/RadiationSensorHandler.cpp | 24 ++-- mission/devices/SyrlinksHkHandler.cpp | 31 +++-- mission/devices/SyrlinksHkHandler.h | 3 +- .../payloadPcduDefinitions.h | 17 +-- mission/system/AcsBoardAssembly.cpp | 30 ++-- 13 files changed, 165 insertions(+), 162 deletions(-) diff --git a/bsp_q7s/core/ObjectFactory.cpp b/bsp_q7s/core/ObjectFactory.cpp index 123ef60e..2d28a095 100644 --- a/bsp_q7s/core/ObjectFactory.cpp +++ b/bsp_q7s/core/ObjectFactory.cpp @@ -662,9 +662,9 @@ void ObjectFactory::createPayloadComponents(LinuxLibgpioIF* gpioComIF) { auto supvGpioCookie = new GpioCookie; supvGpioCookie->addGpio(gpioIds::ENABLE_SUPV_UART, gpioConfigSupv); gpioComIF->addGpios(supvGpioCookie); - auto supervisorCookie = new UartCookie( - objects::PLOC_SUPERVISOR_HANDLER, q7s::UART_PLOC_SUPERVSIOR_DEV, UartModes::NON_CANONICAL, - uart::PLOC_SUPERVISOR_BAUD, supv::MAX_PACKET_SIZE * 20); + auto supervisorCookie = new UartCookie(objects::PLOC_SUPERVISOR_HANDLER, + q7s::UART_PLOC_SUPERVSIOR_DEV, UartModes::NON_CANONICAL, + uart::PLOC_SUPERVISOR_BAUD, supv::MAX_PACKET_SIZE * 20); supervisorCookie->setNoFixedSizeReply(); new PlocSupervisorHandler(objects::PLOC_SUPERVISOR_HANDLER, objects::UART_COM_IF, supervisorCookie, Gpio(gpioIds::ENABLE_SUPV_UART, gpioComIF), diff --git a/linux/devices/devicedefinitions/PlocSupervisorDefinitions.h b/linux/devices/devicedefinitions/PlocSupervisorDefinitions.h index 96e72f86..58166e98 100644 --- a/linux/devices/devicedefinitions/PlocSupervisorDefinitions.h +++ b/linux/devices/devicedefinitions/PlocSupervisorDefinitions.h @@ -1541,6 +1541,6 @@ class LatchupStatusReport : public StaticLocalDataSet { lp_var_t isSet = lp_var_t(sid.objectId, PoolIds::LATCHUP_RPT_TIME_IS_SET, this); }; -} // namespace PLOC_SPV +} // namespace supv #endif /* MISSION_DEVICES_DEVICEDEFINITIONS_PLOCSVPDEFINITIONS_H_ */ diff --git a/linux/devices/ploc/PlocMPSoCHandler.cpp b/linux/devices/ploc/PlocMPSoCHandler.cpp index d6777afd..13fa9ed7 100644 --- a/linux/devices/ploc/PlocMPSoCHandler.cpp +++ b/linux/devices/ploc/PlocMPSoCHandler.cpp @@ -1,9 +1,9 @@ #include "PlocMPSoCHandler.h" -#include "linux/devices/devicedefinitions/PlocSupervisorDefinitions.h" #include "OBSWConfig.h" #include "fsfw/datapool/PoolReadGuard.h" #include "fsfw/globalfunctions/CRC.h" +#include "linux/devices/devicedefinitions/PlocSupervisorDefinitions.h" PlocMPSoCHandler::PlocMPSoCHandler(object_id_t objectId, object_id_t uartComIFid, CookieIF* comCookie, PlocMPSoCHelper* plocMPSoCHelper, @@ -87,8 +87,8 @@ void PlocMPSoCHandler::performOperationHook() { } } CommandMessage message; - for (ReturnValue_t result = commandActionHelperQueue->receiveMessage(&message); result == RETURN_OK; - result = commandActionHelperQueue->receiveMessage(&message)) { + for (ReturnValue_t result = commandActionHelperQueue->receiveMessage(&message); + result == RETURN_OK; result = commandActionHelperQueue->receiveMessage(&message)) { result = commandActionHelper.handleReply(&message); if (result == RETURN_OK) { continue; @@ -133,31 +133,31 @@ ReturnValue_t PlocMPSoCHandler::executeAction(ActionId_t actionId, MessageQueueI } void PlocMPSoCHandler::doStartUp() { - switch(powerState) { - case PowerState::OFF: + switch (powerState) { + case PowerState::OFF: commandActionHelper.commandAction(supervisorHandler, supv::START_MPSOC); powerState = PowerState::BOOTING; break; - case PowerState::ON: + case PowerState::ON: setMode(_MODE_TO_ON); uartIsolatorSwitch.pullHigh(); break; - default: + default: break; } } void PlocMPSoCHandler::doShutDown() { - switch(powerState) { - case PowerState::ON: + switch (powerState) { + case PowerState::ON: uartIsolatorSwitch.pullLow(); commandActionHelper.commandAction(supervisorHandler, supv::SHUTDOWN_MPSOC); powerState = PowerState::SHUTDOWN; break; - case PowerState::OFF: + case PowerState::OFF: setMode(_MODE_POWER_DOWN); break; - default: + default: break; } } @@ -703,64 +703,57 @@ size_t PlocMPSoCHandler::getNextReplyLength(DeviceCommandId_t commandId) { return replyLen; } -MessageQueueIF* PlocMPSoCHandler::getCommandQueuePtr() { - return commandActionHelperQueue; -} +MessageQueueIF* PlocMPSoCHandler::getCommandQueuePtr() { return commandActionHelperQueue; } -void PlocMPSoCHandler::stepSuccessfulReceived(ActionId_t actionId, uint8_t step) { - return; -} +void PlocMPSoCHandler::stepSuccessfulReceived(ActionId_t actionId, uint8_t step) { return; } void PlocMPSoCHandler::stepFailedReceived(ActionId_t actionId, uint8_t step, - ReturnValue_t returnCode) { - switch (actionId) { - case supv::START_MPSOC: - sif::warning << "PlocMPSoCHandler::stepFailedReceived: Failed to start MPSoC" - << std::endl; - powerState = PowerState::OFF; - break; - case supv::SHUTDOWN_MPSOC: - triggerEvent(MPSOC_SHUTDOWN_FAILED); - sif::warning << "PlocMPSoCHandler::stepFailedReceived: Failed to shutdown MPSoC" - << std::endl; - // TODO: Setting state to on or off here? - powerState = PowerState::ON; - break; - default: - sif::debug - << "PlocMPSoCHandler::stepFailedReceived: Received unexpected action reply" - << std::endl; - break; - } + ReturnValue_t returnCode) { + switch (actionId) { + case supv::START_MPSOC: + sif::warning << "PlocMPSoCHandler::stepFailedReceived: Failed to start MPSoC" << std::endl; + powerState = PowerState::OFF; + break; + case supv::SHUTDOWN_MPSOC: + triggerEvent(MPSOC_SHUTDOWN_FAILED); + sif::warning << "PlocMPSoCHandler::stepFailedReceived: Failed to shutdown MPSoC" << std::endl; + // TODO: Setting state to on or off here? + powerState = PowerState::ON; + break; + default: + sif::debug << "PlocMPSoCHandler::stepFailedReceived: Received unexpected action reply" + << std::endl; + break; + } } void PlocMPSoCHandler::dataReceived(ActionId_t actionId, const uint8_t* data, uint32_t size) { - return; + return; } void PlocMPSoCHandler::completionSuccessfulReceived(ActionId_t actionId) { - if (actionId != supv::EXE_REPORT) { - sif::debug << "PlocMPSoCHandler::completionSuccessfulReceived: Did not expect this action " - << "ID" << std::endl; - return; - } - switch(powerState) { + if (actionId != supv::EXE_REPORT) { + sif::debug << "PlocMPSoCHandler::completionSuccessfulReceived: Did not expect this action " + << "ID" << std::endl; + return; + } + switch (powerState) { case PowerState::BOOTING: { - powerState = PowerState::ON; - break; + powerState = PowerState::ON; + break; } case PowerState::SHUTDOWN: { - powerState = PowerState::OFF; - break; + powerState = PowerState::OFF; + break; } default: { break; } - } + } } void PlocMPSoCHandler::completionFailedReceived(ActionId_t actionId, ReturnValue_t returnCode) { - handleActionCommandFailure(actionId); + handleActionCommandFailure(actionId); } void PlocMPSoCHandler::handleDeviceTM(const uint8_t* data, size_t dataSize, @@ -862,27 +855,27 @@ void PlocMPSoCHandler::handleActionCommandFailure(ActionId_t actionId) { switch (actionId) { case supv::ACK_REPORT: case supv::EXE_REPORT: - break; + break; default: - sif::debug << "PlocMPSoCHandler::handleActionCommandFailure: Did not expect this action ID " - << std::endl; - return; + sif::debug << "PlocMPSoCHandler::handleActionCommandFailure: Did not expect this action ID " + << std::endl; + return; } - switch(powerState) { - case PowerState::BOOTING: { - sif::warning << "PlocMPSoCHandler::handleActionCommandFailure: Failed to boot MPSoC" - << std::endl; - powerState = PowerState::OFF; - break; - } - case PowerState::SHUTDOWN: { - sif::warning << "PlocMPSoCHandler::handleActionCommandFailure: Failed to shutdown MPSoC" - << std::endl; - powerState = PowerState::ON; - break; - } - default: - break; + switch (powerState) { + case PowerState::BOOTING: { + sif::warning << "PlocMPSoCHandler::handleActionCommandFailure: Failed to boot MPSoC" + << std::endl; + powerState = PowerState::OFF; + break; + } + case PowerState::SHUTDOWN: { + sif::warning << "PlocMPSoCHandler::handleActionCommandFailure: Failed to shutdown MPSoC" + << std::endl; + powerState = PowerState::ON; + break; + } + default: + break; } return; } diff --git a/linux/devices/ploc/PlocSupervisorHandler.cpp b/linux/devices/ploc/PlocSupervisorHandler.cpp index 078475c9..5065c7dd 100644 --- a/linux/devices/ploc/PlocSupervisorHandler.cpp +++ b/linux/devices/ploc/PlocSupervisorHandler.cpp @@ -384,7 +384,7 @@ ReturnValue_t PlocSupervisorHandler::scanForReply(const uint8_t* start, size_t r ReturnValue_t PlocSupervisorHandler::getSwitches(const uint8_t** switches, uint8_t* numberOfSwitches) { if (powerSwitch == power::NO_SWITCH) { - return DeviceHandlerBase::NO_SWITCH; + return DeviceHandlerBase::NO_SWITCH; } *numberOfSwitches = 1; *switches = &powerSwitch; @@ -489,8 +489,8 @@ ReturnValue_t PlocSupervisorHandler::enableReplyInReplyMap(DeviceCommandMap::ite switch (command->first) { case supv::GET_HK_REPORT: { enabledReplies = 3; - result = DeviceHandlerBase::enableReplyInReplyMap(command, enabledReplies, true, - supv::HK_REPORT); + result = + DeviceHandlerBase::enableReplyInReplyMap(command, enabledReplies, true, supv::HK_REPORT); if (result != RETURN_OK) { sif::debug << "PlocSupervisorHandler::enableReplyInReplyMap: Reply with id " << supv::HK_REPORT << " not in replyMap" << std::endl; @@ -589,15 +589,15 @@ ReturnValue_t PlocSupervisorHandler::enableReplyInReplyMap(DeviceCommandMap::ite result = DeviceHandlerBase::enableReplyInReplyMap(command, enabledReplies, true, supv::ACK_REPORT); if (result != RETURN_OK) { - sif::debug << "PlocSupervisorHandler::enableReplyInReplyMap: Reply with id " - << supv::ACK_REPORT << " not in replyMap" << std::endl; + sif::debug << "PlocSupervisorHandler::enableReplyInReplyMap: Reply with id " << supv::ACK_REPORT + << " not in replyMap" << std::endl; } result = DeviceHandlerBase::enableReplyInReplyMap(command, enabledReplies, true, supv::EXE_REPORT); if (result != RETURN_OK) { - sif::debug << "PlocSupervisorHandler::enableReplyInReplyMap: Reply with id " - << supv::EXE_REPORT << " not in replyMap" << std::endl; + sif::debug << "PlocSupervisorHandler::enableReplyInReplyMap: Reply with id " << supv::EXE_REPORT + << " not in replyMap" << std::endl; } return RETURN_OK; @@ -1013,7 +1013,7 @@ void PlocSupervisorHandler::prepareEmptyCmd(uint16_t apid) { void PlocSupervisorHandler::prepareSelBootImageCmd(const uint8_t* commandData) { supv::MPSoCBootSelect packet(*commandData, *(commandData + 1), *(commandData + 2), - *(commandData + 3)); + *(commandData + 3)); packetToOutBuffer(packet.getWholeData(), packet.getFullSize()); } @@ -1459,9 +1459,8 @@ ReturnValue_t PlocSupervisorHandler::handleMramDumpFile(DeviceCommandId_t id) { return MRAM_FILE_NOT_EXISTS; } std::ofstream file(activeMramFile, std::ios_base::app | std::ios_base::out); - file.write( - reinterpret_cast(spacePacketBuffer + supv::SPACE_PACKET_HEADER_LENGTH), - packetLen - 1); + file.write(reinterpret_cast(spacePacketBuffer + supv::SPACE_PACKET_HEADER_LENGTH), + packetLen - 1); file.close(); return RETURN_OK; } diff --git a/linux/devices/ploc/PlocUpdater.cpp b/linux/devices/ploc/PlocUpdater.cpp index 220b1e00..37a553da 100644 --- a/linux/devices/ploc/PlocUpdater.cpp +++ b/linux/devices/ploc/PlocUpdater.cpp @@ -262,12 +262,11 @@ void PlocUpdater::commandUpdateAvailable() { calcImageCrc(); supv::UpdateInfo packet(supv::APID_UPDATE_AVAILABLE, static_cast(image), - static_cast(partition), imageSize, imageCrc, - numOfUpdatePackets); + static_cast(partition), imageSize, imageCrc, numOfUpdatePackets); - result = commandActionHelper.commandAction(objects::PLOC_SUPERVISOR_HANDLER, - supv::UPDATE_AVAILABLE, packet.getWholeData(), - packet.getFullSize()); + result = + commandActionHelper.commandAction(objects::PLOC_SUPERVISOR_HANDLER, supv::UPDATE_AVAILABLE, + packet.getWholeData(), packet.getFullSize()); if (result != RETURN_OK) { sif::warning << "PlocUpdater::commandUpdateAvailable: Failed to send update available" << " packet to supervisor handler" << std::endl; @@ -311,9 +310,9 @@ void PlocUpdater::commandUpdatePacket() { } packet.makeCrc(); - result = commandActionHelper.commandAction(objects::PLOC_SUPERVISOR_HANDLER, - supv::UPDATE_IMAGE_DATA, packet.getWholeData(), - packet.getFullSize()); + result = + commandActionHelper.commandAction(objects::PLOC_SUPERVISOR_HANDLER, supv::UPDATE_IMAGE_DATA, + packet.getWholeData(), packet.getFullSize()); if (result != RETURN_OK) { sif::warning << "PlocUpdater::commandUpdateAvailable: Failed to send update" @@ -335,12 +334,10 @@ void PlocUpdater::commandUpdateVerify() { ReturnValue_t result = RETURN_OK; supv::UpdateInfo packet(supv::APID_UPDATE_VERIFY, static_cast(image), - static_cast(partition), imageSize, imageCrc, - numOfUpdatePackets); + static_cast(partition), imageSize, imageCrc, numOfUpdatePackets); - result = - commandActionHelper.commandAction(objects::PLOC_SUPERVISOR_HANDLER, supv::UPDATE_VERIFY, - packet.getWholeData(), packet.getFullSize()); + result = commandActionHelper.commandAction(objects::PLOC_SUPERVISOR_HANDLER, supv::UPDATE_VERIFY, + packet.getWholeData(), packet.getFullSize()); if (result != RETURN_OK) { sif::warning << "PlocUpdater::commandUpdateAvailable: Failed to send update available" << " packet to supervisor handler" << std::endl; diff --git a/linux/devices/startracker/StarTrackerHandler.h b/linux/devices/startracker/StarTrackerHandler.h index 2667db31..90a30966 100644 --- a/linux/devices/startracker/StarTrackerHandler.h +++ b/linux/devices/startracker/StarTrackerHandler.h @@ -7,12 +7,12 @@ #include "ArcsecJsonParamBase.h" #include "OBSWConfig.h" #include "StrHelper.h" +#include "devices/powerSwitcherList.h" #include "fsfw/devicehandlers/DeviceHandlerBase.h" #include "fsfw/src/fsfw/serialize/SerializeAdapter.h" #include "fsfw/timemanager/Countdown.h" #include "linux/devices/devicedefinitions/StarTrackerDefinitions.h" #include "thirdparty/arcsec_star_tracker/common/SLIP.h" -#include "devices/powerSwitcherList.h" /** * @brief This is the device handler for the star tracker from arcsec. diff --git a/mission/devices/P60DockHandler.cpp b/mission/devices/P60DockHandler.cpp index b506a92b..ed209b86 100644 --- a/mission/devices/P60DockHandler.cpp +++ b/mission/devices/P60DockHandler.cpp @@ -441,6 +441,9 @@ ReturnValue_t P60DockHandler::initializeLocalDataPool(localpool::DataPool &local localDataPoolMap.emplace(P60System::P60DOCK_ANT6_DEPL, new PoolEntry({0})); localDataPoolMap.emplace(P60System::P60DOCK_AR6_DEPL, new PoolEntry({0})); +#if OBSW_ENABLE_PERIODIC_HK == 1 + poolManager.subscribeForPeriodicPacket(p60dockHkTableDataset.getSid(), false, 0.8, true); +#endif return HasReturnvaluesIF::RETURN_OK; } diff --git a/mission/devices/PayloadPcduHandler.cpp b/mission/devices/PayloadPcduHandler.cpp index 7a1924c1..67cf8c10 100644 --- a/mission/devices/PayloadPcduHandler.cpp +++ b/mission/devices/PayloadPcduHandler.cpp @@ -66,7 +66,7 @@ void PayloadPcduHandler::doTransition(Mode_t modeFrom, Submode_t subModeFrom) { ReturnValue_t PayloadPcduHandler::stateMachineToNormal(Mode_t modeFrom, Submode_t subModeFrom) { using namespace plpcdu; - if (submode == NormalSubmodes::SOLID_STATE_RELAYS_ADC_ON) { + if (((submode >> SOLID_STATE_RELAYS_ADC_ON) & 0b1) == 1) { if (state == States::PL_PCDU_OFF) { sif::error << "PayloadPcduHandler::stateMachineToNormal: Unexpected state PL_PCDU_OFF" << "detected" << std::endl; @@ -116,7 +116,7 @@ ReturnValue_t PayloadPcduHandler::stateMachineToNormal(Mode_t modeFrom, Submode_ } } - if (submode == NormalSubmodes::DRO_ON) { + if (((submode >> DRO_ON) & 1) == 1) { #if OBSW_VERBOSE_LEVEL >= 1 sif::info << "Enabling PL PCDU DRO module" << std::endl; #endif @@ -127,7 +127,7 @@ ReturnValue_t PayloadPcduHandler::stateMachineToNormal(Mode_t modeFrom, Submode_ setMode(MODE_NORMAL, submode); } - if (submode == NormalSubmodes::X8_ON) { + if (((submode >> X8_ON) & 1) == 1) { #if OBSW_VERBOSE_LEVEL >= 1 sif::info << "Enabling PL PCDU X8 module" << std::endl; #endif @@ -138,7 +138,7 @@ ReturnValue_t PayloadPcduHandler::stateMachineToNormal(Mode_t modeFrom, Submode_ setMode(MODE_NORMAL, submode); } - if (submode == NormalSubmodes::TX_ON) { + if (((submode >> TX_ON) & 1) == 1) { #if OBSW_VERBOSE_LEVEL >= 1 sif::info << "Enabling PL PCDU TX module" << std::endl; #endif @@ -149,7 +149,7 @@ ReturnValue_t PayloadPcduHandler::stateMachineToNormal(Mode_t modeFrom, Submode_ setMode(MODE_NORMAL, submode); } - if (submode == NormalSubmodes::MPA_ON) { + if (((submode >> MPA_ON) & 1) == 1) { #if OBSW_VERBOSE_LEVEL >= 1 sif::info << "Enabling PL PCDU MPA module" << std::endl; #endif @@ -160,7 +160,7 @@ ReturnValue_t PayloadPcduHandler::stateMachineToNormal(Mode_t modeFrom, Submode_ setMode(MODE_NORMAL, submode); } - if (submode == NormalSubmodes::HPA_ON) { + if (((submode >> HPA_ON) & 1) == 1) { #if OBSW_VERBOSE_LEVEL >= 1 sif::info << "Enabling PL PCDU HPA module" << std::endl; #endif @@ -549,24 +549,30 @@ ReturnValue_t PayloadPcduHandler::isModeCombinationValid(Mode_t mode, Submode_t using namespace plpcdu; if (mode == MODE_NORMAL) { // Also deals with the case where the mode is MODE_ON, submode should be 0 here - if (submode == NormalSubmodes::SOLID_STATE_RELAYS_ADC_ON and - (this->mode == MODE_NORMAL and this->submode != NormalSubmodes::ALL_OFF)) { + if ((((submode >> SOLID_STATE_RELAYS_ADC_ON) & 0b1) == SOLID_STATE_RELAYS_ADC_ON) and + (this->mode == MODE_NORMAL and this->submode != ALL_OFF_SUBMODE)) { return TRANS_NOT_ALLOWED; } - if ((submode == NormalSubmodes::DRO_ON and - this->submode != NormalSubmodes::SOLID_STATE_RELAYS_ADC_ON)) { + if (((((submode >> DRO_ON) & 1) == 1) and + (this->submode != (1 << SOLID_STATE_RELAYS_ADC_ON)))) { return TRANS_NOT_ALLOWED; } - if ((submode == NormalSubmodes::X8_ON and this->submode != NormalSubmodes::DRO_ON)) { + if ((((submode >> X8_ON) & 1) == 1) and + (this->submode != ((1 << SOLID_STATE_RELAYS_ADC_ON) | (1 << DRO_ON)))) { return TRANS_NOT_ALLOWED; } - if ((submode == NormalSubmodes::TX_ON and this->submode != NormalSubmodes::X8_ON)) { + if (((((submode >> TX_ON) & 1) == 1) and + (this->submode != ((1 << X8_ON) | (1 << DRO_ON) | (1 << SOLID_STATE_RELAYS_ADC_ON))))) { return TRANS_NOT_ALLOWED; } - if ((submode == NormalSubmodes::MPA_ON and this->submode != NormalSubmodes::TX_ON)) { + if ((((submode >> MPA_ON) & 1) == 1 and + (this->submode != + ((1 << TX_ON) | (1 << X8_ON) | (1 << DRO_ON) | (1 << SOLID_STATE_RELAYS_ADC_ON))))) { return TRANS_NOT_ALLOWED; } - if ((submode == NormalSubmodes::HPA_ON and this->submode != NormalSubmodes::MPA_ON)) { + if ((((submode >> HPA_ON) & 1) == 1 and + (this->submode != ((1 << MPA_ON) | (1 << TX_ON) | (1 << X8_ON) | (1 << DRO_ON) | + (1 << SOLID_STATE_RELAYS_ADC_ON))))) { return TRANS_NOT_ALLOWED; } return HasReturnvaluesIF::RETURN_OK; diff --git a/mission/devices/RadiationSensorHandler.cpp b/mission/devices/RadiationSensorHandler.cpp index 179444ca..e91d8427 100644 --- a/mission/devices/RadiationSensorHandler.cpp +++ b/mission/devices/RadiationSensorHandler.cpp @@ -92,15 +92,15 @@ ReturnValue_t RadiationSensorHandler::buildCommandFromCommand(DeviceCommandId_t return RETURN_OK; } case RAD_SENSOR::ENABLE_DEBUG_OUTPUT: { - printPeriodicData = true; - rawPacketLen = 0; - return RETURN_OK; - } - case RAD_SENSOR::DISABLE_DEBUG_OUTPUT: { - rawPacketLen = 0; - printPeriodicData = false; - return RETURN_OK; - } + printPeriodicData = true; + rawPacketLen = 0; + return RETURN_OK; + } + case RAD_SENSOR::DISABLE_DEBUG_OUTPUT: { + rawPacketLen = 0; + printPeriodicData = false; + return RETURN_OK; + } default: return DeviceHandlerIF::COMMAND_NOT_IMPLEMENTED; } @@ -123,7 +123,7 @@ ReturnValue_t RadiationSensorHandler::scanForReply(const uint8_t *start, size_t switch (*foundId) { case RAD_SENSOR::START_CONVERSION: case RAD_SENSOR::WRITE_SETUP: - *foundLen = remainingSize; + *foundLen = remainingSize; return IGNORE_REPLY_DATA; case RAD_SENSOR::READ_CONVERSIONS: { ReturnValue_t result = gpioIF->pullLow(gpioIds::ENABLE_RADFET); @@ -138,8 +138,8 @@ ReturnValue_t RadiationSensorHandler::scanForReply(const uint8_t *start, size_t } case RAD_SENSOR::ENABLE_DEBUG_OUTPUT: case RAD_SENSOR::DISABLE_DEBUG_OUTPUT: - sif::info << "RadiationSensorHandler::scanForReply: " << remainingSize << std::endl; - break; + sif::info << "RadiationSensorHandler::scanForReply: " << remainingSize << std::endl; + break; default: break; } diff --git a/mission/devices/SyrlinksHkHandler.cpp b/mission/devices/SyrlinksHkHandler.cpp index 017bd53c..53a8af23 100644 --- a/mission/devices/SyrlinksHkHandler.cpp +++ b/mission/devices/SyrlinksHkHandler.cpp @@ -139,42 +139,45 @@ ReturnValue_t SyrlinksHkHandler::buildCommandFromCommand(DeviceCommandId_t devic return RETURN_OK; } case (SYRLINKS::READ_TX_AGC_VALUE_HIGH_BYTE): { - readTxAgcValueHighByte.copy(reinterpret_cast(commandBuffer), readTxAgcValueHighByte.size(), 0); + readTxAgcValueHighByte.copy(reinterpret_cast(commandBuffer), + readTxAgcValueHighByte.size(), 0); rawPacketLen = readTxAgcValueHighByte.size(); rememberCommandId = SYRLINKS::READ_TX_AGC_VALUE_HIGH_BYTE; rawPacket = commandBuffer; return RETURN_OK; } case (SYRLINKS::READ_TX_AGC_VALUE_LOW_BYTE): { - readTxAgcValueLowByte.copy(reinterpret_cast(commandBuffer), readTxAgcValueLowByte.size(), 0); + readTxAgcValueLowByte.copy(reinterpret_cast(commandBuffer), + readTxAgcValueLowByte.size(), 0); rawPacketLen = readTxAgcValueLowByte.size(); rememberCommandId = SYRLINKS::READ_TX_AGC_VALUE_LOW_BYTE; rawPacket = commandBuffer; return RETURN_OK; } case (SYRLINKS::TEMP_POWER_AMPLIFIER_HIGH_BYTE): - tempPowerAmpBoardHighByte.copy(reinterpret_cast(commandBuffer), tempPowerAmpBoardHighByte.size(), - 0); + tempPowerAmpBoardHighByte.copy(reinterpret_cast(commandBuffer), + tempPowerAmpBoardHighByte.size(), 0); rawPacketLen = tempPowerAmpBoardHighByte.size(); rememberCommandId = SYRLINKS::TEMP_POWER_AMPLIFIER_HIGH_BYTE; rawPacket = commandBuffer; return RETURN_OK; case (SYRLINKS::TEMP_POWER_AMPLIFIER_LOW_BYTE): - tempPowerAmpBoardLowByte.copy(reinterpret_cast(commandBuffer), tempPowerAmpBoardLowByte.size(), - 0); + tempPowerAmpBoardLowByte.copy(reinterpret_cast(commandBuffer), + tempPowerAmpBoardLowByte.size(), 0); rawPacketLen = tempPowerAmpBoardLowByte.size(); rememberCommandId = SYRLINKS::TEMP_POWER_AMPLIFIER_LOW_BYTE; rawPacket = commandBuffer; return RETURN_OK; case (SYRLINKS::TEMP_BASEBAND_BOARD_HIGH_BYTE): - tempBasebandBoardHighByte.copy(reinterpret_cast(commandBuffer), tempBasebandBoardHighByte.size(), - 0); + tempBasebandBoardHighByte.copy(reinterpret_cast(commandBuffer), + tempBasebandBoardHighByte.size(), 0); rawPacketLen = tempBasebandBoardHighByte.size(); rememberCommandId = SYRLINKS::TEMP_BASEBAND_BOARD_HIGH_BYTE; rawPacket = commandBuffer; return RETURN_OK; case (SYRLINKS::TEMP_BASEBAND_BOARD_LOW_BYTE): - tempBasebandBoardLowByte.copy(reinterpret_cast(commandBuffer), tempBasebandBoardLowByte.size(), 0); + tempBasebandBoardLowByte.copy(reinterpret_cast(commandBuffer), + tempBasebandBoardLowByte.size(), 0); rawPacketLen = tempBasebandBoardLowByte.size(); rememberCommandId = SYRLINKS::TEMP_BASEBAND_BOARD_LOW_BYTE; rawPacket = commandBuffer; @@ -352,8 +355,8 @@ ReturnValue_t SyrlinksHkHandler::interpretDeviceReply(DeviceCommandId_t id, cons rawTempBasebandBoard |= convertHexStringToUint8( reinterpret_cast(packet + SYRLINKS::MESSAGE_HEADER_SIZE)); tempBasebandBoard = calcTempVal(rawTempBasebandBoard); - sif::info << "Syrlinks temperature baseband board: " << tempBasebandBoard << " °C" - << std::endl; + sif::info << "Syrlinks temperature baseband board: " << tempBasebandBoard << " °C" + << std::endl; break; case (SYRLINKS::TEMP_POWER_AMPLIFIER_HIGH_BYTE): result = verifyReply(packet, SYRLINKS::READ_ONE_REGISTER_REPLY_SIE); @@ -364,8 +367,8 @@ ReturnValue_t SyrlinksHkHandler::interpretDeviceReply(DeviceCommandId_t id, cons } rawTempPowerAmplifier = 0; rawTempPowerAmplifier = convertHexStringToUint8(reinterpret_cast( - packet + SYRLINKS::MESSAGE_HEADER_SIZE)) - << 8; + packet + SYRLINKS::MESSAGE_HEADER_SIZE)) + << 8; break; case (SYRLINKS::TEMP_POWER_AMPLIFIER_LOW_BYTE): result = verifyReply(packet, SYRLINKS::READ_ONE_REGISTER_REPLY_SIE); @@ -378,7 +381,7 @@ ReturnValue_t SyrlinksHkHandler::interpretDeviceReply(DeviceCommandId_t id, cons reinterpret_cast(packet + SYRLINKS::MESSAGE_HEADER_SIZE)); tempPowerAmplifier = calcTempVal(rawTempPowerAmplifier); sif::info << "Syrlinks temperature power amplifier board: " << tempPowerAmplifier << " °C" - << std::endl; + << std::endl; break; default: { sif::debug << "SyrlinksHkHandler::interpretDeviceReply: Unknown device reply id" << std::endl; diff --git a/mission/devices/SyrlinksHkHandler.h b/mission/devices/SyrlinksHkHandler.h index 9b9e05c2..a8cb7b8c 100644 --- a/mission/devices/SyrlinksHkHandler.h +++ b/mission/devices/SyrlinksHkHandler.h @@ -1,10 +1,11 @@ #ifndef MISSION_DEVICES_SYRLINKSHKHANDLER_H_ #define MISSION_DEVICES_SYRLINKSHKHANDLER_H_ +#include + #include "devices/powerSwitcherList.h" #include "fsfw/devicehandlers/DeviceHandlerBase.h" #include "mission/devices/devicedefinitions/SyrlinksDefinitions.h" -#include /** * @brief This is the device handler for the syrlinks transceiver. It handles the command diff --git a/mission/devices/devicedefinitions/payloadPcduDefinitions.h b/mission/devices/devicedefinitions/payloadPcduDefinitions.h index 3013cb82..ab387fc7 100644 --- a/mission/devices/devicedefinitions/payloadPcduDefinitions.h +++ b/mission/devices/devicedefinitions/payloadPcduDefinitions.h @@ -91,16 +91,17 @@ static constexpr DeviceCommandId_t SETUP_CMD = 1; static constexpr DeviceCommandId_t READ_TEMP_EXT = 2; static constexpr DeviceCommandId_t READ_WITH_TEMP_EXT = 3; -enum NormalSubmodes { - ALL_OFF = 0, - SOLID_STATE_RELAYS_ADC_ON = 1, - DRO_ON = 2, - X8_ON = 3, - TX_ON = 4, - MPA_ON = 5, - HPA_ON = 6 +enum NormalSubmodeBits { + SOLID_STATE_RELAYS_ADC_ON = 0, + DRO_ON = 1, + X8_ON = 2, + TX_ON = 3, + MPA_ON = 4, + HPA_ON = 5 }; +static constexpr Submode_t ALL_OFF_SUBMODE = 0; + // 12 ADC values * 2 + trailing zero static constexpr size_t ADC_REPLY_SIZE = 25; // Conversion byte + 24 * zero diff --git a/mission/system/AcsBoardAssembly.cpp b/mission/system/AcsBoardAssembly.cpp index e319f32b..0d65d20e 100644 --- a/mission/system/AcsBoardAssembly.cpp +++ b/mission/system/AcsBoardAssembly.cpp @@ -143,13 +143,13 @@ ReturnValue_t AcsBoardAssembly::handleNormalOrOnModeCmd(Mode_t mode, Submode_t s cmdSeq(helper.mgm1Rm3100IdSideA, helper.mgm1SideAMode, ModeTableIdx::MGM_1_A); if (gpsUsable) { gpioHandler(gpioIds::GNSS_0_NRESET, true, - "AcsBoardAssembly::handleNormalOrOnModeCmd: Could not pull nReset pin" - "of GNSS 0 high (used GNSS)"); + "AcsBoardAssembly::handleNormalOrOnModeCmd: Could not pull nReset pin" + "of GNSS 0 high (used GNSS)"); gpioHandler(gpioIds::GNSS_1_NRESET, false, - "AcsBoardAssembly::handleNormalOrOnModeCmd: Could not pull nReset pin" - "of GNSS 1 low (unused GNSS)"); + "AcsBoardAssembly::handleNormalOrOnModeCmd: Could not pull nReset pin" + "of GNSS 1 low (unused GNSS)"); gpioHandler(gpioIds::GNSS_SELECT, false, - "AcsBoardAssembly::handleNormalOrOnModeCmd: Could not pull GNSS select low"); + "AcsBoardAssembly::handleNormalOrOnModeCmd: Could not pull GNSS select low"); } break; } @@ -168,13 +168,13 @@ ReturnValue_t AcsBoardAssembly::handleNormalOrOnModeCmd(Mode_t mode, Submode_t s cmdSeq(helper.mgm3Rm3100IdSideB, helper.mgm3SideBMode, ModeTableIdx::MGM_3_B); if (gpsUsable) { gpioHandler(gpioIds::GNSS_0_NRESET, false, - "AcsBoardAssembly::handleNormalOrOnModeCmd: Could not pull nReset pin" - "of GNSS 0 low (unused GNSS)"); + "AcsBoardAssembly::handleNormalOrOnModeCmd: Could not pull nReset pin" + "of GNSS 0 low (unused GNSS)"); gpioHandler(gpioIds::GNSS_1_NRESET, true, - "AcsBoardAssembly::handleNormalOrOnModeCmd: Could not pull nReset pin" - "of GNSS 1 high (used GNSS)"); + "AcsBoardAssembly::handleNormalOrOnModeCmd: Could not pull nReset pin" + "of GNSS 1 high (used GNSS)"); gpioHandler(gpioIds::GNSS_SELECT, true, - "AcsBoardAssembly::handleNormalOrOnModeCmd: Could not pull GNSS select high"); + "AcsBoardAssembly::handleNormalOrOnModeCmd: Could not pull GNSS select high"); } break; } @@ -191,11 +191,11 @@ ReturnValue_t AcsBoardAssembly::handleNormalOrOnModeCmd(Mode_t mode, Submode_t s ReturnValue_t status = RETURN_OK; if (gpsUsable) { gpioHandler(gpioIds::GNSS_0_NRESET, true, - "AcsBoardAssembly::handleNormalOrOnModeCmd: Could not pull nReset pin" - "of GNSS 0 high (used GNSS)"); + "AcsBoardAssembly::handleNormalOrOnModeCmd: Could not pull nReset pin" + "of GNSS 0 high (used GNSS)"); gpioHandler(gpioIds::GNSS_1_NRESET, true, - "AcsBoardAssembly::handleNormalOrOnModeCmd: Could not pull nReset pin" - "of GNSS 1 high (used GNSS)"); + "AcsBoardAssembly::handleNormalOrOnModeCmd: Could not pull nReset pin" + "of GNSS 1 high (used GNSS)"); if (defaultSubmode == Submodes::A_SIDE) { status = gpioIF->pullLow(gpioIds::GNSS_SELECT); } else { @@ -245,7 +245,7 @@ void AcsBoardAssembly::selectGpsInDualMode(duallane::Submodes side) { void AcsBoardAssembly::gpioHandler(gpioId_t gpio, bool high, std::string error) { ReturnValue_t result = RETURN_OK; - if(high) { + if (high) { result = gpioIF->pullHigh(gpio); } else { result = gpioIF->pullLow(gpio); From d315d6b4589168974b7ec556bfbd353431dc147d Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 4 Apr 2022 13:53:44 +0200 Subject: [PATCH 13/65] tmtc update --- tmtc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tmtc b/tmtc index a39c7007..8b5554d6 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit a39c7007c6aef8cac559b38cdf1b9c8815c346ee +Subproject commit 8b5554d6fdfb9e2d982e4a2af4f5e6d6e844794e From 4327fcb92e47d2d5dc52d434cf6f814763377484 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 4 Apr 2022 13:55:25 +0200 Subject: [PATCH 14/65] set internal state properly --- mission/devices/PayloadPcduHandler.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/mission/devices/PayloadPcduHandler.cpp b/mission/devices/PayloadPcduHandler.cpp index 67cf8c10..b08e73ca 100644 --- a/mission/devices/PayloadPcduHandler.cpp +++ b/mission/devices/PayloadPcduHandler.cpp @@ -51,6 +51,7 @@ void PayloadPcduHandler::doShutDown() { auto opCode = pwrStateMachine.fsm(); if (opCode == power::OpCodes::TO_OFF_DONE or opCode == power::OpCodes::TIMEOUT_OCCURED) { pwrStateMachine.reset(); + state = States::PL_PCDU_OFF; // No need to set mode _MODE_POWER_DOWN, power switching was already handled setMode(MODE_OFF); } From 65ce25ec7abf792d59b83bf85be1c34a46334aa2 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 4 Apr 2022 17:16:52 +0200 Subject: [PATCH 15/65] improved P60 HK handling --- bsp_q7s/core/ObjectFactory.cpp | 6 +- fsfw | 2 +- .../PlocSupervisorDefinitions.h | 2 +- linux/devices/ploc/PlocMPSoCHandler.cpp | 131 ++- linux/devices/ploc/PlocSupervisorHandler.cpp | 21 +- linux/devices/ploc/PlocUpdater.cpp | 23 +- .../devices/startracker/StarTrackerHandler.h | 2 +- mission/devices/ACUHandler.cpp | 127 +-- mission/devices/P60DockHandler.cpp | 408 +++------- mission/devices/P60DockHandler.h | 7 + mission/devices/PCDUHandler.cpp | 309 ++++---- mission/devices/PDU1Handler.cpp | 162 ++-- mission/devices/PDU2Handler.cpp | 160 ++-- mission/devices/RadiationSensorHandler.cpp | 24 +- mission/devices/SyrlinksHkHandler.cpp | 31 +- mission/devices/SyrlinksHkHandler.h | 3 +- .../devicedefinitions/GomspaceDefinitions.h | 749 ++++++++---------- mission/system/AcsBoardAssembly.cpp | 30 +- tmtc | 2 +- 19 files changed, 928 insertions(+), 1271 deletions(-) diff --git a/bsp_q7s/core/ObjectFactory.cpp b/bsp_q7s/core/ObjectFactory.cpp index 123ef60e..2d28a095 100644 --- a/bsp_q7s/core/ObjectFactory.cpp +++ b/bsp_q7s/core/ObjectFactory.cpp @@ -662,9 +662,9 @@ void ObjectFactory::createPayloadComponents(LinuxLibgpioIF* gpioComIF) { auto supvGpioCookie = new GpioCookie; supvGpioCookie->addGpio(gpioIds::ENABLE_SUPV_UART, gpioConfigSupv); gpioComIF->addGpios(supvGpioCookie); - auto supervisorCookie = new UartCookie( - objects::PLOC_SUPERVISOR_HANDLER, q7s::UART_PLOC_SUPERVSIOR_DEV, UartModes::NON_CANONICAL, - uart::PLOC_SUPERVISOR_BAUD, supv::MAX_PACKET_SIZE * 20); + auto supervisorCookie = new UartCookie(objects::PLOC_SUPERVISOR_HANDLER, + q7s::UART_PLOC_SUPERVSIOR_DEV, UartModes::NON_CANONICAL, + uart::PLOC_SUPERVISOR_BAUD, supv::MAX_PACKET_SIZE * 20); supervisorCookie->setNoFixedSizeReply(); new PlocSupervisorHandler(objects::PLOC_SUPERVISOR_HANDLER, objects::UART_COM_IF, supervisorCookie, Gpio(gpioIds::ENABLE_SUPV_UART, gpioComIF), diff --git a/fsfw b/fsfw index ce2f7c4f..e4c6a69f 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit ce2f7c4fdf97d92466c921135b9cec770ba7fd20 +Subproject commit e4c6a69f776cd8056985ce56ba6528bd842a1ea8 diff --git a/linux/devices/devicedefinitions/PlocSupervisorDefinitions.h b/linux/devices/devicedefinitions/PlocSupervisorDefinitions.h index 96e72f86..58166e98 100644 --- a/linux/devices/devicedefinitions/PlocSupervisorDefinitions.h +++ b/linux/devices/devicedefinitions/PlocSupervisorDefinitions.h @@ -1541,6 +1541,6 @@ class LatchupStatusReport : public StaticLocalDataSet { lp_var_t isSet = lp_var_t(sid.objectId, PoolIds::LATCHUP_RPT_TIME_IS_SET, this); }; -} // namespace PLOC_SPV +} // namespace supv #endif /* MISSION_DEVICES_DEVICEDEFINITIONS_PLOCSVPDEFINITIONS_H_ */ diff --git a/linux/devices/ploc/PlocMPSoCHandler.cpp b/linux/devices/ploc/PlocMPSoCHandler.cpp index d6777afd..13fa9ed7 100644 --- a/linux/devices/ploc/PlocMPSoCHandler.cpp +++ b/linux/devices/ploc/PlocMPSoCHandler.cpp @@ -1,9 +1,9 @@ #include "PlocMPSoCHandler.h" -#include "linux/devices/devicedefinitions/PlocSupervisorDefinitions.h" #include "OBSWConfig.h" #include "fsfw/datapool/PoolReadGuard.h" #include "fsfw/globalfunctions/CRC.h" +#include "linux/devices/devicedefinitions/PlocSupervisorDefinitions.h" PlocMPSoCHandler::PlocMPSoCHandler(object_id_t objectId, object_id_t uartComIFid, CookieIF* comCookie, PlocMPSoCHelper* plocMPSoCHelper, @@ -87,8 +87,8 @@ void PlocMPSoCHandler::performOperationHook() { } } CommandMessage message; - for (ReturnValue_t result = commandActionHelperQueue->receiveMessage(&message); result == RETURN_OK; - result = commandActionHelperQueue->receiveMessage(&message)) { + for (ReturnValue_t result = commandActionHelperQueue->receiveMessage(&message); + result == RETURN_OK; result = commandActionHelperQueue->receiveMessage(&message)) { result = commandActionHelper.handleReply(&message); if (result == RETURN_OK) { continue; @@ -133,31 +133,31 @@ ReturnValue_t PlocMPSoCHandler::executeAction(ActionId_t actionId, MessageQueueI } void PlocMPSoCHandler::doStartUp() { - switch(powerState) { - case PowerState::OFF: + switch (powerState) { + case PowerState::OFF: commandActionHelper.commandAction(supervisorHandler, supv::START_MPSOC); powerState = PowerState::BOOTING; break; - case PowerState::ON: + case PowerState::ON: setMode(_MODE_TO_ON); uartIsolatorSwitch.pullHigh(); break; - default: + default: break; } } void PlocMPSoCHandler::doShutDown() { - switch(powerState) { - case PowerState::ON: + switch (powerState) { + case PowerState::ON: uartIsolatorSwitch.pullLow(); commandActionHelper.commandAction(supervisorHandler, supv::SHUTDOWN_MPSOC); powerState = PowerState::SHUTDOWN; break; - case PowerState::OFF: + case PowerState::OFF: setMode(_MODE_POWER_DOWN); break; - default: + default: break; } } @@ -703,64 +703,57 @@ size_t PlocMPSoCHandler::getNextReplyLength(DeviceCommandId_t commandId) { return replyLen; } -MessageQueueIF* PlocMPSoCHandler::getCommandQueuePtr() { - return commandActionHelperQueue; -} +MessageQueueIF* PlocMPSoCHandler::getCommandQueuePtr() { return commandActionHelperQueue; } -void PlocMPSoCHandler::stepSuccessfulReceived(ActionId_t actionId, uint8_t step) { - return; -} +void PlocMPSoCHandler::stepSuccessfulReceived(ActionId_t actionId, uint8_t step) { return; } void PlocMPSoCHandler::stepFailedReceived(ActionId_t actionId, uint8_t step, - ReturnValue_t returnCode) { - switch (actionId) { - case supv::START_MPSOC: - sif::warning << "PlocMPSoCHandler::stepFailedReceived: Failed to start MPSoC" - << std::endl; - powerState = PowerState::OFF; - break; - case supv::SHUTDOWN_MPSOC: - triggerEvent(MPSOC_SHUTDOWN_FAILED); - sif::warning << "PlocMPSoCHandler::stepFailedReceived: Failed to shutdown MPSoC" - << std::endl; - // TODO: Setting state to on or off here? - powerState = PowerState::ON; - break; - default: - sif::debug - << "PlocMPSoCHandler::stepFailedReceived: Received unexpected action reply" - << std::endl; - break; - } + ReturnValue_t returnCode) { + switch (actionId) { + case supv::START_MPSOC: + sif::warning << "PlocMPSoCHandler::stepFailedReceived: Failed to start MPSoC" << std::endl; + powerState = PowerState::OFF; + break; + case supv::SHUTDOWN_MPSOC: + triggerEvent(MPSOC_SHUTDOWN_FAILED); + sif::warning << "PlocMPSoCHandler::stepFailedReceived: Failed to shutdown MPSoC" << std::endl; + // TODO: Setting state to on or off here? + powerState = PowerState::ON; + break; + default: + sif::debug << "PlocMPSoCHandler::stepFailedReceived: Received unexpected action reply" + << std::endl; + break; + } } void PlocMPSoCHandler::dataReceived(ActionId_t actionId, const uint8_t* data, uint32_t size) { - return; + return; } void PlocMPSoCHandler::completionSuccessfulReceived(ActionId_t actionId) { - if (actionId != supv::EXE_REPORT) { - sif::debug << "PlocMPSoCHandler::completionSuccessfulReceived: Did not expect this action " - << "ID" << std::endl; - return; - } - switch(powerState) { + if (actionId != supv::EXE_REPORT) { + sif::debug << "PlocMPSoCHandler::completionSuccessfulReceived: Did not expect this action " + << "ID" << std::endl; + return; + } + switch (powerState) { case PowerState::BOOTING: { - powerState = PowerState::ON; - break; + powerState = PowerState::ON; + break; } case PowerState::SHUTDOWN: { - powerState = PowerState::OFF; - break; + powerState = PowerState::OFF; + break; } default: { break; } - } + } } void PlocMPSoCHandler::completionFailedReceived(ActionId_t actionId, ReturnValue_t returnCode) { - handleActionCommandFailure(actionId); + handleActionCommandFailure(actionId); } void PlocMPSoCHandler::handleDeviceTM(const uint8_t* data, size_t dataSize, @@ -862,27 +855,27 @@ void PlocMPSoCHandler::handleActionCommandFailure(ActionId_t actionId) { switch (actionId) { case supv::ACK_REPORT: case supv::EXE_REPORT: - break; + break; default: - sif::debug << "PlocMPSoCHandler::handleActionCommandFailure: Did not expect this action ID " - << std::endl; - return; + sif::debug << "PlocMPSoCHandler::handleActionCommandFailure: Did not expect this action ID " + << std::endl; + return; } - switch(powerState) { - case PowerState::BOOTING: { - sif::warning << "PlocMPSoCHandler::handleActionCommandFailure: Failed to boot MPSoC" - << std::endl; - powerState = PowerState::OFF; - break; - } - case PowerState::SHUTDOWN: { - sif::warning << "PlocMPSoCHandler::handleActionCommandFailure: Failed to shutdown MPSoC" - << std::endl; - powerState = PowerState::ON; - break; - } - default: - break; + switch (powerState) { + case PowerState::BOOTING: { + sif::warning << "PlocMPSoCHandler::handleActionCommandFailure: Failed to boot MPSoC" + << std::endl; + powerState = PowerState::OFF; + break; + } + case PowerState::SHUTDOWN: { + sif::warning << "PlocMPSoCHandler::handleActionCommandFailure: Failed to shutdown MPSoC" + << std::endl; + powerState = PowerState::ON; + break; + } + default: + break; } return; } diff --git a/linux/devices/ploc/PlocSupervisorHandler.cpp b/linux/devices/ploc/PlocSupervisorHandler.cpp index 078475c9..5065c7dd 100644 --- a/linux/devices/ploc/PlocSupervisorHandler.cpp +++ b/linux/devices/ploc/PlocSupervisorHandler.cpp @@ -384,7 +384,7 @@ ReturnValue_t PlocSupervisorHandler::scanForReply(const uint8_t* start, size_t r ReturnValue_t PlocSupervisorHandler::getSwitches(const uint8_t** switches, uint8_t* numberOfSwitches) { if (powerSwitch == power::NO_SWITCH) { - return DeviceHandlerBase::NO_SWITCH; + return DeviceHandlerBase::NO_SWITCH; } *numberOfSwitches = 1; *switches = &powerSwitch; @@ -489,8 +489,8 @@ ReturnValue_t PlocSupervisorHandler::enableReplyInReplyMap(DeviceCommandMap::ite switch (command->first) { case supv::GET_HK_REPORT: { enabledReplies = 3; - result = DeviceHandlerBase::enableReplyInReplyMap(command, enabledReplies, true, - supv::HK_REPORT); + result = + DeviceHandlerBase::enableReplyInReplyMap(command, enabledReplies, true, supv::HK_REPORT); if (result != RETURN_OK) { sif::debug << "PlocSupervisorHandler::enableReplyInReplyMap: Reply with id " << supv::HK_REPORT << " not in replyMap" << std::endl; @@ -589,15 +589,15 @@ ReturnValue_t PlocSupervisorHandler::enableReplyInReplyMap(DeviceCommandMap::ite result = DeviceHandlerBase::enableReplyInReplyMap(command, enabledReplies, true, supv::ACK_REPORT); if (result != RETURN_OK) { - sif::debug << "PlocSupervisorHandler::enableReplyInReplyMap: Reply with id " - << supv::ACK_REPORT << " not in replyMap" << std::endl; + sif::debug << "PlocSupervisorHandler::enableReplyInReplyMap: Reply with id " << supv::ACK_REPORT + << " not in replyMap" << std::endl; } result = DeviceHandlerBase::enableReplyInReplyMap(command, enabledReplies, true, supv::EXE_REPORT); if (result != RETURN_OK) { - sif::debug << "PlocSupervisorHandler::enableReplyInReplyMap: Reply with id " - << supv::EXE_REPORT << " not in replyMap" << std::endl; + sif::debug << "PlocSupervisorHandler::enableReplyInReplyMap: Reply with id " << supv::EXE_REPORT + << " not in replyMap" << std::endl; } return RETURN_OK; @@ -1013,7 +1013,7 @@ void PlocSupervisorHandler::prepareEmptyCmd(uint16_t apid) { void PlocSupervisorHandler::prepareSelBootImageCmd(const uint8_t* commandData) { supv::MPSoCBootSelect packet(*commandData, *(commandData + 1), *(commandData + 2), - *(commandData + 3)); + *(commandData + 3)); packetToOutBuffer(packet.getWholeData(), packet.getFullSize()); } @@ -1459,9 +1459,8 @@ ReturnValue_t PlocSupervisorHandler::handleMramDumpFile(DeviceCommandId_t id) { return MRAM_FILE_NOT_EXISTS; } std::ofstream file(activeMramFile, std::ios_base::app | std::ios_base::out); - file.write( - reinterpret_cast(spacePacketBuffer + supv::SPACE_PACKET_HEADER_LENGTH), - packetLen - 1); + file.write(reinterpret_cast(spacePacketBuffer + supv::SPACE_PACKET_HEADER_LENGTH), + packetLen - 1); file.close(); return RETURN_OK; } diff --git a/linux/devices/ploc/PlocUpdater.cpp b/linux/devices/ploc/PlocUpdater.cpp index 220b1e00..37a553da 100644 --- a/linux/devices/ploc/PlocUpdater.cpp +++ b/linux/devices/ploc/PlocUpdater.cpp @@ -262,12 +262,11 @@ void PlocUpdater::commandUpdateAvailable() { calcImageCrc(); supv::UpdateInfo packet(supv::APID_UPDATE_AVAILABLE, static_cast(image), - static_cast(partition), imageSize, imageCrc, - numOfUpdatePackets); + static_cast(partition), imageSize, imageCrc, numOfUpdatePackets); - result = commandActionHelper.commandAction(objects::PLOC_SUPERVISOR_HANDLER, - supv::UPDATE_AVAILABLE, packet.getWholeData(), - packet.getFullSize()); + result = + commandActionHelper.commandAction(objects::PLOC_SUPERVISOR_HANDLER, supv::UPDATE_AVAILABLE, + packet.getWholeData(), packet.getFullSize()); if (result != RETURN_OK) { sif::warning << "PlocUpdater::commandUpdateAvailable: Failed to send update available" << " packet to supervisor handler" << std::endl; @@ -311,9 +310,9 @@ void PlocUpdater::commandUpdatePacket() { } packet.makeCrc(); - result = commandActionHelper.commandAction(objects::PLOC_SUPERVISOR_HANDLER, - supv::UPDATE_IMAGE_DATA, packet.getWholeData(), - packet.getFullSize()); + result = + commandActionHelper.commandAction(objects::PLOC_SUPERVISOR_HANDLER, supv::UPDATE_IMAGE_DATA, + packet.getWholeData(), packet.getFullSize()); if (result != RETURN_OK) { sif::warning << "PlocUpdater::commandUpdateAvailable: Failed to send update" @@ -335,12 +334,10 @@ void PlocUpdater::commandUpdateVerify() { ReturnValue_t result = RETURN_OK; supv::UpdateInfo packet(supv::APID_UPDATE_VERIFY, static_cast(image), - static_cast(partition), imageSize, imageCrc, - numOfUpdatePackets); + static_cast(partition), imageSize, imageCrc, numOfUpdatePackets); - result = - commandActionHelper.commandAction(objects::PLOC_SUPERVISOR_HANDLER, supv::UPDATE_VERIFY, - packet.getWholeData(), packet.getFullSize()); + result = commandActionHelper.commandAction(objects::PLOC_SUPERVISOR_HANDLER, supv::UPDATE_VERIFY, + packet.getWholeData(), packet.getFullSize()); if (result != RETURN_OK) { sif::warning << "PlocUpdater::commandUpdateAvailable: Failed to send update available" << " packet to supervisor handler" << std::endl; diff --git a/linux/devices/startracker/StarTrackerHandler.h b/linux/devices/startracker/StarTrackerHandler.h index 2667db31..90a30966 100644 --- a/linux/devices/startracker/StarTrackerHandler.h +++ b/linux/devices/startracker/StarTrackerHandler.h @@ -7,12 +7,12 @@ #include "ArcsecJsonParamBase.h" #include "OBSWConfig.h" #include "StrHelper.h" +#include "devices/powerSwitcherList.h" #include "fsfw/devicehandlers/DeviceHandlerBase.h" #include "fsfw/src/fsfw/serialize/SerializeAdapter.h" #include "fsfw/timemanager/Countdown.h" #include "linux/devices/devicedefinitions/StarTrackerDefinitions.h" #include "thirdparty/arcsec_star_tracker/common/SLIP.h" -#include "devices/powerSwitcherList.h" /** * @brief This is the device handler for the star tracker from arcsec. diff --git a/mission/devices/ACUHandler.cpp b/mission/devices/ACUHandler.cpp index b7a54088..7c6e048c 100644 --- a/mission/devices/ACUHandler.cpp +++ b/mission/devices/ACUHandler.cpp @@ -194,81 +194,82 @@ void ACUHandler::parseHkTableReply(const uint8_t *packet) { ReturnValue_t ACUHandler::initializeLocalDataPool(localpool::DataPool &localDataPoolMap, LocalDataPoolManager &poolManager) { - localDataPoolMap.emplace(P60System::ACU_CURRENT_IN_CHANNEL0, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::ACU_CURRENT_IN_CHANNEL1, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::ACU_CURRENT_IN_CHANNEL2, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::ACU_CURRENT_IN_CHANNEL3, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::ACU_CURRENT_IN_CHANNEL4, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::ACU_CURRENT_IN_CHANNEL5, new PoolEntry({0})); + using namespace P60System; + localDataPoolMap.emplace(pool::ACU_CURRENT_IN_CHANNEL0, new PoolEntry({0})); + localDataPoolMap.emplace(pool::ACU_CURRENT_IN_CHANNEL1, new PoolEntry({0})); + localDataPoolMap.emplace(pool::ACU_CURRENT_IN_CHANNEL2, new PoolEntry({0})); + localDataPoolMap.emplace(pool::ACU_CURRENT_IN_CHANNEL3, new PoolEntry({0})); + localDataPoolMap.emplace(pool::ACU_CURRENT_IN_CHANNEL4, new PoolEntry({0})); + localDataPoolMap.emplace(pool::ACU_CURRENT_IN_CHANNEL5, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::ACU_VOLTAGE_IN_CHANNEL0, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::ACU_VOLTAGE_IN_CHANNEL1, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::ACU_VOLTAGE_IN_CHANNEL2, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::ACU_VOLTAGE_IN_CHANNEL3, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::ACU_VOLTAGE_IN_CHANNEL4, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::ACU_VOLTAGE_IN_CHANNEL5, new PoolEntry({0})); + localDataPoolMap.emplace(pool::ACU_VOLTAGE_IN_CHANNEL0, new PoolEntry({0})); + localDataPoolMap.emplace(pool::ACU_VOLTAGE_IN_CHANNEL1, new PoolEntry({0})); + localDataPoolMap.emplace(pool::ACU_VOLTAGE_IN_CHANNEL2, new PoolEntry({0})); + localDataPoolMap.emplace(pool::ACU_VOLTAGE_IN_CHANNEL3, new PoolEntry({0})); + localDataPoolMap.emplace(pool::ACU_VOLTAGE_IN_CHANNEL4, new PoolEntry({0})); + localDataPoolMap.emplace(pool::ACU_VOLTAGE_IN_CHANNEL5, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::ACU_VCC, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::ACU_VBAT, new PoolEntry({0})); + localDataPoolMap.emplace(pool::ACU_VCC, new PoolEntry({0})); + localDataPoolMap.emplace(pool::ACU_VBAT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::ACU_TEMPERATURE_1, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::ACU_TEMPERATURE_2, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::ACU_TEMPERATURE_3, new PoolEntry({0})); + localDataPoolMap.emplace(pool::ACU_TEMPERATURE_1, new PoolEntry({0})); + localDataPoolMap.emplace(pool::ACU_TEMPERATURE_2, new PoolEntry({0})); + localDataPoolMap.emplace(pool::ACU_TEMPERATURE_3, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::ACU_MPPT_MODE, new PoolEntry({0})); + localDataPoolMap.emplace(pool::ACU_MPPT_MODE, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::ACU_VBOOST_CHANNEL0, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::ACU_VBOOST_CHANNEL1, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::ACU_VBOOST_CHANNEL2, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::ACU_VBOOST_CHANNEL3, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::ACU_VBOOST_CHANNEL4, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::ACU_VBOOST_CHANNEL5, new PoolEntry({0})); + localDataPoolMap.emplace(pool::ACU_VBOOST_CHANNEL0, new PoolEntry({0})); + localDataPoolMap.emplace(pool::ACU_VBOOST_CHANNEL1, new PoolEntry({0})); + localDataPoolMap.emplace(pool::ACU_VBOOST_CHANNEL2, new PoolEntry({0})); + localDataPoolMap.emplace(pool::ACU_VBOOST_CHANNEL3, new PoolEntry({0})); + localDataPoolMap.emplace(pool::ACU_VBOOST_CHANNEL4, new PoolEntry({0})); + localDataPoolMap.emplace(pool::ACU_VBOOST_CHANNEL5, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::ACU_POWER_CHANNEL0, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::ACU_POWER_CHANNEL1, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::ACU_POWER_CHANNEL2, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::ACU_POWER_CHANNEL3, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::ACU_POWER_CHANNEL4, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::ACU_POWER_CHANNEL5, new PoolEntry({0})); + localDataPoolMap.emplace(pool::ACU_POWER_CHANNEL0, new PoolEntry({0})); + localDataPoolMap.emplace(pool::ACU_POWER_CHANNEL1, new PoolEntry({0})); + localDataPoolMap.emplace(pool::ACU_POWER_CHANNEL2, new PoolEntry({0})); + localDataPoolMap.emplace(pool::ACU_POWER_CHANNEL3, new PoolEntry({0})); + localDataPoolMap.emplace(pool::ACU_POWER_CHANNEL4, new PoolEntry({0})); + localDataPoolMap.emplace(pool::ACU_POWER_CHANNEL5, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::ACU_DAC_EN_0, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::ACU_DAC_EN_1, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::ACU_DAC_EN_2, new PoolEntry({0})); + localDataPoolMap.emplace(pool::ACU_DAC_EN_0, new PoolEntry({0})); + localDataPoolMap.emplace(pool::ACU_DAC_EN_1, new PoolEntry({0})); + localDataPoolMap.emplace(pool::ACU_DAC_EN_2, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::ACU_DAC_RAW_0, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::ACU_DAC_RAW_1, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::ACU_DAC_RAW_2, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::ACU_DAC_RAW_3, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::ACU_DAC_RAW_4, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::ACU_DAC_RAW_5, new PoolEntry({0})); + localDataPoolMap.emplace(pool::ACU_DAC_RAW_0, new PoolEntry({0})); + localDataPoolMap.emplace(pool::ACU_DAC_RAW_1, new PoolEntry({0})); + localDataPoolMap.emplace(pool::ACU_DAC_RAW_2, new PoolEntry({0})); + localDataPoolMap.emplace(pool::ACU_DAC_RAW_3, new PoolEntry({0})); + localDataPoolMap.emplace(pool::ACU_DAC_RAW_4, new PoolEntry({0})); + localDataPoolMap.emplace(pool::ACU_DAC_RAW_5, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::ACU_BOOTCAUSE, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::ACU_BOOTCNT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::ACU_UPTIME, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::ACU_RESET_CAUSE, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::ACU_MPPT_TIME, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::ACU_MPPT_PERIOD, new PoolEntry({0})); + localDataPoolMap.emplace(pool::ACU_BOOTCAUSE, new PoolEntry({0})); + localDataPoolMap.emplace(pool::ACU_BOOTCNT, new PoolEntry({0})); + localDataPoolMap.emplace(pool::ACU_UPTIME, new PoolEntry({0})); + localDataPoolMap.emplace(pool::ACU_RESET_CAUSE, new PoolEntry({0})); + localDataPoolMap.emplace(pool::ACU_MPPT_TIME, new PoolEntry({0})); + localDataPoolMap.emplace(pool::ACU_MPPT_PERIOD, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::ACU_DEVICE_0, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::ACU_DEVICE_1, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::ACU_DEVICE_2, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::ACU_DEVICE_3, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::ACU_DEVICE_4, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::ACU_DEVICE_5, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::ACU_DEVICE_6, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::ACU_DEVICE_7, new PoolEntry({0})); + localDataPoolMap.emplace(pool::ACU_DEVICE_0, new PoolEntry({0})); + localDataPoolMap.emplace(pool::ACU_DEVICE_1, new PoolEntry({0})); + localDataPoolMap.emplace(pool::ACU_DEVICE_2, new PoolEntry({0})); + localDataPoolMap.emplace(pool::ACU_DEVICE_3, new PoolEntry({0})); + localDataPoolMap.emplace(pool::ACU_DEVICE_4, new PoolEntry({0})); + localDataPoolMap.emplace(pool::ACU_DEVICE_5, new PoolEntry({0})); + localDataPoolMap.emplace(pool::ACU_DEVICE_6, new PoolEntry({0})); + localDataPoolMap.emplace(pool::ACU_DEVICE_7, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::ACU_DEVICE_0_STATUS, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::ACU_DEVICE_1_STATUS, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::ACU_DEVICE_2_STATUS, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::ACU_DEVICE_3_STATUS, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::ACU_DEVICE_4_STATUS, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::ACU_DEVICE_5_STATUS, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::ACU_DEVICE_6_STATUS, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::ACU_DEVICE_7_STATUS, new PoolEntry({0})); + localDataPoolMap.emplace(pool::ACU_DEVICE_0_STATUS, new PoolEntry({0})); + localDataPoolMap.emplace(pool::ACU_DEVICE_1_STATUS, new PoolEntry({0})); + localDataPoolMap.emplace(pool::ACU_DEVICE_2_STATUS, new PoolEntry({0})); + localDataPoolMap.emplace(pool::ACU_DEVICE_3_STATUS, new PoolEntry({0})); + localDataPoolMap.emplace(pool::ACU_DEVICE_4_STATUS, new PoolEntry({0})); + localDataPoolMap.emplace(pool::ACU_DEVICE_5_STATUS, new PoolEntry({0})); + localDataPoolMap.emplace(pool::ACU_DEVICE_6_STATUS, new PoolEntry({0})); + localDataPoolMap.emplace(pool::ACU_DEVICE_7_STATUS, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::ACU_WDT_CNT_GND, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::ACU_WDT_GND_LEFT, new PoolEntry({0})); + localDataPoolMap.emplace(pool::ACU_WDT_CNT_GND, new PoolEntry({0})); + localDataPoolMap.emplace(pool::ACU_WDT_GND_LEFT, new PoolEntry({0})); return HasReturnvaluesIF::RETURN_OK; } diff --git a/mission/devices/P60DockHandler.cpp b/mission/devices/P60DockHandler.cpp index b506a92b..5ad4ffee 100644 --- a/mission/devices/P60DockHandler.cpp +++ b/mission/devices/P60DockHandler.cpp @@ -71,95 +71,29 @@ void P60DockHandler::letChildHandleHkReply(DeviceCommandId_t id, const uint8_t * } void P60DockHandler::parseHkTableReply(const uint8_t *packet) { + using namespace P60Dock; uint16_t dataOffset = 0; - p60dockHkTableDataset.read(); + PoolReadGuard pg(&p60dockHkTableDataset); + if (pg.getReadResult() != HasReturnvaluesIF::RETURN_OK) { + return; + } /** * Fist 10 bytes contain the gomspace header. Each variable is preceded by the 16-bit table * address. */ dataOffset += 12; - p60dockHkTableDataset.currentAcuVcc = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - p60dockHkTableDataset.currentPdu1Vcc = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - p60dockHkTableDataset.currentX3IdleVcc = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - p60dockHkTableDataset.currentPdu2Vcc = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - p60dockHkTableDataset.currentAcuVbat = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - p60dockHkTableDataset.currentPdu1Vbat = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - p60dockHkTableDataset.currentX3IdleVbat = - *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - p60dockHkTableDataset.currentPdu2Vbat = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - p60dockHkTableDataset.currentStackVbat = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - p60dockHkTableDataset.currentStack3V3 = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - p60dockHkTableDataset.currentStack5V = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - p60dockHkTableDataset.currentGS3V3 = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - p60dockHkTableDataset.currentGS5V = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - - p60dockHkTableDataset.voltageAcuVcc = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - p60dockHkTableDataset.voltageAcuVcc = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - p60dockHkTableDataset.voltagePdu1Vcc = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - p60dockHkTableDataset.voltageX3IdleVcc = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - p60dockHkTableDataset.voltagePdu2Vcc = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - p60dockHkTableDataset.voltageAcuVbat = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - p60dockHkTableDataset.voltagePdu1Vbat = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - p60dockHkTableDataset.voltageX3IdleVbat = - *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - p60dockHkTableDataset.voltagePdu2Vbat = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - p60dockHkTableDataset.voltageStackVbat = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - p60dockHkTableDataset.voltageStack3V3 = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - p60dockHkTableDataset.voltageStack5V = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - p60dockHkTableDataset.voltageGS3V3 = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - - p60dockHkTableDataset.outputEnableStateAcuVcc = *(packet + dataOffset); - dataOffset += 3; - p60dockHkTableDataset.outputEnableStatePdu1Vcc = *(packet + dataOffset); - dataOffset += 3; - p60dockHkTableDataset.outputEnableStateX3IdleVcc = *(packet + dataOffset); - dataOffset += 3; - p60dockHkTableDataset.outputEnableStatePdu2Vcc = *(packet + dataOffset); - dataOffset += 3; - p60dockHkTableDataset.outputEnableStateAcuVbat = *(packet + dataOffset); - dataOffset += 3; - p60dockHkTableDataset.outputEnableStatePdu1Vbat = *(packet + dataOffset); - dataOffset += 3; - p60dockHkTableDataset.outputEnableStateX3IdleVbat = *(packet + dataOffset); - dataOffset += 3; - p60dockHkTableDataset.outputEnableStatePdu2Vbat = *(packet + dataOffset); - dataOffset += 3; - p60dockHkTableDataset.outputEnableStateStackVbat = *(packet + dataOffset); - dataOffset += 3; - p60dockHkTableDataset.outputEnableStateStack3V3 = *(packet + dataOffset); - dataOffset += 3; - p60dockHkTableDataset.outputEnableStateStack5V = *(packet + dataOffset); - dataOffset += 3; - p60dockHkTableDataset.outputEnableStateGS3V3 = *(packet + dataOffset); - dataOffset += 3; - p60dockHkTableDataset.outputEnableStateGS5V = *(packet + dataOffset); - dataOffset += 3; + for (uint8_t idx = 0; idx < hk::CHNLS_LEN; idx++) { + p60dockHkTableDataset.currents[idx] = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); + dataOffset += 4; + } + for (uint8_t idx = 0; idx < hk::CHNLS_LEN; idx++) { + p60dockHkTableDataset.voltages[idx] = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); + dataOffset += 4; + } + for (uint8_t idx = 0; idx < hk::CHNLS_LEN; idx++) { + p60dockHkTableDataset.outputEnables[idx] = *(packet + dataOffset); + dataOffset += 3; + } p60dockHkTableDataset.temperature1 = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); dataOffset += 4; @@ -187,35 +121,10 @@ void P60DockHandler::parseHkTableReply(const uint8_t *packet) { p60dockHkTableDataset.converter5VStatus = *(packet + dataOffset); dataOffset += 3; - p60dockHkTableDataset.latchupsAcuVcc = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - p60dockHkTableDataset.latchupsAcuVcc = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - p60dockHkTableDataset.latchupsPdu1Vcc = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - p60dockHkTableDataset.latchupsX3IdleVcc = - *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - p60dockHkTableDataset.latchupsPdu2Vcc = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - p60dockHkTableDataset.latchupsAcuVbat = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - p60dockHkTableDataset.latchupsPdu1Vbat = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - p60dockHkTableDataset.latchupsX3IdleVbat = - *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - p60dockHkTableDataset.latchupsPdu2Vbat = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - p60dockHkTableDataset.latchupsStackVbat = - *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - p60dockHkTableDataset.latchupsStack3V3 = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - p60dockHkTableDataset.latchupsStack5V = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - p60dockHkTableDataset.latchupsGS3V3 = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; + for (uint8_t idx = 0; idx < hk::CHNLS_LEN; idx++) { + p60dockHkTableDataset.latchups[idx] = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); + dataOffset += 4; + } p60dockHkTableDataset.dockVbatVoltageValue = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); @@ -234,39 +143,14 @@ void P60DockHandler::parseHkTableReply(const uint8_t *packet) { *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); dataOffset += 4; - p60dockHkTableDataset.device0 = *(packet + dataOffset); - dataOffset += 3; - p60dockHkTableDataset.device1 = *(packet + dataOffset); - dataOffset += 3; - p60dockHkTableDataset.device2 = *(packet + dataOffset); - dataOffset += 3; - p60dockHkTableDataset.device3 = *(packet + dataOffset); - dataOffset += 3; - p60dockHkTableDataset.device4 = *(packet + dataOffset); - dataOffset += 3; - p60dockHkTableDataset.device5 = *(packet + dataOffset); - dataOffset += 3; - p60dockHkTableDataset.device6 = *(packet + dataOffset); - dataOffset += 3; - p60dockHkTableDataset.device7 = *(packet + dataOffset); - dataOffset += 3; - - p60dockHkTableDataset.device0Status = *(packet + dataOffset); - dataOffset += 3; - p60dockHkTableDataset.device1Status = *(packet + dataOffset); - dataOffset += 3; - p60dockHkTableDataset.device2Status = *(packet + dataOffset); - dataOffset += 3; - p60dockHkTableDataset.device3Status = *(packet + dataOffset); - dataOffset += 3; - p60dockHkTableDataset.device4Status = *(packet + dataOffset); - dataOffset += 3; - p60dockHkTableDataset.device5Status = *(packet + dataOffset); - dataOffset += 3; - p60dockHkTableDataset.device6Status = *(packet + dataOffset); - dataOffset += 3; - p60dockHkTableDataset.device7Status = *(packet + dataOffset); - dataOffset += 3; + for (uint8_t idx = 0; idx < NUM_DEVS; idx++) { + p60dockHkTableDataset.devicesType[idx] = *(packet + dataOffset); + dataOffset += 3; + } + for (uint8_t idx = 0; idx < NUM_DEVS; idx++) { + p60dockHkTableDataset.devicesStatus[idx] = *(packet + dataOffset); + dataOffset += 3; + } p60dockHkTableDataset.dearmStatus = *(packet + dataOffset); dataOffset += 3; @@ -320,126 +204,60 @@ void P60DockHandler::parseHkTableReply(const uint8_t *packet) { p60dockHkTableDataset.ant6Depl = *(packet + dataOffset); dataOffset += 3; p60dockHkTableDataset.ar6Depl = *(packet + dataOffset); - - p60dockHkTableDataset.commit(); } ReturnValue_t P60DockHandler::initializeLocalDataPool(localpool::DataPool &localDataPoolMap, LocalDataPoolManager &poolManager) { - localDataPoolMap.emplace(P60System::P60DOCK_CURRENT_ACU_VCC, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_CURRENT_PDU1_VCC, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_CURRENT_X3_IDLE_VCC, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_CURRENT_PDU2_VCC, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_CURRENT_ACU_VBAT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_CURRENT_PDU1_VBAT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_CURRENT_X3_IDLE_VBAT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_CURRENT_PDU2_VBAT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_CURRENT_STACK_VBAT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_CURRENT_STACK_3V3, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_CURRENT_STACK_5V, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_CURRENT_GS3V3, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_CURRENT_GS5V, new PoolEntry({0})); + using namespace P60System; + localDataPoolMap.emplace(pool::CURRENTS, &hkCurrents); - localDataPoolMap.emplace(P60System::P60DOCK_VOLTAGE_ACU_VCC, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_VOLTAGE_PDU1_VCC, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_VOLTAGE_X3_IDLE_VCC, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_VOLTAGE_PDU2_VCC, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_VOLTAGE_ACU_VBAT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_VOLTAGE_PDU1_VBAT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_VOLTAGE_X3_IDLE_VBAT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_VOLTAGE_PDU2_VBAT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_VOLTAGE_STACK_VBAT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_VOLTAGE_STACK_3V3, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_VOLTAGE_STACK_5V, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_VOLTAGE_GS3V3, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_VOLTAGE_GS5V, new PoolEntry({0})); + localDataPoolMap.emplace(pool::VOLTAGES, &hkVoltages); - localDataPoolMap.emplace(P60System::P60DOCK_OUTPUTENABLE_ACU_VCC, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_OUTPUTENABLE_PDU1_VCC, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_OUTPUTENABLE_X3_IDLE_VCC, - new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_OUTPUTENABLE_PDU2_VCC, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_OUTPUTENABLE_ACU_VBAT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_OUTPUTENABLE_PDU1_VBAT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_OUTPUTENABLE_X3_IDLE_VBAT, - new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_OUTPUTENABLE_PDU2_VBAT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_OUTPUTENABLE_STACK_VBAT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_OUTPUTENABLE_STACK_3V3, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_OUTPUTENABLE_STACK_5V, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_OUTPUTENABLE_GS3V3, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_OUTPUTENABLE_GS5V, new PoolEntry({0})); + localDataPoolMap.emplace(pool::OUTPUT_ENABLE, &outputEnables); - localDataPoolMap.emplace(P60System::P60DOCK_TEMPERATURE_1, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_TEMPERATURE_2, new PoolEntry({0})); + localDataPoolMap.emplace(pool::P60DOCK_TEMPERATURE_1, new PoolEntry({0})); + localDataPoolMap.emplace(pool::P60DOCK_TEMPERATURE_2, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_BOOT_CAUSE, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_BOOT_CNT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_UPTIME, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_RESETCAUSE, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_BATT_MODE, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_HEATER_ON, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_CONV_5V_ENABLE_STATUS, new PoolEntry({0})); + localDataPoolMap.emplace(pool::P60DOCK_BOOT_CAUSE, new PoolEntry({0})); + localDataPoolMap.emplace(pool::P60DOCK_BOOT_CNT, new PoolEntry({0})); + localDataPoolMap.emplace(pool::P60DOCK_UPTIME, new PoolEntry({0})); + localDataPoolMap.emplace(pool::P60DOCK_RESETCAUSE, new PoolEntry({0})); + localDataPoolMap.emplace(pool::P60DOCK_BATT_MODE, new PoolEntry({0})); + localDataPoolMap.emplace(pool::P60DOCK_HEATER_ON, new PoolEntry({0})); + localDataPoolMap.emplace(pool::P60DOCK_CONV_5V_ENABLE_STATUS, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_LATCHUP_ACU_VCC, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_LATCHUP_PDU1_VCC, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_LATCHUP_X3_IDLE_VCC, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_LATCHUP_PDU2_VCC, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_LATCHUP_ACU_VBAT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_LATCHUP_PDU1_VBAT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_LATCHUP_X3_IDLE_VBAT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_LATCHUP_PDU2_VBAT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_LATCHUP_STACK_VBAT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_LATCHUP_STACK_3V3, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_LATCHUP_STACK_5V, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_LATCHUP_GS3V3, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_LATCHUP_GS5V, new PoolEntry({0})); + localDataPoolMap.emplace(pool::LATCHUPS, &latchups); - localDataPoolMap.emplace(P60System::P60DOCK_VBAT_VALUE, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_VCC_CURRENT_VALUE, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_BATTERY_CURRENT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_BATTERY_VOLTAGE, new PoolEntry({0})); + localDataPoolMap.emplace(pool::P60DOCK_DOCK_VBAT, new PoolEntry({0})); + localDataPoolMap.emplace(pool::P60DOCK_DOCK_VCC_CURRENT, new PoolEntry({0})); + localDataPoolMap.emplace(pool::P60DOCK_BATTERY_CURRENT, new PoolEntry({0})); + localDataPoolMap.emplace(pool::P60DOCK_BATTERY_VOLTAGE, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_BATTERY_TEMPERATURE_1, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_BATTERY_TEMPERATURE_2, new PoolEntry({0})); + localDataPoolMap.emplace(pool::P60DOCK_BATTERY_TEMPERATURE_1, new PoolEntry({0})); + localDataPoolMap.emplace(pool::P60DOCK_BATTERY_TEMPERATURE_2, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_DEVICE_0, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_DEVICE_1, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_DEVICE_2, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_DEVICE_3, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_DEVICE_4, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_DEVICE_5, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_DEVICE_6, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_DEVICE_7, new PoolEntry({0})); + localDataPoolMap.emplace(pool::DEVICES_TYPE, &devicesType); + localDataPoolMap.emplace(pool::DEVICES_STATUS, &devicesStatus); - localDataPoolMap.emplace(P60System::P60DOCK_DEVICE_0_STATUS, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_DEVICE_1_STATUS, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_DEVICE_2_STATUS, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_DEVICE_3_STATUS, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_DEVICE_4_STATUS, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_DEVICE_5_STATUS, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_DEVICE_6_STATUS, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_DEVICE_7_STATUS, new PoolEntry({0})); + localDataPoolMap.emplace(pool::P60DOCK_DEARM_STATUS, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_DEARM_STATUS, new PoolEntry({0})); + localDataPoolMap.emplace(pool::P60DOCK_WDT_CNT_GND, new PoolEntry({0})); + localDataPoolMap.emplace(pool::P60DOCK_WDT_CNT_I2C, new PoolEntry({0})); + localDataPoolMap.emplace(pool::P60DOCK_WDT_CNT_CAN, new PoolEntry({0})); + localDataPoolMap.emplace(pool::P60DOCK_WDT_CNT_CSP_1, new PoolEntry({0})); + localDataPoolMap.emplace(pool::P60DOCK_WDT_CNT_CSP_2, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_WDT_CNT_GND, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_WDT_CNT_I2C, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_WDT_CNT_CAN, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_WDT_CNT_CSP_1, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_WDT_CNT_CSP_2, new PoolEntry({0})); + localDataPoolMap.emplace(pool::P60DOCK_WDT_GND_LEFT, new PoolEntry({0})); + localDataPoolMap.emplace(pool::P60DOCK_WDT_I2C_LEFT, new PoolEntry({0})); + localDataPoolMap.emplace(pool::P60DOCK_WDT_CAN_LEFT, new PoolEntry({0})); + localDataPoolMap.emplace(pool::P60DOCK_WDT_CSP_LEFT_1, new PoolEntry({0})); + localDataPoolMap.emplace(pool::P60DOCK_WDT_CSP_LEFT_2, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_WDT_GND_LEFT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_WDT_I2C_LEFT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_WDT_CAN_LEFT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_WDT_CSP_LEFT_1, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_WDT_CSP_LEFT_2, new PoolEntry({0})); + localDataPoolMap.emplace(pool::P60DOCK_BATT_CHARGE_CURRENT, new PoolEntry({0})); + localDataPoolMap.emplace(pool::P60DOCK_BATT_DISCHARGE_CURRENT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_BATT_CHARGE_CURRENT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_BATT_DISCHARGE_CURRENT, new PoolEntry({0})); - - localDataPoolMap.emplace(P60System::P60DOCK_ANT6_DEPL, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_AR6_DEPL, new PoolEntry({0})); + localDataPoolMap.emplace(pool::P60DOCK_ANT6_DEPL, new PoolEntry({0})); + localDataPoolMap.emplace(pool::P60DOCK_AR6_DEPL, new PoolEntry({0})); return HasReturnvaluesIF::RETURN_OK; } @@ -474,6 +292,7 @@ ReturnValue_t P60DockHandler::printStatus(DeviceCommandId_t cmd) { } void P60DockHandler::printHkTableSwitchIV() { + using namespace P60Dock; sif::info << "P60 Dock Info:" << std::endl; sif::info << "Boot Cause: " << p60dockHkTableDataset.bootcause << " | Boot Count: " << std::setw(4) << std::right << p60dockHkTableDataset.bootCount @@ -488,70 +307,43 @@ void P60DockHandler::printHkTableSwitchIV() { sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "BATT" << std::dec << "| -, " << std::setw(4) << std::right << p60dockHkTableDataset.batteryCurrent.value << ", " << std::setw(5) << p60dockHkTableDataset.batteryVoltage.value << std::endl; - sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "ACU VCC" << std::dec << "| " - << unsigned(p60dockHkTableDataset.outputEnableStateAcuVcc.value) << ", " << std::setw(4) - << std::right << p60dockHkTableDataset.currentAcuVcc.value << ", " << std::setw(5) - << p60dockHkTableDataset.voltageAcuVcc.value << std::endl; - sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "ACU VBAT" << std::dec << "| " - << unsigned(p60dockHkTableDataset.outputEnableStateAcuVbat.value) << ", " - << std::setw(4) << std::right << p60dockHkTableDataset.currentAcuVbat.value << ", " - << std::setw(5) << p60dockHkTableDataset.voltageAcuVbat.value << std::endl; - sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "PDU1 VCC" << std::dec << "| " - << unsigned(p60dockHkTableDataset.outputEnableStatePdu1Vcc.value) << ", " - << std::setw(4) << std::right << p60dockHkTableDataset.currentPdu1Vcc.value << ", " - << std::setw(5) << p60dockHkTableDataset.voltagePdu1Vcc.value << std::endl; - sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "PDU1 VBAT" << std::dec << "| " - << unsigned(p60dockHkTableDataset.outputEnableStatePdu1Vbat.value) << ", " - << std::setw(4) << std::right << p60dockHkTableDataset.currentPdu1Vbat.value << ", " - << std::setw(5) << p60dockHkTableDataset.voltagePdu1Vbat.value << std::endl; + auto genericPrintoutHandler = [&](std::string name, uint8_t idx) { + sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << name << std::dec << "| " + << unsigned(p60dockHkTableDataset.outputEnables[idx]) << ", " << std::setw(4) + << std::right << p60dockHkTableDataset.currents[idx] << ", " << std::setw(5) + << p60dockHkTableDataset.voltages[idx] << std::endl; + }; - sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "PDU2 VCC" << std::dec << "| " - << unsigned(p60dockHkTableDataset.outputEnableStatePdu2Vcc.value) << ", " - << std::setw(4) << std::right << p60dockHkTableDataset.currentPdu2Vcc.value << ", " - << std::setw(5) << p60dockHkTableDataset.voltagePdu2Vcc.value << std::endl; - sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "PDU2 VBAT" << std::dec << "| " - << unsigned(p60dockHkTableDataset.outputEnableStatePdu2Vbat.value) << ", " - << std::setw(4) << std::right << p60dockHkTableDataset.currentPdu2Vbat.value << ", " - << std::setw(5) << p60dockHkTableDataset.voltagePdu2Vbat.value << std::endl; - sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "Stack VBAT" << std::dec << "| " - << unsigned(p60dockHkTableDataset.outputEnableStateStackVbat.value) << ", " - << std::setw(4) << std::right << p60dockHkTableDataset.currentStackVbat.value << ", " - << std::setw(5) << p60dockHkTableDataset.voltageStackVbat.value << std::endl; - sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "Stack 3V3" << std::dec << "| " - << unsigned(p60dockHkTableDataset.outputEnableStateStack3V3.value) << ", " - << std::setw(4) << std::right << p60dockHkTableDataset.currentStack3V3.value << ", " - << std::setw(5) << p60dockHkTableDataset.voltageStack3V3.value << std::endl; - sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "Stack 5V" << std::dec << "| " - << unsigned(p60dockHkTableDataset.outputEnableStateStack5V.value) << ", " - << std::setw(4) << std::right << p60dockHkTableDataset.currentStack5V.value << ", " - << std::setw(5) << p60dockHkTableDataset.voltageStack5V.value << std::endl; + genericPrintoutHandler("ACU VCC", hk::ACU_VCC); + genericPrintoutHandler("ACU VBAT", hk::ACU_VBAT); + genericPrintoutHandler("PDU1 VCC", hk::PDU1_VCC); + genericPrintoutHandler("PDU1 VBAT", hk::PDU1_VBAT); + genericPrintoutHandler("PDU2 VCC", hk::PDU2_VCC); + genericPrintoutHandler("PDU2 VBAT", hk::PDU2_VBAT); + genericPrintoutHandler("Stack VBAT", hk::STACK_VBAT); + genericPrintoutHandler("Stack 3V3", hk::STACK_3V3); + genericPrintoutHandler("Stack 5V", hk::STACK_5V); } void P60DockHandler::printHkTableLatchups() { + using namespace P60Dock; sif::info << "P60 Latchup Information" << std::endl; - sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "ACU VCC" << std::dec << "| " - << std::setw(4) << std::right << p60dockHkTableDataset.latchupsAcuVcc << std::endl; - sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "ACU VBAT" << std::dec << "| " - << std::setw(4) << std::right << p60dockHkTableDataset.latchupsAcuVbat << std::endl; - sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "PDU1 VCC" << std::dec << "| " - << std::setw(4) << std::right << p60dockHkTableDataset.latchupsPdu1Vcc << std::endl; - sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "PDU1 VBAT" << std::dec << "| " - << std::setw(4) << std::right << p60dockHkTableDataset.latchupsPdu1Vbat << std::endl; - sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "PDU2 VCC" << std::dec << "| " - << std::setw(4) << std::right << p60dockHkTableDataset.latchupsPdu2Vcc << std::endl; - sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "PDU2 VBAT" << std::dec << "| " - << std::setw(4) << std::right << p60dockHkTableDataset.latchupsPdu2Vbat << std::endl; - sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "Stack 3V3" << std::dec << "| " - << std::setw(4) << std::right << p60dockHkTableDataset.latchupsStack3V3 << std::endl; - sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "Stack 5V" << std::dec << "| " - << std::setw(4) << std::right << p60dockHkTableDataset.latchupsStack5V << std::endl; - sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "GS 3V3" << std::dec << "| " - << std::setw(4) << std::right << p60dockHkTableDataset.latchupsGS3V3 << std::endl; - sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "GS 5V" << std::dec << "| " - << std::setw(4) << std::right << p60dockHkTableDataset.latchupsGS5V << std::endl; - sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "X3 VBAT" << std::dec << "| " - << std::setw(4) << std::right << p60dockHkTableDataset.latchupsX3IdleVbat << std::endl; - sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "X3 VCC" << std::dec << "| " - << std::setw(4) << std::right << p60dockHkTableDataset.latchupsX3IdleVcc << std::endl; + auto genericPrintoutHandler = [&](std::string name, uint8_t idx) { + sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << name << std::dec << "| " + << std::setw(4) << std::right << p60dockHkTableDataset.latchups[idx] << std::endl; + }; + genericPrintoutHandler("ACU VCC", hk::ACU_VCC); + genericPrintoutHandler("ACU VBAT", hk::ACU_VBAT); + genericPrintoutHandler("PDU1 VCC", hk::PDU1_VCC); + genericPrintoutHandler("PDU1 VBAT", hk::PDU1_VBAT); + genericPrintoutHandler("PDU2 VCC", hk::PDU2_VCC); + genericPrintoutHandler("PDU2 VBAT", hk::PDU2_VBAT); + genericPrintoutHandler("STACK VBAT", hk::STACK_VBAT); + genericPrintoutHandler("STACK 3V3", hk::STACK_3V3); + genericPrintoutHandler("STACK 5V", hk::STACK_5V); + genericPrintoutHandler("GS 3V3", hk::GS3V3); + genericPrintoutHandler("GS 5V", hk::GS5V); + genericPrintoutHandler("X3 VBAT", hk::X3_IDLE_VBAT); + genericPrintoutHandler("X3 VCC", hk::X3_IDLE_VCC); } diff --git a/mission/devices/P60DockHandler.h b/mission/devices/P60DockHandler.h index 38ca391a..b86f37bb 100644 --- a/mission/devices/P60DockHandler.h +++ b/mission/devices/P60DockHandler.h @@ -39,6 +39,13 @@ class P60DockHandler : public GomspaceDeviceHandler { P60Dock::HkTableDataset p60dockHkTableDataset; static constexpr uint8_t MAX_CHANNEL_STR_WIDTH = 16; + PoolEntry hkCurrents = PoolEntry(P60Dock::hk::CHNLS_LEN); + PoolEntry hkVoltages = PoolEntry(P60Dock::hk::CHNLS_LEN); + PoolEntry outputEnables = PoolEntry(P60Dock::hk::CHNLS_LEN); + PoolEntry latchups = PoolEntry(P60Dock::hk::CHNLS_LEN); + + PoolEntry devicesType = PoolEntry(P60Dock::NUM_DEVS); + PoolEntry devicesStatus = PoolEntry(P60Dock::NUM_DEVS); /** * @brief Function extracts the hk table information from the received csp packet and stores * the values in the p60dockHkTableDataset. diff --git a/mission/devices/PCDUHandler.cpp b/mission/devices/PCDUHandler.cpp index 837d4f37..44b9181a 100644 --- a/mission/devices/PCDUHandler.cpp +++ b/mission/devices/PCDUHandler.cpp @@ -376,221 +376,210 @@ object_id_t PCDUHandler::getObjectId() const { return SystemObject::getObjectId( ReturnValue_t PCDUHandler::initializeLocalDataPool(localpool::DataPool& localDataPoolMap, LocalDataPoolManager& poolManager) { using namespace pcduSwitches; - localDataPoolMap.emplace(P60System::PDU2_CURRENT_OUT_Q7S, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_CURRENT_OUT_PAYLOAD_PCDU_CH1, + using namespace P60System; + localDataPoolMap.emplace(pool::PDU2_CURRENT_OUT_Q7S, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_CURRENT_OUT_PAYLOAD_PCDU_CH1, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_CURRENT_OUT_RW, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_CURRENT_OUT_TCS_BOARD_HEATER_IN, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_CURRENT_OUT_SUS_REDUNDANT, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_CURRENT_OUT_DEPLOYMENT_MECHANISM, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_CURRENT_OUT_RW, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_CURRENT_OUT_TCS_BOARD_HEATER_IN, - new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_CURRENT_OUT_SUS_REDUNDANT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_CURRENT_OUT_DEPLOYMENT_MECHANISM, - new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_CURRENT_OUT_PAYLOAD_PCDU_CH6, - new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_CURRENT_OUT_ACS_BOARD_SIDE_B, - new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_CURRENT_OUT_PAYLOAD_CAMERA, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_CURRENT_OUT_PAYLOAD_PCDU_CH6, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_CURRENT_OUT_ACS_BOARD_SIDE_B, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_CURRENT_OUT_PAYLOAD_CAMERA, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_VOLTAGE_OUT_Q7S, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_VOLTAGE_OUT_PAYLOAD_PCDU_CH1, + localDataPoolMap.emplace(pool::PDU2_VOLTAGE_OUT_Q7S, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_VOLTAGE_OUT_PAYLOAD_PCDU_CH1, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_VOLTAGE_OUT_RW, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_VOLTAGE_OUT_TCS_BOARD_HEATER_IN, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_VOLTAGE_OUT_SUS_REDUNDANT, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_VOLTAGE_OUT_DEPLOYMENT_MECHANISM, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_VOLTAGE_OUT_RW, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_VOLTAGE_OUT_TCS_BOARD_HEATER_IN, - new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_VOLTAGE_OUT_SUS_REDUNDANT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_VOLTAGE_OUT_DEPLOYMENT_MECHANISM, - new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_VOLTAGE_OUT_PAYLOAD_PCDU_CH6, - new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_VOLTAGE_OUT_ACS_BOARD_SIDE_B, - new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_VOLTAGE_OUT_PAYLOAD_CAMERA, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_VOLTAGE_OUT_PAYLOAD_PCDU_CH6, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_VOLTAGE_OUT_ACS_BOARD_SIDE_B, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_VOLTAGE_OUT_PAYLOAD_CAMERA, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_VCC, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_VBAT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_TEMPERATURE, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_CONV_EN_1, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_CONV_EN_2, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_CONV_EN_3, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_VCC, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_VBAT, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_TEMPERATURE, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_CONV_EN_1, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_CONV_EN_2, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_CONV_EN_3, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_OUT_EN_Q7S, + localDataPoolMap.emplace(pool::PDU2_OUT_EN_Q7S, new PoolEntry({INIT_SWITCH_STATES[Switches::PDU2_CH0_Q7S]})); localDataPoolMap.emplace( - P60System::PDU2_OUT_EN_PAYLOAD_PCDU_CH1, + pool::PDU2_OUT_EN_PAYLOAD_PCDU_CH1, new PoolEntry({INIT_SWITCH_STATES[Switches::PDU2_CH1_PL_PCDU_BATT_0_14V8]})); - localDataPoolMap.emplace(P60System::PDU2_OUT_EN_RW, + localDataPoolMap.emplace(pool::PDU2_OUT_EN_RW, new PoolEntry({INIT_SWITCH_STATES[Switches::PDU2_CH2_RW_5V]})); #ifdef TE0720_1CFA - localDataPoolMap.emplace(P60System::PDU2_OUT_EN_TCS_BOARD_HEATER_IN, new PoolEntry({1})); + localDataPoolMap.emplace(pool::PDU2_OUT_EN_TCS_BOARD_HEATER_IN, new PoolEntry({1})); #else localDataPoolMap.emplace( - P60System::PDU2_OUT_EN_TCS_BOARD_HEATER_IN, + pool::PDU2_OUT_EN_TCS_BOARD_HEATER_IN, new PoolEntry({INIT_SWITCH_STATES[Switches::PDU2_CH3_TCS_BOARD_HEATER_IN_8V]})); #endif localDataPoolMap.emplace( - P60System::PDU2_OUT_EN_SUS_REDUNDANT, + pool::PDU2_OUT_EN_SUS_REDUNDANT, new PoolEntry({INIT_SWITCH_STATES[Switches::PDU2_CH4_SUS_REDUNDANT_3V3]})); localDataPoolMap.emplace( - P60System::PDU2_OUT_EN_DEPLOYMENT_MECHANISM, + pool::PDU2_OUT_EN_DEPLOYMENT_MECHANISM, new PoolEntry({INIT_SWITCH_STATES[Switches::PDU2_CH5_DEPLOYMENT_MECHANISM_8V]})); localDataPoolMap.emplace( - P60System::PDU2_OUT_EN_PAYLOAD_PCDU_CH6, + pool::PDU2_OUT_EN_PAYLOAD_PCDU_CH6, new PoolEntry({INIT_SWITCH_STATES[Switches::PDU2_CH6_PL_PCDU_BATT_1_14V8]})); localDataPoolMap.emplace( - P60System::PDU2_OUT_EN_ACS_BOARD_SIDE_B, + pool::PDU2_OUT_EN_ACS_BOARD_SIDE_B, new PoolEntry({INIT_SWITCH_STATES[Switches::PDU2_CH7_ACS_BOARD_SIDE_B_3V3]})); localDataPoolMap.emplace( - P60System::PDU2_OUT_EN_PAYLOAD_CAMERA, + pool::PDU2_OUT_EN_PAYLOAD_CAMERA, new PoolEntry({INIT_SWITCH_STATES[Switches::PDU2_CH8_PAYLOAD_CAMERA]})); - localDataPoolMap.emplace(P60System::PDU2_BOOTCAUSE, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_BOOTCNT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_UPTIME, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_RESETCAUSE, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_BATT_MODE, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_BOOTCAUSE, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_BOOTCNT, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_UPTIME, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_RESETCAUSE, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_BATT_MODE, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_LATCHUP_Q7S, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_LATCHUP_PAYLOAD_PCDU_CH1, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_LATCHUP_RW, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_LATCHUP_TCS_BOARD_HEATER_IN, - new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_LATCHUP_TCS_BOARD_HEATER_IN, - new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_LATCHUP_SUS_REDUNDANT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_LATCHUP_DEPLOYMENT_MECHANISM, - new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_LATCHUP_PAYLOAD_PCDU_CH6, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_LATCHUP_ACS_BOARD_SIDE_B, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_LATCHUP_PAYLOAD_CAMERA, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_LATCHUP_Q7S, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_LATCHUP_PAYLOAD_PCDU_CH1, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_LATCHUP_RW, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_LATCHUP_TCS_BOARD_HEATER_IN, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_LATCHUP_TCS_BOARD_HEATER_IN, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_LATCHUP_SUS_REDUNDANT, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_LATCHUP_DEPLOYMENT_MECHANISM, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_LATCHUP_PAYLOAD_PCDU_CH6, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_LATCHUP_ACS_BOARD_SIDE_B, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_LATCHUP_PAYLOAD_CAMERA, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_DEVICE_0, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_DEVICE_1, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_DEVICE_2, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_DEVICE_3, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_DEVICE_4, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_DEVICE_5, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_DEVICE_6, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_DEVICE_7, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_DEVICE_0, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_DEVICE_1, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_DEVICE_2, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_DEVICE_3, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_DEVICE_4, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_DEVICE_5, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_DEVICE_6, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_DEVICE_7, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_DEVICE_0_STATUS, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_DEVICE_1_STATUS, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_DEVICE_2_STATUS, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_DEVICE_3_STATUS, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_DEVICE_4_STATUS, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_DEVICE_5_STATUS, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_DEVICE_6_STATUS, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_DEVICE_7_STATUS, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_DEVICE_0_STATUS, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_DEVICE_1_STATUS, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_DEVICE_2_STATUS, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_DEVICE_3_STATUS, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_DEVICE_4_STATUS, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_DEVICE_5_STATUS, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_DEVICE_6_STATUS, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_DEVICE_7_STATUS, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_WDT_CNT_GND, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_WDT_CNT_I2C, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_WDT_CNT_CAN, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_WDT_CNT_CSP1, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_WDT_CNT_CSP2, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_WDT_GND_LEFT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_WDT_I2C_LEFT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_WDT_CAN_LEFT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_WDT_CSP_LEFT1, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_WDT_CSP_LEFT2, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_WDT_CNT_GND, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_WDT_CNT_I2C, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_WDT_CNT_CAN, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_WDT_CNT_CSP1, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_WDT_CNT_CSP2, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_WDT_GND_LEFT, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_WDT_I2C_LEFT, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_WDT_CAN_LEFT, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_WDT_CSP_LEFT1, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_WDT_CSP_LEFT2, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_CURRENT_OUT_TCS_BOARD_3V3, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_CURRENT_OUT_SYRLINKS, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_CURRENT_OUT_STAR_TRACKER, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_CURRENT_OUT_MGT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_CURRENT_OUT_SUS_NOMINAL, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_CURRENT_OUT_SOLAR_CELL_EXP, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_CURRENT_OUT_PLOC, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_CURRENT_OUT_ACS_BOARD_SIDE_A, - new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_CURRENT_OUT_CHANNEL8, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU1_CURRENT_OUT_TCS_BOARD_3V3, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU1_CURRENT_OUT_SYRLINKS, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU1_CURRENT_OUT_STAR_TRACKER, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU1_CURRENT_OUT_MGT, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU1_CURRENT_OUT_SUS_NOMINAL, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU1_CURRENT_OUT_SOLAR_CELL_EXP, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU1_CURRENT_OUT_PLOC, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU1_CURRENT_OUT_ACS_BOARD_SIDE_A, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU1_CURRENT_OUT_CHANNEL8, new PoolEntry({0})); localDataPoolMap.emplace( - P60System::PDU1_VOLTAGE_OUT_TCS_BOARD_3V3, + pool::PDU1_VOLTAGE_OUT_TCS_BOARD_3V3, new PoolEntry({INIT_SWITCH_STATES[Switches::PDU1_CH0_TCS_BOARD_3V3]})); localDataPoolMap.emplace( - P60System::PDU1_VOLTAGE_OUT_SYRLINKS, + pool::PDU1_VOLTAGE_OUT_SYRLINKS, new PoolEntry({INIT_SWITCH_STATES[Switches::PDU1_CH1_SYRLINKS_12V]})); localDataPoolMap.emplace( - P60System::PDU1_VOLTAGE_OUT_STAR_TRACKER, + pool::PDU1_VOLTAGE_OUT_STAR_TRACKER, new PoolEntry({INIT_SWITCH_STATES[Switches::PDU1_CH2_STAR_TRACKER_5V]})); - localDataPoolMap.emplace(P60System::PDU1_VOLTAGE_OUT_MGT, + localDataPoolMap.emplace(pool::PDU1_VOLTAGE_OUT_MGT, new PoolEntry({INIT_SWITCH_STATES[Switches::PDU1_CH3_MGT_5V]})); localDataPoolMap.emplace( - P60System::PDU1_VOLTAGE_OUT_SUS_NOMINAL, + pool::PDU1_VOLTAGE_OUT_SUS_NOMINAL, new PoolEntry({INIT_SWITCH_STATES[Switches::PDU1_CH4_SUS_NOMINAL_3V3]})); localDataPoolMap.emplace( - P60System::PDU1_VOLTAGE_OUT_SOLAR_CELL_EXP, + pool::PDU1_VOLTAGE_OUT_SOLAR_CELL_EXP, new PoolEntry({INIT_SWITCH_STATES[Switches::PDU1_CH5_SOLAR_CELL_EXP_5V]})); localDataPoolMap.emplace( - P60System::PDU1_VOLTAGE_OUT_PLOC, + pool::PDU1_VOLTAGE_OUT_PLOC, new PoolEntry({INIT_SWITCH_STATES[Switches::PDU1_CH6_PLOC_12V]})); localDataPoolMap.emplace( - P60System::PDU1_VOLTAGE_OUT_ACS_BOARD_SIDE_A, + pool::PDU1_VOLTAGE_OUT_ACS_BOARD_SIDE_A, new PoolEntry({INIT_SWITCH_STATES[Switches::PDU1_CH7_ACS_A_SIDE_3V3]})); localDataPoolMap.emplace( - P60System::PDU1_VOLTAGE_OUT_CHANNEL8, + pool::PDU1_VOLTAGE_OUT_CHANNEL8, new PoolEntry({INIT_SWITCH_STATES[Switches::PDU1_CH8_UNOCCUPIED]})); - localDataPoolMap.emplace(P60System::PDU1_VCC, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_VBAT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_TEMPERATURE, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_CONV_EN_1, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_CONV_EN_2, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_CONV_EN_3, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU1_VCC, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU1_VBAT, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU1_TEMPERATURE, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU1_CONV_EN_1, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU1_CONV_EN_2, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU1_CONV_EN_3, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_OUT_EN_TCS_BOARD_3V3, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_OUT_EN_SYRLINKS, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_OUT_EN_STAR_TRACKER, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_OUT_EN_MGT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_OUT_EN_SUS_NOMINAL, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_OUT_EN_SOLAR_CELL_EXP, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_OUT_EN_PLOC, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_OUT_EN_ACS_BOARD_SIDE_A, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_OUT_EN_CHANNEL8, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU1_OUT_EN_TCS_BOARD_3V3, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU1_OUT_EN_SYRLINKS, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU1_OUT_EN_STAR_TRACKER, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU1_OUT_EN_MGT, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU1_OUT_EN_SUS_NOMINAL, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU1_OUT_EN_SOLAR_CELL_EXP, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU1_OUT_EN_PLOC, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU1_OUT_EN_ACS_BOARD_SIDE_A, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU1_OUT_EN_CHANNEL8, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_BOOTCAUSE, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_BOOTCNT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_UPTIME, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_RESETCAUSE, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_BATT_MODE, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU1_BOOTCAUSE, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU1_BOOTCNT, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU1_UPTIME, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU1_RESETCAUSE, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU1_BATT_MODE, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_LATCHUP_TCS_BOARD_3V3, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_LATCHUP_SYRLINKS, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_LATCHUP_STAR_TRACKER, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_LATCHUP_MGT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_LATCHUP_SUS_NOMINAL, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_LATCHUP_SOLAR_CELL_EXP, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_LATCHUP_PLOC, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_LATCHUP_ACS_BOARD_SIDE_A, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_LATCHUP_CHANNEL8, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU1_LATCHUP_TCS_BOARD_3V3, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU1_LATCHUP_SYRLINKS, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU1_LATCHUP_STAR_TRACKER, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU1_LATCHUP_MGT, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU1_LATCHUP_SUS_NOMINAL, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU1_LATCHUP_SOLAR_CELL_EXP, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU1_LATCHUP_PLOC, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU1_LATCHUP_ACS_BOARD_SIDE_A, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU1_LATCHUP_CHANNEL8, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_DEVICE_0, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_DEVICE_1, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_DEVICE_2, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_DEVICE_3, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_DEVICE_4, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_DEVICE_5, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_DEVICE_6, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_DEVICE_7, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU1_DEVICE_0, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU1_DEVICE_1, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU1_DEVICE_2, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU1_DEVICE_3, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU1_DEVICE_4, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU1_DEVICE_5, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU1_DEVICE_6, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU1_DEVICE_7, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_DEVICE_0_STATUS, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_DEVICE_1_STATUS, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_DEVICE_2_STATUS, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_DEVICE_3_STATUS, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_DEVICE_4_STATUS, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_DEVICE_5_STATUS, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_DEVICE_6_STATUS, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_DEVICE_7_STATUS, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU1_DEVICE_0_STATUS, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU1_DEVICE_1_STATUS, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU1_DEVICE_2_STATUS, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU1_DEVICE_3_STATUS, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU1_DEVICE_4_STATUS, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU1_DEVICE_5_STATUS, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU1_DEVICE_6_STATUS, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU1_DEVICE_7_STATUS, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_WDT_CNT_GND, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_WDT_CNT_I2C, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_WDT_CNT_CAN, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_WDT_CNT_CSP1, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_WDT_CNT_CSP2, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_WDT_GND_LEFT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_WDT_I2C_LEFT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_WDT_CAN_LEFT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_WDT_CSP_LEFT1, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_WDT_CSP_LEFT2, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU1_WDT_CNT_GND, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU1_WDT_CNT_I2C, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU1_WDT_CNT_CAN, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU1_WDT_CNT_CSP1, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU1_WDT_CNT_CSP2, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU1_WDT_GND_LEFT, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU1_WDT_I2C_LEFT, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU1_WDT_CAN_LEFT, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU1_WDT_CSP_LEFT1, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU1_WDT_CSP_LEFT2, new PoolEntry({0})); return HasReturnvaluesIF::RETURN_OK; } diff --git a/mission/devices/PDU1Handler.cpp b/mission/devices/PDU1Handler.cpp index 38256cf9..264fd098 100644 --- a/mission/devices/PDU1Handler.cpp +++ b/mission/devices/PDU1Handler.cpp @@ -329,89 +329,103 @@ void PDU1Handler::parseHkTableReply(const uint8_t *packet) { ReturnValue_t PDU1Handler::initializeLocalDataPool(localpool::DataPool &localDataPoolMap, LocalDataPoolManager &poolManager) { - localDataPoolMap.emplace(P60System::PDU1_CURRENT_OUT_TCS_BOARD_3V3, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_CURRENT_OUT_SYRLINKS, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_CURRENT_OUT_STAR_TRACKER, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_CURRENT_OUT_MGT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_CURRENT_OUT_SUS_NOMINAL, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_CURRENT_OUT_SOLAR_CELL_EXP, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_CURRENT_OUT_PLOC, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_CURRENT_OUT_ACS_BOARD_SIDE_A, + localDataPoolMap.emplace(P60System::pool::PDU1_CURRENT_OUT_TCS_BOARD_3V3, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_CURRENT_OUT_CHANNEL8, new PoolEntry({0})); - - localDataPoolMap.emplace(P60System::PDU1_VOLTAGE_OUT_TCS_BOARD_3V3, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_VOLTAGE_OUT_SYRLINKS, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_VOLTAGE_OUT_STAR_TRACKER, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_VOLTAGE_OUT_MGT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_VOLTAGE_OUT_SUS_NOMINAL, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_VOLTAGE_OUT_SOLAR_CELL_EXP, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_VOLTAGE_OUT_PLOC, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_VOLTAGE_OUT_ACS_BOARD_SIDE_A, + localDataPoolMap.emplace(P60System::pool::PDU1_CURRENT_OUT_SYRLINKS, new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_CURRENT_OUT_STAR_TRACKER, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_VOLTAGE_OUT_CHANNEL8, new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_CURRENT_OUT_MGT, new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_CURRENT_OUT_SUS_NOMINAL, + new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_CURRENT_OUT_SOLAR_CELL_EXP, + new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_CURRENT_OUT_PLOC, new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_CURRENT_OUT_ACS_BOARD_SIDE_A, + new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_CURRENT_OUT_CHANNEL8, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_VCC, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_VBAT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_TEMPERATURE, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_CONV_EN_1, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_CONV_EN_2, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_CONV_EN_3, new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_VOLTAGE_OUT_TCS_BOARD_3V3, + new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_VOLTAGE_OUT_SYRLINKS, new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_VOLTAGE_OUT_STAR_TRACKER, + new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_VOLTAGE_OUT_MGT, new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_VOLTAGE_OUT_SUS_NOMINAL, + new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_VOLTAGE_OUT_SOLAR_CELL_EXP, + new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_VOLTAGE_OUT_PLOC, new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_VOLTAGE_OUT_ACS_BOARD_SIDE_A, + new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_VOLTAGE_OUT_CHANNEL8, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_OUT_EN_TCS_BOARD_3V3, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_OUT_EN_SYRLINKS, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_OUT_EN_STAR_TRACKER, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_OUT_EN_MGT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_OUT_EN_SUS_NOMINAL, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_OUT_EN_SOLAR_CELL_EXP, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_OUT_EN_PLOC, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_OUT_EN_ACS_BOARD_SIDE_A, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_OUT_EN_CHANNEL8, new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_VCC, new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_VBAT, new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_TEMPERATURE, new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_CONV_EN_1, new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_CONV_EN_2, new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_CONV_EN_3, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_BOOTCAUSE, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_BOOTCNT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_UPTIME, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_RESETCAUSE, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_BATT_MODE, new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_OUT_EN_TCS_BOARD_3V3, new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_OUT_EN_SYRLINKS, new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_OUT_EN_STAR_TRACKER, new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_OUT_EN_MGT, new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_OUT_EN_SUS_NOMINAL, new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_OUT_EN_SOLAR_CELL_EXP, + new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_OUT_EN_PLOC, new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_OUT_EN_ACS_BOARD_SIDE_A, + new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_OUT_EN_CHANNEL8, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_LATCHUP_TCS_BOARD_3V3, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_LATCHUP_SYRLINKS, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_LATCHUP_STAR_TRACKER, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_LATCHUP_MGT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_LATCHUP_SUS_NOMINAL, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_LATCHUP_SOLAR_CELL_EXP, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_LATCHUP_PLOC, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_LATCHUP_ACS_BOARD_SIDE_A, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_LATCHUP_CHANNEL8, new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_BOOTCAUSE, new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_BOOTCNT, new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_UPTIME, new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_RESETCAUSE, new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_BATT_MODE, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_DEVICE_0, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_DEVICE_1, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_DEVICE_2, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_DEVICE_3, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_DEVICE_4, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_DEVICE_5, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_DEVICE_6, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_DEVICE_7, new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_LATCHUP_TCS_BOARD_3V3, + new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_LATCHUP_SYRLINKS, new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_LATCHUP_STAR_TRACKER, + new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_LATCHUP_MGT, new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_LATCHUP_SUS_NOMINAL, new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_LATCHUP_SOLAR_CELL_EXP, + new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_LATCHUP_PLOC, new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_LATCHUP_ACS_BOARD_SIDE_A, + new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_LATCHUP_CHANNEL8, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_DEVICE_0_STATUS, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_DEVICE_1_STATUS, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_DEVICE_2_STATUS, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_DEVICE_3_STATUS, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_DEVICE_4_STATUS, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_DEVICE_5_STATUS, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_DEVICE_6_STATUS, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_DEVICE_7_STATUS, new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_DEVICE_0, new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_DEVICE_1, new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_DEVICE_2, new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_DEVICE_3, new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_DEVICE_4, new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_DEVICE_5, new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_DEVICE_6, new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_DEVICE_7, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_WDT_CNT_GND, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_WDT_CNT_I2C, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_WDT_CNT_CAN, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_WDT_CNT_CSP1, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_WDT_CNT_CSP2, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_WDT_GND_LEFT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_WDT_I2C_LEFT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_WDT_CAN_LEFT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_WDT_CSP_LEFT1, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_WDT_CSP_LEFT2, new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_DEVICE_0_STATUS, new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_DEVICE_1_STATUS, new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_DEVICE_2_STATUS, new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_DEVICE_3_STATUS, new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_DEVICE_4_STATUS, new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_DEVICE_5_STATUS, new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_DEVICE_6_STATUS, new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_DEVICE_7_STATUS, new PoolEntry({0})); + + localDataPoolMap.emplace(P60System::pool::PDU1_WDT_CNT_GND, new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_WDT_CNT_I2C, new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_WDT_CNT_CAN, new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_WDT_CNT_CSP1, new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_WDT_CNT_CSP2, new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_WDT_GND_LEFT, new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_WDT_I2C_LEFT, new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_WDT_CAN_LEFT, new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_WDT_CSP_LEFT1, new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_WDT_CSP_LEFT2, new PoolEntry({0})); #if OBSW_ENABLE_PERIODIC_HK == 1 poolManager.subscribeForPeriodicPacket(pdu1HkTableDataset.getSid(), false, 0.4, true); #endif diff --git a/mission/devices/PDU2Handler.cpp b/mission/devices/PDU2Handler.cpp index 512d8745..48e7f90e 100644 --- a/mission/devices/PDU2Handler.cpp +++ b/mission/devices/PDU2Handler.cpp @@ -266,104 +266,94 @@ void PDU2Handler::parseHkTableReply(const uint8_t *packet) { ReturnValue_t PDU2Handler::initializeLocalDataPool(localpool::DataPool &localDataPoolMap, LocalDataPoolManager &poolManager) { - localDataPoolMap.emplace(P60System::PDU2_CURRENT_OUT_Q7S, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_CURRENT_OUT_PAYLOAD_PCDU_CH1, + using namespace P60System; + localDataPoolMap.emplace(pool::PDU2_CURRENT_OUT_Q7S, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_CURRENT_OUT_PAYLOAD_PCDU_CH1, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_CURRENT_OUT_RW, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_CURRENT_OUT_TCS_BOARD_HEATER_IN, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_CURRENT_OUT_SUS_REDUNDANT, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_CURRENT_OUT_DEPLOYMENT_MECHANISM, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_CURRENT_OUT_RW, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_CURRENT_OUT_TCS_BOARD_HEATER_IN, - new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_CURRENT_OUT_SUS_REDUNDANT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_CURRENT_OUT_DEPLOYMENT_MECHANISM, - new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_CURRENT_OUT_PAYLOAD_PCDU_CH6, - new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_CURRENT_OUT_ACS_BOARD_SIDE_B, - new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_CURRENT_OUT_PAYLOAD_CAMERA, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_CURRENT_OUT_PAYLOAD_PCDU_CH6, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_CURRENT_OUT_ACS_BOARD_SIDE_B, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_CURRENT_OUT_PAYLOAD_CAMERA, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_VOLTAGE_OUT_Q7S, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_VOLTAGE_OUT_PAYLOAD_PCDU_CH1, + localDataPoolMap.emplace(pool::PDU2_VOLTAGE_OUT_Q7S, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_VOLTAGE_OUT_PAYLOAD_PCDU_CH1, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_VOLTAGE_OUT_RW, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_VOLTAGE_OUT_TCS_BOARD_HEATER_IN, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_VOLTAGE_OUT_SUS_REDUNDANT, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_VOLTAGE_OUT_DEPLOYMENT_MECHANISM, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_VOLTAGE_OUT_RW, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_VOLTAGE_OUT_TCS_BOARD_HEATER_IN, - new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_VOLTAGE_OUT_SUS_REDUNDANT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_VOLTAGE_OUT_DEPLOYMENT_MECHANISM, - new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_VOLTAGE_OUT_PAYLOAD_PCDU_CH6, - new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_VOLTAGE_OUT_ACS_BOARD_SIDE_B, - new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_VOLTAGE_OUT_PAYLOAD_CAMERA, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_VOLTAGE_OUT_PAYLOAD_PCDU_CH6, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_VOLTAGE_OUT_ACS_BOARD_SIDE_B, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_VOLTAGE_OUT_PAYLOAD_CAMERA, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_VCC, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_VBAT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_TEMPERATURE, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_CONV_EN_1, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_CONV_EN_2, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_CONV_EN_3, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_VCC, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_VBAT, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_TEMPERATURE, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_CONV_EN_1, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_CONV_EN_2, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_CONV_EN_3, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_OUT_EN_Q7S, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_OUT_EN_PAYLOAD_PCDU_CH1, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_OUT_EN_RW, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_OUT_EN_Q7S, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_OUT_EN_PAYLOAD_PCDU_CH1, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_OUT_EN_RW, new PoolEntry({0})); #ifdef TE0720_1CFA - localDataPoolMap.emplace(P60System::PDU2_OUT_EN_TCS_BOARD_HEATER_IN, new PoolEntry({1})); + localDataPoolMap.emplace(pool::PDU2_OUT_EN_TCS_BOARD_HEATER_IN, new PoolEntry({1})); #else - localDataPoolMap.emplace(P60System::PDU2_OUT_EN_TCS_BOARD_HEATER_IN, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_OUT_EN_TCS_BOARD_HEATER_IN, new PoolEntry({0})); #endif - localDataPoolMap.emplace(P60System::PDU2_OUT_EN_SUS_REDUNDANT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_OUT_EN_DEPLOYMENT_MECHANISM, - new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_OUT_EN_PAYLOAD_PCDU_CH6, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_OUT_EN_ACS_BOARD_SIDE_B, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_OUT_EN_PAYLOAD_CAMERA, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_OUT_EN_SUS_REDUNDANT, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_OUT_EN_DEPLOYMENT_MECHANISM, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_OUT_EN_PAYLOAD_PCDU_CH6, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_OUT_EN_ACS_BOARD_SIDE_B, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_OUT_EN_PAYLOAD_CAMERA, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_BOOTCAUSE, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_BOOTCNT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_UPTIME, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_RESETCAUSE, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_BATT_MODE, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_BOOTCAUSE, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_BOOTCNT, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_UPTIME, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_RESETCAUSE, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_BATT_MODE, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_LATCHUP_Q7S, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_LATCHUP_PAYLOAD_PCDU_CH1, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_LATCHUP_RW, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_LATCHUP_TCS_BOARD_HEATER_IN, - new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_LATCHUP_SUS_REDUNDANT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_LATCHUP_DEPLOYMENT_MECHANISM, - new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_LATCHUP_PAYLOAD_PCDU_CH6, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_LATCHUP_ACS_BOARD_SIDE_B, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_LATCHUP_PAYLOAD_CAMERA, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_LATCHUP_Q7S, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_LATCHUP_PAYLOAD_PCDU_CH1, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_LATCHUP_RW, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_LATCHUP_TCS_BOARD_HEATER_IN, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_LATCHUP_SUS_REDUNDANT, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_LATCHUP_DEPLOYMENT_MECHANISM, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_LATCHUP_PAYLOAD_PCDU_CH6, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_LATCHUP_ACS_BOARD_SIDE_B, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_LATCHUP_PAYLOAD_CAMERA, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_DEVICE_0, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_DEVICE_1, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_DEVICE_2, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_DEVICE_3, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_DEVICE_4, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_DEVICE_5, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_DEVICE_6, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_DEVICE_7, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_DEVICE_0, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_DEVICE_1, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_DEVICE_2, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_DEVICE_3, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_DEVICE_4, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_DEVICE_5, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_DEVICE_6, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_DEVICE_7, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_DEVICE_0_STATUS, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_DEVICE_1_STATUS, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_DEVICE_2_STATUS, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_DEVICE_3_STATUS, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_DEVICE_4_STATUS, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_DEVICE_5_STATUS, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_DEVICE_6_STATUS, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_DEVICE_7_STATUS, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_DEVICE_0_STATUS, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_DEVICE_1_STATUS, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_DEVICE_2_STATUS, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_DEVICE_3_STATUS, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_DEVICE_4_STATUS, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_DEVICE_5_STATUS, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_DEVICE_6_STATUS, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_DEVICE_7_STATUS, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_WDT_CNT_GND, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_WDT_CNT_I2C, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_WDT_CNT_CAN, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_WDT_CNT_CSP1, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_WDT_CNT_CSP2, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_WDT_GND_LEFT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_WDT_I2C_LEFT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_WDT_CAN_LEFT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_WDT_CSP_LEFT1, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_WDT_CSP_LEFT2, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_WDT_CNT_GND, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_WDT_CNT_I2C, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_WDT_CNT_CAN, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_WDT_CNT_CSP1, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_WDT_CNT_CSP2, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_WDT_GND_LEFT, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_WDT_I2C_LEFT, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_WDT_CAN_LEFT, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_WDT_CSP_LEFT1, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_WDT_CSP_LEFT2, new PoolEntry({0})); #if OBSW_ENABLE_PERIODIC_HK == 1 poolManager.subscribeForPeriodicPacket(pdu2HkTableDataset.getSid(), false, 0.4, true); #endif diff --git a/mission/devices/RadiationSensorHandler.cpp b/mission/devices/RadiationSensorHandler.cpp index 179444ca..e91d8427 100644 --- a/mission/devices/RadiationSensorHandler.cpp +++ b/mission/devices/RadiationSensorHandler.cpp @@ -92,15 +92,15 @@ ReturnValue_t RadiationSensorHandler::buildCommandFromCommand(DeviceCommandId_t return RETURN_OK; } case RAD_SENSOR::ENABLE_DEBUG_OUTPUT: { - printPeriodicData = true; - rawPacketLen = 0; - return RETURN_OK; - } - case RAD_SENSOR::DISABLE_DEBUG_OUTPUT: { - rawPacketLen = 0; - printPeriodicData = false; - return RETURN_OK; - } + printPeriodicData = true; + rawPacketLen = 0; + return RETURN_OK; + } + case RAD_SENSOR::DISABLE_DEBUG_OUTPUT: { + rawPacketLen = 0; + printPeriodicData = false; + return RETURN_OK; + } default: return DeviceHandlerIF::COMMAND_NOT_IMPLEMENTED; } @@ -123,7 +123,7 @@ ReturnValue_t RadiationSensorHandler::scanForReply(const uint8_t *start, size_t switch (*foundId) { case RAD_SENSOR::START_CONVERSION: case RAD_SENSOR::WRITE_SETUP: - *foundLen = remainingSize; + *foundLen = remainingSize; return IGNORE_REPLY_DATA; case RAD_SENSOR::READ_CONVERSIONS: { ReturnValue_t result = gpioIF->pullLow(gpioIds::ENABLE_RADFET); @@ -138,8 +138,8 @@ ReturnValue_t RadiationSensorHandler::scanForReply(const uint8_t *start, size_t } case RAD_SENSOR::ENABLE_DEBUG_OUTPUT: case RAD_SENSOR::DISABLE_DEBUG_OUTPUT: - sif::info << "RadiationSensorHandler::scanForReply: " << remainingSize << std::endl; - break; + sif::info << "RadiationSensorHandler::scanForReply: " << remainingSize << std::endl; + break; default: break; } diff --git a/mission/devices/SyrlinksHkHandler.cpp b/mission/devices/SyrlinksHkHandler.cpp index 017bd53c..53a8af23 100644 --- a/mission/devices/SyrlinksHkHandler.cpp +++ b/mission/devices/SyrlinksHkHandler.cpp @@ -139,42 +139,45 @@ ReturnValue_t SyrlinksHkHandler::buildCommandFromCommand(DeviceCommandId_t devic return RETURN_OK; } case (SYRLINKS::READ_TX_AGC_VALUE_HIGH_BYTE): { - readTxAgcValueHighByte.copy(reinterpret_cast(commandBuffer), readTxAgcValueHighByte.size(), 0); + readTxAgcValueHighByte.copy(reinterpret_cast(commandBuffer), + readTxAgcValueHighByte.size(), 0); rawPacketLen = readTxAgcValueHighByte.size(); rememberCommandId = SYRLINKS::READ_TX_AGC_VALUE_HIGH_BYTE; rawPacket = commandBuffer; return RETURN_OK; } case (SYRLINKS::READ_TX_AGC_VALUE_LOW_BYTE): { - readTxAgcValueLowByte.copy(reinterpret_cast(commandBuffer), readTxAgcValueLowByte.size(), 0); + readTxAgcValueLowByte.copy(reinterpret_cast(commandBuffer), + readTxAgcValueLowByte.size(), 0); rawPacketLen = readTxAgcValueLowByte.size(); rememberCommandId = SYRLINKS::READ_TX_AGC_VALUE_LOW_BYTE; rawPacket = commandBuffer; return RETURN_OK; } case (SYRLINKS::TEMP_POWER_AMPLIFIER_HIGH_BYTE): - tempPowerAmpBoardHighByte.copy(reinterpret_cast(commandBuffer), tempPowerAmpBoardHighByte.size(), - 0); + tempPowerAmpBoardHighByte.copy(reinterpret_cast(commandBuffer), + tempPowerAmpBoardHighByte.size(), 0); rawPacketLen = tempPowerAmpBoardHighByte.size(); rememberCommandId = SYRLINKS::TEMP_POWER_AMPLIFIER_HIGH_BYTE; rawPacket = commandBuffer; return RETURN_OK; case (SYRLINKS::TEMP_POWER_AMPLIFIER_LOW_BYTE): - tempPowerAmpBoardLowByte.copy(reinterpret_cast(commandBuffer), tempPowerAmpBoardLowByte.size(), - 0); + tempPowerAmpBoardLowByte.copy(reinterpret_cast(commandBuffer), + tempPowerAmpBoardLowByte.size(), 0); rawPacketLen = tempPowerAmpBoardLowByte.size(); rememberCommandId = SYRLINKS::TEMP_POWER_AMPLIFIER_LOW_BYTE; rawPacket = commandBuffer; return RETURN_OK; case (SYRLINKS::TEMP_BASEBAND_BOARD_HIGH_BYTE): - tempBasebandBoardHighByte.copy(reinterpret_cast(commandBuffer), tempBasebandBoardHighByte.size(), - 0); + tempBasebandBoardHighByte.copy(reinterpret_cast(commandBuffer), + tempBasebandBoardHighByte.size(), 0); rawPacketLen = tempBasebandBoardHighByte.size(); rememberCommandId = SYRLINKS::TEMP_BASEBAND_BOARD_HIGH_BYTE; rawPacket = commandBuffer; return RETURN_OK; case (SYRLINKS::TEMP_BASEBAND_BOARD_LOW_BYTE): - tempBasebandBoardLowByte.copy(reinterpret_cast(commandBuffer), tempBasebandBoardLowByte.size(), 0); + tempBasebandBoardLowByte.copy(reinterpret_cast(commandBuffer), + tempBasebandBoardLowByte.size(), 0); rawPacketLen = tempBasebandBoardLowByte.size(); rememberCommandId = SYRLINKS::TEMP_BASEBAND_BOARD_LOW_BYTE; rawPacket = commandBuffer; @@ -352,8 +355,8 @@ ReturnValue_t SyrlinksHkHandler::interpretDeviceReply(DeviceCommandId_t id, cons rawTempBasebandBoard |= convertHexStringToUint8( reinterpret_cast(packet + SYRLINKS::MESSAGE_HEADER_SIZE)); tempBasebandBoard = calcTempVal(rawTempBasebandBoard); - sif::info << "Syrlinks temperature baseband board: " << tempBasebandBoard << " °C" - << std::endl; + sif::info << "Syrlinks temperature baseband board: " << tempBasebandBoard << " °C" + << std::endl; break; case (SYRLINKS::TEMP_POWER_AMPLIFIER_HIGH_BYTE): result = verifyReply(packet, SYRLINKS::READ_ONE_REGISTER_REPLY_SIE); @@ -364,8 +367,8 @@ ReturnValue_t SyrlinksHkHandler::interpretDeviceReply(DeviceCommandId_t id, cons } rawTempPowerAmplifier = 0; rawTempPowerAmplifier = convertHexStringToUint8(reinterpret_cast( - packet + SYRLINKS::MESSAGE_HEADER_SIZE)) - << 8; + packet + SYRLINKS::MESSAGE_HEADER_SIZE)) + << 8; break; case (SYRLINKS::TEMP_POWER_AMPLIFIER_LOW_BYTE): result = verifyReply(packet, SYRLINKS::READ_ONE_REGISTER_REPLY_SIE); @@ -378,7 +381,7 @@ ReturnValue_t SyrlinksHkHandler::interpretDeviceReply(DeviceCommandId_t id, cons reinterpret_cast(packet + SYRLINKS::MESSAGE_HEADER_SIZE)); tempPowerAmplifier = calcTempVal(rawTempPowerAmplifier); sif::info << "Syrlinks temperature power amplifier board: " << tempPowerAmplifier << " °C" - << std::endl; + << std::endl; break; default: { sif::debug << "SyrlinksHkHandler::interpretDeviceReply: Unknown device reply id" << std::endl; diff --git a/mission/devices/SyrlinksHkHandler.h b/mission/devices/SyrlinksHkHandler.h index 9b9e05c2..a8cb7b8c 100644 --- a/mission/devices/SyrlinksHkHandler.h +++ b/mission/devices/SyrlinksHkHandler.h @@ -1,10 +1,11 @@ #ifndef MISSION_DEVICES_SYRLINKSHKHANDLER_H_ #define MISSION_DEVICES_SYRLINKSHKHANDLER_H_ +#include + #include "devices/powerSwitcherList.h" #include "fsfw/devicehandlers/DeviceHandlerBase.h" #include "mission/devices/devicedefinitions/SyrlinksDefinitions.h" -#include /** * @brief This is the device handler for the syrlinks transceiver. It handles the command diff --git a/mission/devices/devicedefinitions/GomspaceDefinitions.h b/mission/devices/devicedefinitions/GomspaceDefinitions.h index d06c7eef..3a66ca69 100644 --- a/mission/devices/devicedefinitions/GomspaceDefinitions.h +++ b/mission/devices/devicedefinitions/GomspaceDefinitions.h @@ -42,46 +42,13 @@ static const DeviceCommandId_t PRINT_LATCHUPS = 33; } // namespace GOMSPACE namespace P60System { -enum P60SytemPoolIds : lp_id_t { - P60DOCK_CURRENT_ACU_VCC, - P60DOCK_CURRENT_PDU1_VCC, - P60DOCK_CURRENT_X3_IDLE_VCC, - P60DOCK_CURRENT_PDU2_VCC, - P60DOCK_CURRENT_ACU_VBAT, - P60DOCK_CURRENT_PDU1_VBAT, - P60DOCK_CURRENT_X3_IDLE_VBAT, - P60DOCK_CURRENT_PDU2_VBAT, - P60DOCK_CURRENT_STACK_VBAT, - P60DOCK_CURRENT_STACK_3V3, - P60DOCK_CURRENT_STACK_5V, - P60DOCK_CURRENT_GS3V3, - P60DOCK_CURRENT_GS5V, - P60DOCK_VOLTAGE_ACU_VCC, - P60DOCK_VOLTAGE_PDU1_VCC, - P60DOCK_VOLTAGE_X3_IDLE_VCC, - P60DOCK_VOLTAGE_PDU2_VCC, - P60DOCK_VOLTAGE_ACU_VBAT, - P60DOCK_VOLTAGE_PDU1_VBAT, - P60DOCK_VOLTAGE_X3_IDLE_VBAT, - P60DOCK_VOLTAGE_PDU2_VBAT, - P60DOCK_VOLTAGE_STACK_VBAT, - P60DOCK_VOLTAGE_STACK_3V3, - P60DOCK_VOLTAGE_STACK_5V, - P60DOCK_VOLTAGE_GS3V3, - P60DOCK_VOLTAGE_GS5V, - P60DOCK_OUTPUTENABLE_ACU_VCC, - P60DOCK_OUTPUTENABLE_PDU1_VCC, - P60DOCK_OUTPUTENABLE_X3_IDLE_VCC, - P60DOCK_OUTPUTENABLE_PDU2_VCC, - P60DOCK_OUTPUTENABLE_ACU_VBAT, - P60DOCK_OUTPUTENABLE_PDU1_VBAT, - P60DOCK_OUTPUTENABLE_X3_IDLE_VBAT, - P60DOCK_OUTPUTENABLE_PDU2_VBAT, - P60DOCK_OUTPUTENABLE_STACK_VBAT, - P60DOCK_OUTPUTENABLE_STACK_3V3, - P60DOCK_OUTPUTENABLE_STACK_5V, - P60DOCK_OUTPUTENABLE_GS3V3, - P60DOCK_OUTPUTENABLE_GS5V, + +namespace pool { + +enum Ids : lp_id_t { + CURRENTS, + VOLTAGES, + OUTPUT_ENABLE, P60DOCK_TEMPERATURE_1, P60DOCK_TEMPERATURE_2, P60DOCK_BOOT_CAUSE, @@ -91,41 +58,16 @@ enum P60SytemPoolIds : lp_id_t { P60DOCK_BATT_MODE, P60DOCK_HEATER_ON, P60DOCK_CONV_5V_ENABLE_STATUS, - P60DOCK_LATCHUP_ACU_VCC, - P60DOCK_LATCHUP_PDU1_VCC, - P60DOCK_LATCHUP_X3_IDLE_VCC, - P60DOCK_LATCHUP_PDU2_VCC, - P60DOCK_LATCHUP_ACU_VBAT, - P60DOCK_LATCHUP_PDU1_VBAT, - P60DOCK_LATCHUP_X3_IDLE_VBAT, - P60DOCK_LATCHUP_PDU2_VBAT, - P60DOCK_LATCHUP_STACK_VBAT, - P60DOCK_LATCHUP_STACK_3V3, - P60DOCK_LATCHUP_STACK_5V, - P60DOCK_LATCHUP_GS3V3, - P60DOCK_LATCHUP_GS5V, - P60DOCK_VBAT_VALUE, - P60DOCK_VCC_CURRENT_VALUE, + LATCHUPS, + P60DOCK_DOCK_VBAT, + P60DOCK_DOCK_VCC_CURRENT, + // Difference between charge and discharge P60DOCK_BATTERY_CURRENT, P60DOCK_BATTERY_VOLTAGE, P60DOCK_BATTERY_TEMPERATURE_1, P60DOCK_BATTERY_TEMPERATURE_2, - P60DOCK_DEVICE_0, - P60DOCK_DEVICE_1, - P60DOCK_DEVICE_2, - P60DOCK_DEVICE_3, - P60DOCK_DEVICE_4, - P60DOCK_DEVICE_5, - P60DOCK_DEVICE_6, - P60DOCK_DEVICE_7, - P60DOCK_DEVICE_0_STATUS, - P60DOCK_DEVICE_1_STATUS, - P60DOCK_DEVICE_2_STATUS, - P60DOCK_DEVICE_3_STATUS, - P60DOCK_DEVICE_4_STATUS, - P60DOCK_DEVICE_5_STATUS, - P60DOCK_DEVICE_6_STATUS, - P60DOCK_DEVICE_7_STATUS, + DEVICES_TYPE, + DEVICES_STATUS, P60DOCK_DEVICE_TYPE_GROUP, P60DOCK_DEVICE_STATUS_GROUP, P60DOCK_DEARM_STATUS, @@ -359,9 +301,33 @@ enum P60SytemPoolIds : lp_id_t { ACU_WDT_GND_LEFT }; } +} // namespace P60System namespace P60Dock { +static constexpr uint8_t NUM_DEVS = 8; + +namespace hk { + +enum Index : uint8_t { + ACU_VCC = 0, + PDU1_VCC = 1, + X3_IDLE_VCC = 2, + PDU2_VCC = 3, + ACU_VBAT = 4, + PDU1_VBAT = 5, + X3_IDLE_VBAT = 6, + PDU2_VBAT = 7, + STACK_VBAT = 8, + STACK_3V3 = 9, + STACK_5V = 10, + GS3V3 = 11, + GS5V = 12, + CHNLS_LEN = 13 +}; + +} + enum SwitchChannels : uint8_t { ACU = 0, PDU1 = 1, @@ -408,207 +374,99 @@ class HkTableDataset : public StaticLocalDataSet { : StaticLocalDataSet(sid_t(objectId, HK_TABLE_DATA_SET_ID)) {} /** Measured output currents */ - lp_var_t currentAcuVcc = - lp_var_t(sid.objectId, P60System::P60DOCK_CURRENT_ACU_VCC, this); - lp_var_t currentPdu1Vcc = - lp_var_t(sid.objectId, P60System::P60DOCK_CURRENT_PDU1_VCC, this); - lp_var_t currentX3IdleVcc = - lp_var_t(sid.objectId, P60System::P60DOCK_CURRENT_X3_IDLE_VCC, this); - lp_var_t currentPdu2Vcc = - lp_var_t(sid.objectId, P60System::P60DOCK_CURRENT_PDU2_VCC, this); - lp_var_t currentAcuVbat = - lp_var_t(sid.objectId, P60System::P60DOCK_CURRENT_ACU_VBAT, this); - lp_var_t currentPdu1Vbat = - lp_var_t(sid.objectId, P60System::P60DOCK_CURRENT_PDU1_VBAT, this); - lp_var_t currentX3IdleVbat = - lp_var_t(sid.objectId, P60System::P60DOCK_CURRENT_X3_IDLE_VBAT, this); - lp_var_t currentPdu2Vbat = - lp_var_t(sid.objectId, P60System::P60DOCK_CURRENT_PDU2_VBAT, this); - lp_var_t currentStackVbat = - lp_var_t(sid.objectId, P60System::P60DOCK_CURRENT_STACK_VBAT, this); - lp_var_t currentStack3V3 = - lp_var_t(sid.objectId, P60System::P60DOCK_CURRENT_STACK_3V3, this); - lp_var_t currentStack5V = - lp_var_t(sid.objectId, P60System::P60DOCK_CURRENT_STACK_5V, this); - lp_var_t currentGS3V3 = - lp_var_t(sid.objectId, P60System::P60DOCK_CURRENT_GS3V3, this); - lp_var_t currentGS5V = - lp_var_t(sid.objectId, P60System::P60DOCK_CURRENT_GS5V, this); + lp_vec_t currents = + lp_vec_t(sid.objectId, P60System::pool::CURRENTS, + this); /** Measured output voltages */ - lp_var_t voltageAcuVcc = - lp_var_t(sid.objectId, P60System::P60DOCK_VOLTAGE_ACU_VCC, this); - lp_var_t voltagePdu1Vcc = - lp_var_t(sid.objectId, P60System::P60DOCK_VOLTAGE_PDU1_VCC, this); - lp_var_t voltageX3IdleVcc = - lp_var_t(sid.objectId, P60System::P60DOCK_VOLTAGE_X3_IDLE_VCC, this); - lp_var_t voltagePdu2Vcc = - lp_var_t(sid.objectId, P60System::P60DOCK_VOLTAGE_PDU2_VCC, this); - lp_var_t voltageAcuVbat = - lp_var_t(sid.objectId, P60System::P60DOCK_VOLTAGE_ACU_VBAT, this); - lp_var_t voltagePdu1Vbat = - lp_var_t(sid.objectId, P60System::P60DOCK_VOLTAGE_PDU1_VBAT, this); - lp_var_t voltageX3IdleVbat = - lp_var_t(sid.objectId, P60System::P60DOCK_VOLTAGE_X3_IDLE_VBAT, this); - lp_var_t voltagePdu2Vbat = - lp_var_t(sid.objectId, P60System::P60DOCK_VOLTAGE_PDU2_VBAT, this); - lp_var_t voltageStackVbat = - lp_var_t(sid.objectId, P60System::P60DOCK_VOLTAGE_STACK_VBAT, this); - lp_var_t voltageStack3V3 = - lp_var_t(sid.objectId, P60System::P60DOCK_VOLTAGE_STACK_3V3, this); - lp_var_t voltageStack5V = - lp_var_t(sid.objectId, P60System::P60DOCK_VOLTAGE_STACK_5V, this); - lp_var_t voltageGS3V3 = - lp_var_t(sid.objectId, P60System::P60DOCK_VOLTAGE_GS3V3, this); - lp_var_t voltageGS5V = - lp_var_t(sid.objectId, P60System::P60DOCK_VOLTAGE_GS5V, this); + lp_vec_t voltages = + lp_vec_t(sid.objectId, P60System::pool::VOLTAGES, + this); /** Output enable states */ - lp_var_t outputEnableStateAcuVcc = - lp_var_t(sid.objectId, P60System::P60DOCK_OUTPUTENABLE_ACU_VCC, this); - lp_var_t outputEnableStatePdu1Vcc = - lp_var_t(sid.objectId, P60System::P60DOCK_OUTPUTENABLE_PDU1_VCC, this); - lp_var_t outputEnableStateX3IdleVcc = - lp_var_t(sid.objectId, P60System::P60DOCK_OUTPUTENABLE_X3_IDLE_VCC, this); - lp_var_t outputEnableStatePdu2Vcc = - lp_var_t(sid.objectId, P60System::P60DOCK_OUTPUTENABLE_PDU2_VCC, this); - lp_var_t outputEnableStateAcuVbat = - lp_var_t(sid.objectId, P60System::P60DOCK_OUTPUTENABLE_ACU_VBAT, this); - lp_var_t outputEnableStatePdu1Vbat = - lp_var_t(sid.objectId, P60System::P60DOCK_OUTPUTENABLE_PDU1_VBAT, this); - lp_var_t outputEnableStateX3IdleVbat = - lp_var_t(sid.objectId, P60System::P60DOCK_OUTPUTENABLE_X3_IDLE_VBAT, this); - lp_var_t outputEnableStatePdu2Vbat = - lp_var_t(sid.objectId, P60System::P60DOCK_OUTPUTENABLE_PDU2_VBAT, this); - lp_var_t outputEnableStateStackVbat = - lp_var_t(sid.objectId, P60System::P60DOCK_OUTPUTENABLE_STACK_VBAT, this); - lp_var_t outputEnableStateStack3V3 = - lp_var_t(sid.objectId, P60System::P60DOCK_OUTPUTENABLE_STACK_3V3, this); - lp_var_t outputEnableStateStack5V = - lp_var_t(sid.objectId, P60System::P60DOCK_OUTPUTENABLE_STACK_5V, this); - lp_var_t outputEnableStateGS3V3 = - lp_var_t(sid.objectId, P60System::P60DOCK_OUTPUTENABLE_GS3V3, this); - lp_var_t outputEnableStateGS5V = - lp_var_t(sid.objectId, P60System::P60DOCK_OUTPUTENABLE_GS5V, this); + lp_vec_t outputEnables = + lp_vec_t(sid.objectId, P60System::pool::OUTPUT_ENABLE, + this); lp_var_t temperature1 = - lp_var_t(sid.objectId, P60System::P60DOCK_TEMPERATURE_1, this); + lp_var_t(sid.objectId, P60System::pool::P60DOCK_TEMPERATURE_1, this); lp_var_t temperature2 = - lp_var_t(sid.objectId, P60System::P60DOCK_TEMPERATURE_2, this); + lp_var_t(sid.objectId, P60System::pool::P60DOCK_TEMPERATURE_2, this); lp_var_t bootcause = - lp_var_t(sid.objectId, P60System::P60DOCK_BOOT_CAUSE, this); + lp_var_t(sid.objectId, P60System::pool::P60DOCK_BOOT_CAUSE, this); lp_var_t bootCount = - lp_var_t(sid.objectId, P60System::P60DOCK_BOOT_CNT, this); - lp_var_t uptime = lp_var_t(sid.objectId, P60System::P60DOCK_UPTIME, this); + lp_var_t(sid.objectId, P60System::pool::P60DOCK_BOOT_CNT, this); + lp_var_t uptime = + lp_var_t(sid.objectId, P60System::pool::P60DOCK_UPTIME, this); lp_var_t resetcause = - lp_var_t(sid.objectId, P60System::P60DOCK_RESETCAUSE, this); - lp_var_t battMode = lp_var_t(sid.objectId, P60System::P60DOCK_BATT_MODE, this); + lp_var_t(sid.objectId, P60System::pool::P60DOCK_RESETCAUSE, this); + lp_var_t battMode = + lp_var_t(sid.objectId, P60System::pool::P60DOCK_BATT_MODE, this); /** Battery heater control only possible on BP4 packs */ - lp_var_t heaterOn = lp_var_t(sid.objectId, P60System::P60DOCK_HEATER_ON, this); + lp_var_t heaterOn = + lp_var_t(sid.objectId, P60System::pool::P60DOCK_HEATER_ON, this); lp_var_t converter5VStatus = - lp_var_t(sid.objectId, P60System::P60DOCK_CONV_5V_ENABLE_STATUS, this); + lp_var_t(sid.objectId, P60System::pool::P60DOCK_CONV_5V_ENABLE_STATUS, this); /** Number of detected latchups on each output channel */ - lp_var_t latchupsAcuVcc = - lp_var_t(sid.objectId, P60System::P60DOCK_LATCHUP_ACU_VCC, this); - lp_var_t latchupsPdu1Vcc = - lp_var_t(sid.objectId, P60System::P60DOCK_LATCHUP_PDU1_VCC, this); - lp_var_t latchupsX3IdleVcc = - lp_var_t(sid.objectId, P60System::P60DOCK_LATCHUP_X3_IDLE_VCC, this); - lp_var_t latchupsPdu2Vcc = - lp_var_t(sid.objectId, P60System::P60DOCK_LATCHUP_PDU2_VCC, this); - lp_var_t latchupsAcuVbat = - lp_var_t(sid.objectId, P60System::P60DOCK_LATCHUP_ACU_VBAT, this); - lp_var_t latchupsPdu1Vbat = - lp_var_t(sid.objectId, P60System::P60DOCK_LATCHUP_PDU1_VBAT, this); - lp_var_t latchupsX3IdleVbat = - lp_var_t(sid.objectId, P60System::P60DOCK_LATCHUP_X3_IDLE_VBAT, this); - lp_var_t latchupsPdu2Vbat = - lp_var_t(sid.objectId, P60System::P60DOCK_LATCHUP_PDU2_VBAT, this); - lp_var_t latchupsStackVbat = - lp_var_t(sid.objectId, P60System::P60DOCK_LATCHUP_STACK_VBAT, this); - lp_var_t latchupsStack3V3 = - lp_var_t(sid.objectId, P60System::P60DOCK_LATCHUP_STACK_3V3, this); - lp_var_t latchupsStack5V = - lp_var_t(sid.objectId, P60System::P60DOCK_LATCHUP_STACK_5V, this); - lp_var_t latchupsGS3V3 = - lp_var_t(sid.objectId, P60System::P60DOCK_LATCHUP_GS3V3, this); - lp_var_t latchupsGS5V = - lp_var_t(sid.objectId, P60System::P60DOCK_LATCHUP_GS5V, this); + lp_vec_t latchups = + lp_vec_t(sid.objectId, P60System::pool::LATCHUPS, + this); lp_var_t dockVbatVoltageValue = - lp_var_t(sid.objectId, P60System::P60DOCK_VBAT_VALUE, this); + lp_var_t(sid.objectId, P60System::pool::P60DOCK_DOCK_VBAT, this); lp_var_t dockVccCurrent = - lp_var_t(sid.objectId, P60System::P60DOCK_VCC_CURRENT_VALUE, this); + lp_var_t(sid.objectId, P60System::pool::P60DOCK_DOCK_VCC_CURRENT, this); // Difference between charge and discharge current lp_var_t batteryCurrent = - lp_var_t(sid.objectId, P60System::P60DOCK_BATTERY_CURRENT, this); + lp_var_t(sid.objectId, P60System::pool::P60DOCK_BATTERY_CURRENT, this); lp_var_t batteryVoltage = - lp_var_t(sid.objectId, P60System::P60DOCK_BATTERY_VOLTAGE, this); + lp_var_t(sid.objectId, P60System::pool::P60DOCK_BATTERY_VOLTAGE, this); lp_var_t batteryTemperature1 = - lp_var_t(sid.objectId, P60System::P60DOCK_BATTERY_TEMPERATURE_1, this); + lp_var_t(sid.objectId, P60System::pool::P60DOCK_BATTERY_TEMPERATURE_1, this); lp_var_t batteryTemperature2 = - lp_var_t(sid.objectId, P60System::P60DOCK_BATTERY_TEMPERATURE_2, this); + lp_var_t(sid.objectId, P60System::pool::P60DOCK_BATTERY_TEMPERATURE_2, this); - lp_var_t device0 = lp_var_t(sid.objectId, P60System::P60DOCK_DEVICE_0, this); - lp_var_t device1 = lp_var_t(sid.objectId, P60System::P60DOCK_DEVICE_1, this); - lp_var_t device2 = lp_var_t(sid.objectId, P60System::P60DOCK_DEVICE_2, this); - lp_var_t device3 = lp_var_t(sid.objectId, P60System::P60DOCK_DEVICE_3, this); - lp_var_t device4 = lp_var_t(sid.objectId, P60System::P60DOCK_DEVICE_4, this); - lp_var_t device5 = lp_var_t(sid.objectId, P60System::P60DOCK_DEVICE_5, this); - lp_var_t device6 = lp_var_t(sid.objectId, P60System::P60DOCK_DEVICE_6, this); - lp_var_t device7 = lp_var_t(sid.objectId, P60System::P60DOCK_DEVICE_7, this); - - lp_var_t device0Status = - lp_var_t(sid.objectId, P60System::P60DOCK_DEVICE_0_STATUS, this); - lp_var_t device1Status = - lp_var_t(sid.objectId, P60System::P60DOCK_DEVICE_1_STATUS, this); - lp_var_t device2Status = - lp_var_t(sid.objectId, P60System::P60DOCK_DEVICE_2_STATUS, this); - lp_var_t device3Status = - lp_var_t(sid.objectId, P60System::P60DOCK_DEVICE_3_STATUS, this); - lp_var_t device4Status = - lp_var_t(sid.objectId, P60System::P60DOCK_DEVICE_4_STATUS, this); - lp_var_t device5Status = - lp_var_t(sid.objectId, P60System::P60DOCK_DEVICE_5_STATUS, this); - lp_var_t device6Status = - lp_var_t(sid.objectId, P60System::P60DOCK_DEVICE_6_STATUS, this); - lp_var_t device7Status = - lp_var_t(sid.objectId, P60System::P60DOCK_DEVICE_7_STATUS, this); + lp_vec_t devicesType = + lp_vec_t(sid.objectId, P60System::pool::DEVICES_TYPE, this); + lp_vec_t devicesStatus = + lp_vec_t(sid.objectId, P60System::pool::DEVICES_STATUS, this); lp_var_t dearmStatus = - lp_var_t(sid.objectId, P60System::P60DOCK_DEARM_STATUS, this); + lp_var_t(sid.objectId, P60System::pool::P60DOCK_DEARM_STATUS, this); /** Number of reboots due to gnd, i2c, csp watchdog timeout */ lp_var_t wdtCntGnd = - lp_var_t(sid.objectId, P60System::P60DOCK_WDT_CNT_GND, this); + lp_var_t(sid.objectId, P60System::pool::P60DOCK_WDT_CNT_GND, this); lp_var_t wdtCntI2c = - lp_var_t(sid.objectId, P60System::P60DOCK_WDT_CNT_I2C, this); + lp_var_t(sid.objectId, P60System::pool::P60DOCK_WDT_CNT_I2C, this); lp_var_t wdtCntCan = - lp_var_t(sid.objectId, P60System::P60DOCK_WDT_CNT_CAN, this); + lp_var_t(sid.objectId, P60System::pool::P60DOCK_WDT_CNT_CAN, this); lp_var_t wdtCntCsp1 = - lp_var_t(sid.objectId, P60System::P60DOCK_WDT_CNT_CSP_1, this); + lp_var_t(sid.objectId, P60System::pool::P60DOCK_WDT_CNT_CSP_1, this); lp_var_t wdtCntCsp2 = - lp_var_t(sid.objectId, P60System::P60DOCK_WDT_CNT_CSP_2, this); + lp_var_t(sid.objectId, P60System::pool::P60DOCK_WDT_CNT_CSP_2, this); lp_var_t wdtGndLeft = - lp_var_t(sid.objectId, P60System::P60DOCK_WDT_GND_LEFT, this); + lp_var_t(sid.objectId, P60System::pool::P60DOCK_WDT_GND_LEFT, this); lp_var_t wdtI2cLeft = - lp_var_t(sid.objectId, P60System::P60DOCK_WDT_I2C_LEFT, this); + lp_var_t(sid.objectId, P60System::pool::P60DOCK_WDT_I2C_LEFT, this); lp_var_t wdtCanLeft = - lp_var_t(sid.objectId, P60System::P60DOCK_WDT_CAN_LEFT, this); + lp_var_t(sid.objectId, P60System::pool::P60DOCK_WDT_CAN_LEFT, this); lp_var_t wdtCspLeft1 = - lp_var_t(sid.objectId, P60System::P60DOCK_WDT_CSP_LEFT_1, this); + lp_var_t(sid.objectId, P60System::pool::P60DOCK_WDT_CSP_LEFT_1, this); lp_var_t wdtCspLeft2 = - lp_var_t(sid.objectId, P60System::P60DOCK_WDT_CSP_LEFT_2, this); + lp_var_t(sid.objectId, P60System::pool::P60DOCK_WDT_CSP_LEFT_2, this); lp_var_t batteryChargeCurrent = - lp_var_t(sid.objectId, P60System::P60DOCK_BATT_CHARGE_CURRENT, this); + lp_var_t(sid.objectId, P60System::pool::P60DOCK_BATT_CHARGE_CURRENT, this); lp_var_t batteryDischargeCurrent = - lp_var_t(sid.objectId, P60System::P60DOCK_BATT_DISCHARGE_CURRENT, this); - lp_var_t ant6Depl = lp_var_t(sid.objectId, P60System::P60DOCK_ANT6_DEPL, this); - lp_var_t ar6Depl = lp_var_t(sid.objectId, P60System::P60DOCK_AR6_DEPL, this); + lp_var_t(sid.objectId, P60System::pool::P60DOCK_BATT_DISCHARGE_CURRENT, this); + lp_var_t ant6Depl = + lp_var_t(sid.objectId, P60System::pool::P60DOCK_ANT6_DEPL, this); + lp_var_t ar6Depl = + lp_var_t(sid.objectId, P60System::pool::P60DOCK_AR6_DEPL, this); }; } // namespace P60Dock @@ -666,163 +524,166 @@ class PDU1HkTableDataset : public StaticLocalDataSet { /** Measured output currents */ lp_var_t currentOutTCSBoard3V3 = - lp_var_t(sid.objectId, P60System::PDU1_CURRENT_OUT_TCS_BOARD_3V3, this); + lp_var_t(sid.objectId, P60System::pool::PDU1_CURRENT_OUT_TCS_BOARD_3V3, this); lp_var_t currentOutSyrlinks = - lp_var_t(sid.objectId, P60System::PDU1_CURRENT_OUT_SYRLINKS, this); + lp_var_t(sid.objectId, P60System::pool::PDU1_CURRENT_OUT_SYRLINKS, this); lp_var_t currentOutStarTracker = - lp_var_t(sid.objectId, P60System::PDU1_CURRENT_OUT_STAR_TRACKER, this); + lp_var_t(sid.objectId, P60System::pool::PDU1_CURRENT_OUT_STAR_TRACKER, this); lp_var_t currentOutMGT = - lp_var_t(sid.objectId, P60System::PDU1_CURRENT_OUT_MGT, this); + lp_var_t(sid.objectId, P60System::pool::PDU1_CURRENT_OUT_MGT, this); lp_var_t currentOutSUSNominal = - lp_var_t(sid.objectId, P60System::PDU1_CURRENT_OUT_SUS_NOMINAL, this); + lp_var_t(sid.objectId, P60System::pool::PDU1_CURRENT_OUT_SUS_NOMINAL, this); lp_var_t currentOutSolarCellExp = - lp_var_t(sid.objectId, P60System::PDU1_CURRENT_OUT_SOLAR_CELL_EXP, this); + lp_var_t(sid.objectId, P60System::pool::PDU1_CURRENT_OUT_SOLAR_CELL_EXP, this); lp_var_t currentOutPLOC = - lp_var_t(sid.objectId, P60System::PDU1_CURRENT_OUT_PLOC, this); + lp_var_t(sid.objectId, P60System::pool::PDU1_CURRENT_OUT_PLOC, this); lp_var_t currentOutACSBoardSideA = - lp_var_t(sid.objectId, P60System::PDU1_CURRENT_OUT_ACS_BOARD_SIDE_A, this); + lp_var_t(sid.objectId, P60System::pool::PDU1_CURRENT_OUT_ACS_BOARD_SIDE_A, this); lp_var_t currentOutChannel8 = - lp_var_t(sid.objectId, P60System::PDU1_CURRENT_OUT_CHANNEL8, this); + lp_var_t(sid.objectId, P60System::pool::PDU1_CURRENT_OUT_CHANNEL8, this); /** Measured voltage of output channels */ lp_var_t voltageOutTCSBoard3V3 = - lp_var_t(sid.objectId, P60System::PDU1_VOLTAGE_OUT_TCS_BOARD_3V3, this); + lp_var_t(sid.objectId, P60System::pool::PDU1_VOLTAGE_OUT_TCS_BOARD_3V3, this); lp_var_t voltageOutSyrlinks = - lp_var_t(sid.objectId, P60System::PDU1_VOLTAGE_OUT_SYRLINKS, this); + lp_var_t(sid.objectId, P60System::pool::PDU1_VOLTAGE_OUT_SYRLINKS, this); lp_var_t voltageOutStarTracker = - lp_var_t(sid.objectId, P60System::PDU1_VOLTAGE_OUT_STAR_TRACKER, this); + lp_var_t(sid.objectId, P60System::pool::PDU1_VOLTAGE_OUT_STAR_TRACKER, this); lp_var_t voltageOutMGT = - lp_var_t(sid.objectId, P60System::PDU1_VOLTAGE_OUT_MGT, this); + lp_var_t(sid.objectId, P60System::pool::PDU1_VOLTAGE_OUT_MGT, this); lp_var_t voltageOutSUSNominal = - lp_var_t(sid.objectId, P60System::PDU1_VOLTAGE_OUT_SUS_NOMINAL, this); + lp_var_t(sid.objectId, P60System::pool::PDU1_VOLTAGE_OUT_SUS_NOMINAL, this); lp_var_t voltageOutSolarCellExp = - lp_var_t(sid.objectId, P60System::PDU1_VOLTAGE_OUT_SOLAR_CELL_EXP, this); + lp_var_t(sid.objectId, P60System::pool::PDU1_VOLTAGE_OUT_SOLAR_CELL_EXP, this); lp_var_t voltageOutPLOC = - lp_var_t(sid.objectId, P60System::PDU1_VOLTAGE_OUT_PLOC, this); + lp_var_t(sid.objectId, P60System::pool::PDU1_VOLTAGE_OUT_PLOC, this); lp_var_t voltageOutACSBoardSideA = - lp_var_t(sid.objectId, P60System::PDU1_VOLTAGE_OUT_ACS_BOARD_SIDE_A, this); + lp_var_t(sid.objectId, P60System::pool::PDU1_VOLTAGE_OUT_ACS_BOARD_SIDE_A, this); lp_var_t voltageOutChannel8 = - lp_var_t(sid.objectId, P60System::PDU1_VOLTAGE_OUT_CHANNEL8, this); + lp_var_t(sid.objectId, P60System::pool::PDU1_VOLTAGE_OUT_CHANNEL8, this); /** Measured VCC */ - lp_var_t vcc = lp_var_t(sid.objectId, P60System::PDU1_VCC, this); + lp_var_t vcc = lp_var_t(sid.objectId, P60System::pool::PDU1_VCC, this); /** Measured VBAT */ - lp_var_t vbat = lp_var_t(sid.objectId, P60System::PDU1_VBAT, this); + lp_var_t vbat = lp_var_t(sid.objectId, P60System::pool::PDU1_VBAT, this); lp_var_t temperature = - lp_var_t(sid.objectId, P60System::PDU1_TEMPERATURE, this); + lp_var_t(sid.objectId, P60System::pool::PDU1_TEMPERATURE, this); /** Output converter enable status */ lp_var_t converterEnable1 = - lp_var_t(sid.objectId, P60System::PDU1_CONV_EN_1, this); + lp_var_t(sid.objectId, P60System::pool::PDU1_CONV_EN_1, this); lp_var_t converterEnable2 = - lp_var_t(sid.objectId, P60System::PDU1_CONV_EN_2, this); + lp_var_t(sid.objectId, P60System::pool::PDU1_CONV_EN_2, this); lp_var_t converterEnable3 = - lp_var_t(sid.objectId, P60System::PDU1_CONV_EN_3, this); + lp_var_t(sid.objectId, P60System::pool::PDU1_CONV_EN_3, this); /** Output channels enable status */ lp_var_t outEnabledTCSBoard3V3 = - lp_var_t(sid.objectId, P60System::PDU1_OUT_EN_TCS_BOARD_3V3, this); + lp_var_t(sid.objectId, P60System::pool::PDU1_OUT_EN_TCS_BOARD_3V3, this); lp_var_t outEnabledSyrlinks = - lp_var_t(sid.objectId, P60System::PDU1_OUT_EN_SYRLINKS, this); + lp_var_t(sid.objectId, P60System::pool::PDU1_OUT_EN_SYRLINKS, this); lp_var_t outEnabledStarTracker = - lp_var_t(sid.objectId, P60System::PDU1_OUT_EN_STAR_TRACKER, this); + lp_var_t(sid.objectId, P60System::pool::PDU1_OUT_EN_STAR_TRACKER, this); lp_var_t outEnabledMGT = - lp_var_t(sid.objectId, P60System::PDU1_OUT_EN_MGT, this); + lp_var_t(sid.objectId, P60System::pool::PDU1_OUT_EN_MGT, this); lp_var_t outEnabledSUSNominal = - lp_var_t(sid.objectId, P60System::PDU1_OUT_EN_SUS_NOMINAL, this); + lp_var_t(sid.objectId, P60System::pool::PDU1_OUT_EN_SUS_NOMINAL, this); lp_var_t outEnabledSolarCellExp = - lp_var_t(sid.objectId, P60System::PDU1_OUT_EN_SOLAR_CELL_EXP, this); + lp_var_t(sid.objectId, P60System::pool::PDU1_OUT_EN_SOLAR_CELL_EXP, this); lp_var_t outEnabledPLOC = - lp_var_t(sid.objectId, P60System::PDU1_OUT_EN_PLOC, this); + lp_var_t(sid.objectId, P60System::pool::PDU1_OUT_EN_PLOC, this); lp_var_t outEnabledAcsBoardSideA = - lp_var_t(sid.objectId, P60System::PDU1_OUT_EN_ACS_BOARD_SIDE_A, this); + lp_var_t(sid.objectId, P60System::pool::PDU1_OUT_EN_ACS_BOARD_SIDE_A, this); lp_var_t outEnabledChannel8 = - lp_var_t(sid.objectId, P60System::PDU1_OUT_EN_CHANNEL8, this); - lp_var_t bootcause = lp_var_t(sid.objectId, P60System::PDU1_BOOTCAUSE, this); + lp_var_t(sid.objectId, P60System::pool::PDU1_OUT_EN_CHANNEL8, this); + lp_var_t bootcause = + lp_var_t(sid.objectId, P60System::pool::PDU1_BOOTCAUSE, this); /** Number of reboots */ - lp_var_t bootcount = lp_var_t(sid.objectId, P60System::PDU1_BOOTCNT, this); + lp_var_t bootcount = + lp_var_t(sid.objectId, P60System::pool::PDU1_BOOTCNT, this); /** Uptime in seconds */ - lp_var_t uptime = lp_var_t(sid.objectId, P60System::PDU1_UPTIME, this); + lp_var_t uptime = lp_var_t(sid.objectId, P60System::pool::PDU1_UPTIME, this); lp_var_t resetcause = - lp_var_t(sid.objectId, P60System::PDU1_RESETCAUSE, this); + lp_var_t(sid.objectId, P60System::pool::PDU1_RESETCAUSE, this); /** Battery mode: 1 = Critical, 2 = Safe, 3 = Normal, 4 = Full */ - lp_var_t battMode = lp_var_t(sid.objectId, P60System::PDU1_BATT_MODE, this); + lp_var_t battMode = + lp_var_t(sid.objectId, P60System::pool::PDU1_BATT_MODE, this); /** Number of detected latchups on each output channel */ lp_var_t latchupsTcsBoard3V3 = - lp_var_t(sid.objectId, P60System::PDU1_LATCHUP_TCS_BOARD_3V3, this); + lp_var_t(sid.objectId, P60System::pool::PDU1_LATCHUP_TCS_BOARD_3V3, this); lp_var_t latchupsSyrlinks = - lp_var_t(sid.objectId, P60System::PDU1_LATCHUP_SYRLINKS, this); + lp_var_t(sid.objectId, P60System::pool::PDU1_LATCHUP_SYRLINKS, this); lp_var_t latchupsStarTracker = - lp_var_t(sid.objectId, P60System::PDU1_LATCHUP_STAR_TRACKER, this); + lp_var_t(sid.objectId, P60System::pool::PDU1_LATCHUP_STAR_TRACKER, this); lp_var_t latchupsMgt = - lp_var_t(sid.objectId, P60System::PDU1_LATCHUP_MGT, this); + lp_var_t(sid.objectId, P60System::pool::PDU1_LATCHUP_MGT, this); lp_var_t latchupsSusNominal = - lp_var_t(sid.objectId, P60System::PDU1_LATCHUP_SUS_NOMINAL, this); + lp_var_t(sid.objectId, P60System::pool::PDU1_LATCHUP_SUS_NOMINAL, this); lp_var_t latchupsSolarCellExp = - lp_var_t(sid.objectId, P60System::PDU1_LATCHUP_SOLAR_CELL_EXP, this); + lp_var_t(sid.objectId, P60System::pool::PDU1_LATCHUP_SOLAR_CELL_EXP, this); lp_var_t latchupsPloc = - lp_var_t(sid.objectId, P60System::PDU1_LATCHUP_PLOC, this); + lp_var_t(sid.objectId, P60System::pool::PDU1_LATCHUP_PLOC, this); lp_var_t latchupsAcsBoardSideA = - lp_var_t(sid.objectId, P60System::PDU1_LATCHUP_ACS_BOARD_SIDE_A, this); + lp_var_t(sid.objectId, P60System::pool::PDU1_LATCHUP_ACS_BOARD_SIDE_A, this); lp_var_t latchupsChannel8 = - lp_var_t(sid.objectId, P60System::PDU1_LATCHUP_CHANNEL8, this); + lp_var_t(sid.objectId, P60System::pool::PDU1_LATCHUP_CHANNEL8, this); /** * There are 8 devices on the PDU. FRAM, ADCs, temperature sensor etc. Each device is * identified by an ID. Refer also to gs-man-nanopower-p60-pdu-200-1.pdf on pages 17 and 18. */ - lp_var_t device0 = lp_var_t(sid.objectId, P60System::PDU1_DEVICE_0, this); - lp_var_t device1 = lp_var_t(sid.objectId, P60System::PDU1_DEVICE_1, this); - lp_var_t device2 = lp_var_t(sid.objectId, P60System::PDU1_DEVICE_2, this); - lp_var_t device3 = lp_var_t(sid.objectId, P60System::PDU1_DEVICE_3, this); - lp_var_t device4 = lp_var_t(sid.objectId, P60System::PDU1_DEVICE_4, this); - lp_var_t device5 = lp_var_t(sid.objectId, P60System::PDU1_DEVICE_5, this); - lp_var_t device6 = lp_var_t(sid.objectId, P60System::PDU1_DEVICE_6, this); - lp_var_t device7 = lp_var_t(sid.objectId, P60System::PDU1_DEVICE_7, this); + lp_var_t device0 = lp_var_t(sid.objectId, P60System::pool::PDU1_DEVICE_0, this); + lp_var_t device1 = lp_var_t(sid.objectId, P60System::pool::PDU1_DEVICE_1, this); + lp_var_t device2 = lp_var_t(sid.objectId, P60System::pool::PDU1_DEVICE_2, this); + lp_var_t device3 = lp_var_t(sid.objectId, P60System::pool::PDU1_DEVICE_3, this); + lp_var_t device4 = lp_var_t(sid.objectId, P60System::pool::PDU1_DEVICE_4, this); + lp_var_t device5 = lp_var_t(sid.objectId, P60System::pool::PDU1_DEVICE_5, this); + lp_var_t device6 = lp_var_t(sid.objectId, P60System::pool::PDU1_DEVICE_6, this); + lp_var_t device7 = lp_var_t(sid.objectId, P60System::pool::PDU1_DEVICE_7, this); /** The status of each device. 0 = None, 1 = Ok, 2 = Error, 3 = Not found */ lp_var_t device0Status = - lp_var_t(sid.objectId, P60System::PDU1_DEVICE_0_STATUS, this); + lp_var_t(sid.objectId, P60System::pool::PDU1_DEVICE_0_STATUS, this); lp_var_t device1Status = - lp_var_t(sid.objectId, P60System::PDU1_DEVICE_1_STATUS, this); + lp_var_t(sid.objectId, P60System::pool::PDU1_DEVICE_1_STATUS, this); lp_var_t device2Status = - lp_var_t(sid.objectId, P60System::PDU1_DEVICE_2_STATUS, this); + lp_var_t(sid.objectId, P60System::pool::PDU1_DEVICE_2_STATUS, this); lp_var_t device3Status = - lp_var_t(sid.objectId, P60System::PDU1_DEVICE_3_STATUS, this); + lp_var_t(sid.objectId, P60System::pool::PDU1_DEVICE_3_STATUS, this); lp_var_t device4Status = - lp_var_t(sid.objectId, P60System::PDU1_DEVICE_4_STATUS, this); + lp_var_t(sid.objectId, P60System::pool::PDU1_DEVICE_4_STATUS, this); lp_var_t device5Status = - lp_var_t(sid.objectId, P60System::PDU1_DEVICE_5_STATUS, this); + lp_var_t(sid.objectId, P60System::pool::PDU1_DEVICE_5_STATUS, this); lp_var_t device6Status = - lp_var_t(sid.objectId, P60System::PDU1_DEVICE_6_STATUS, this); + lp_var_t(sid.objectId, P60System::pool::PDU1_DEVICE_6_STATUS, this); lp_var_t device7Status = - lp_var_t(sid.objectId, P60System::PDU1_DEVICE_7_STATUS, this); + lp_var_t(sid.objectId, P60System::pool::PDU1_DEVICE_7_STATUS, this); /** Number of reboots triggered by the ground watchdog */ lp_var_t gndWdtReboots = - lp_var_t(sid.objectId, P60System::PDU1_WDT_CNT_GND, this); + lp_var_t(sid.objectId, P60System::pool::PDU1_WDT_CNT_GND, this); /** Number of reboots triggered through the I2C watchdog. Not relevant for EIVE. */ lp_var_t i2cWdtReboots = - lp_var_t(sid.objectId, P60System::PDU1_WDT_CNT_I2C, this); + lp_var_t(sid.objectId, P60System::pool::PDU1_WDT_CNT_I2C, this); /** Number of reboots triggered through the CAN watchdog */ lp_var_t canWdtReboots = - lp_var_t(sid.objectId, P60System::PDU1_WDT_CNT_CAN, this); + lp_var_t(sid.objectId, P60System::pool::PDU1_WDT_CNT_CAN, this); /** Number of reboots triggered through the CSP watchdog */ lp_var_t csp1WdtReboots = - lp_var_t(sid.objectId, P60System::PDU1_WDT_CNT_CSP1, this); + lp_var_t(sid.objectId, P60System::pool::PDU1_WDT_CNT_CSP1, this); lp_var_t csp2WdtReboots = - lp_var_t(sid.objectId, P60System::PDU1_WDT_CNT_CSP2, this); + lp_var_t(sid.objectId, P60System::pool::PDU1_WDT_CNT_CSP2, this); /** Ground watchdog remaining seconds before rebooting */ lp_var_t groundWatchdogSecondsLeft = - lp_var_t(sid.objectId, P60System::PDU1_WDT_GND_LEFT, this); + lp_var_t(sid.objectId, P60System::pool::PDU1_WDT_GND_LEFT, this); /** I2C watchdog remaining seconds before rebooting. Not relevant for EIVE. */ lp_var_t i2cWatchdogSecondsLeft = - lp_var_t(sid.objectId, P60System::PDU1_WDT_I2C_LEFT, this); + lp_var_t(sid.objectId, P60System::pool::PDU1_WDT_I2C_LEFT, this); /** CAN watchdog remaining seconds before rebooting. */ lp_var_t canWatchdogSecondsLeft = - lp_var_t(sid.objectId, P60System::PDU1_WDT_CAN_LEFT, this); + lp_var_t(sid.objectId, P60System::pool::PDU1_WDT_CAN_LEFT, this); /** CSP watchdogs remaining pings before rebooting. */ lp_var_t csp2WatchdogPingsLeft = - lp_var_t(sid.objectId, P60System::PDU1_WDT_CSP_LEFT1, this); + lp_var_t(sid.objectId, P60System::pool::PDU1_WDT_CSP_LEFT1, this); lp_var_t csp1WatchdogPingsLeft = - lp_var_t(sid.objectId, P60System::PDU1_WDT_CSP_LEFT2, this); + lp_var_t(sid.objectId, P60System::pool::PDU1_WDT_CSP_LEFT2, this); }; } // namespace PDU1 @@ -867,163 +728,166 @@ class PDU2HkTableDataset : public StaticLocalDataSet { /** Measured output currents */ lp_var_t currentOutQ7S = - lp_var_t(sid.objectId, P60System::PDU2_CURRENT_OUT_Q7S, this); + lp_var_t(sid.objectId, P60System::pool::PDU2_CURRENT_OUT_Q7S, this); lp_var_t currentOutPayloadPCDUCh1 = - lp_var_t(sid.objectId, P60System::PDU2_CURRENT_OUT_PAYLOAD_PCDU_CH1, this); + lp_var_t(sid.objectId, P60System::pool::PDU2_CURRENT_OUT_PAYLOAD_PCDU_CH1, this); lp_var_t currentOutReactionWheels = - lp_var_t(sid.objectId, P60System::PDU2_CURRENT_OUT_RW, this); + lp_var_t(sid.objectId, P60System::pool::PDU2_CURRENT_OUT_RW, this); lp_var_t currentOutTCSBoardHeaterIn = - lp_var_t(sid.objectId, P60System::PDU2_CURRENT_OUT_TCS_BOARD_HEATER_IN, this); + lp_var_t(sid.objectId, P60System::pool::PDU2_CURRENT_OUT_TCS_BOARD_HEATER_IN, this); lp_var_t currentOutSUSRedundant = - lp_var_t(sid.objectId, P60System::PDU2_CURRENT_OUT_SUS_REDUNDANT, this); + lp_var_t(sid.objectId, P60System::pool::PDU2_CURRENT_OUT_SUS_REDUNDANT, this); lp_var_t currentOutDeplMechanism = - lp_var_t(sid.objectId, P60System::PDU2_CURRENT_OUT_DEPLOYMENT_MECHANISM, this); + lp_var_t(sid.objectId, P60System::pool::PDU2_CURRENT_OUT_DEPLOYMENT_MECHANISM, this); lp_var_t currentOutPayloadPCDUCh6 = - lp_var_t(sid.objectId, P60System::PDU2_CURRENT_OUT_PAYLOAD_PCDU_CH6, this); + lp_var_t(sid.objectId, P60System::pool::PDU2_CURRENT_OUT_PAYLOAD_PCDU_CH6, this); lp_var_t currentOutACSBoardSideB = - lp_var_t(sid.objectId, P60System::PDU2_CURRENT_OUT_ACS_BOARD_SIDE_B, this); + lp_var_t(sid.objectId, P60System::pool::PDU2_CURRENT_OUT_ACS_BOARD_SIDE_B, this); lp_var_t currentOutPayloadCamera = - lp_var_t(sid.objectId, P60System::PDU2_CURRENT_OUT_PAYLOAD_CAMERA, this); + lp_var_t(sid.objectId, P60System::pool::PDU2_CURRENT_OUT_PAYLOAD_CAMERA, this); /** Measured voltage of output channels */ lp_var_t voltageOutQ7S = - lp_var_t(sid.objectId, P60System::PDU2_VOLTAGE_OUT_Q7S, this); + lp_var_t(sid.objectId, P60System::pool::PDU2_VOLTAGE_OUT_Q7S, this); lp_var_t voltageOutPayloadPCDUCh1 = - lp_var_t(sid.objectId, P60System::PDU2_VOLTAGE_OUT_PAYLOAD_PCDU_CH1, this); + lp_var_t(sid.objectId, P60System::pool::PDU2_VOLTAGE_OUT_PAYLOAD_PCDU_CH1, this); lp_var_t voltageOutReactionWheels = - lp_var_t(sid.objectId, P60System::PDU2_VOLTAGE_OUT_RW, this); + lp_var_t(sid.objectId, P60System::pool::PDU2_VOLTAGE_OUT_RW, this); lp_var_t voltageOutTCSBoardHeaterIn = - lp_var_t(sid.objectId, P60System::PDU2_VOLTAGE_OUT_TCS_BOARD_HEATER_IN, this); + lp_var_t(sid.objectId, P60System::pool::PDU2_VOLTAGE_OUT_TCS_BOARD_HEATER_IN, this); lp_var_t voltageOutSUSRedundant = - lp_var_t(sid.objectId, P60System::PDU2_VOLTAGE_OUT_SUS_REDUNDANT, this); + lp_var_t(sid.objectId, P60System::pool::PDU2_VOLTAGE_OUT_SUS_REDUNDANT, this); lp_var_t voltageOutDeplMechanism = - lp_var_t(sid.objectId, P60System::PDU2_VOLTAGE_OUT_DEPLOYMENT_MECHANISM, this); + lp_var_t(sid.objectId, P60System::pool::PDU2_VOLTAGE_OUT_DEPLOYMENT_MECHANISM, this); lp_var_t voltageOutPayloadPCDUCh6 = - lp_var_t(sid.objectId, P60System::PDU2_VOLTAGE_OUT_PAYLOAD_PCDU_CH6, this); + lp_var_t(sid.objectId, P60System::pool::PDU2_VOLTAGE_OUT_PAYLOAD_PCDU_CH6, this); lp_var_t voltageOutACSBoardSideB = - lp_var_t(sid.objectId, P60System::PDU2_VOLTAGE_OUT_ACS_BOARD_SIDE_B, this); + lp_var_t(sid.objectId, P60System::pool::PDU2_VOLTAGE_OUT_ACS_BOARD_SIDE_B, this); lp_var_t voltageOutPayloadCamera = - lp_var_t(sid.objectId, P60System::PDU2_VOLTAGE_OUT_PAYLOAD_CAMERA, this); + lp_var_t(sid.objectId, P60System::pool::PDU2_VOLTAGE_OUT_PAYLOAD_CAMERA, this); /** Measured VCC */ - lp_var_t vcc = lp_var_t(sid.objectId, P60System::PDU2_VCC, this); + lp_var_t vcc = lp_var_t(sid.objectId, P60System::pool::PDU2_VCC, this); /** Measured VBAT */ - lp_var_t vbat = lp_var_t(sid.objectId, P60System::PDU2_VBAT, this); + lp_var_t vbat = lp_var_t(sid.objectId, P60System::pool::PDU2_VBAT, this); lp_var_t temperature = - lp_var_t(sid.objectId, P60System::PDU2_TEMPERATURE, this); + lp_var_t(sid.objectId, P60System::pool::PDU2_TEMPERATURE, this); /** Output converter enable status */ lp_var_t converterEnable1 = - lp_var_t(sid.objectId, P60System::PDU2_CONV_EN_1, this); + lp_var_t(sid.objectId, P60System::pool::PDU2_CONV_EN_1, this); lp_var_t converterEnable2 = - lp_var_t(sid.objectId, P60System::PDU2_CONV_EN_2, this); + lp_var_t(sid.objectId, P60System::pool::PDU2_CONV_EN_2, this); lp_var_t converterEnable3 = - lp_var_t(sid.objectId, P60System::PDU2_CONV_EN_3, this); + lp_var_t(sid.objectId, P60System::pool::PDU2_CONV_EN_3, this); /** Output channels enable status */ lp_var_t outEnabledQ7S = - lp_var_t(sid.objectId, P60System::PDU2_OUT_EN_Q7S, this); + lp_var_t(sid.objectId, P60System::pool::PDU2_OUT_EN_Q7S, this); lp_var_t outEnabledPlPCDUCh1 = - lp_var_t(sid.objectId, P60System::PDU2_OUT_EN_PAYLOAD_PCDU_CH1, this); + lp_var_t(sid.objectId, P60System::pool::PDU2_OUT_EN_PAYLOAD_PCDU_CH1, this); lp_var_t outEnabledReactionWheels = - lp_var_t(sid.objectId, P60System::PDU2_OUT_EN_RW, this); + lp_var_t(sid.objectId, P60System::pool::PDU2_OUT_EN_RW, this); lp_var_t outEnabledTCSBoardHeaterIn = - lp_var_t(sid.objectId, P60System::PDU2_OUT_EN_TCS_BOARD_HEATER_IN, this); + lp_var_t(sid.objectId, P60System::pool::PDU2_OUT_EN_TCS_BOARD_HEATER_IN, this); lp_var_t outEnabledSUSRedundant = - lp_var_t(sid.objectId, P60System::PDU2_OUT_EN_SUS_REDUNDANT, this); + lp_var_t(sid.objectId, P60System::pool::PDU2_OUT_EN_SUS_REDUNDANT, this); lp_var_t outEnabledDeplMechanism = - lp_var_t(sid.objectId, P60System::PDU2_OUT_EN_DEPLOYMENT_MECHANISM, this); + lp_var_t(sid.objectId, P60System::pool::PDU2_OUT_EN_DEPLOYMENT_MECHANISM, this); lp_var_t outEnabledPlPCDUCh6 = - lp_var_t(sid.objectId, P60System::PDU2_OUT_EN_PAYLOAD_PCDU_CH6, this); + lp_var_t(sid.objectId, P60System::pool::PDU2_OUT_EN_PAYLOAD_PCDU_CH6, this); lp_var_t outEnabledAcsBoardSideB = - lp_var_t(sid.objectId, P60System::PDU2_OUT_EN_ACS_BOARD_SIDE_B, this); + lp_var_t(sid.objectId, P60System::pool::PDU2_OUT_EN_ACS_BOARD_SIDE_B, this); lp_var_t outEnabledPayloadCamera = - lp_var_t(sid.objectId, P60System::PDU2_OUT_EN_PAYLOAD_CAMERA, this); + lp_var_t(sid.objectId, P60System::pool::PDU2_OUT_EN_PAYLOAD_CAMERA, this); - lp_var_t bootcause = lp_var_t(sid.objectId, P60System::PDU2_BOOTCAUSE, this); + lp_var_t bootcause = + lp_var_t(sid.objectId, P60System::pool::PDU2_BOOTCAUSE, this); /** Number of reboots */ - lp_var_t bootcount = lp_var_t(sid.objectId, P60System::PDU2_BOOTCNT, this); + lp_var_t bootcount = + lp_var_t(sid.objectId, P60System::pool::PDU2_BOOTCNT, this); /** Uptime in seconds */ - lp_var_t uptime = lp_var_t(sid.objectId, P60System::PDU2_UPTIME, this); + lp_var_t uptime = lp_var_t(sid.objectId, P60System::pool::PDU2_UPTIME, this); lp_var_t resetcause = - lp_var_t(sid.objectId, P60System::PDU2_RESETCAUSE, this); + lp_var_t(sid.objectId, P60System::pool::PDU2_RESETCAUSE, this); /** Battery mode: 1 = Critical, 2 = Safe, 3 = Normal, 4 = Full */ - lp_var_t battMode = lp_var_t(sid.objectId, P60System::PDU2_BATT_MODE, this); + lp_var_t battMode = + lp_var_t(sid.objectId, P60System::pool::PDU2_BATT_MODE, this); /** Number of detected latchups on each output channel */ lp_var_t latchupsQ7S = - lp_var_t(sid.objectId, P60System::PDU2_LATCHUP_Q7S, this); + lp_var_t(sid.objectId, P60System::pool::PDU2_LATCHUP_Q7S, this); lp_var_t latchupsPayloadPcduCh1 = - lp_var_t(sid.objectId, P60System::PDU2_LATCHUP_PAYLOAD_PCDU_CH1, this); + lp_var_t(sid.objectId, P60System::pool::PDU2_LATCHUP_PAYLOAD_PCDU_CH1, this); lp_var_t latchupsRw = - lp_var_t(sid.objectId, P60System::PDU2_LATCHUP_RW, this); + lp_var_t(sid.objectId, P60System::pool::PDU2_LATCHUP_RW, this); lp_var_t latchupsTcsBoardHeaterIn = - lp_var_t(sid.objectId, P60System::PDU2_LATCHUP_TCS_BOARD_HEATER_IN, this); + lp_var_t(sid.objectId, P60System::pool::PDU2_LATCHUP_TCS_BOARD_HEATER_IN, this); lp_var_t latchupsSusRedundant = - lp_var_t(sid.objectId, P60System::PDU2_LATCHUP_SUS_REDUNDANT, this); + lp_var_t(sid.objectId, P60System::pool::PDU2_LATCHUP_SUS_REDUNDANT, this); lp_var_t latchupsDeplMenchanism = - lp_var_t(sid.objectId, P60System::PDU2_LATCHUP_DEPLOYMENT_MECHANISM, this); + lp_var_t(sid.objectId, P60System::pool::PDU2_LATCHUP_DEPLOYMENT_MECHANISM, this); lp_var_t latchupsPayloadPcduCh6 = - lp_var_t(sid.objectId, P60System::PDU2_LATCHUP_PAYLOAD_PCDU_CH6, this); + lp_var_t(sid.objectId, P60System::pool::PDU2_LATCHUP_PAYLOAD_PCDU_CH6, this); lp_var_t latchupsAcsBoardSideB = - lp_var_t(sid.objectId, P60System::PDU2_LATCHUP_ACS_BOARD_SIDE_B, this); + lp_var_t(sid.objectId, P60System::pool::PDU2_LATCHUP_ACS_BOARD_SIDE_B, this); lp_var_t latchupsPayloadCamera = - lp_var_t(sid.objectId, P60System::PDU2_LATCHUP_PAYLOAD_CAMERA, this); + lp_var_t(sid.objectId, P60System::pool::PDU2_LATCHUP_PAYLOAD_CAMERA, this); /** * There are 8 devices on the PDU. FRAM, ADCs, temperature sensor etc. Each device is * identified by an ID. Refer also to gs-man-nanopower-p60-pdu-200-1.pdf on pages 17 and 18. */ - lp_var_t device0 = lp_var_t(sid.objectId, P60System::PDU2_DEVICE_0, this); - lp_var_t device1 = lp_var_t(sid.objectId, P60System::PDU2_DEVICE_1, this); - lp_var_t device2 = lp_var_t(sid.objectId, P60System::PDU2_DEVICE_2, this); - lp_var_t device3 = lp_var_t(sid.objectId, P60System::PDU2_DEVICE_3, this); - lp_var_t device4 = lp_var_t(sid.objectId, P60System::PDU2_DEVICE_4, this); - lp_var_t device5 = lp_var_t(sid.objectId, P60System::PDU2_DEVICE_5, this); - lp_var_t device6 = lp_var_t(sid.objectId, P60System::PDU2_DEVICE_6, this); - lp_var_t device7 = lp_var_t(sid.objectId, P60System::PDU2_DEVICE_7, this); + lp_var_t device0 = lp_var_t(sid.objectId, P60System::pool::PDU2_DEVICE_0, this); + lp_var_t device1 = lp_var_t(sid.objectId, P60System::pool::PDU2_DEVICE_1, this); + lp_var_t device2 = lp_var_t(sid.objectId, P60System::pool::PDU2_DEVICE_2, this); + lp_var_t device3 = lp_var_t(sid.objectId, P60System::pool::PDU2_DEVICE_3, this); + lp_var_t device4 = lp_var_t(sid.objectId, P60System::pool::PDU2_DEVICE_4, this); + lp_var_t device5 = lp_var_t(sid.objectId, P60System::pool::PDU2_DEVICE_5, this); + lp_var_t device6 = lp_var_t(sid.objectId, P60System::pool::PDU2_DEVICE_6, this); + lp_var_t device7 = lp_var_t(sid.objectId, P60System::pool::PDU2_DEVICE_7, this); /** The status of each device. 0 = None, 1 = Ok, 2 = Error, 3 = Not found */ lp_var_t device0Status = - lp_var_t(sid.objectId, P60System::PDU2_DEVICE_0_STATUS, this); + lp_var_t(sid.objectId, P60System::pool::PDU2_DEVICE_0_STATUS, this); lp_var_t device1Status = - lp_var_t(sid.objectId, P60System::PDU2_DEVICE_1_STATUS, this); + lp_var_t(sid.objectId, P60System::pool::PDU2_DEVICE_1_STATUS, this); lp_var_t device2Status = - lp_var_t(sid.objectId, P60System::PDU2_DEVICE_2_STATUS, this); + lp_var_t(sid.objectId, P60System::pool::PDU2_DEVICE_2_STATUS, this); lp_var_t device3Status = - lp_var_t(sid.objectId, P60System::PDU2_DEVICE_3_STATUS, this); + lp_var_t(sid.objectId, P60System::pool::PDU2_DEVICE_3_STATUS, this); lp_var_t device4Status = - lp_var_t(sid.objectId, P60System::PDU2_DEVICE_4_STATUS, this); + lp_var_t(sid.objectId, P60System::pool::PDU2_DEVICE_4_STATUS, this); lp_var_t device5Status = - lp_var_t(sid.objectId, P60System::PDU2_DEVICE_5_STATUS, this); + lp_var_t(sid.objectId, P60System::pool::PDU2_DEVICE_5_STATUS, this); lp_var_t device6Status = - lp_var_t(sid.objectId, P60System::PDU2_DEVICE_6_STATUS, this); + lp_var_t(sid.objectId, P60System::pool::PDU2_DEVICE_6_STATUS, this); lp_var_t device7Status = - lp_var_t(sid.objectId, P60System::PDU2_DEVICE_7_STATUS, this); + lp_var_t(sid.objectId, P60System::pool::PDU2_DEVICE_7_STATUS, this); /** Number of reboots triggered by the ground watchdog */ lp_var_t gndWdtReboots = - lp_var_t(sid.objectId, P60System::PDU2_WDT_CNT_GND, this); + lp_var_t(sid.objectId, P60System::pool::PDU2_WDT_CNT_GND, this); /** Number of reboots triggered through the I2C watchdog. Not relevant for EIVE. */ lp_var_t i2cWdtReboots = - lp_var_t(sid.objectId, P60System::PDU2_WDT_CNT_I2C, this); + lp_var_t(sid.objectId, P60System::pool::PDU2_WDT_CNT_I2C, this); /** Number of reboots triggered through the CAN watchdog */ lp_var_t canWdtReboots = - lp_var_t(sid.objectId, P60System::PDU2_WDT_CNT_CAN, this); + lp_var_t(sid.objectId, P60System::pool::PDU2_WDT_CNT_CAN, this); /** Number of reboots triggered through the CSP watchdog */ lp_var_t csp1WdtReboots = - lp_var_t(sid.objectId, P60System::PDU2_WDT_CNT_CSP1, this); + lp_var_t(sid.objectId, P60System::pool::PDU2_WDT_CNT_CSP1, this); lp_var_t csp2WdtReboots = - lp_var_t(sid.objectId, P60System::PDU2_WDT_CNT_CSP2, this); + lp_var_t(sid.objectId, P60System::pool::PDU2_WDT_CNT_CSP2, this); /** Ground watchdog remaining seconds before rebooting */ lp_var_t groundWatchdogSecondsLeft = - lp_var_t(sid.objectId, P60System::PDU2_WDT_GND_LEFT, this); + lp_var_t(sid.objectId, P60System::pool::PDU2_WDT_GND_LEFT, this); /** I2C watchdog remaining seconds before rebooting. Not relevant for EIVE. */ lp_var_t i2cWatchdogSecondsLeft = - lp_var_t(sid.objectId, P60System::PDU2_WDT_I2C_LEFT, this); + lp_var_t(sid.objectId, P60System::pool::PDU2_WDT_I2C_LEFT, this); /** CAN watchdog remaining seconds before rebooting. */ lp_var_t canWatchdogSecondsLeft = - lp_var_t(sid.objectId, P60System::PDU2_WDT_CAN_LEFT, this); + lp_var_t(sid.objectId, P60System::pool::PDU2_WDT_CAN_LEFT, this); /** CSP watchdog remaining pings before rebooting. */ lp_var_t csp1WatchdogPingsLeft = - lp_var_t(sid.objectId, P60System::PDU2_WDT_CSP_LEFT1, this); + lp_var_t(sid.objectId, P60System::pool::PDU2_WDT_CSP_LEFT1, this); lp_var_t csp2WatchdogPingsLeft = - lp_var_t(sid.objectId, P60System::PDU2_WDT_CSP_LEFT2, this); + lp_var_t(sid.objectId, P60System::pool::PDU2_WDT_CSP_LEFT2, this); }; } // namespace PDU2 @@ -1049,124 +913,131 @@ class HkTableDataset : public StaticLocalDataSet { : StaticLocalDataSet(sid_t(objectId, HK_TABLE_DATA_SET_ID)) {} lp_var_t currentInChannel0 = - lp_var_t(sid.objectId, P60System::ACU_CURRENT_IN_CHANNEL0, this); + lp_var_t(sid.objectId, P60System::pool::ACU_CURRENT_IN_CHANNEL0, this); lp_var_t currentInChannel1 = - lp_var_t(sid.objectId, P60System::ACU_CURRENT_IN_CHANNEL1, this); + lp_var_t(sid.objectId, P60System::pool::ACU_CURRENT_IN_CHANNEL1, this); lp_var_t currentInChannel2 = - lp_var_t(sid.objectId, P60System::ACU_CURRENT_IN_CHANNEL2, this); + lp_var_t(sid.objectId, P60System::pool::ACU_CURRENT_IN_CHANNEL2, this); lp_var_t currentInChannel3 = - lp_var_t(sid.objectId, P60System::ACU_CURRENT_IN_CHANNEL3, this); + lp_var_t(sid.objectId, P60System::pool::ACU_CURRENT_IN_CHANNEL3, this); lp_var_t currentInChannel4 = - lp_var_t(sid.objectId, P60System::ACU_CURRENT_IN_CHANNEL4, this); + lp_var_t(sid.objectId, P60System::pool::ACU_CURRENT_IN_CHANNEL4, this); lp_var_t currentInChannel5 = - lp_var_t(sid.objectId, P60System::ACU_CURRENT_IN_CHANNEL5, this); + lp_var_t(sid.objectId, P60System::pool::ACU_CURRENT_IN_CHANNEL5, this); lp_var_t voltageInChannel0 = - lp_var_t(sid.objectId, P60System::ACU_VOLTAGE_IN_CHANNEL0, this); + lp_var_t(sid.objectId, P60System::pool::ACU_VOLTAGE_IN_CHANNEL0, this); lp_var_t voltageInChannel1 = - lp_var_t(sid.objectId, P60System::ACU_VOLTAGE_IN_CHANNEL1, this); + lp_var_t(sid.objectId, P60System::pool::ACU_VOLTAGE_IN_CHANNEL1, this); lp_var_t voltageInChannel2 = - lp_var_t(sid.objectId, P60System::ACU_VOLTAGE_IN_CHANNEL2, this); + lp_var_t(sid.objectId, P60System::pool::ACU_VOLTAGE_IN_CHANNEL2, this); lp_var_t voltageInChannel3 = - lp_var_t(sid.objectId, P60System::ACU_VOLTAGE_IN_CHANNEL3, this); + lp_var_t(sid.objectId, P60System::pool::ACU_VOLTAGE_IN_CHANNEL3, this); lp_var_t voltageInChannel4 = - lp_var_t(sid.objectId, P60System::ACU_VOLTAGE_IN_CHANNEL4, this); + lp_var_t(sid.objectId, P60System::pool::ACU_VOLTAGE_IN_CHANNEL4, this); lp_var_t voltageInChannel5 = - lp_var_t(sid.objectId, P60System::ACU_VOLTAGE_IN_CHANNEL5, this); + lp_var_t(sid.objectId, P60System::pool::ACU_VOLTAGE_IN_CHANNEL5, this); - lp_var_t vcc = lp_var_t(sid.objectId, P60System::ACU_VCC, this); - lp_var_t vbat = lp_var_t(sid.objectId, P60System::ACU_VBAT, this); + lp_var_t vcc = lp_var_t(sid.objectId, P60System::pool::ACU_VCC, this); + lp_var_t vbat = lp_var_t(sid.objectId, P60System::pool::ACU_VBAT, this); lp_var_t temperature1 = - lp_var_t(sid.objectId, P60System::ACU_TEMPERATURE_1, this); + lp_var_t(sid.objectId, P60System::pool::ACU_TEMPERATURE_1, this); lp_var_t temperature2 = - lp_var_t(sid.objectId, P60System::ACU_TEMPERATURE_2, this); + lp_var_t(sid.objectId, P60System::pool::ACU_TEMPERATURE_2, this); lp_var_t temperature3 = - lp_var_t(sid.objectId, P60System::ACU_TEMPERATURE_3, this); + lp_var_t(sid.objectId, P60System::pool::ACU_TEMPERATURE_3, this); - lp_var_t mpptMode = lp_var_t(sid.objectId, P60System::ACU_MPPT_MODE, this); + lp_var_t mpptMode = + lp_var_t(sid.objectId, P60System::pool::ACU_MPPT_MODE, this); lp_var_t vboostInChannel0 = - lp_var_t(sid.objectId, P60System::ACU_VBOOST_CHANNEL0, this); + lp_var_t(sid.objectId, P60System::pool::ACU_VBOOST_CHANNEL0, this); lp_var_t vboostInChannel1 = - lp_var_t(sid.objectId, P60System::ACU_VBOOST_CHANNEL1, this); + lp_var_t(sid.objectId, P60System::pool::ACU_VBOOST_CHANNEL1, this); lp_var_t vboostInChannel2 = - lp_var_t(sid.objectId, P60System::ACU_VBOOST_CHANNEL2, this); + lp_var_t(sid.objectId, P60System::pool::ACU_VBOOST_CHANNEL2, this); lp_var_t vboostInChannel3 = - lp_var_t(sid.objectId, P60System::ACU_VBOOST_CHANNEL3, this); + lp_var_t(sid.objectId, P60System::pool::ACU_VBOOST_CHANNEL3, this); lp_var_t vboostInChannel4 = - lp_var_t(sid.objectId, P60System::ACU_VBOOST_CHANNEL4, this); + lp_var_t(sid.objectId, P60System::pool::ACU_VBOOST_CHANNEL4, this); lp_var_t vboostInChannel5 = - lp_var_t(sid.objectId, P60System::ACU_VBOOST_CHANNEL5, this); + lp_var_t(sid.objectId, P60System::pool::ACU_VBOOST_CHANNEL5, this); lp_var_t powerInChannel0 = - lp_var_t(sid.objectId, P60System::ACU_POWER_CHANNEL0, this); + lp_var_t(sid.objectId, P60System::pool::ACU_POWER_CHANNEL0, this); lp_var_t powerInChannel1 = - lp_var_t(sid.objectId, P60System::ACU_POWER_CHANNEL1, this); + lp_var_t(sid.objectId, P60System::pool::ACU_POWER_CHANNEL1, this); lp_var_t powerInChannel2 = - lp_var_t(sid.objectId, P60System::ACU_POWER_CHANNEL2, this); + lp_var_t(sid.objectId, P60System::pool::ACU_POWER_CHANNEL2, this); lp_var_t powerInChannel3 = - lp_var_t(sid.objectId, P60System::ACU_POWER_CHANNEL3, this); + lp_var_t(sid.objectId, P60System::pool::ACU_POWER_CHANNEL3, this); lp_var_t powerInChannel4 = - lp_var_t(sid.objectId, P60System::ACU_POWER_CHANNEL4, this); + lp_var_t(sid.objectId, P60System::pool::ACU_POWER_CHANNEL4, this); lp_var_t powerInChannel5 = - lp_var_t(sid.objectId, P60System::ACU_POWER_CHANNEL5, this); + lp_var_t(sid.objectId, P60System::pool::ACU_POWER_CHANNEL5, this); - lp_var_t dac0Enable = lp_var_t(sid.objectId, P60System::ACU_DAC_EN_0, this); - lp_var_t dac1Enable = lp_var_t(sid.objectId, P60System::ACU_DAC_EN_1, this); - lp_var_t dac2Enable = lp_var_t(sid.objectId, P60System::ACU_DAC_EN_2, this); + lp_var_t dac0Enable = + lp_var_t(sid.objectId, P60System::pool::ACU_DAC_EN_0, this); + lp_var_t dac1Enable = + lp_var_t(sid.objectId, P60System::pool::ACU_DAC_EN_1, this); + lp_var_t dac2Enable = + lp_var_t(sid.objectId, P60System::pool::ACU_DAC_EN_2, this); lp_var_t dacRawChannelVal0 = - lp_var_t(sid.objectId, P60System::ACU_DAC_RAW_0, this); + lp_var_t(sid.objectId, P60System::pool::ACU_DAC_RAW_0, this); lp_var_t dacRawChannelVal1 = - lp_var_t(sid.objectId, P60System::ACU_DAC_RAW_1, this); + lp_var_t(sid.objectId, P60System::pool::ACU_DAC_RAW_1, this); lp_var_t dacRawChannelVal2 = - lp_var_t(sid.objectId, P60System::ACU_DAC_RAW_2, this); + lp_var_t(sid.objectId, P60System::pool::ACU_DAC_RAW_2, this); lp_var_t dacRawChannelVal3 = - lp_var_t(sid.objectId, P60System::ACU_DAC_RAW_3, this); + lp_var_t(sid.objectId, P60System::pool::ACU_DAC_RAW_3, this); lp_var_t dacRawChannelVal4 = - lp_var_t(sid.objectId, P60System::ACU_DAC_RAW_4, this); + lp_var_t(sid.objectId, P60System::pool::ACU_DAC_RAW_4, this); lp_var_t dacRawChannelVal5 = - lp_var_t(sid.objectId, P60System::ACU_DAC_RAW_5, this); + lp_var_t(sid.objectId, P60System::pool::ACU_DAC_RAW_5, this); - lp_var_t bootCause = lp_var_t(sid.objectId, P60System::ACU_BOOTCAUSE, this); - lp_var_t bootcnt = lp_var_t(sid.objectId, P60System::ACU_BOOTCNT, this); - lp_var_t uptime = lp_var_t(sid.objectId, P60System::ACU_UPTIME, this); + lp_var_t bootCause = + lp_var_t(sid.objectId, P60System::pool::ACU_BOOTCAUSE, this); + lp_var_t bootcnt = lp_var_t(sid.objectId, P60System::pool::ACU_BOOTCNT, this); + lp_var_t uptime = lp_var_t(sid.objectId, P60System::pool::ACU_UPTIME, this); lp_var_t resetCause = - lp_var_t(sid.objectId, P60System::ACU_RESET_CAUSE, this); - lp_var_t mpptTime = lp_var_t(sid.objectId, P60System::ACU_MPPT_TIME, this); + lp_var_t(sid.objectId, P60System::pool::ACU_RESET_CAUSE, this); + lp_var_t mpptTime = + lp_var_t(sid.objectId, P60System::pool::ACU_MPPT_TIME, this); lp_var_t mpptPeriod = - lp_var_t(sid.objectId, P60System::ACU_MPPT_PERIOD, this); + lp_var_t(sid.objectId, P60System::pool::ACU_MPPT_PERIOD, this); - lp_var_t device0 = lp_var_t(sid.objectId, P60System::ACU_DEVICE_0, this); - lp_var_t device1 = lp_var_t(sid.objectId, P60System::ACU_DEVICE_1, this); - lp_var_t device2 = lp_var_t(sid.objectId, P60System::ACU_DEVICE_2, this); - lp_var_t device3 = lp_var_t(sid.objectId, P60System::ACU_DEVICE_3, this); - lp_var_t device4 = lp_var_t(sid.objectId, P60System::ACU_DEVICE_4, this); - lp_var_t device5 = lp_var_t(sid.objectId, P60System::ACU_DEVICE_5, this); - lp_var_t device6 = lp_var_t(sid.objectId, P60System::ACU_DEVICE_6, this); - lp_var_t device7 = lp_var_t(sid.objectId, P60System::ACU_DEVICE_7, this); + lp_var_t device0 = lp_var_t(sid.objectId, P60System::pool::ACU_DEVICE_0, this); + lp_var_t device1 = lp_var_t(sid.objectId, P60System::pool::ACU_DEVICE_1, this); + lp_var_t device2 = lp_var_t(sid.objectId, P60System::pool::ACU_DEVICE_2, this); + lp_var_t device3 = lp_var_t(sid.objectId, P60System::pool::ACU_DEVICE_3, this); + lp_var_t device4 = lp_var_t(sid.objectId, P60System::pool::ACU_DEVICE_4, this); + lp_var_t device5 = lp_var_t(sid.objectId, P60System::pool::ACU_DEVICE_5, this); + lp_var_t device6 = lp_var_t(sid.objectId, P60System::pool::ACU_DEVICE_6, this); + lp_var_t device7 = lp_var_t(sid.objectId, P60System::pool::ACU_DEVICE_7, this); lp_var_t device0Status = - lp_var_t(sid.objectId, P60System::ACU_DEVICE_0_STATUS, this); + lp_var_t(sid.objectId, P60System::pool::ACU_DEVICE_0_STATUS, this); lp_var_t device1Status = - lp_var_t(sid.objectId, P60System::ACU_DEVICE_1_STATUS, this); + lp_var_t(sid.objectId, P60System::pool::ACU_DEVICE_1_STATUS, this); lp_var_t device2Status = - lp_var_t(sid.objectId, P60System::ACU_DEVICE_2_STATUS, this); + lp_var_t(sid.objectId, P60System::pool::ACU_DEVICE_2_STATUS, this); lp_var_t device3Status = - lp_var_t(sid.objectId, P60System::ACU_DEVICE_3_STATUS, this); + lp_var_t(sid.objectId, P60System::pool::ACU_DEVICE_3_STATUS, this); lp_var_t device4Status = - lp_var_t(sid.objectId, P60System::ACU_DEVICE_4_STATUS, this); + lp_var_t(sid.objectId, P60System::pool::ACU_DEVICE_4_STATUS, this); lp_var_t device5Status = - lp_var_t(sid.objectId, P60System::ACU_DEVICE_5_STATUS, this); + lp_var_t(sid.objectId, P60System::pool::ACU_DEVICE_5_STATUS, this); lp_var_t device6Status = - lp_var_t(sid.objectId, P60System::ACU_DEVICE_6_STATUS, this); + lp_var_t(sid.objectId, P60System::pool::ACU_DEVICE_6_STATUS, this); lp_var_t device7Status = - lp_var_t(sid.objectId, P60System::ACU_DEVICE_7_STATUS, this); + lp_var_t(sid.objectId, P60System::pool::ACU_DEVICE_7_STATUS, this); - lp_var_t wdtCntGnd = lp_var_t(sid.objectId, P60System::ACU_WDT_CNT_GND, this); + lp_var_t wdtCntGnd = + lp_var_t(sid.objectId, P60System::pool::ACU_WDT_CNT_GND, this); lp_var_t wdtGndLeft = - lp_var_t(sid.objectId, P60System::ACU_WDT_GND_LEFT, this); + lp_var_t(sid.objectId, P60System::pool::ACU_WDT_GND_LEFT, this); }; } // namespace ACU diff --git a/mission/system/AcsBoardAssembly.cpp b/mission/system/AcsBoardAssembly.cpp index e319f32b..0d65d20e 100644 --- a/mission/system/AcsBoardAssembly.cpp +++ b/mission/system/AcsBoardAssembly.cpp @@ -143,13 +143,13 @@ ReturnValue_t AcsBoardAssembly::handleNormalOrOnModeCmd(Mode_t mode, Submode_t s cmdSeq(helper.mgm1Rm3100IdSideA, helper.mgm1SideAMode, ModeTableIdx::MGM_1_A); if (gpsUsable) { gpioHandler(gpioIds::GNSS_0_NRESET, true, - "AcsBoardAssembly::handleNormalOrOnModeCmd: Could not pull nReset pin" - "of GNSS 0 high (used GNSS)"); + "AcsBoardAssembly::handleNormalOrOnModeCmd: Could not pull nReset pin" + "of GNSS 0 high (used GNSS)"); gpioHandler(gpioIds::GNSS_1_NRESET, false, - "AcsBoardAssembly::handleNormalOrOnModeCmd: Could not pull nReset pin" - "of GNSS 1 low (unused GNSS)"); + "AcsBoardAssembly::handleNormalOrOnModeCmd: Could not pull nReset pin" + "of GNSS 1 low (unused GNSS)"); gpioHandler(gpioIds::GNSS_SELECT, false, - "AcsBoardAssembly::handleNormalOrOnModeCmd: Could not pull GNSS select low"); + "AcsBoardAssembly::handleNormalOrOnModeCmd: Could not pull GNSS select low"); } break; } @@ -168,13 +168,13 @@ ReturnValue_t AcsBoardAssembly::handleNormalOrOnModeCmd(Mode_t mode, Submode_t s cmdSeq(helper.mgm3Rm3100IdSideB, helper.mgm3SideBMode, ModeTableIdx::MGM_3_B); if (gpsUsable) { gpioHandler(gpioIds::GNSS_0_NRESET, false, - "AcsBoardAssembly::handleNormalOrOnModeCmd: Could not pull nReset pin" - "of GNSS 0 low (unused GNSS)"); + "AcsBoardAssembly::handleNormalOrOnModeCmd: Could not pull nReset pin" + "of GNSS 0 low (unused GNSS)"); gpioHandler(gpioIds::GNSS_1_NRESET, true, - "AcsBoardAssembly::handleNormalOrOnModeCmd: Could not pull nReset pin" - "of GNSS 1 high (used GNSS)"); + "AcsBoardAssembly::handleNormalOrOnModeCmd: Could not pull nReset pin" + "of GNSS 1 high (used GNSS)"); gpioHandler(gpioIds::GNSS_SELECT, true, - "AcsBoardAssembly::handleNormalOrOnModeCmd: Could not pull GNSS select high"); + "AcsBoardAssembly::handleNormalOrOnModeCmd: Could not pull GNSS select high"); } break; } @@ -191,11 +191,11 @@ ReturnValue_t AcsBoardAssembly::handleNormalOrOnModeCmd(Mode_t mode, Submode_t s ReturnValue_t status = RETURN_OK; if (gpsUsable) { gpioHandler(gpioIds::GNSS_0_NRESET, true, - "AcsBoardAssembly::handleNormalOrOnModeCmd: Could not pull nReset pin" - "of GNSS 0 high (used GNSS)"); + "AcsBoardAssembly::handleNormalOrOnModeCmd: Could not pull nReset pin" + "of GNSS 0 high (used GNSS)"); gpioHandler(gpioIds::GNSS_1_NRESET, true, - "AcsBoardAssembly::handleNormalOrOnModeCmd: Could not pull nReset pin" - "of GNSS 1 high (used GNSS)"); + "AcsBoardAssembly::handleNormalOrOnModeCmd: Could not pull nReset pin" + "of GNSS 1 high (used GNSS)"); if (defaultSubmode == Submodes::A_SIDE) { status = gpioIF->pullLow(gpioIds::GNSS_SELECT); } else { @@ -245,7 +245,7 @@ void AcsBoardAssembly::selectGpsInDualMode(duallane::Submodes side) { void AcsBoardAssembly::gpioHandler(gpioId_t gpio, bool high, std::string error) { ReturnValue_t result = RETURN_OK; - if(high) { + if (high) { result = gpioIF->pullHigh(gpio); } else { result = gpioIF->pullLow(gpio); diff --git a/tmtc b/tmtc index a1478466..0fc8369b 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit a14784666f6d8ce0e3d993ae60edd235363a95e1 +Subproject commit 0fc8369bbcb7162305c8154568e0158b778c65b3 From 6020b20fc99990d8b8a85bad06110162d7a7c182 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 4 Apr 2022 18:47:09 +0200 Subject: [PATCH 16/65] hk handling --- linux/devices/GPSHyperionLinuxController.cpp | 4 +++- mission/devices/P60DockHandler.cpp | 3 ++- mission/devices/PDU1Handler.cpp | 2 -- tmtc | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/linux/devices/GPSHyperionLinuxController.cpp b/linux/devices/GPSHyperionLinuxController.cpp index a811fbc5..ca35264e 100644 --- a/linux/devices/GPSHyperionLinuxController.cpp +++ b/linux/devices/GPSHyperionLinuxController.cpp @@ -76,9 +76,11 @@ ReturnValue_t GPSHyperionLinuxController::initializeLocalDataPool( localDataPoolMap.emplace(GpsHyperion::SATS_IN_USE, new PoolEntry()); localDataPoolMap.emplace(GpsHyperion::SATS_IN_VIEW, new PoolEntry()); localDataPoolMap.emplace(GpsHyperion::FIX_MODE, new PoolEntry()); + bool enablePeriodicHk = false; #if OBSW_ENABLE_PERIODIC_HK == 1 - poolManager.subscribeForPeriodicPacket(gpsSet.getSid(), true, 2.0, false); + enablePeriodicHk = true; #endif + poolManager.subscribeForPeriodicPacket(gpsSet.getSid(), enablePeriodicHk, 2.0, false); return HasReturnvaluesIF::RETURN_OK; } diff --git a/mission/devices/P60DockHandler.cpp b/mission/devices/P60DockHandler.cpp index 5ad4ffee..9db22146 100644 --- a/mission/devices/P60DockHandler.cpp +++ b/mission/devices/P60DockHandler.cpp @@ -101,6 +101,7 @@ void P60DockHandler::parseHkTableReply(const uint8_t *packet) { dataOffset += 4; p60dockHkTableDataset.bootcause = *(packet + dataOffset) << 24 | + *(packet + dataOffset + 1) << 16 | *(packet + dataOffset + 2) << 8 | *(packet + dataOffset + 3); dataOffset += 6; @@ -258,7 +259,7 @@ ReturnValue_t P60DockHandler::initializeLocalDataPool(localpool::DataPool &local localDataPoolMap.emplace(pool::P60DOCK_ANT6_DEPL, new PoolEntry({0})); localDataPoolMap.emplace(pool::P60DOCK_AR6_DEPL, new PoolEntry({0})); - + poolManager.subscribeForPeriodicPacket(p60dockHkTableDataset.getSid(), false, 0.4, false); return HasReturnvaluesIF::RETURN_OK; } diff --git a/mission/devices/PDU1Handler.cpp b/mission/devices/PDU1Handler.cpp index 264fd098..e0c369a3 100644 --- a/mission/devices/PDU1Handler.cpp +++ b/mission/devices/PDU1Handler.cpp @@ -426,9 +426,7 @@ ReturnValue_t PDU1Handler::initializeLocalDataPool(localpool::DataPool &localDat localDataPoolMap.emplace(P60System::pool::PDU1_WDT_CAN_LEFT, new PoolEntry({0})); localDataPoolMap.emplace(P60System::pool::PDU1_WDT_CSP_LEFT1, new PoolEntry({0})); localDataPoolMap.emplace(P60System::pool::PDU1_WDT_CSP_LEFT2, new PoolEntry({0})); -#if OBSW_ENABLE_PERIODIC_HK == 1 poolManager.subscribeForPeriodicPacket(pdu1HkTableDataset.getSid(), false, 0.4, true); -#endif return HasReturnvaluesIF::RETURN_OK; } diff --git a/tmtc b/tmtc index 0fc8369b..923929ca 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 0fc8369bbcb7162305c8154568e0158b778c65b3 +Subproject commit 923929ca5511e70b460f6edeaab607b259f0bff5 From 3cfd0deb22207f52915159629e9b4b078c46652e Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 5 Apr 2022 19:29:09 +0200 Subject: [PATCH 17/65] set p60 dock HK vars to valid --- fsfw | 2 +- mission/devices/P60DockHandler.cpp | 1 + tmtc | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/fsfw b/fsfw index e4c6a69f..aded4fae 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit e4c6a69f776cd8056985ce56ba6528bd842a1ea8 +Subproject commit aded4fae1e4f8a8a325c49b8c0d4bb4d7408d676 diff --git a/mission/devices/P60DockHandler.cpp b/mission/devices/P60DockHandler.cpp index 9db22146..0afa3458 100644 --- a/mission/devices/P60DockHandler.cpp +++ b/mission/devices/P60DockHandler.cpp @@ -205,6 +205,7 @@ void P60DockHandler::parseHkTableReply(const uint8_t *packet) { p60dockHkTableDataset.ant6Depl = *(packet + dataOffset); dataOffset += 3; p60dockHkTableDataset.ar6Depl = *(packet + dataOffset); + p60dockHkTableDataset.setValidity(true, true); } ReturnValue_t P60DockHandler::initializeLocalDataPool(localpool::DataPool &localDataPoolMap, diff --git a/tmtc b/tmtc index 923929ca..a038e4c1 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 923929ca5511e70b460f6edeaab607b259f0bff5 +Subproject commit a038e4c175a96c1d0e9e6de8371244f60f3bd204 From 36db47466f9b77cb5c30c934fc24f45414e17878 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 5 Apr 2022 19:43:28 +0200 Subject: [PATCH 18/65] tmtc update --- tmtc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tmtc b/tmtc index a038e4c1..5b2dfa55 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit a038e4c175a96c1d0e9e6de8371244f60f3bd204 +Subproject commit 5b2dfa55eb7b6caffeffc55ab8e8cd450db488fd From 65d504bed1d480deca213ca4a2211eae432e6792 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 5 Apr 2022 19:49:57 +0200 Subject: [PATCH 19/65] p60 dock HK is diagnostic again --- mission/devices/P60DockHandler.cpp | 2 +- tmtc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mission/devices/P60DockHandler.cpp b/mission/devices/P60DockHandler.cpp index 0afa3458..3093e844 100644 --- a/mission/devices/P60DockHandler.cpp +++ b/mission/devices/P60DockHandler.cpp @@ -260,7 +260,7 @@ ReturnValue_t P60DockHandler::initializeLocalDataPool(localpool::DataPool &local localDataPoolMap.emplace(pool::P60DOCK_ANT6_DEPL, new PoolEntry({0})); localDataPoolMap.emplace(pool::P60DOCK_AR6_DEPL, new PoolEntry({0})); - poolManager.subscribeForPeriodicPacket(p60dockHkTableDataset.getSid(), false, 0.4, false); + poolManager.subscribeForPeriodicPacket(p60dockHkTableDataset.getSid(), false, 0.4, true); return HasReturnvaluesIF::RETURN_OK; } diff --git a/tmtc b/tmtc index 5b2dfa55..3f5d77a5 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 5b2dfa55eb7b6caffeffc55ab8e8cd450db488fd +Subproject commit 3f5d77a5e56b6a9fe8951439ddc417bf54d6f0d6 From f325d139da3b0504392d81c50ee2d6f3cc751a19 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 6 Apr 2022 12:10:22 +0200 Subject: [PATCH 20/65] p60 dock HK does not need to be diagnostic --- mission/devices/P60DockHandler.cpp | 2 +- tmtc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mission/devices/P60DockHandler.cpp b/mission/devices/P60DockHandler.cpp index 3093e844..455784fb 100644 --- a/mission/devices/P60DockHandler.cpp +++ b/mission/devices/P60DockHandler.cpp @@ -260,7 +260,7 @@ ReturnValue_t P60DockHandler::initializeLocalDataPool(localpool::DataPool &local localDataPoolMap.emplace(pool::P60DOCK_ANT6_DEPL, new PoolEntry({0})); localDataPoolMap.emplace(pool::P60DOCK_AR6_DEPL, new PoolEntry({0})); - poolManager.subscribeForPeriodicPacket(p60dockHkTableDataset.getSid(), false, 0.4, true); + poolManager.subscribeForPeriodicPacket(p60dockHkTableDataset.getSid(), false, 10.0, false); return HasReturnvaluesIF::RETURN_OK; } diff --git a/tmtc b/tmtc index 3f5d77a5..1c105752 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 3f5d77a5e56b6a9fe8951439ddc417bf54d6f0d6 +Subproject commit 1c105752642084acf21f78b1b2302f0f4d26aec9 From 834e935c64bf6257df1c455cb36667751dbd2e4c Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 7 Apr 2022 00:14:18 +0200 Subject: [PATCH 21/65] switch handling working now --- mission/devices/PayloadPcduHandler.cpp | 101 +++++++++++-------------- mission/devices/PayloadPcduHandler.h | 3 + 2 files changed, 46 insertions(+), 58 deletions(-) diff --git a/mission/devices/PayloadPcduHandler.cpp b/mission/devices/PayloadPcduHandler.cpp index b08e73ca..621b7d9e 100644 --- a/mission/devices/PayloadPcduHandler.cpp +++ b/mission/devices/PayloadPcduHandler.cpp @@ -67,6 +67,7 @@ void PayloadPcduHandler::doTransition(Mode_t modeFrom, Submode_t subModeFrom) { ReturnValue_t PayloadPcduHandler::stateMachineToNormal(Mode_t modeFrom, Submode_t subModeFrom) { using namespace plpcdu; + bool doFinish = true; if (((submode >> SOLID_STATE_RELAYS_ADC_ON) & 0b1) == 1) { if (state == States::PL_PCDU_OFF) { sif::error << "PayloadPcduHandler::stateMachineToNormal: Unexpected state PL_PCDU_OFF" @@ -83,22 +84,24 @@ ReturnValue_t PayloadPcduHandler::stateMachineToNormal(Mode_t modeFrom, Submode_ gpioIF->pullHigh(gpioIds::PLPCDU_ENB_VBAT1); state = States::ON_TRANS_SSR; transitionOk = true; + doFinish = false; } if (state == States::ON_TRANS_SSR) { // If necessary, check whether a certain amount of time has elapsed if (transitionOk) { transitionOk = false; state = States::ON_TRANS_ADC_CLOSE_ZERO; - adcCountdown.setTimeout(50); adcCountdown.resetTimer(); adcState = AdcStates::BOOT_DELAY; + doFinish = false; // If the values are not close to zero, we should not allow transition monMode = MonitoringMode::CLOSE_TO_ZERO; } } if (state == States::ON_TRANS_ADC_CLOSE_ZERO) { if (adcState == AdcStates::BOOT_DELAY) { + doFinish = false; if (adcCountdown.hasTimedOut()) { adcState = AdcStates::SEND_SETUP; adcCmdExecuted = false; @@ -107,68 +110,38 @@ ReturnValue_t PayloadPcduHandler::stateMachineToNormal(Mode_t modeFrom, Submode_ if (adcState == AdcStates::SEND_SETUP) { if (adcCmdExecuted) { adcState = AdcStates::NORMAL; + doFinish = true; adcCountdown.setTimeout(100); adcCountdown.resetTimer(); adcCmdExecuted = false; - setMode(MODE_NORMAL, submode); - return HasReturnvaluesIF::RETURN_OK; } } } } - if (((submode >> DRO_ON) & 1) == 1) { + auto switchHandler = [&](NormalSubmodeBits bit, gpioId_t id, std::string info) { + if (((diffMask >> bit) & 1) == 1) { + if (((submode >> bit) & 1) == 1) { #if OBSW_VERBOSE_LEVEL >= 1 - sif::info << "Enabling PL PCDU DRO module" << std::endl; + sif::info << "Enabling PL PCDU " << info << " module" << std::endl; #endif - // Switch on DRO and start monitoring for negative voltages - gpioIF->pullHigh(gpioIds::PLPCDU_ENB_DRO); - adcCountdown.setTimeout(100); - adcCountdown.resetTimer(); - setMode(MODE_NORMAL, submode); - } + // Switch on DRO and start monitoring for negative voltages + updateSwitchGpio(id, gpio::Levels::HIGH); + } else { +#if OBSW_VERBOSE_LEVEL >= 1 + sif::info << "Disabling PL PCDU " << info << " module" << std::endl; +#endif + updateSwitchGpio(id, gpio::Levels::LOW); + } + } + }; - if (((submode >> X8_ON) & 1) == 1) { -#if OBSW_VERBOSE_LEVEL >= 1 - sif::info << "Enabling PL PCDU X8 module" << std::endl; -#endif - // Switch on DRO and start monitoring for negative voltages - gpioIF->pullHigh(gpioIds::PLPCDU_ENB_X8); - adcCountdown.setTimeout(100); - adcCountdown.resetTimer(); - setMode(MODE_NORMAL, submode); - } - - if (((submode >> TX_ON) & 1) == 1) { -#if OBSW_VERBOSE_LEVEL >= 1 - sif::info << "Enabling PL PCDU TX module" << std::endl; -#endif - // Switch on DRO and start monitoring for negative voltages - gpioIF->pullHigh(gpioIds::PLPCDU_ENB_TX); - adcCountdown.setTimeout(100); - adcCountdown.resetTimer(); - setMode(MODE_NORMAL, submode); - } - - if (((submode >> MPA_ON) & 1) == 1) { -#if OBSW_VERBOSE_LEVEL >= 1 - sif::info << "Enabling PL PCDU MPA module" << std::endl; -#endif - // Switch on DRO and start monitoring for negative voltages - gpioIF->pullHigh(gpioIds::PLPCDU_ENB_MPA); - adcCountdown.setTimeout(100); - adcCountdown.resetTimer(); - setMode(MODE_NORMAL, submode); - } - - if (((submode >> HPA_ON) & 1) == 1) { -#if OBSW_VERBOSE_LEVEL >= 1 - sif::info << "Enabling PL PCDU HPA module" << std::endl; -#endif - // Switch on DRO and start monitoring for negative voltages - gpioIF->pullHigh(gpioIds::PLPCDU_ENB_HPA); - adcCountdown.setTimeout(100); - adcCountdown.resetTimer(); + switchHandler(DRO_ON, gpioIds::PLPCDU_ENB_DRO, "DRO"); + switchHandler(X8_ON, gpioIds::PLPCDU_ENB_X8, "X8"); + switchHandler(TX_ON, gpioIds::PLPCDU_ENB_TX, "TX"); + switchHandler(MPA_ON, gpioIds::PLPCDU_ENB_MPA, "MPA"); + switchHandler(HPA_ON, gpioIds::PLPCDU_ENB_HPA, "HPA"); + if (doFinish) { setMode(MODE_NORMAL, submode); } return RETURN_OK; @@ -202,6 +175,16 @@ ReturnValue_t PayloadPcduHandler::buildTransitionDeviceCommand(DeviceCommandId_t return NOTHING_TO_SEND; } +void PayloadPcduHandler::updateSwitchGpio(gpioId_t id, gpio::Levels level) { + if (level == gpio::Levels::HIGH) { + gpioIF->pullHigh(id); + } else { + gpioIF->pullLow(id); + } + adcCountdown.setTimeout(100); + adcCountdown.resetTimer(); +} + void PayloadPcduHandler::fillCommandAndReplyMap() { insertInCommandAndReplyMap(plpcdu::READ_CMD, 2, &adcSet); insertInCommandAndReplyMap(plpcdu::READ_TEMP_EXT, 1, &adcSet); @@ -549,31 +532,33 @@ bool PayloadPcduHandler::checkCurrent(float val, float upperBound, Event event) ReturnValue_t PayloadPcduHandler::isModeCombinationValid(Mode_t mode, Submode_t submode) { using namespace plpcdu; if (mode == MODE_NORMAL) { + diffMask = submode ^ this->submode; // Also deals with the case where the mode is MODE_ON, submode should be 0 here if ((((submode >> SOLID_STATE_RELAYS_ADC_ON) & 0b1) == SOLID_STATE_RELAYS_ADC_ON) and (this->mode == MODE_NORMAL and this->submode != ALL_OFF_SUBMODE)) { return TRANS_NOT_ALLOWED; } if (((((submode >> DRO_ON) & 1) == 1) and - (this->submode != (1 << SOLID_STATE_RELAYS_ADC_ON)))) { + ((this->submode & 0b1) != (1 << SOLID_STATE_RELAYS_ADC_ON)))) { return TRANS_NOT_ALLOWED; } if ((((submode >> X8_ON) & 1) == 1) and - (this->submode != ((1 << SOLID_STATE_RELAYS_ADC_ON) | (1 << DRO_ON)))) { + ((this->submode & 0b11) != ((1 << SOLID_STATE_RELAYS_ADC_ON) | (1 << DRO_ON)))) { return TRANS_NOT_ALLOWED; } if (((((submode >> TX_ON) & 1) == 1) and - (this->submode != ((1 << X8_ON) | (1 << DRO_ON) | (1 << SOLID_STATE_RELAYS_ADC_ON))))) { + ((this->submode & 0b111) != + ((1 << X8_ON) | (1 << DRO_ON) | (1 << SOLID_STATE_RELAYS_ADC_ON))))) { return TRANS_NOT_ALLOWED; } if ((((submode >> MPA_ON) & 1) == 1 and - (this->submode != + ((this->submode & 0b1111) != ((1 << TX_ON) | (1 << X8_ON) | (1 << DRO_ON) | (1 << SOLID_STATE_RELAYS_ADC_ON))))) { return TRANS_NOT_ALLOWED; } if ((((submode >> HPA_ON) & 1) == 1 and - (this->submode != ((1 << MPA_ON) | (1 << TX_ON) | (1 << X8_ON) | (1 << DRO_ON) | - (1 << SOLID_STATE_RELAYS_ADC_ON))))) { + ((this->submode & 0b11111) != ((1 << MPA_ON) | (1 << TX_ON) | (1 << X8_ON) | + (1 << DRO_ON) | (1 << SOLID_STATE_RELAYS_ADC_ON))))) { return TRANS_NOT_ALLOWED; } return HasReturnvaluesIF::RETURN_OK; diff --git a/mission/devices/PayloadPcduHandler.h b/mission/devices/PayloadPcduHandler.h index 18311ec8..dba5b4ef 100644 --- a/mission/devices/PayloadPcduHandler.h +++ b/mission/devices/PayloadPcduHandler.h @@ -134,6 +134,7 @@ class PayloadPcduHandler : public DeviceHandlerBase { SdCardMountedIF* sdcMan; plpcdu::PlPcduParameter params; bool quickTransitionAlreadyCalled = true; + uint8_t diffMask = 0; PoolEntry channelValues = PoolEntry({0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}); PoolEntry processedValues = @@ -141,6 +142,8 @@ class PayloadPcduHandler : public DeviceHandlerBase { PoolEntry tempC = PoolEntry({0.0}); DualLanePowerStateMachine pwrStateMachine; + void updateSwitchGpio(gpioId_t id, gpio::Levels level); + void doTransition(Mode_t modeFrom, Submode_t subModeFrom) override; void doStartUp() override; void doShutDown() override; From 06a15ccec18aa8458da45c84060ed7c127189d65 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 7 Apr 2022 00:16:15 +0200 Subject: [PATCH 22/65] submodule updates --- fsfw | 2 +- tmtc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fsfw b/fsfw index 1bc7a918..0677de39 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 1bc7a918694030d1f49f1d2998a289d77b132849 +Subproject commit 0677de39aa4c20e8ee1c066909818d2dfffcbc2a diff --git a/tmtc b/tmtc index 8b5554d6..5d9f0083 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 8b5554d6fdfb9e2d982e4a2af4f5e6d6e844794e +Subproject commit 5d9f0083204ff7fcb8269241695aad3ef824f32c From c6e16e0866c9c8e5e3f855042a9b64638acbef8a Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 7 Apr 2022 09:57:19 +0200 Subject: [PATCH 23/65] resolve merge conflict, ran afmt --- mission/devices/SyrlinksHkHandler.cpp | 57 +++++++++++---------------- mission/devices/SyrlinksHkHandler.h | 11 ++---- 2 files changed, 25 insertions(+), 43 deletions(-) diff --git a/mission/devices/SyrlinksHkHandler.cpp b/mission/devices/SyrlinksHkHandler.cpp index 2a847071..9108a6f1 100644 --- a/mission/devices/SyrlinksHkHandler.cpp +++ b/mission/devices/SyrlinksHkHandler.cpp @@ -192,10 +192,10 @@ void SyrlinksHkHandler::fillCommandAndReplyMap() { true, syrlinks::ACK_REPLY); this->insertInCommandAndReplyMap(syrlinks::WRITE_LCL_CONFIG, 1, nullptr, syrlinks::ACK_SIZE, false, true, syrlinks::ACK_REPLY); - this->insertInCommandAndReplyMap(syrlinks::CONFIG_BPSK, 1, nullptr, syrlinks::ACK_SIZE, - false, true, syrlinks::ACK_REPLY); - this->insertInCommandAndReplyMap(syrlinks::CONFIG_OQPSK, 1, nullptr, syrlinks::ACK_SIZE, - false, true, syrlinks::ACK_REPLY); + this->insertInCommandAndReplyMap(syrlinks::CONFIG_BPSK, 1, nullptr, syrlinks::ACK_SIZE, false, + true, syrlinks::ACK_REPLY); + this->insertInCommandAndReplyMap(syrlinks::CONFIG_OQPSK, 1, nullptr, syrlinks::ACK_SIZE, false, + true, syrlinks::ACK_REPLY); this->insertInCommandMap(syrlinks::ENABLE_DEBUG); this->insertInCommandMap(syrlinks::DISABLE_DEBUG); this->insertInCommandAndReplyMap(syrlinks::READ_LCL_CONFIG, 1, nullptr, @@ -361,17 +361,12 @@ ReturnValue_t SyrlinksHkHandler::interpretDeviceReply(DeviceCommandId_t id, cons rawTempBasebandBoard |= convertHexStringToUint8( reinterpret_cast(packet + syrlinks::MESSAGE_HEADER_SIZE)); tempBasebandBoard = calcTempVal(rawTempBasebandBoard); -<<<<<<< HEAD - sif::info << "Syrlinks temperature baseband board: " << tempBasebandBoard << " °C" - << std::endl; -======= temperatureSet.temperatureBasebandBoard = tempBasebandBoard; PoolReadGuard rg(&temperatureSet); if (debug) { sif::info << "Syrlinks temperature baseband board: " << tempBasebandBoard << " °C" << std::endl; } ->>>>>>> origin/develop break; } case (syrlinks::TEMP_POWER_AMPLIFIER_HIGH_BYTE): { @@ -383,11 +378,7 @@ ReturnValue_t SyrlinksHkHandler::interpretDeviceReply(DeviceCommandId_t id, cons } rawTempPowerAmplifier = 0; rawTempPowerAmplifier = convertHexStringToUint8(reinterpret_cast( -<<<<<<< HEAD - packet + SYRLINKS::MESSAGE_HEADER_SIZE)) -======= packet + syrlinks::MESSAGE_HEADER_SIZE)) ->>>>>>> origin/develop << 8; break; } @@ -401,17 +392,12 @@ ReturnValue_t SyrlinksHkHandler::interpretDeviceReply(DeviceCommandId_t id, cons rawTempPowerAmplifier |= convertHexStringToUint8( reinterpret_cast(packet + syrlinks::MESSAGE_HEADER_SIZE)); tempPowerAmplifier = calcTempVal(rawTempPowerAmplifier); -<<<<<<< HEAD - sif::info << "Syrlinks temperature power amplifier board: " << tempPowerAmplifier << " °C" - << std::endl; -======= PoolReadGuard rg(&temperatureSet); temperatureSet.temperaturePowerAmplifier = tempPowerAmplifier; if (debug) { sif::info << "Syrlinks temperature power amplifier board: " << tempPowerAmplifier << " °C" << std::endl; } ->>>>>>> origin/develop break; } default: { @@ -485,7 +471,8 @@ ReturnValue_t SyrlinksHkHandler::parseReplyStatus(const char* status) { case '0': return RETURN_OK; case '1': - sif::debug << "SyrlinksHkHandler::parseReplyStatus: Uart framing or parity error" << std::endl; + sif::debug << "SyrlinksHkHandler::parseReplyStatus: Uart framing or parity error" + << std::endl; return UART_FRAMIN_OR_PARITY_ERROR_ACK; case '2': sif::debug << "SyrlinksHkHandler::parseReplyStatus: Bad character detected" << std::endl; @@ -555,15 +542,15 @@ void SyrlinksHkHandler::parseRxStatusRegistersReply(const uint8_t* packet) { #if OBSW_VERBOSE_LEVEL >= 1 && OBSW_DEBUG_SYRLINKS == 1 if (debug) { - sif::info << "Syrlinks RX Status: 0x" << std::hex << (unsigned int)rxDataset.rxStatus.value - << std::endl; - sif::info << "Syrlinks RX Sensitivity: " << std::dec << rxDataset.rxSensitivity << std::endl; - sif::info << "Syrlinks RX Frequency Shift: " << rxDataset.rxFrequencyShift << std::endl; - sif::info << "Syrlinks RX IQ Power: " << rxDataset.rxIqPower << std::endl; - sif::info << "Syrlinks RX AGC Value: " << rxDataset.rxAgcValue << std::endl; - sif::info << "Syrlinks RX Demod Eb: " << rxDataset.rxDemodEb << std::endl; - sif::info << "Syrlinks RX Demod N0: " << rxDataset.rxDemodN0 << std::endl; - sif::info << "Syrlinks RX Datarate: " << (unsigned int)rxDataset.rxDataRate.value << std::endl; + sif::info << "Syrlinks RX Status: 0x" << std::hex << (unsigned int)rxDataset.rxStatus.value + << std::endl; + sif::info << "Syrlinks RX Sensitivity: " << std::dec << rxDataset.rxSensitivity << std::endl; + sif::info << "Syrlinks RX Frequency Shift: " << rxDataset.rxFrequencyShift << std::endl; + sif::info << "Syrlinks RX IQ Power: " << rxDataset.rxIqPower << std::endl; + sif::info << "Syrlinks RX AGC Value: " << rxDataset.rxAgcValue << std::endl; + sif::info << "Syrlinks RX Demod Eb: " << rxDataset.rxDemodEb << std::endl; + sif::info << "Syrlinks RX Demod N0: " << rxDataset.rxDemodN0 << std::endl; + sif::info << "Syrlinks RX Datarate: " << (unsigned int)rxDataset.rxDataRate.value << std::endl; } #endif } @@ -572,8 +559,8 @@ void SyrlinksHkHandler::parseLclConfigReply(const uint8_t* packet) { uint16_t offset = syrlinks::MESSAGE_HEADER_SIZE; uint8_t lclConfig = convertHexStringToUint8(reinterpret_cast(packet + offset)); if (debug) { - sif::info << "SyrlinksHkHandler::parseRxStatusRegistersReply: Lcl config: " - << static_cast(lclConfig) << std::endl; + sif::info << "SyrlinksHkHandler::parseRxStatusRegistersReply: Lcl config: " + << static_cast(lclConfig) << std::endl; } } @@ -583,8 +570,8 @@ void SyrlinksHkHandler::parseTxStatusReply(const uint8_t* packet) { txDataset.txStatus = convertHexStringToUint8(reinterpret_cast(packet + offset)); #if OBSW_DEBUG_SYRLINKS == 1 if (debug) { - sif::info << "Syrlinks TX Status: 0x" << std::hex << (unsigned int)txDataset.txStatus.value - << std::endl; + sif::info << "Syrlinks TX Status: 0x" << std::hex << (unsigned int)txDataset.txStatus.value + << std::endl; } #endif } @@ -595,8 +582,8 @@ void SyrlinksHkHandler::parseTxWaveformReply(const uint8_t* packet) { txDataset.txWaveform = convertHexStringToUint8(reinterpret_cast(packet + offset)); #if OBSW_DEBUG_SYRLINKS == 1 if (debug) { - sif::info << "Syrlinks TX Waveform: 0x" << std::hex << (unsigned int)txDataset.txWaveform.value - << std::endl; + sif::info << "Syrlinks TX Waveform: 0x" << std::hex << (unsigned int)txDataset.txWaveform.value + << std::endl; } #endif } @@ -608,7 +595,7 @@ void SyrlinksHkHandler::parseAgcLowByte(const uint8_t* packet) { convertHexStringToUint8(reinterpret_cast(packet + offset)); #if OBSW_DEBUG_SYRLINKS == 1 if (debug) { - sif::info << "Syrlinks TX AGC Value: " << txDataset.txAgcValue << std::endl; + sif::info << "Syrlinks TX AGC Value: " << txDataset.txAgcValue << std::endl; } #endif } diff --git a/mission/devices/SyrlinksHkHandler.h b/mission/devices/SyrlinksHkHandler.h index 6d8c6002..78ae6d99 100644 --- a/mission/devices/SyrlinksHkHandler.h +++ b/mission/devices/SyrlinksHkHandler.h @@ -5,10 +5,9 @@ #include "devices/powerSwitcherList.h" #include "fsfw/devicehandlers/DeviceHandlerBase.h" -#include "mission/devices/devicedefinitions/SyrlinksDefinitions.h" -#include "fsfw_hal/linux/gpio/Gpio.h" #include "fsfw/timemanager/Countdown.h" -#include +#include "fsfw_hal/linux/gpio/Gpio.h" +#include "mission/devices/devicedefinitions/SyrlinksDefinitions.h" /** * @brief This is the device handler for the syrlinks transceiver. It handles the command @@ -104,11 +103,7 @@ class SyrlinksHkHandler : public DeviceHandlerBase { uint8_t commandBuffer[syrlinks::MAX_COMMAND_SIZE]; - enum class StartupState { - OFF, - ENABLE_TEMPERATURE_PROTECTION, - DONE - }; + enum class StartupState { OFF, ENABLE_TEMPERATURE_PROTECTION, DONE }; StartupState startupState = StartupState::OFF; From bc47402a6d0a2d72dfd09a9c48334c1bf50ed7d6 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 7 Apr 2022 09:57:52 +0200 Subject: [PATCH 24/65] run auto-formatter --- mission/devices/SyrlinksHkHandler.cpp | 43 ++++++++++++++------------- mission/devices/SyrlinksHkHandler.h | 13 ++++---- 2 files changed, 27 insertions(+), 29 deletions(-) diff --git a/mission/devices/SyrlinksHkHandler.cpp b/mission/devices/SyrlinksHkHandler.cpp index 24d17a86..9108a6f1 100644 --- a/mission/devices/SyrlinksHkHandler.cpp +++ b/mission/devices/SyrlinksHkHandler.cpp @@ -192,10 +192,10 @@ void SyrlinksHkHandler::fillCommandAndReplyMap() { true, syrlinks::ACK_REPLY); this->insertInCommandAndReplyMap(syrlinks::WRITE_LCL_CONFIG, 1, nullptr, syrlinks::ACK_SIZE, false, true, syrlinks::ACK_REPLY); - this->insertInCommandAndReplyMap(syrlinks::CONFIG_BPSK, 1, nullptr, syrlinks::ACK_SIZE, - false, true, syrlinks::ACK_REPLY); - this->insertInCommandAndReplyMap(syrlinks::CONFIG_OQPSK, 1, nullptr, syrlinks::ACK_SIZE, - false, true, syrlinks::ACK_REPLY); + this->insertInCommandAndReplyMap(syrlinks::CONFIG_BPSK, 1, nullptr, syrlinks::ACK_SIZE, false, + true, syrlinks::ACK_REPLY); + this->insertInCommandAndReplyMap(syrlinks::CONFIG_OQPSK, 1, nullptr, syrlinks::ACK_SIZE, false, + true, syrlinks::ACK_REPLY); this->insertInCommandMap(syrlinks::ENABLE_DEBUG); this->insertInCommandMap(syrlinks::DISABLE_DEBUG); this->insertInCommandAndReplyMap(syrlinks::READ_LCL_CONFIG, 1, nullptr, @@ -471,7 +471,8 @@ ReturnValue_t SyrlinksHkHandler::parseReplyStatus(const char* status) { case '0': return RETURN_OK; case '1': - sif::debug << "SyrlinksHkHandler::parseReplyStatus: Uart framing or parity error" << std::endl; + sif::debug << "SyrlinksHkHandler::parseReplyStatus: Uart framing or parity error" + << std::endl; return UART_FRAMIN_OR_PARITY_ERROR_ACK; case '2': sif::debug << "SyrlinksHkHandler::parseReplyStatus: Bad character detected" << std::endl; @@ -541,15 +542,15 @@ void SyrlinksHkHandler::parseRxStatusRegistersReply(const uint8_t* packet) { #if OBSW_VERBOSE_LEVEL >= 1 && OBSW_DEBUG_SYRLINKS == 1 if (debug) { - sif::info << "Syrlinks RX Status: 0x" << std::hex << (unsigned int)rxDataset.rxStatus.value - << std::endl; - sif::info << "Syrlinks RX Sensitivity: " << std::dec << rxDataset.rxSensitivity << std::endl; - sif::info << "Syrlinks RX Frequency Shift: " << rxDataset.rxFrequencyShift << std::endl; - sif::info << "Syrlinks RX IQ Power: " << rxDataset.rxIqPower << std::endl; - sif::info << "Syrlinks RX AGC Value: " << rxDataset.rxAgcValue << std::endl; - sif::info << "Syrlinks RX Demod Eb: " << rxDataset.rxDemodEb << std::endl; - sif::info << "Syrlinks RX Demod N0: " << rxDataset.rxDemodN0 << std::endl; - sif::info << "Syrlinks RX Datarate: " << (unsigned int)rxDataset.rxDataRate.value << std::endl; + sif::info << "Syrlinks RX Status: 0x" << std::hex << (unsigned int)rxDataset.rxStatus.value + << std::endl; + sif::info << "Syrlinks RX Sensitivity: " << std::dec << rxDataset.rxSensitivity << std::endl; + sif::info << "Syrlinks RX Frequency Shift: " << rxDataset.rxFrequencyShift << std::endl; + sif::info << "Syrlinks RX IQ Power: " << rxDataset.rxIqPower << std::endl; + sif::info << "Syrlinks RX AGC Value: " << rxDataset.rxAgcValue << std::endl; + sif::info << "Syrlinks RX Demod Eb: " << rxDataset.rxDemodEb << std::endl; + sif::info << "Syrlinks RX Demod N0: " << rxDataset.rxDemodN0 << std::endl; + sif::info << "Syrlinks RX Datarate: " << (unsigned int)rxDataset.rxDataRate.value << std::endl; } #endif } @@ -558,8 +559,8 @@ void SyrlinksHkHandler::parseLclConfigReply(const uint8_t* packet) { uint16_t offset = syrlinks::MESSAGE_HEADER_SIZE; uint8_t lclConfig = convertHexStringToUint8(reinterpret_cast(packet + offset)); if (debug) { - sif::info << "SyrlinksHkHandler::parseRxStatusRegistersReply: Lcl config: " - << static_cast(lclConfig) << std::endl; + sif::info << "SyrlinksHkHandler::parseRxStatusRegistersReply: Lcl config: " + << static_cast(lclConfig) << std::endl; } } @@ -569,8 +570,8 @@ void SyrlinksHkHandler::parseTxStatusReply(const uint8_t* packet) { txDataset.txStatus = convertHexStringToUint8(reinterpret_cast(packet + offset)); #if OBSW_DEBUG_SYRLINKS == 1 if (debug) { - sif::info << "Syrlinks TX Status: 0x" << std::hex << (unsigned int)txDataset.txStatus.value - << std::endl; + sif::info << "Syrlinks TX Status: 0x" << std::hex << (unsigned int)txDataset.txStatus.value + << std::endl; } #endif } @@ -581,8 +582,8 @@ void SyrlinksHkHandler::parseTxWaveformReply(const uint8_t* packet) { txDataset.txWaveform = convertHexStringToUint8(reinterpret_cast(packet + offset)); #if OBSW_DEBUG_SYRLINKS == 1 if (debug) { - sif::info << "Syrlinks TX Waveform: 0x" << std::hex << (unsigned int)txDataset.txWaveform.value - << std::endl; + sif::info << "Syrlinks TX Waveform: 0x" << std::hex << (unsigned int)txDataset.txWaveform.value + << std::endl; } #endif } @@ -594,7 +595,7 @@ void SyrlinksHkHandler::parseAgcLowByte(const uint8_t* packet) { convertHexStringToUint8(reinterpret_cast(packet + offset)); #if OBSW_DEBUG_SYRLINKS == 1 if (debug) { - sif::info << "Syrlinks TX AGC Value: " << txDataset.txAgcValue << std::endl; + sif::info << "Syrlinks TX AGC Value: " << txDataset.txAgcValue << std::endl; } #endif } diff --git a/mission/devices/SyrlinksHkHandler.h b/mission/devices/SyrlinksHkHandler.h index 7eab1b01..78ae6d99 100644 --- a/mission/devices/SyrlinksHkHandler.h +++ b/mission/devices/SyrlinksHkHandler.h @@ -1,12 +1,13 @@ #ifndef MISSION_DEVICES_SYRLINKSHKHANDLER_H_ #define MISSION_DEVICES_SYRLINKSHKHANDLER_H_ +#include + #include "devices/powerSwitcherList.h" #include "fsfw/devicehandlers/DeviceHandlerBase.h" -#include "mission/devices/devicedefinitions/SyrlinksDefinitions.h" -#include "fsfw_hal/linux/gpio/Gpio.h" #include "fsfw/timemanager/Countdown.h" -#include +#include "fsfw_hal/linux/gpio/Gpio.h" +#include "mission/devices/devicedefinitions/SyrlinksDefinitions.h" /** * @brief This is the device handler for the syrlinks transceiver. It handles the command @@ -102,11 +103,7 @@ class SyrlinksHkHandler : public DeviceHandlerBase { uint8_t commandBuffer[syrlinks::MAX_COMMAND_SIZE]; - enum class StartupState { - OFF, - ENABLE_TEMPERATURE_PROTECTION, - DONE - }; + enum class StartupState { OFF, ENABLE_TEMPERATURE_PROTECTION, DONE }; StartupState startupState = StartupState::OFF; From a6d20de0a51b54cadab4549128dbec1e729755d3 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 7 Apr 2022 10:02:56 +0200 Subject: [PATCH 25/65] GPS linux controller update --- linux/devices/GPSHyperionLinuxController.cpp | 22 +++++++++++++++++++- linux/devices/GPSHyperionLinuxController.h | 2 ++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/linux/devices/GPSHyperionLinuxController.cpp b/linux/devices/GPSHyperionLinuxController.cpp index a811fbc5..d696a188 100644 --- a/linux/devices/GPSHyperionLinuxController.cpp +++ b/linux/devices/GPSHyperionLinuxController.cpp @@ -9,13 +9,16 @@ #include #endif #include +#include GPSHyperionLinuxController::GPSHyperionLinuxController(object_id_t objectId, object_id_t parentId, bool debugHyperionGps) : ExtendedControllerBase(objectId, objects::NO_OBJECT), gpsSet(this), myGpsmm(GPSD_SHARED_MEMORY, nullptr), - debugHyperionGps(debugHyperionGps) {} + debugHyperionGps(debugHyperionGps) { + timeUpdateCd.resetTimer(); +} GPSHyperionLinuxController::~GPSHyperionLinuxController() {} @@ -172,6 +175,20 @@ void GPSHyperionLinuxController::readGpsDataFromGpsd() { timeval time = {}; time.tv_sec = gpsSet.unixSeconds.value; time.tv_usec = gps->fix.time.tv_nsec / 1000; + std::time_t t = std::time(nullptr); + if (time.tv_sec == t) { + timeIsConstantCounter++; + } else { + timeIsConstantCounter = 0; + } + // If the received time does not change anymore for whatever reason, do not set it here + // to avoid stale times. Also, don't do it too often often to avoid jumping times + if (timeIsConstantCounter < 20 and timeUpdateCd.hasTimedOut()) { + // Update the system time here for now. NTP seems to be unable to do so for whatever reason + settimeofday(&time, nullptr); + timeUpdateCd.resetTimer(); + } + Clock::TimeOfDay_t timeOfDay = {}; Clock::convertTimevalToTimeOfDay(&time, &timeOfDay); gpsSet.year = timeOfDay.year; @@ -192,6 +209,9 @@ void GPSHyperionLinuxController::readGpsDataFromGpsd() { std::cout << "Longitude: " << gps->fix.longitude << std::endl; std::cout << "Altitude(MSL): " << gps->fix.altMSL << std::endl; std::cout << "Speed(m/s): " << gps->fix.speed << std::endl; + std::time_t t = std::time(nullptr); + std::tm tm = *std::gmtime(&t); + std::cout << "C Time: " << std::put_time(&tm, "%c") << std::endl; } } #endif diff --git a/linux/devices/GPSHyperionLinuxController.h b/linux/devices/GPSHyperionLinuxController.h index f0e4e6e0..46acb5fc 100644 --- a/linux/devices/GPSHyperionLinuxController.h +++ b/linux/devices/GPSHyperionLinuxController.h @@ -51,6 +51,8 @@ class GPSHyperionLinuxController : public ExtendedControllerBase { bool modeCommanded = true; gpsmm myGpsmm; bool debugHyperionGps = false; + uint32_t timeIsConstantCounter = 0; + Countdown timeUpdateCd = Countdown(60); void readGpsDataFromGpsd(); }; From 81e33348bb80f2b97bcb36f036117a5d267af1c6 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 7 Apr 2022 10:06:20 +0200 Subject: [PATCH 26/65] tmtc update --- tmtc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tmtc b/tmtc index 1c105752..8f2ff303 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 1c105752642084acf21f78b1b2302f0f4d26aec9 +Subproject commit 8f2ff3034fff627b807f32c02fd9e676126bae5f From c3aa9fb9083e618c2cb4962f064a5af8c97a5e6a Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 7 Apr 2022 10:55:29 +0200 Subject: [PATCH 27/65] update for gps - GPSD/NTPD finally seem to work now. Still keep code to set it manually for now --- linux/devices/GPSHyperionLinuxController.cpp | 7 +- mission/utility/compileTime.h | 97 ++++++++++++++++++++ 2 files changed, 102 insertions(+), 2 deletions(-) create mode 100644 mission/utility/compileTime.h diff --git a/linux/devices/GPSHyperionLinuxController.cpp b/linux/devices/GPSHyperionLinuxController.cpp index d696a188..f1de53e9 100644 --- a/linux/devices/GPSHyperionLinuxController.cpp +++ b/linux/devices/GPSHyperionLinuxController.cpp @@ -4,6 +4,8 @@ #include "fsfw/datapool/PoolReadGuard.h" #include "fsfw/timemanager/Clock.h" +#include "mission/utility/compileTime.h" + #if FSFW_DEV_HYPERION_GPS_CREATE_NMEA_CSV == 1 #include #include @@ -184,8 +186,9 @@ void GPSHyperionLinuxController::readGpsDataFromGpsd() { // If the received time does not change anymore for whatever reason, do not set it here // to avoid stale times. Also, don't do it too often often to avoid jumping times if (timeIsConstantCounter < 20 and timeUpdateCd.hasTimedOut()) { - // Update the system time here for now. NTP seems to be unable to do so for whatever reason - settimeofday(&time, nullptr); + // Update the system time here for now. NTP seems to be unable to do so for whatever reason. + // Further tests have shown that the time seems to be set by NTPD after sme time.. + // Clock::setClock(&time); timeUpdateCd.resetTimer(); } diff --git a/mission/utility/compileTime.h b/mission/utility/compileTime.h new file mode 100644 index 00000000..c55673f6 --- /dev/null +++ b/mission/utility/compileTime.h @@ -0,0 +1,97 @@ +/* + * + * Created: 29.03.2018 + * + * Authors: + * + * Assembled from the code released on Stackoverflow by: + * Dennis (instructable.com/member/nqtronix) | https://stackoverflow.com/questions/23032002/c-c-how-to-get-integer-unix-timestamp-of-build-time-not-string + * and + * Alexis Wilke | https://stackoverflow.com/questions/10538444/do-you-know-of-a-c-macro-to-compute-unix-time-and-date + * + * Assembled by Jean Rabault + * + * UNIX_TIMESTAMP gives the UNIX timestamp (unsigned long integer of seconds since 1st Jan 1970) of compilation from macros using the compiler defined __TIME__ macro. + * This should include Gregorian calendar leap days, in particular the 29ths of February, 100 and 400 years modulo leaps. + * + * Careful: __TIME__ is the local time of the computer, NOT the UTC time in general! + * + */ + +#ifndef COMPILE_TIME_H_ +#define COMPILE_TIME_H_ + +// Some definitions for calculation +#define SEC_PER_MIN 60UL +#define SEC_PER_HOUR 3600UL +#define SEC_PER_DAY 86400UL +#define SEC_PER_YEAR (SEC_PER_DAY*365) + +// extracts 1..4 characters from a string and interprets it as a decimal value +#define CONV_STR2DEC_1(str, i) (str[i]>'0'?str[i]-'0':0) +#define CONV_STR2DEC_2(str, i) (CONV_STR2DEC_1(str, i)*10 + str[i+1]-'0') +#define CONV_STR2DEC_3(str, i) (CONV_STR2DEC_2(str, i)*10 + str[i+2]-'0') +#define CONV_STR2DEC_4(str, i) (CONV_STR2DEC_3(str, i)*10 + str[i+3]-'0') + +// Custom "glue logic" to convert the month name to a usable number +#define GET_MONTH(str, i) (str[i]=='J' && str[i+1]=='a' && str[i+2]=='n' ? 1 : \ + str[i]=='F' && str[i+1]=='e' && str[i+2]=='b' ? 2 : \ + str[i]=='M' && str[i+1]=='a' && str[i+2]=='r' ? 3 : \ + str[i]=='A' && str[i+1]=='p' && str[i+2]=='r' ? 4 : \ + str[i]=='M' && str[i+1]=='a' && str[i+2]=='y' ? 5 : \ + str[i]=='J' && str[i+1]=='u' && str[i+2]=='n' ? 6 : \ + str[i]=='J' && str[i+1]=='u' && str[i+2]=='l' ? 7 : \ + str[i]=='A' && str[i+1]=='u' && str[i+2]=='g' ? 8 : \ + str[i]=='S' && str[i+1]=='e' && str[i+2]=='p' ? 9 : \ + str[i]=='O' && str[i+1]=='c' && str[i+2]=='t' ? 10 : \ + str[i]=='N' && str[i+1]=='o' && str[i+2]=='v' ? 11 : \ + str[i]=='D' && str[i+1]=='e' && str[i+2]=='c' ? 12 : 0) + +// extract the information from the time string given by __TIME__ and __DATE__ +#define __TIME_SECONDS__ CONV_STR2DEC_2(__TIME__, 6) +#define __TIME_MINUTES__ CONV_STR2DEC_2(__TIME__, 3) +#define __TIME_HOURS__ CONV_STR2DEC_2(__TIME__, 0) +#define __TIME_DAYS__ CONV_STR2DEC_2(__DATE__, 4) +#define __TIME_MONTH__ GET_MONTH(__DATE__, 0) +#define __TIME_YEARS__ CONV_STR2DEC_4(__DATE__, 7) + +// Days in February +#define _UNIX_TIMESTAMP_FDAY(year) \ + (((year) % 400) == 0UL ? 29UL : \ + (((year) % 100) == 0UL ? 28UL : \ + (((year) % 4) == 0UL ? 29UL : \ + 28UL))) + +// Days in the year +#define _UNIX_TIMESTAMP_YDAY(year, month, day) \ + ( \ + /* January */ day \ + /* February */ + (month >= 2 ? 31UL : 0UL) \ + /* March */ + (month >= 3 ? _UNIX_TIMESTAMP_FDAY(year) : 0UL) \ + /* April */ + (month >= 4 ? 31UL : 0UL) \ + /* May */ + (month >= 5 ? 30UL : 0UL) \ + /* June */ + (month >= 6 ? 31UL : 0UL) \ + /* July */ + (month >= 7 ? 30UL : 0UL) \ + /* August */ + (month >= 8 ? 31UL : 0UL) \ + /* September */+ (month >= 9 ? 31UL : 0UL) \ + /* October */ + (month >= 10 ? 30UL : 0UL) \ + /* November */ + (month >= 11 ? 31UL : 0UL) \ + /* December */ + (month >= 12 ? 30UL : 0UL) \ + ) + +// get the UNIX timestamp from a digits representation +#define _UNIX_TIMESTAMP(year, month, day, hour, minute, second) \ + ( /* time */ second \ + + minute * SEC_PER_MIN \ + + hour * SEC_PER_HOUR \ + + /* year day (month + day) */ (_UNIX_TIMESTAMP_YDAY(year, month, day) - 1) * SEC_PER_DAY \ + + /* year */ (year - 1970UL) * SEC_PER_YEAR \ + + ((year - 1969UL) / 4UL) * SEC_PER_DAY \ + - ((year - 1901UL) / 100UL) * SEC_PER_DAY \ + + ((year - 1601UL) / 400UL) * SEC_PER_DAY \ + ) + +// the UNIX timestamp +#define UNIX_TIMESTAMP (_UNIX_TIMESTAMP(__TIME_YEARS__, __TIME_MONTH__, __TIME_DAYS__, __TIME_HOURS__, __TIME_MINUTES__, __TIME_SECONDS__)) + +#endif From b2933f95d72bc809425b394145471e42aab10988 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 7 Apr 2022 11:07:51 +0200 Subject: [PATCH 28/65] fsfw update --- fsfw | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fsfw b/fsfw index 43917d98..a11d7455 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 43917d98c025b446aa0d79d2166b1f031fb288ae +Subproject commit a11d7455dfaf2e736f73f6c4dda1f8c06b9f1234 From 5c4ae861b16cb1a41254276143cc575373ad92bf Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 7 Apr 2022 11:11:37 +0200 Subject: [PATCH 29/65] exclude gps changes --- linux/devices/GPSHyperionLinuxController.cpp | 26 ++------------------ linux/devices/GPSHyperionLinuxController.h | 2 -- 2 files changed, 2 insertions(+), 26 deletions(-) diff --git a/linux/devices/GPSHyperionLinuxController.cpp b/linux/devices/GPSHyperionLinuxController.cpp index b892dc70..a811fbc5 100644 --- a/linux/devices/GPSHyperionLinuxController.cpp +++ b/linux/devices/GPSHyperionLinuxController.cpp @@ -9,16 +9,13 @@ #include #endif #include -#include GPSHyperionLinuxController::GPSHyperionLinuxController(object_id_t objectId, object_id_t parentId, bool debugHyperionGps) : ExtendedControllerBase(objectId, objects::NO_OBJECT), gpsSet(this), myGpsmm(GPSD_SHARED_MEMORY, nullptr), - debugHyperionGps(debugHyperionGps) { - timeUpdateCd.resetTimer(); -} + debugHyperionGps(debugHyperionGps) {} GPSHyperionLinuxController::~GPSHyperionLinuxController() {} @@ -79,11 +76,9 @@ ReturnValue_t GPSHyperionLinuxController::initializeLocalDataPool( localDataPoolMap.emplace(GpsHyperion::SATS_IN_USE, new PoolEntry()); localDataPoolMap.emplace(GpsHyperion::SATS_IN_VIEW, new PoolEntry()); localDataPoolMap.emplace(GpsHyperion::FIX_MODE, new PoolEntry()); - bool enablePeriodicHk = false; #if OBSW_ENABLE_PERIODIC_HK == 1 - enablePeriodicHk = true; + poolManager.subscribeForPeriodicPacket(gpsSet.getSid(), true, 2.0, false); #endif - poolManager.subscribeForPeriodicPacket(gpsSet.getSid(), enablePeriodicHk, 2.0, false); return HasReturnvaluesIF::RETURN_OK; } @@ -177,20 +172,6 @@ void GPSHyperionLinuxController::readGpsDataFromGpsd() { timeval time = {}; time.tv_sec = gpsSet.unixSeconds.value; time.tv_usec = gps->fix.time.tv_nsec / 1000; - std::time_t t = std::time(nullptr); - if (time.tv_sec == t) { - timeIsConstantCounter++; - } else { - timeIsConstantCounter = 0; - } - // If the received time does not change anymore for whatever reason, do not set it here - // to avoid stale times. Also, don't do it too often often to avoid jumping times - if (timeIsConstantCounter < 3 and timeUpdateCd.hasTimedOut()) { - // Update the system time here for now. NTP seems to be unable to do so for whatever reason - settimeofday(&time, nullptr); - timeUpdateCd.resetTimer(); - } - Clock::TimeOfDay_t timeOfDay = {}; Clock::convertTimevalToTimeOfDay(&time, &timeOfDay); gpsSet.year = timeOfDay.year; @@ -211,9 +192,6 @@ void GPSHyperionLinuxController::readGpsDataFromGpsd() { std::cout << "Longitude: " << gps->fix.longitude << std::endl; std::cout << "Altitude(MSL): " << gps->fix.altMSL << std::endl; std::cout << "Speed(m/s): " << gps->fix.speed << std::endl; - std::time_t t = std::time(nullptr); - std::tm tm = *std::gmtime(&t); - std::cout << "C Time: " << std::put_time(&tm, "%c") << std::endl; } } #endif diff --git a/linux/devices/GPSHyperionLinuxController.h b/linux/devices/GPSHyperionLinuxController.h index 46acb5fc..f0e4e6e0 100644 --- a/linux/devices/GPSHyperionLinuxController.h +++ b/linux/devices/GPSHyperionLinuxController.h @@ -51,8 +51,6 @@ class GPSHyperionLinuxController : public ExtendedControllerBase { bool modeCommanded = true; gpsmm myGpsmm; bool debugHyperionGps = false; - uint32_t timeIsConstantCounter = 0; - Countdown timeUpdateCd = Countdown(60); void readGpsDataFromGpsd(); }; From 8f4f2713315e6f28dae3459ce85368ffb8e8cd2c Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 7 Apr 2022 11:15:28 +0200 Subject: [PATCH 30/65] longer HK intervals --- linux/devices/GPSHyperionLinuxController.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/linux/devices/GPSHyperionLinuxController.cpp b/linux/devices/GPSHyperionLinuxController.cpp index f1de53e9..b608f972 100644 --- a/linux/devices/GPSHyperionLinuxController.cpp +++ b/linux/devices/GPSHyperionLinuxController.cpp @@ -81,9 +81,7 @@ ReturnValue_t GPSHyperionLinuxController::initializeLocalDataPool( localDataPoolMap.emplace(GpsHyperion::SATS_IN_USE, new PoolEntry()); localDataPoolMap.emplace(GpsHyperion::SATS_IN_VIEW, new PoolEntry()); localDataPoolMap.emplace(GpsHyperion::FIX_MODE, new PoolEntry()); -#if OBSW_ENABLE_PERIODIC_HK == 1 - poolManager.subscribeForPeriodicPacket(gpsSet.getSid(), true, 2.0, false); -#endif + poolManager.subscribeForPeriodicPacket(gpsSet.getSid(), false, 10.0, false); return HasReturnvaluesIF::RETURN_OK; } From ca92b858645b02bc36f71bb709ddb17dd0a58a9f Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 7 Apr 2022 11:22:29 +0200 Subject: [PATCH 31/65] enable periodic HK by default --- linux/devices/GPSHyperionLinuxController.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/linux/devices/GPSHyperionLinuxController.cpp b/linux/devices/GPSHyperionLinuxController.cpp index b608f972..34e02001 100644 --- a/linux/devices/GPSHyperionLinuxController.cpp +++ b/linux/devices/GPSHyperionLinuxController.cpp @@ -81,7 +81,11 @@ ReturnValue_t GPSHyperionLinuxController::initializeLocalDataPool( localDataPoolMap.emplace(GpsHyperion::SATS_IN_USE, new PoolEntry()); localDataPoolMap.emplace(GpsHyperion::SATS_IN_VIEW, new PoolEntry()); localDataPoolMap.emplace(GpsHyperion::FIX_MODE, new PoolEntry()); - poolManager.subscribeForPeriodicPacket(gpsSet.getSid(), false, 10.0, false); + bool enableHk = false; +#if OBSW_ENABLE_PERIODIC_HK == 1 + enableHk = true; +#endif + poolManager.subscribeForPeriodicPacket(gpsSet.getSid(), enableHk, 60.0, false); return HasReturnvaluesIF::RETURN_OK; } From 66627741f9728a708b0d2267518594120bd31afd Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 7 Apr 2022 11:53:21 +0200 Subject: [PATCH 32/65] periodic HK definitions for all device handlers --- mission/devices/ACUHandler.cpp | 1 + mission/devices/BpxBatteryHandler.cpp | 5 +---- mission/devices/GPSHyperionHandler.cpp | 2 +- mission/devices/GyroADIS1650XHandler.cpp | 1 + mission/devices/IMTQHandler.cpp | 2 ++ mission/devices/Max31865PT1000Handler.cpp | 3 +-- mission/devices/PDU1Handler.cpp | 2 +- mission/devices/PDU2Handler.cpp | 4 +--- mission/devices/PayloadPcduHandler.cpp | 2 +- mission/devices/RadiationSensorHandler.cpp | 1 + mission/devices/RwHandler.cpp | 4 +++- mission/devices/SusHandler.cpp | 1 + mission/devices/SyrlinksHkHandler.cpp | 3 +++ mission/devices/Tmp1075Handler.cpp | 3 ++- mission/devices/devicedefinitions/Tmp1075Definitions.h | 4 ++-- 15 files changed, 22 insertions(+), 16 deletions(-) diff --git a/mission/devices/ACUHandler.cpp b/mission/devices/ACUHandler.cpp index 7c6e048c..133eb237 100644 --- a/mission/devices/ACUHandler.cpp +++ b/mission/devices/ACUHandler.cpp @@ -271,6 +271,7 @@ ReturnValue_t ACUHandler::initializeLocalDataPool(localpool::DataPool &localData localDataPoolMap.emplace(pool::ACU_WDT_CNT_GND, new PoolEntry({0})); localDataPoolMap.emplace(pool::ACU_WDT_GND_LEFT, new PoolEntry({0})); + poolManager.subscribeForPeriodicPacket(acuHkTableDataset.getSid(), false, 30.0, false); return HasReturnvaluesIF::RETURN_OK; } diff --git a/mission/devices/BpxBatteryHandler.cpp b/mission/devices/BpxBatteryHandler.cpp index 2ad20c9d..9da04207 100644 --- a/mission/devices/BpxBatteryHandler.cpp +++ b/mission/devices/BpxBatteryHandler.cpp @@ -270,10 +270,7 @@ ReturnValue_t BpxBatteryHandler::initializeLocalDataPool(localpool::DataPool& lo localDataPoolMap.emplace(BpxBattery::BATTERY_HEATER_MODE, &battheatMode); localDataPoolMap.emplace(BpxBattery::BATTHEAT_LOW_LIMIT, &battheatLow); localDataPoolMap.emplace(BpxBattery::BATTHEAT_HIGH_LIMIT, &battheatHigh); - -#if OBSW_ENABLE_PERIODIC_HK == 1 - poolManager.subscribeForPeriodicPacket(hkSet.getSid(), true, 1.0, false); -#endif + poolManager.subscribeForPeriodicPacket(hkSet.getSid(), false, 30.0, false); return HasReturnvaluesIF::RETURN_OK; } diff --git a/mission/devices/GPSHyperionHandler.cpp b/mission/devices/GPSHyperionHandler.cpp index d6928bb5..ac1f99fa 100644 --- a/mission/devices/GPSHyperionHandler.cpp +++ b/mission/devices/GPSHyperionHandler.cpp @@ -169,7 +169,7 @@ ReturnValue_t GPSHyperionHandler::initializeLocalDataPool(localpool::DataPool &l localDataPoolMap.emplace(GpsHyperion::UNIX_SECONDS, new PoolEntry()); localDataPoolMap.emplace(GpsHyperion::SATS_IN_USE, new PoolEntry()); localDataPoolMap.emplace(GpsHyperion::FIX_MODE, new PoolEntry()); - poolManager.subscribeForPeriodicPacket(gpsSet.getSid(), true, 2.0, false); + poolManager.subscribeForPeriodicPacket(gpsSet.getSid(), false, 30.0, false); return HasReturnvaluesIF::RETURN_OK; } diff --git a/mission/devices/GyroADIS1650XHandler.cpp b/mission/devices/GyroADIS1650XHandler.cpp index b29f71de..3b525287 100644 --- a/mission/devices/GyroADIS1650XHandler.cpp +++ b/mission/devices/GyroADIS1650XHandler.cpp @@ -363,6 +363,7 @@ ReturnValue_t GyroADIS1650XHandler::initializeLocalDataPool(localpool::DataPool localDataPoolMap.emplace(ADIS1650X::FILTER_SETTINGS, new PoolEntry()); localDataPoolMap.emplace(ADIS1650X::MSC_CTRL_REGISTER, new PoolEntry()); localDataPoolMap.emplace(ADIS1650X::DEC_RATE_REGISTER, new PoolEntry()); + poolManager.subscribeForPeriodicPacket(primaryDataset.getSid(), false, 5.0, true); return HasReturnvaluesIF::RETURN_OK; } diff --git a/mission/devices/IMTQHandler.cpp b/mission/devices/IMTQHandler.cpp index 3c3e1a66..99537dcb 100644 --- a/mission/devices/IMTQHandler.cpp +++ b/mission/devices/IMTQHandler.cpp @@ -599,6 +599,8 @@ ReturnValue_t IMTQHandler::initializeLocalDataPool(localpool::DataPool& localDat localDataPoolMap.emplace(IMTQ::FINA_NEG_Z_COIL_Y_TEMPERATURE, new PoolEntry({0})); localDataPoolMap.emplace(IMTQ::FINA_NEG_Z_COIL_Z_TEMPERATURE, new PoolEntry({0})); + poolManager.subscribeForPeriodicPacket(engHkDataset.getSid(), false, 10.0, true); + poolManager.subscribeForPeriodicPacket(calMtmMeasurementSet.getSid(), false, 10.0, true); return HasReturnvaluesIF::RETURN_OK; } diff --git a/mission/devices/Max31865PT1000Handler.cpp b/mission/devices/Max31865PT1000Handler.cpp index 9a4d88ce..3bb3e911 100644 --- a/mission/devices/Max31865PT1000Handler.cpp +++ b/mission/devices/Max31865PT1000Handler.cpp @@ -515,8 +515,7 @@ ReturnValue_t Max31865PT1000Handler::initializeLocalDataPool(localpool::DataPool localDataPoolMap.emplace(Max31865Definitions::PoolIds::TEMPERATURE_C, new PoolEntry({0}, 1, true)); localDataPoolMap.emplace(Max31865Definitions::PoolIds::FAULT_BYTE, new PoolEntry({0})); - // poolManager.subscribeForPeriodicPacket(sensorDatasetSid, - // false, 4.0, false); + poolManager.subscribeForPeriodicPacket(sensorDataset.getSid(), false, 30.0, false); return HasReturnvaluesIF::RETURN_OK; } diff --git a/mission/devices/PDU1Handler.cpp b/mission/devices/PDU1Handler.cpp index e0c369a3..def2acac 100644 --- a/mission/devices/PDU1Handler.cpp +++ b/mission/devices/PDU1Handler.cpp @@ -426,7 +426,7 @@ ReturnValue_t PDU1Handler::initializeLocalDataPool(localpool::DataPool &localDat localDataPoolMap.emplace(P60System::pool::PDU1_WDT_CAN_LEFT, new PoolEntry({0})); localDataPoolMap.emplace(P60System::pool::PDU1_WDT_CSP_LEFT1, new PoolEntry({0})); localDataPoolMap.emplace(P60System::pool::PDU1_WDT_CSP_LEFT2, new PoolEntry({0})); - poolManager.subscribeForPeriodicPacket(pdu1HkTableDataset.getSid(), false, 0.4, true); + poolManager.subscribeForPeriodicPacket(pdu1HkTableDataset.getSid(), false, 10.0, false); return HasReturnvaluesIF::RETURN_OK; } diff --git a/mission/devices/PDU2Handler.cpp b/mission/devices/PDU2Handler.cpp index 48e7f90e..2fca1ebd 100644 --- a/mission/devices/PDU2Handler.cpp +++ b/mission/devices/PDU2Handler.cpp @@ -354,9 +354,7 @@ ReturnValue_t PDU2Handler::initializeLocalDataPool(localpool::DataPool &localDat localDataPoolMap.emplace(pool::PDU2_WDT_CAN_LEFT, new PoolEntry({0})); localDataPoolMap.emplace(pool::PDU2_WDT_CSP_LEFT1, new PoolEntry({0})); localDataPoolMap.emplace(pool::PDU2_WDT_CSP_LEFT2, new PoolEntry({0})); -#if OBSW_ENABLE_PERIODIC_HK == 1 - poolManager.subscribeForPeriodicPacket(pdu2HkTableDataset.getSid(), false, 0.4, true); -#endif + poolManager.subscribeForPeriodicPacket(pdu2HkTableDataset.getSid(), false, 10.0, false); return HasReturnvaluesIF::RETURN_OK; } diff --git a/mission/devices/PayloadPcduHandler.cpp b/mission/devices/PayloadPcduHandler.cpp index 621b7d9e..a13b7ba6 100644 --- a/mission/devices/PayloadPcduHandler.cpp +++ b/mission/devices/PayloadPcduHandler.cpp @@ -293,7 +293,7 @@ ReturnValue_t PayloadPcduHandler::initializeLocalDataPool(localpool::DataPool& l localDataPoolMap.emplace(plpcdu::PlPcduPoolIds::CHANNEL_VEC, &channelValues); localDataPoolMap.emplace(plpcdu::PlPcduPoolIds::PROCESSED_VEC, &processedValues); localDataPoolMap.emplace(plpcdu::PlPcduPoolIds::TEMP, &tempC); - poolManager.subscribeForPeriodicPacket(adcSet.getSid(), false, 0.1, true); + poolManager.subscribeForPeriodicPacket(adcSet.getSid(), false, 5.0, true); return HasReturnvaluesIF::RETURN_OK; } diff --git a/mission/devices/RadiationSensorHandler.cpp b/mission/devices/RadiationSensorHandler.cpp index e91d8427..b3a9954a 100644 --- a/mission/devices/RadiationSensorHandler.cpp +++ b/mission/devices/RadiationSensorHandler.cpp @@ -203,6 +203,7 @@ ReturnValue_t RadiationSensorHandler::initializeLocalDataPool(localpool::DataPoo localDataPoolMap.emplace(RAD_SENSOR::AIN5, new PoolEntry({0})); localDataPoolMap.emplace(RAD_SENSOR::AIN6, new PoolEntry({0})); localDataPoolMap.emplace(RAD_SENSOR::AIN7, new PoolEntry({0})); + poolManager.subscribeForPeriodicPacket(dataset.getSid(), false, 20.0, false); return HasReturnvaluesIF::RETURN_OK; } diff --git a/mission/devices/RwHandler.cpp b/mission/devices/RwHandler.cpp index 941abf29..99cd341c 100644 --- a/mission/devices/RwHandler.cpp +++ b/mission/devices/RwHandler.cpp @@ -279,7 +279,9 @@ ReturnValue_t RwHandler::initializeLocalDataPool(localpool::DataPool& localDataP localDataPoolMap.emplace(RwDefinitions::SPI_BYTES_READ, new PoolEntry({0})); localDataPoolMap.emplace(RwDefinitions::SPI_REG_OVERRUN_ERRORS, new PoolEntry({0})); localDataPoolMap.emplace(RwDefinitions::SPI_TOTAL_ERRORS, new PoolEntry({0})); - + poolManager.subscribeForPeriodicPacket(temperatureSet.getSid(), false, 30.0, false); + poolManager.subscribeForPeriodicPacket(statusSet.getSid(), false, 5.0, true); + poolManager.subscribeForPeriodicPacket(tmDataset.getSid(), false, 30.0, false); return RETURN_OK; } diff --git a/mission/devices/SusHandler.cpp b/mission/devices/SusHandler.cpp index bea5a749..d763b47d 100644 --- a/mission/devices/SusHandler.cpp +++ b/mission/devices/SusHandler.cpp @@ -200,6 +200,7 @@ ReturnValue_t SusHandler::initializeLocalDataPool(localpool::DataPool &localData LocalDataPoolManager &poolManager) { localDataPoolMap.emplace(SUS::TEMPERATURE_C, &tempC); localDataPoolMap.emplace(SUS::CHANNEL_VEC, &channelVec); + poolManager.subscribeForPeriodicPacket(dataset.getSid(), false, 5.0, true); return HasReturnvaluesIF::RETURN_OK; } diff --git a/mission/devices/SyrlinksHkHandler.cpp b/mission/devices/SyrlinksHkHandler.cpp index 9108a6f1..43888724 100644 --- a/mission/devices/SyrlinksHkHandler.cpp +++ b/mission/devices/SyrlinksHkHandler.cpp @@ -627,6 +627,9 @@ ReturnValue_t SyrlinksHkHandler::initializeLocalDataPool(localpool::DataPool& lo localDataPoolMap.emplace(syrlinks::TEMP_BASEBAND_BOARD, new PoolEntry({0})); localDataPoolMap.emplace(syrlinks::TEMP_POWER_AMPLIFIER, new PoolEntry({0})); + poolManager.subscribeForPeriodicPacket(txDataset.getSid(), false, 5.0, true); + poolManager.subscribeForPeriodicPacket(rxDataset.getSid(), false, 5.0, true); + poolManager.subscribeForPeriodicPacket(temperatureSet.getSid(), false, 10.0, false); return HasReturnvaluesIF::RETURN_OK; } diff --git a/mission/devices/Tmp1075Handler.cpp b/mission/devices/Tmp1075Handler.cpp index 59298851..ce434ff0 100644 --- a/mission/devices/Tmp1075Handler.cpp +++ b/mission/devices/Tmp1075Handler.cpp @@ -119,6 +119,7 @@ uint32_t Tmp1075Handler::getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) { ReturnValue_t Tmp1075Handler::initializeLocalDataPool(localpool::DataPool &localDataPoolMap, LocalDataPoolManager &poolManager) { - localDataPoolMap.emplace(TMP1075::TEMPERATURE_C_TMP1075_1, new PoolEntry({0.0})); + localDataPoolMap.emplace(TMP1075::TEMPERATURE_C_TMP1075, new PoolEntry({0.0})); + poolManager.subscribeForPeriodicPacket(dataset.getSid(), false, 30.0, false); return HasReturnvaluesIF::RETURN_OK; } diff --git a/mission/devices/devicedefinitions/Tmp1075Definitions.h b/mission/devices/devicedefinitions/Tmp1075Definitions.h index 3f48508c..6799fd42 100644 --- a/mission/devices/devicedefinitions/Tmp1075Definitions.h +++ b/mission/devices/devicedefinitions/Tmp1075Definitions.h @@ -21,7 +21,7 @@ static const uint32_t TMP1075_DATA_SET_ID = GET_TEMP; static const uint8_t MAX_REPLY_LENGTH = GET_TEMP_REPLY_SIZE; -enum Tmp1075PoolIds : lp_id_t { TEMPERATURE_C_TMP1075_1, TEMPERATURE_C_TMP1075_2 }; +enum Tmp1075PoolIds : lp_id_t { TEMPERATURE_C_TMP1075 }; class Tmp1075Dataset : public StaticLocalDataSet { public: @@ -29,7 +29,7 @@ class Tmp1075Dataset : public StaticLocalDataSet { Tmp1075Dataset(object_id_t objectId) : StaticLocalDataSet(sid_t(objectId, TMP1075_DATA_SET_ID)) {} - lp_var_t temperatureCelcius = lp_var_t(sid.objectId, TEMPERATURE_C_TMP1075_1, this); + lp_var_t temperatureCelcius = lp_var_t(sid.objectId, TEMPERATURE_C_TMP1075, this); }; } // namespace TMP1075 From 64dce75e09d7d409dd053fb14a4ff6accc1c297c Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 7 Apr 2022 11:56:01 +0200 Subject: [PATCH 33/65] hk update for gps --- linux/devices/GPSHyperionLinuxController.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/linux/devices/GPSHyperionLinuxController.cpp b/linux/devices/GPSHyperionLinuxController.cpp index a811fbc5..29dba910 100644 --- a/linux/devices/GPSHyperionLinuxController.cpp +++ b/linux/devices/GPSHyperionLinuxController.cpp @@ -76,9 +76,7 @@ ReturnValue_t GPSHyperionLinuxController::initializeLocalDataPool( localDataPoolMap.emplace(GpsHyperion::SATS_IN_USE, new PoolEntry()); localDataPoolMap.emplace(GpsHyperion::SATS_IN_VIEW, new PoolEntry()); localDataPoolMap.emplace(GpsHyperion::FIX_MODE, new PoolEntry()); -#if OBSW_ENABLE_PERIODIC_HK == 1 - poolManager.subscribeForPeriodicPacket(gpsSet.getSid(), true, 2.0, false); -#endif + poolManager.subscribeForPeriodicPacket(gpsSet.getSid(), false, 30.0, false); return HasReturnvaluesIF::RETURN_OK; } From 4e3fa54ae25f54dde23b0669737dbb20d86f3cce Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 7 Apr 2022 12:22:08 +0200 Subject: [PATCH 34/65] split P60 dock HK into core and aux HK --- linux/devices/GPSHyperionLinuxController.cpp | 1 - mission/devices/ACUHandler.cpp | 9 +- mission/devices/ACUHandler.h | 2 + mission/devices/GomspaceDeviceHandler.cpp | 18 +- mission/devices/GomspaceDeviceHandler.h | 4 +- mission/devices/P60DockHandler.cpp | 175 +++++++++--------- mission/devices/P60DockHandler.h | 4 +- mission/devices/PDU1Handler.cpp | 10 +- mission/devices/PDU1Handler.h | 2 +- mission/devices/PDU2Handler.cpp | 10 +- mission/devices/PDU2Handler.h | 1 + .../devicedefinitions/GomspaceDefinitions.h | 50 +++-- mission/utility/compileTime.h | 113 ++++++----- 13 files changed, 205 insertions(+), 194 deletions(-) diff --git a/linux/devices/GPSHyperionLinuxController.cpp b/linux/devices/GPSHyperionLinuxController.cpp index 34e02001..4ab0988b 100644 --- a/linux/devices/GPSHyperionLinuxController.cpp +++ b/linux/devices/GPSHyperionLinuxController.cpp @@ -3,7 +3,6 @@ #include "OBSWConfig.h" #include "fsfw/datapool/PoolReadGuard.h" #include "fsfw/timemanager/Clock.h" - #include "mission/utility/compileTime.h" #if FSFW_DEV_HYPERION_GPS_CREATE_NMEA_CSV == 1 diff --git a/mission/devices/ACUHandler.cpp b/mission/devices/ACUHandler.cpp index 7c6e048c..3abe5f53 100644 --- a/mission/devices/ACUHandler.cpp +++ b/mission/devices/ACUHandler.cpp @@ -4,7 +4,7 @@ ACUHandler::ACUHandler(object_id_t objectId, object_id_t comIF, CookieIF *comCookie) : GomspaceDeviceHandler(objectId, comIF, comCookie, ACU::MAX_CONFIGTABLE_ADDRESS, - ACU::MAX_HKTABLE_ADDRESS, ACU::HK_TABLE_REPLY_SIZE, &acuHkTableDataset), + ACU::MAX_HKTABLE_ADDRESS, ACU::HK_TABLE_REPLY_SIZE), acuHkTableDataset(this) {} ACUHandler::~ACUHandler() {} @@ -39,6 +39,13 @@ void ACUHandler::letChildHandleHkReply(DeviceCommandId_t id, const uint8_t *pack #endif } +LocalPoolDataSetBase *ACUHandler::getDataSetHandle(sid_t sid) { + if (sid == acuHkTableDataset.getSid()) { + return &acuHkTableDataset; + } + return nullptr; +} + void ACUHandler::parseHkTableReply(const uint8_t *packet) { uint16_t dataOffset = 0; acuHkTableDataset.read(); diff --git a/mission/devices/ACUHandler.h b/mission/devices/ACUHandler.h index f3af5eae..3b1feaf3 100644 --- a/mission/devices/ACUHandler.h +++ b/mission/devices/ACUHandler.h @@ -31,6 +31,8 @@ class ACUHandler : public GomspaceDeviceHandler { virtual ReturnValue_t childCommandHook(DeviceCommandId_t cmd, const uint8_t* commandData, size_t commandDataLen) override; + LocalPoolDataSetBase* getDataSetHandle(sid_t sid) override; + private: static const DeviceCommandId_t PRINT_CHANNEL_STATS = 51; diff --git a/mission/devices/GomspaceDeviceHandler.cpp b/mission/devices/GomspaceDeviceHandler.cpp index 25bde5db..26c09901 100644 --- a/mission/devices/GomspaceDeviceHandler.cpp +++ b/mission/devices/GomspaceDeviceHandler.cpp @@ -7,20 +7,14 @@ GomspaceDeviceHandler::GomspaceDeviceHandler(object_id_t objectId, object_id_t comIF, CookieIF* comCookie, uint16_t maxConfigTableAddress, - uint16_t maxHkTableAddress, uint16_t hkTableReplySize, - LocalPoolDataSetBase* hkTableDataset) + uint16_t maxHkTableAddress, uint16_t hkTableReplySize) : DeviceHandlerBase(objectId, comIF, comCookie), maxConfigTableAddress(maxConfigTableAddress), maxHkTableAddress(maxHkTableAddress), - hkTableReplySize(hkTableReplySize), - hkTableDataset(hkTableDataset) { + hkTableReplySize(hkTableReplySize) { if (comCookie == nullptr) { sif::error << "GomspaceDeviceHandler::GomspaceDeviceHandler: Invalid com cookie" << std::endl; } - if (hkTableDataset == nullptr) { - sif::error << "GomspaceDeviceHandler::GomspaceDeviceHandler: Invalid hk table data set" - << std::endl; - } } GomspaceDeviceHandler::~GomspaceDeviceHandler() {} @@ -405,14 +399,6 @@ ReturnValue_t GomspaceDeviceHandler::generateRequestFullHkTableCmd(uint16_t hkTa uint32_t GomspaceDeviceHandler::getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) { return 0; } -LocalPoolDataSetBase* GomspaceDeviceHandler::getDataSetHandle(sid_t sid) { - if (sid == hkTableDataset->getSid()) { - return hkTableDataset; - } else { - return nullptr; - } -} - void GomspaceDeviceHandler::setModeNormal() { mode = MODE_NORMAL; } ReturnValue_t GomspaceDeviceHandler::printStatus(DeviceCommandId_t cmd) { diff --git a/mission/devices/GomspaceDeviceHandler.h b/mission/devices/GomspaceDeviceHandler.h index 3d50b27b..fedc91d9 100644 --- a/mission/devices/GomspaceDeviceHandler.h +++ b/mission/devices/GomspaceDeviceHandler.h @@ -39,7 +39,7 @@ class GomspaceDeviceHandler : public DeviceHandlerBase { */ GomspaceDeviceHandler(object_id_t objectId, object_id_t comIF, CookieIF *comCookie, uint16_t maxConfigTableAddress, uint16_t maxHkTableAddress, - uint16_t hkTableReplySize, LocalPoolDataSetBase *hkTableDataset); + uint16_t hkTableReplySize); virtual ~GomspaceDeviceHandler(); /** @@ -100,7 +100,7 @@ class GomspaceDeviceHandler : public DeviceHandlerBase { */ virtual void letChildHandleHkReply(DeviceCommandId_t id, const uint8_t *packet) = 0; - virtual LocalPoolDataSetBase *getDataSetHandle(sid_t sid) override; + virtual LocalPoolDataSetBase *getDataSetHandle(sid_t sid) = 0; /** * @brief Can be overriden by child classes to implement device specific commands. diff --git a/mission/devices/P60DockHandler.cpp b/mission/devices/P60DockHandler.cpp index 455784fb..9a337687 100644 --- a/mission/devices/P60DockHandler.cpp +++ b/mission/devices/P60DockHandler.cpp @@ -6,9 +6,9 @@ P60DockHandler::P60DockHandler(object_id_t objectId, object_id_t comIF, CookieIF *comCookie) : GomspaceDeviceHandler(objectId, comIF, comCookie, P60Dock::MAX_CONFIGTABLE_ADDRESS, - P60Dock::MAX_HKTABLE_ADDRESS, P60Dock::HK_TABLE_REPLY_SIZE, - &p60dockHkTableDataset), - p60dockHkTableDataset(this) {} + P60Dock::MAX_HKTABLE_ADDRESS, P60Dock::HK_TABLE_REPLY_SIZE), + coreHk(this), + auxHk(this) {} P60DockHandler::~P60DockHandler() {} @@ -23,7 +23,7 @@ void P60DockHandler::letChildHandleHkReply(DeviceCommandId_t id, const uint8_t * * Hk table will be sent to the commander if hk table request was not triggered by the * P60DockHandler itself. */ - handleDeviceTM(&p60dockHkTableDataset, id, true); + handleDeviceTM(&coreHk, id, true); #if OBSW_VERBOSE_LEVEL >= 1 && OBSW_DEBUG_P60DOCK == 1 p60dockHkTableDataset.read(); @@ -73,8 +73,12 @@ void P60DockHandler::letChildHandleHkReply(DeviceCommandId_t id, const uint8_t * void P60DockHandler::parseHkTableReply(const uint8_t *packet) { using namespace P60Dock; uint16_t dataOffset = 0; - PoolReadGuard pg(&p60dockHkTableDataset); - if (pg.getReadResult() != HasReturnvaluesIF::RETURN_OK) { + PoolReadGuard pg0(&coreHk); + PoolReadGuard pg1(&auxHk); + if (pg0.getReadResult() != HasReturnvaluesIF::RETURN_OK or + pg1.getReadResult() != HasReturnvaluesIF::RETURN_OK) { + coreHk.setValidity(false, true); + auxHk.setValidity(false, true); return; } /** @@ -83,129 +87,116 @@ void P60DockHandler::parseHkTableReply(const uint8_t *packet) { */ dataOffset += 12; for (uint8_t idx = 0; idx < hk::CHNLS_LEN; idx++) { - p60dockHkTableDataset.currents[idx] = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); + coreHk.currents[idx] = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); dataOffset += 4; } for (uint8_t idx = 0; idx < hk::CHNLS_LEN; idx++) { - p60dockHkTableDataset.voltages[idx] = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); + coreHk.voltages[idx] = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); dataOffset += 4; } for (uint8_t idx = 0; idx < hk::CHNLS_LEN; idx++) { - p60dockHkTableDataset.outputEnables[idx] = *(packet + dataOffset); + coreHk.outputEnables[idx] = *(packet + dataOffset); dataOffset += 3; } - p60dockHkTableDataset.temperature1 = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); + coreHk.temperature1 = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); dataOffset += 4; - p60dockHkTableDataset.temperature2 = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); + coreHk.temperature2 = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); dataOffset += 4; - p60dockHkTableDataset.bootcause = *(packet + dataOffset) << 24 | + auxHk.bootcause = *(packet + dataOffset) << 24 | - *(packet + dataOffset + 1) << 16 | - *(packet + dataOffset + 2) << 8 | *(packet + dataOffset + 3); + *(packet + dataOffset + 1) << 16 | *(packet + dataOffset + 2) << 8 | + *(packet + dataOffset + 3); dataOffset += 6; - p60dockHkTableDataset.bootCount = *(packet + dataOffset) << 24 | - *(packet + dataOffset + 1) << 16 | - *(packet + dataOffset + 2) << 8 | *(packet + dataOffset + 3); + coreHk.bootCount = *(packet + dataOffset) << 24 | *(packet + dataOffset + 1) << 16 | + *(packet + dataOffset + 2) << 8 | *(packet + dataOffset + 3); dataOffset += 6; - p60dockHkTableDataset.uptime = *(packet + dataOffset) << 24 | *(packet + dataOffset + 1) << 16 | - *(packet + dataOffset + 2) << 8 | *(packet + dataOffset + 3); + auxHk.uptime = *(packet + dataOffset) << 24 | *(packet + dataOffset + 1) << 16 | + *(packet + dataOffset + 2) << 8 | *(packet + dataOffset + 3); dataOffset += 6; - p60dockHkTableDataset.resetcause = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); + auxHk.resetcause = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); dataOffset += 4; - p60dockHkTableDataset.battMode = *(packet + dataOffset); + coreHk.battMode = *(packet + dataOffset); dataOffset += 3; - p60dockHkTableDataset.heaterOn = *(packet + dataOffset); + auxHk.heaterOn = *(packet + dataOffset); /* + 13 because here begins a new gomspace csp data field */ dataOffset += 13; - p60dockHkTableDataset.converter5VStatus = *(packet + dataOffset); + auxHk.converter5VStatus = *(packet + dataOffset); dataOffset += 3; for (uint8_t idx = 0; idx < hk::CHNLS_LEN; idx++) { - p60dockHkTableDataset.latchups[idx] = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); + auxHk.latchups[idx] = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); dataOffset += 4; } - p60dockHkTableDataset.dockVbatVoltageValue = - *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); + auxHk.dockVbatVoltageValue = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); dataOffset += 4; - p60dockHkTableDataset.dockVccCurrent = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); + auxHk.dockVccCurrent = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); dataOffset += 4; - p60dockHkTableDataset.batteryCurrent = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); + coreHk.batteryCurrent = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); dataOffset += 4; - p60dockHkTableDataset.batteryVoltage = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); + coreHk.batteryVoltage = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); dataOffset += 4; - p60dockHkTableDataset.batteryTemperature1 = - *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); + auxHk.batteryTemperature1 = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); dataOffset += 4; - p60dockHkTableDataset.batteryTemperature2 = - *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); + auxHk.batteryTemperature2 = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); dataOffset += 4; for (uint8_t idx = 0; idx < NUM_DEVS; idx++) { - p60dockHkTableDataset.devicesType[idx] = *(packet + dataOffset); + auxHk.devicesType[idx] = *(packet + dataOffset); dataOffset += 3; } for (uint8_t idx = 0; idx < NUM_DEVS; idx++) { - p60dockHkTableDataset.devicesStatus[idx] = *(packet + dataOffset); + auxHk.devicesStatus[idx] = *(packet + dataOffset); dataOffset += 3; } - p60dockHkTableDataset.dearmStatus = *(packet + dataOffset); + auxHk.dearmStatus = *(packet + dataOffset); dataOffset += 3; - p60dockHkTableDataset.wdtCntGnd = *(packet + dataOffset) << 24 | - *(packet + dataOffset + 1) << 16 | - *(packet + dataOffset + 2) << 8 | *(packet + dataOffset + 3); + auxHk.wdtCntGnd = *(packet + dataOffset) << 24 | *(packet + dataOffset + 1) << 16 | + *(packet + dataOffset + 2) << 8 | *(packet + dataOffset + 3); dataOffset += 6; - p60dockHkTableDataset.wdtCntI2c = *(packet + dataOffset) << 24 | - *(packet + dataOffset + 1) << 16 | - *(packet + dataOffset + 2) << 8 | *(packet + dataOffset + 3); + auxHk.wdtCntI2c = *(packet + dataOffset) << 24 | *(packet + dataOffset + 1) << 16 | + *(packet + dataOffset + 2) << 8 | *(packet + dataOffset + 3); dataOffset += 6; - p60dockHkTableDataset.wdtCntCan = *(packet + dataOffset) << 24 | - *(packet + dataOffset + 1) << 16 | - *(packet + dataOffset + 2) << 8 | *(packet + dataOffset + 3); + auxHk.wdtCntCan = *(packet + dataOffset) << 24 | *(packet + dataOffset + 1) << 16 | + *(packet + dataOffset + 2) << 8 | *(packet + dataOffset + 3); dataOffset += 6; - p60dockHkTableDataset.wdtCntCsp1 = *(packet + dataOffset) << 24 | - *(packet + dataOffset + 1) << 16 | - *(packet + dataOffset + 2) << 8 | *(packet + dataOffset + 3); + auxHk.wdtCntCsp1 = *(packet + dataOffset) << 24 | *(packet + dataOffset + 1) << 16 | + *(packet + dataOffset + 2) << 8 | *(packet + dataOffset + 3); dataOffset += 6; - p60dockHkTableDataset.wdtCntCsp2 = *(packet + dataOffset) << 24 | - *(packet + dataOffset + 1) << 16 | - *(packet + dataOffset + 2) << 8 | *(packet + dataOffset + 3); + auxHk.wdtCntCsp2 = *(packet + dataOffset) << 24 | *(packet + dataOffset + 1) << 16 | + *(packet + dataOffset + 2) << 8 | *(packet + dataOffset + 3); dataOffset += 6; - p60dockHkTableDataset.wdtGndLeft = *(packet + dataOffset) << 24 | - *(packet + dataOffset + 1) << 16 | - *(packet + dataOffset + 2) << 8 | *(packet + dataOffset + 3); + auxHk.wdtGndLeft = *(packet + dataOffset) << 24 | *(packet + dataOffset + 1) << 16 | + *(packet + dataOffset + 2) << 8 | *(packet + dataOffset + 3); dataOffset += 6; - p60dockHkTableDataset.wdtI2cLeft = *(packet + dataOffset) << 24 | - *(packet + dataOffset + 1) << 16 | - *(packet + dataOffset + 2) << 8 | *(packet + dataOffset + 3); + auxHk.wdtI2cLeft = *(packet + dataOffset) << 24 | *(packet + dataOffset + 1) << 16 | + *(packet + dataOffset + 2) << 8 | *(packet + dataOffset + 3); dataOffset += 6; - p60dockHkTableDataset.wdtCanLeft = *(packet + dataOffset) << 24 | - *(packet + dataOffset + 1) << 16 | - *(packet + dataOffset + 2) << 8 | *(packet + dataOffset + 3); + auxHk.wdtCanLeft = *(packet + dataOffset) << 24 | *(packet + dataOffset + 1) << 16 | + *(packet + dataOffset + 2) << 8 | *(packet + dataOffset + 3); /* +16 because here begins a new gomspace csp packet */ dataOffset += 16; - p60dockHkTableDataset.wdtCspLeft1 = *(packet + dataOffset); + auxHk.wdtCspLeft1 = *(packet + dataOffset); dataOffset += 3; - p60dockHkTableDataset.wdtCspLeft2 = *(packet + dataOffset); + auxHk.wdtCspLeft2 = *(packet + dataOffset); dataOffset += 3; - p60dockHkTableDataset.batteryChargeCurrent = - *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); + auxHk.batteryChargeCurrent = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); dataOffset += 4; - p60dockHkTableDataset.batteryDischargeCurrent = - *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); + auxHk.batteryDischargeCurrent = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); dataOffset += 4; - p60dockHkTableDataset.ant6Depl = *(packet + dataOffset); + auxHk.ant6Depl = *(packet + dataOffset); dataOffset += 3; - p60dockHkTableDataset.ar6Depl = *(packet + dataOffset); - p60dockHkTableDataset.setValidity(true, true); + auxHk.ar6Depl = *(packet + dataOffset); + coreHk.setValidity(true, true); + auxHk.setValidity(true, true); } ReturnValue_t P60DockHandler::initializeLocalDataPool(localpool::DataPool &localDataPoolMap, @@ -260,7 +251,8 @@ ReturnValue_t P60DockHandler::initializeLocalDataPool(localpool::DataPool &local localDataPoolMap.emplace(pool::P60DOCK_ANT6_DEPL, new PoolEntry({0})); localDataPoolMap.emplace(pool::P60DOCK_AR6_DEPL, new PoolEntry({0})); - poolManager.subscribeForPeriodicPacket(p60dockHkTableDataset.getSid(), false, 10.0, false); + poolManager.subscribeForPeriodicPacket(coreHk.getSid(), false, 10.0, false); + poolManager.subscribeForPeriodicPacket(auxHk.getSid(), false, 30.0, false); return HasReturnvaluesIF::RETURN_OK; } @@ -268,16 +260,17 @@ ReturnValue_t P60DockHandler::printStatus(DeviceCommandId_t cmd) { ReturnValue_t result = RETURN_OK; switch (cmd) { case (GOMSPACE::PRINT_SWITCH_V_I): { - PoolReadGuard pg(&p60dockHkTableDataset); - result = pg.getReadResult(); - if (result != HasReturnvaluesIF::RETURN_OK) { + PoolReadGuard pg0(&coreHk); + PoolReadGuard pg1(&auxHk); + if (pg0.getReadResult() != HasReturnvaluesIF::RETURN_OK or + pg1.getReadResult() != HasReturnvaluesIF::RETURN_OK) { break; } printHkTableSwitchIV(); return HasReturnvaluesIF::RETURN_OK; } case (GOMSPACE::PRINT_LATCHUPS): { - PoolReadGuard pg(&p60dockHkTableDataset); + PoolReadGuard pg(&auxHk); result = pg.getReadResult(); printHkTableLatchups(); if (result != HasReturnvaluesIF::RETURN_OK) { @@ -296,25 +289,22 @@ ReturnValue_t P60DockHandler::printStatus(DeviceCommandId_t cmd) { void P60DockHandler::printHkTableSwitchIV() { using namespace P60Dock; sif::info << "P60 Dock Info:" << std::endl; - sif::info << "Boot Cause: " << p60dockHkTableDataset.bootcause - << " | Boot Count: " << std::setw(4) << std::right << p60dockHkTableDataset.bootCount - << std::endl; - sif::info << "Reset Cause: " << p60dockHkTableDataset.resetcause - << " | Battery Mode: " << static_cast(p60dockHkTableDataset.battMode.value) - << std::endl; + sif::info << "Boot Cause: " << auxHk.bootcause << " | Boot Count: " << std::setw(4) << std::right + << coreHk.bootCount << std::endl; + sif::info << "Reset Cause: " << auxHk.resetcause + << " | Battery Mode: " << static_cast(coreHk.battMode.value) << std::endl; sif::info << "SwitchState, Currents [mA], Voltages [mV]:" << std::endl; sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "Dock VBAT VCC" << std::dec - << "| -, " << std::setw(4) << std::right << p60dockHkTableDataset.dockVccCurrent << ", " - << std::setw(5) << p60dockHkTableDataset.dockVbatVoltageValue << std::endl; + << "| -, " << std::setw(4) << std::right << auxHk.dockVccCurrent << ", " << std::setw(5) + << auxHk.dockVbatVoltageValue << std::endl; sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "BATT" << std::dec << "| -, " - << std::setw(4) << std::right << p60dockHkTableDataset.batteryCurrent.value << ", " - << std::setw(5) << p60dockHkTableDataset.batteryVoltage.value << std::endl; + << std::setw(4) << std::right << coreHk.batteryCurrent.value << ", " << std::setw(5) + << coreHk.batteryVoltage.value << std::endl; auto genericPrintoutHandler = [&](std::string name, uint8_t idx) { sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << name << std::dec << "| " - << unsigned(p60dockHkTableDataset.outputEnables[idx]) << ", " << std::setw(4) - << std::right << p60dockHkTableDataset.currents[idx] << ", " << std::setw(5) - << p60dockHkTableDataset.voltages[idx] << std::endl; + << unsigned(coreHk.outputEnables[idx]) << ", " << std::setw(4) << std::right + << coreHk.currents[idx] << ", " << std::setw(5) << coreHk.voltages[idx] << std::endl; }; genericPrintoutHandler("ACU VCC", hk::ACU_VCC); @@ -328,12 +318,21 @@ void P60DockHandler::printHkTableSwitchIV() { genericPrintoutHandler("Stack 5V", hk::STACK_5V); } +LocalPoolDataSetBase *P60DockHandler::getDataSetHandle(sid_t sid) { + if (sid == coreHk.getSid()) { + return &coreHk; + } else if (sid == auxHk.getSid()) { + return &auxHk; + } + return nullptr; +} + void P60DockHandler::printHkTableLatchups() { using namespace P60Dock; sif::info << "P60 Latchup Information" << std::endl; auto genericPrintoutHandler = [&](std::string name, uint8_t idx) { sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << name << std::dec << "| " - << std::setw(4) << std::right << p60dockHkTableDataset.latchups[idx] << std::endl; + << std::setw(4) << std::right << auxHk.latchups[idx] << std::endl; }; genericPrintoutHandler("ACU VCC", hk::ACU_VCC); genericPrintoutHandler("ACU VBAT", hk::ACU_VBAT); diff --git a/mission/devices/P60DockHandler.h b/mission/devices/P60DockHandler.h index b86f37bb..47484680 100644 --- a/mission/devices/P60DockHandler.h +++ b/mission/devices/P60DockHandler.h @@ -31,12 +31,14 @@ class P60DockHandler : public GomspaceDeviceHandler { * @return */ ReturnValue_t printStatus(DeviceCommandId_t cmd) override; + LocalPoolDataSetBase* getDataSetHandle(sid_t sid) override; void printHkTableSwitchIV(); void printHkTableLatchups(); private: - P60Dock::HkTableDataset p60dockHkTableDataset; + P60Dock::CoreHkSet coreHk; + P60Dock::HkTableDataset auxHk; static constexpr uint8_t MAX_CHANNEL_STR_WIDTH = 16; PoolEntry hkCurrents = PoolEntry(P60Dock::hk::CHNLS_LEN); diff --git a/mission/devices/PDU1Handler.cpp b/mission/devices/PDU1Handler.cpp index e0c369a3..be26d984 100644 --- a/mission/devices/PDU1Handler.cpp +++ b/mission/devices/PDU1Handler.cpp @@ -7,8 +7,7 @@ PDU1Handler::PDU1Handler(object_id_t objectId, object_id_t comIF, CookieIF *comCookie) : GomspaceDeviceHandler(objectId, comIF, comCookie, PDU::MAX_CONFIGTABLE_ADDRESS, - PDU::MAX_HKTABLE_ADDRESS, PDU::HK_TABLE_REPLY_SIZE, - &pdu1HkTableDataset), + PDU::MAX_HKTABLE_ADDRESS, PDU::HK_TABLE_REPLY_SIZE), pdu1HkTableDataset(this) {} PDU1Handler::~PDU1Handler() {} @@ -430,6 +429,13 @@ ReturnValue_t PDU1Handler::initializeLocalDataPool(localpool::DataPool &localDat return HasReturnvaluesIF::RETURN_OK; } +LocalPoolDataSetBase *PDU1Handler::getDataSetHandle(sid_t sid) { + if (sid == pdu1HkTableDataset.getSid()) { + return &pdu1HkTableDataset; + } + return nullptr; +} + ReturnValue_t PDU1Handler::printStatus(DeviceCommandId_t cmd) { ReturnValue_t result = RETURN_OK; switch (cmd) { diff --git a/mission/devices/PDU1Handler.h b/mission/devices/PDU1Handler.h index 732c38d2..67afc922 100644 --- a/mission/devices/PDU1Handler.h +++ b/mission/devices/PDU1Handler.h @@ -36,7 +36,7 @@ class PDU1Handler : public GomspaceDeviceHandler { virtual ReturnValue_t buildNormalDeviceCommand(DeviceCommandId_t* id) override; virtual void letChildHandleHkReply(DeviceCommandId_t id, const uint8_t* packet) override; ReturnValue_t printStatus(DeviceCommandId_t cmd) override; - + LocalPoolDataSetBase* getDataSetHandle(sid_t sid) override; ReturnValue_t setParamCallback(SetParamMessageUnpacker& unpacker, bool afterExectuion) override; private: diff --git a/mission/devices/PDU2Handler.cpp b/mission/devices/PDU2Handler.cpp index 48e7f90e..69a8f3fd 100644 --- a/mission/devices/PDU2Handler.cpp +++ b/mission/devices/PDU2Handler.cpp @@ -7,8 +7,7 @@ PDU2Handler::PDU2Handler(object_id_t objectId, object_id_t comIF, CookieIF *comCookie) : GomspaceDeviceHandler(objectId, comIF, comCookie, PDU::MAX_CONFIGTABLE_ADDRESS, - PDU::MAX_HKTABLE_ADDRESS, PDU::HK_TABLE_REPLY_SIZE, - &pdu2HkTableDataset), + PDU::MAX_HKTABLE_ADDRESS, PDU::HK_TABLE_REPLY_SIZE), pdu2HkTableDataset(this) {} PDU2Handler::~PDU2Handler() {} @@ -54,6 +53,13 @@ void PDU2Handler::assignChannelHookFunction(GOMSPACE::ChannelSwitchHook hook, vo this->hookArgs = args; } +LocalPoolDataSetBase *PDU2Handler::getDataSetHandle(sid_t sid) { + if (sid == pdu2HkTableDataset.getSid()) { + return &pdu2HkTableDataset; + } + return nullptr; +} + void PDU2Handler::parseHkTableReply(const uint8_t *packet) { uint16_t dataOffset = 0; pdu2HkTableDataset.read(); diff --git a/mission/devices/PDU2Handler.h b/mission/devices/PDU2Handler.h index ca639568..ab113dda 100644 --- a/mission/devices/PDU2Handler.h +++ b/mission/devices/PDU2Handler.h @@ -36,6 +36,7 @@ class PDU2Handler : public GomspaceDeviceHandler { virtual void letChildHandleHkReply(DeviceCommandId_t id, const uint8_t* packet) override; ReturnValue_t printStatus(DeviceCommandId_t cmd) override; ReturnValue_t setParamCallback(SetParamMessageUnpacker& unpacker, bool afterExecution) override; + LocalPoolDataSetBase* getDataSetHandle(sid_t sid) override; private: static constexpr uint8_t MAX_CHANNEL_STR_WIDTH = 24; diff --git a/mission/devices/devicedefinitions/GomspaceDefinitions.h b/mission/devices/devicedefinitions/GomspaceDefinitions.h index 3a66ca69..4b277b40 100644 --- a/mission/devices/devicedefinitions/GomspaceDefinitions.h +++ b/mission/devices/devicedefinitions/GomspaceDefinitions.h @@ -351,7 +351,9 @@ static const uint16_t MAX_CONFIGTABLE_ADDRESS = 408; static const uint16_t MAX_HKTABLE_ADDRESS = 187; static const uint16_t HK_TABLE_SIZE = 188; -static const uint8_t HK_TABLE_DATA_SET_ID = 0x3; +static constexpr uint32_t CORE_TABLE_SET_ID = 0x3; +static constexpr uint32_t AUX_TABLE_DATA_SET_ID = 0x4; + static const uint8_t HK_TABLE_ENTRIES = 100; /** @@ -360,18 +362,11 @@ static const uint8_t HK_TABLE_ENTRIES = 100; */ static const uint16_t HK_TABLE_REPLY_SIZE = 407; -/** - * @brief This class defines a dataset for the hk table of the P60 Dock. - * @details - * The GS port and X3 are not required for EIVE. X3 is another slot on the P60 dock and - * GS is required for a module from Gomspace which is not used. - */ -class HkTableDataset : public StaticLocalDataSet { +class CoreHkSet : public StaticLocalDataSet<16> { public: - HkTableDataset(HasLocalDataPoolIF* owner) : StaticLocalDataSet(owner, HK_TABLE_DATA_SET_ID) {} + CoreHkSet(HasLocalDataPoolIF* owner) : StaticLocalDataSet(owner, CORE_TABLE_SET_ID) {} - HkTableDataset(object_id_t objectId) - : StaticLocalDataSet(sid_t(objectId, HK_TABLE_DATA_SET_ID)) {} + CoreHkSet(object_id_t objectId) : StaticLocalDataSet(sid_t(objectId, CORE_TABLE_SET_ID)) {} /** Measured output currents */ lp_vec_t currents = @@ -387,22 +382,42 @@ class HkTableDataset : public StaticLocalDataSet { lp_vec_t outputEnables = lp_vec_t(sid.objectId, P60System::pool::OUTPUT_ENABLE, this); + lp_var_t bootCount = + lp_var_t(sid.objectId, P60System::pool::P60DOCK_BOOT_CNT, this); + lp_var_t battMode = + lp_var_t(sid.objectId, P60System::pool::P60DOCK_BATT_MODE, this); + + // Difference between charge and discharge current + lp_var_t batteryCurrent = + lp_var_t(sid.objectId, P60System::pool::P60DOCK_BATTERY_CURRENT, this); + lp_var_t batteryVoltage = + lp_var_t(sid.objectId, P60System::pool::P60DOCK_BATTERY_VOLTAGE, this); lp_var_t temperature1 = lp_var_t(sid.objectId, P60System::pool::P60DOCK_TEMPERATURE_1, this); lp_var_t temperature2 = lp_var_t(sid.objectId, P60System::pool::P60DOCK_TEMPERATURE_2, this); +}; +/** + * @brief This class defines a dataset for the hk table of the P60 Dock. + * @details + * The GS port and X3 are not required for EIVE. X3 is another slot on the P60 dock and + * GS is required for a module from Gomspace which is not used. + */ +class HkTableDataset : public StaticLocalDataSet<32> { + public: + HkTableDataset(HasLocalDataPoolIF* owner) : StaticLocalDataSet(owner, AUX_TABLE_DATA_SET_ID) {} + + HkTableDataset(object_id_t objectId) + : StaticLocalDataSet(sid_t(objectId, AUX_TABLE_DATA_SET_ID)) {} lp_var_t bootcause = lp_var_t(sid.objectId, P60System::pool::P60DOCK_BOOT_CAUSE, this); - lp_var_t bootCount = - lp_var_t(sid.objectId, P60System::pool::P60DOCK_BOOT_CNT, this); lp_var_t uptime = lp_var_t(sid.objectId, P60System::pool::P60DOCK_UPTIME, this); lp_var_t resetcause = lp_var_t(sid.objectId, P60System::pool::P60DOCK_RESETCAUSE, this); - lp_var_t battMode = - lp_var_t(sid.objectId, P60System::pool::P60DOCK_BATT_MODE, this); + /** Battery heater control only possible on BP4 packs */ lp_var_t heaterOn = lp_var_t(sid.objectId, P60System::pool::P60DOCK_HEATER_ON, this); @@ -418,11 +433,6 @@ class HkTableDataset : public StaticLocalDataSet { lp_var_t(sid.objectId, P60System::pool::P60DOCK_DOCK_VBAT, this); lp_var_t dockVccCurrent = lp_var_t(sid.objectId, P60System::pool::P60DOCK_DOCK_VCC_CURRENT, this); - // Difference between charge and discharge current - lp_var_t batteryCurrent = - lp_var_t(sid.objectId, P60System::pool::P60DOCK_BATTERY_CURRENT, this); - lp_var_t batteryVoltage = - lp_var_t(sid.objectId, P60System::pool::P60DOCK_BATTERY_VOLTAGE, this); lp_var_t batteryTemperature1 = lp_var_t(sid.objectId, P60System::pool::P60DOCK_BATTERY_TEMPERATURE_1, this); diff --git a/mission/utility/compileTime.h b/mission/utility/compileTime.h index c55673f6..0e367248 100644 --- a/mission/utility/compileTime.h +++ b/mission/utility/compileTime.h @@ -5,14 +5,17 @@ * Authors: * * Assembled from the code released on Stackoverflow by: - * Dennis (instructable.com/member/nqtronix) | https://stackoverflow.com/questions/23032002/c-c-how-to-get-integer-unix-timestamp-of-build-time-not-string + * Dennis (instructable.com/member/nqtronix) | + * https://stackoverflow.com/questions/23032002/c-c-how-to-get-integer-unix-timestamp-of-build-time-not-string * and - * Alexis Wilke | https://stackoverflow.com/questions/10538444/do-you-know-of-a-c-macro-to-compute-unix-time-and-date + * Alexis Wilke | + * https://stackoverflow.com/questions/10538444/do-you-know-of-a-c-macro-to-compute-unix-time-and-date * * Assembled by Jean Rabault * - * UNIX_TIMESTAMP gives the UNIX timestamp (unsigned long integer of seconds since 1st Jan 1970) of compilation from macros using the compiler defined __TIME__ macro. - * This should include Gregorian calendar leap days, in particular the 29ths of February, 100 and 400 years modulo leaps. + * UNIX_TIMESTAMP gives the UNIX timestamp (unsigned long integer of seconds since 1st Jan 1970) of + * compilation from macros using the compiler defined __TIME__ macro. This should include Gregorian + * calendar leap days, in particular the 29ths of February, 100 and 400 years modulo leaps. * * Careful: __TIME__ is the local time of the computer, NOT the UTC time in general! * @@ -22,76 +25,66 @@ #define COMPILE_TIME_H_ // Some definitions for calculation -#define SEC_PER_MIN 60UL -#define SEC_PER_HOUR 3600UL -#define SEC_PER_DAY 86400UL -#define SEC_PER_YEAR (SEC_PER_DAY*365) +#define SEC_PER_MIN 60UL +#define SEC_PER_HOUR 3600UL +#define SEC_PER_DAY 86400UL +#define SEC_PER_YEAR (SEC_PER_DAY * 365) // extracts 1..4 characters from a string and interprets it as a decimal value -#define CONV_STR2DEC_1(str, i) (str[i]>'0'?str[i]-'0':0) -#define CONV_STR2DEC_2(str, i) (CONV_STR2DEC_1(str, i)*10 + str[i+1]-'0') -#define CONV_STR2DEC_3(str, i) (CONV_STR2DEC_2(str, i)*10 + str[i+2]-'0') -#define CONV_STR2DEC_4(str, i) (CONV_STR2DEC_3(str, i)*10 + str[i+3]-'0') +#define CONV_STR2DEC_1(str, i) (str[i] > '0' ? str[i] - '0' : 0) +#define CONV_STR2DEC_2(str, i) (CONV_STR2DEC_1(str, i) * 10 + str[i + 1] - '0') +#define CONV_STR2DEC_3(str, i) (CONV_STR2DEC_2(str, i) * 10 + str[i + 2] - '0') +#define CONV_STR2DEC_4(str, i) (CONV_STR2DEC_3(str, i) * 10 + str[i + 3] - '0') // Custom "glue logic" to convert the month name to a usable number -#define GET_MONTH(str, i) (str[i]=='J' && str[i+1]=='a' && str[i+2]=='n' ? 1 : \ - str[i]=='F' && str[i+1]=='e' && str[i+2]=='b' ? 2 : \ - str[i]=='M' && str[i+1]=='a' && str[i+2]=='r' ? 3 : \ - str[i]=='A' && str[i+1]=='p' && str[i+2]=='r' ? 4 : \ - str[i]=='M' && str[i+1]=='a' && str[i+2]=='y' ? 5 : \ - str[i]=='J' && str[i+1]=='u' && str[i+2]=='n' ? 6 : \ - str[i]=='J' && str[i+1]=='u' && str[i+2]=='l' ? 7 : \ - str[i]=='A' && str[i+1]=='u' && str[i+2]=='g' ? 8 : \ - str[i]=='S' && str[i+1]=='e' && str[i+2]=='p' ? 9 : \ - str[i]=='O' && str[i+1]=='c' && str[i+2]=='t' ? 10 : \ - str[i]=='N' && str[i+1]=='o' && str[i+2]=='v' ? 11 : \ - str[i]=='D' && str[i+1]=='e' && str[i+2]=='c' ? 12 : 0) +#define GET_MONTH(str, i) \ + (str[i] == 'J' && str[i + 1] == 'a' && str[i + 2] == 'n' ? 1 \ + : str[i] == 'F' && str[i + 1] == 'e' && str[i + 2] == 'b' ? 2 \ + : str[i] == 'M' && str[i + 1] == 'a' && str[i + 2] == 'r' ? 3 \ + : str[i] == 'A' && str[i + 1] == 'p' && str[i + 2] == 'r' ? 4 \ + : str[i] == 'M' && str[i + 1] == 'a' && str[i + 2] == 'y' ? 5 \ + : str[i] == 'J' && str[i + 1] == 'u' && str[i + 2] == 'n' ? 6 \ + : str[i] == 'J' && str[i + 1] == 'u' && str[i + 2] == 'l' ? 7 \ + : str[i] == 'A' && str[i + 1] == 'u' && str[i + 2] == 'g' ? 8 \ + : str[i] == 'S' && str[i + 1] == 'e' && str[i + 2] == 'p' ? 9 \ + : str[i] == 'O' && str[i + 1] == 'c' && str[i + 2] == 't' ? 10 \ + : str[i] == 'N' && str[i + 1] == 'o' && str[i + 2] == 'v' ? 11 \ + : str[i] == 'D' && str[i + 1] == 'e' && str[i + 2] == 'c' ? 12 \ + : 0) // extract the information from the time string given by __TIME__ and __DATE__ -#define __TIME_SECONDS__ CONV_STR2DEC_2(__TIME__, 6) -#define __TIME_MINUTES__ CONV_STR2DEC_2(__TIME__, 3) -#define __TIME_HOURS__ CONV_STR2DEC_2(__TIME__, 0) -#define __TIME_DAYS__ CONV_STR2DEC_2(__DATE__, 4) -#define __TIME_MONTH__ GET_MONTH(__DATE__, 0) -#define __TIME_YEARS__ CONV_STR2DEC_4(__DATE__, 7) +#define __TIME_SECONDS__ CONV_STR2DEC_2(__TIME__, 6) +#define __TIME_MINUTES__ CONV_STR2DEC_2(__TIME__, 3) +#define __TIME_HOURS__ CONV_STR2DEC_2(__TIME__, 0) +#define __TIME_DAYS__ CONV_STR2DEC_2(__DATE__, 4) +#define __TIME_MONTH__ GET_MONTH(__DATE__, 0) +#define __TIME_YEARS__ CONV_STR2DEC_4(__DATE__, 7) // Days in February #define _UNIX_TIMESTAMP_FDAY(year) \ - (((year) % 400) == 0UL ? 29UL : \ - (((year) % 100) == 0UL ? 28UL : \ - (((year) % 4) == 0UL ? 29UL : \ - 28UL))) + (((year) % 400) == 0UL ? 29UL \ + : (((year) % 100) == 0UL ? 28UL : (((year) % 4) == 0UL ? 29UL : 28UL))) // Days in the year -#define _UNIX_TIMESTAMP_YDAY(year, month, day) \ - ( \ - /* January */ day \ - /* February */ + (month >= 2 ? 31UL : 0UL) \ - /* March */ + (month >= 3 ? _UNIX_TIMESTAMP_FDAY(year) : 0UL) \ - /* April */ + (month >= 4 ? 31UL : 0UL) \ - /* May */ + (month >= 5 ? 30UL : 0UL) \ - /* June */ + (month >= 6 ? 31UL : 0UL) \ - /* July */ + (month >= 7 ? 30UL : 0UL) \ - /* August */ + (month >= 8 ? 31UL : 0UL) \ - /* September */+ (month >= 9 ? 31UL : 0UL) \ - /* October */ + (month >= 10 ? 30UL : 0UL) \ - /* November */ + (month >= 11 ? 31UL : 0UL) \ - /* December */ + (month >= 12 ? 30UL : 0UL) \ - ) +#define _UNIX_TIMESTAMP_YDAY(year, month, day) \ + (/* January */ day /* February */ + (month >= 2 ? 31UL : 0UL) /* March */ + \ + (month >= 3 ? _UNIX_TIMESTAMP_FDAY(year) : 0UL) /* April */ + \ + (month >= 4 ? 31UL : 0UL) /* May */ + (month >= 5 ? 30UL : 0UL) /* June */ + \ + (month >= 6 ? 31UL : 0UL) /* July */ + (month >= 7 ? 30UL : 0UL) /* August */ + \ + (month >= 8 ? 31UL : 0UL) /* September */ + (month >= 9 ? 31UL : 0UL) /* October */ + \ + (month >= 10 ? 30UL : 0UL) /* November */ + (month >= 11 ? 31UL : 0UL) /* December */ + \ + (month >= 12 ? 30UL : 0UL)) // get the UNIX timestamp from a digits representation -#define _UNIX_TIMESTAMP(year, month, day, hour, minute, second) \ - ( /* time */ second \ - + minute * SEC_PER_MIN \ - + hour * SEC_PER_HOUR \ - + /* year day (month + day) */ (_UNIX_TIMESTAMP_YDAY(year, month, day) - 1) * SEC_PER_DAY \ - + /* year */ (year - 1970UL) * SEC_PER_YEAR \ - + ((year - 1969UL) / 4UL) * SEC_PER_DAY \ - - ((year - 1901UL) / 100UL) * SEC_PER_DAY \ - + ((year - 1601UL) / 400UL) * SEC_PER_DAY \ - ) +#define _UNIX_TIMESTAMP(year, month, day, hour, minute, second) \ + (/* time */ second + minute * SEC_PER_MIN + hour * SEC_PER_HOUR + \ + /* year day (month + day) */ (_UNIX_TIMESTAMP_YDAY(year, month, day) - 1) * SEC_PER_DAY + \ + /* year */ (year - 1970UL) * SEC_PER_YEAR + ((year - 1969UL) / 4UL) * SEC_PER_DAY - \ + ((year - 1901UL) / 100UL) * SEC_PER_DAY + ((year - 1601UL) / 400UL) * SEC_PER_DAY) // the UNIX timestamp -#define UNIX_TIMESTAMP (_UNIX_TIMESTAMP(__TIME_YEARS__, __TIME_MONTH__, __TIME_DAYS__, __TIME_HOURS__, __TIME_MINUTES__, __TIME_SECONDS__)) +#define UNIX_TIMESTAMP \ + (_UNIX_TIMESTAMP(__TIME_YEARS__, __TIME_MONTH__, __TIME_DAYS__, __TIME_HOURS__, \ + __TIME_MINUTES__, __TIME_SECONDS__)) #endif From 5e4c3728edb3abab62e0ac68b2e0ec9ff1a553db Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 7 Apr 2022 12:53:51 +0200 Subject: [PATCH 35/65] split up p60 hk packets --- mission/devices/PCDUHandler.cpp | 10 ++-- .../devicedefinitions/GomspaceDefinitions.h | 55 ++++++++++--------- tmtc | 2 +- 3 files changed, 35 insertions(+), 32 deletions(-) diff --git a/mission/devices/PCDUHandler.cpp b/mission/devices/PCDUHandler.cpp index 44b9181a..c819b223 100644 --- a/mission/devices/PCDUHandler.cpp +++ b/mission/devices/PCDUHandler.cpp @@ -51,7 +51,8 @@ ReturnValue_t PCDUHandler::initialize() { return RETURN_FAILED; } result = pdu2Handler->getSubscriptionInterface()->subscribeForSetUpdateMessage( - PDU2::HK_TABLE_DATA_SET_ID, this->getObjectId(), commandQueue->getId(), true); + static_cast(P60System::SetIds::PDU_2), this->getObjectId(), commandQueue->getId(), + true); if (result != RETURN_OK) { sif::error << "PCDUHandler::initialize: Failed to subscribe for set update messages from " << "PDU2Handler" << std::endl; @@ -66,7 +67,8 @@ ReturnValue_t PCDUHandler::initialize() { return RETURN_FAILED; } result = pdu1Handler->getSubscriptionInterface()->subscribeForSetUpdateMessage( - PDU1::HK_TABLE_DATA_SET_ID, this->getObjectId(), commandQueue->getId(), true); + static_cast(P60System::SetIds::PDU_1), this->getObjectId(), commandQueue->getId(), + true); if (result != RETURN_OK) { sif::error << "PCDUHandler::initialize: Failed to subscribe for set update messages from " << "PDU1Handler" << std::endl; @@ -101,10 +103,10 @@ void PCDUHandler::readCommandQueue() { MessageQueueId_t PCDUHandler::getCommandQueue() const { return commandQueue->getId(); } void PCDUHandler::handleChangedDataset(sid_t sid, store_address_t storeId, bool* clearMessage) { - if (sid == sid_t(objects::PDU2_HANDLER, PDU2::HK_TABLE_DATA_SET_ID)) { + if (sid == sid_t(objects::PDU2_HANDLER, static_cast(P60System::SetIds::PDU_2))) { updateHkTableDataset(storeId, &pdu2HkTableDataset, &timeStampPdu2HkDataset); updatePdu2SwitchStates(); - } else if (sid == sid_t(objects::PDU1_HANDLER, PDU1::HK_TABLE_DATA_SET_ID)) { + } else if (sid == sid_t(objects::PDU1_HANDLER, static_cast(P60System::SetIds::PDU_1))) { updateHkTableDataset(storeId, &pdu1HkTableDataset, &timeStampPdu1HkDataset); updatePdu1SwitchStates(); } else { diff --git a/mission/devices/devicedefinitions/GomspaceDefinitions.h b/mission/devices/devicedefinitions/GomspaceDefinitions.h index 4b277b40..93fe9e6b 100644 --- a/mission/devices/devicedefinitions/GomspaceDefinitions.h +++ b/mission/devices/devicedefinitions/GomspaceDefinitions.h @@ -43,6 +43,8 @@ static const DeviceCommandId_t PRINT_LATCHUPS = 33; namespace P60System { +enum class SetIds : uint32_t { PDU_1 = 1, PDU_2 = 2, P60_CORE = 3, P60_AUX = 4, ACU = 5 }; + namespace pool { enum Ids : lp_id_t { @@ -351,9 +353,6 @@ static const uint16_t MAX_CONFIGTABLE_ADDRESS = 408; static const uint16_t MAX_HKTABLE_ADDRESS = 187; static const uint16_t HK_TABLE_SIZE = 188; -static constexpr uint32_t CORE_TABLE_SET_ID = 0x3; -static constexpr uint32_t AUX_TABLE_DATA_SET_ID = 0x4; - static const uint8_t HK_TABLE_ENTRIES = 100; /** @@ -364,9 +363,11 @@ static const uint16_t HK_TABLE_REPLY_SIZE = 407; class CoreHkSet : public StaticLocalDataSet<16> { public: - CoreHkSet(HasLocalDataPoolIF* owner) : StaticLocalDataSet(owner, CORE_TABLE_SET_ID) {} + CoreHkSet(HasLocalDataPoolIF* owner) + : StaticLocalDataSet(owner, static_cast(::P60System::SetIds::P60_CORE)) {} - CoreHkSet(object_id_t objectId) : StaticLocalDataSet(sid_t(objectId, CORE_TABLE_SET_ID)) {} + CoreHkSet(object_id_t objectId) + : StaticLocalDataSet(sid_t(objectId, static_cast(::P60System::SetIds::P60_CORE))) {} /** Measured output currents */ lp_vec_t currents = @@ -406,10 +407,16 @@ class CoreHkSet : public StaticLocalDataSet<16> { */ class HkTableDataset : public StaticLocalDataSet<32> { public: - HkTableDataset(HasLocalDataPoolIF* owner) : StaticLocalDataSet(owner, AUX_TABLE_DATA_SET_ID) {} + HkTableDataset(HasLocalDataPoolIF* owner) + : StaticLocalDataSet(owner, static_cast(::P60System::SetIds::P60_AUX)) {} HkTableDataset(object_id_t objectId) - : StaticLocalDataSet(sid_t(objectId, AUX_TABLE_DATA_SET_ID)) {} + : StaticLocalDataSet(sid_t(objectId, static_cast(::P60System::SetIds::P60_AUX))) {} + + /** Number of detected latchups on each output channel */ + lp_vec_t latchups = + lp_vec_t(sid.objectId, P60System::pool::LATCHUPS, + this); lp_var_t bootcause = lp_var_t(sid.objectId, P60System::pool::P60DOCK_BOOT_CAUSE, this); @@ -424,11 +431,6 @@ class HkTableDataset : public StaticLocalDataSet<32> { lp_var_t converter5VStatus = lp_var_t(sid.objectId, P60System::pool::P60DOCK_CONV_5V_ENABLE_STATUS, this); - /** Number of detected latchups on each output channel */ - lp_vec_t latchups = - lp_vec_t(sid.objectId, P60System::pool::LATCHUPS, - this); - lp_var_t dockVbatVoltageValue = lp_var_t(sid.objectId, P60System::pool::P60DOCK_DOCK_VBAT, this); lp_var_t dockVccCurrent = @@ -439,11 +441,6 @@ class HkTableDataset : public StaticLocalDataSet<32> { lp_var_t batteryTemperature2 = lp_var_t(sid.objectId, P60System::pool::P60DOCK_BATTERY_TEMPERATURE_2, this); - lp_vec_t devicesType = - lp_vec_t(sid.objectId, P60System::pool::DEVICES_TYPE, this); - lp_vec_t devicesStatus = - lp_vec_t(sid.objectId, P60System::pool::DEVICES_STATUS, this); - lp_var_t dearmStatus = lp_var_t(sid.objectId, P60System::pool::P60DOCK_DEARM_STATUS, this); @@ -477,6 +474,11 @@ class HkTableDataset : public StaticLocalDataSet<32> { lp_var_t(sid.objectId, P60System::pool::P60DOCK_ANT6_DEPL, this); lp_var_t ar6Depl = lp_var_t(sid.objectId, P60System::pool::P60DOCK_AR6_DEPL, this); + + lp_vec_t devicesType = + lp_vec_t(sid.objectId, P60System::pool::DEVICES_TYPE, this); + lp_vec_t devicesStatus = + lp_vec_t(sid.objectId, P60System::pool::DEVICES_STATUS, this); }; } // namespace P60Dock @@ -494,7 +496,6 @@ static const uint8_t HK_TABLE_ENTRIES = 73; } // namespace PDU namespace PDU1 { -static const uint32_t HK_TABLE_DATA_SET_ID = 0x1; // hk table has table id 4 enum SwitchChannels : uint8_t { TCS_BOARD_3V3 = 0, @@ -527,10 +528,11 @@ static const uint16_t CONFIG_ADDRESS_OUT_EN_CHANNEL8 = 0x50; */ class PDU1HkTableDataset : public StaticLocalDataSet { public: - PDU1HkTableDataset(HasLocalDataPoolIF* owner) : StaticLocalDataSet(owner, HK_TABLE_DATA_SET_ID) {} + PDU1HkTableDataset(HasLocalDataPoolIF* owner) + : StaticLocalDataSet(owner, static_cast(::P60System::SetIds::PDU_1)) {} PDU1HkTableDataset(object_id_t objectId) - : StaticLocalDataSet(sid_t(objectId, HK_TABLE_DATA_SET_ID)) {} + : StaticLocalDataSet(sid_t(objectId, static_cast(::P60System::SetIds::PDU_1))) {} /** Measured output currents */ lp_var_t currentOutTCSBoard3V3 = @@ -698,7 +700,6 @@ class PDU1HkTableDataset : public StaticLocalDataSet { } // namespace PDU1 namespace PDU2 { -static const uint32_t HK_TABLE_DATA_SET_ID = 0x2; enum SwitchChannels : uint8_t { Q7S = 0, @@ -731,10 +732,11 @@ static const uint16_t CONFIG_ADDRESS_OUT_EN_PAYLOAD_CAMERA = 0x50; */ class PDU2HkTableDataset : public StaticLocalDataSet { public: - PDU2HkTableDataset(HasLocalDataPoolIF* owner) : StaticLocalDataSet(owner, HK_TABLE_DATA_SET_ID) {} + PDU2HkTableDataset(HasLocalDataPoolIF* owner) + : StaticLocalDataSet(owner, static_cast(::P60System::SetIds::PDU_2)) {} PDU2HkTableDataset(object_id_t objectId) - : StaticLocalDataSet(sid_t(objectId, HK_TABLE_DATA_SET_ID)) {} + : StaticLocalDataSet(sid_t(objectId, static_cast(::P60System::SetIds::PDU_2))) {} /** Measured output currents */ lp_var_t currentOutQ7S = @@ -903,8 +905,6 @@ class PDU2HkTableDataset : public StaticLocalDataSet { namespace ACU { -static const uint32_t HK_TABLE_DATA_SET_ID = 0x4; - /* When receiving full housekeeping (telemetry) table */ static const uint16_t MAX_REPLY_LENGTH = 262; static const uint16_t MAX_CONFIGTABLE_ADDRESS = 26; @@ -917,10 +917,11 @@ static const uint16_t HK_TABLE_REPLY_SIZE = 262; */ class HkTableDataset : public StaticLocalDataSet { public: - HkTableDataset(HasLocalDataPoolIF* owner) : StaticLocalDataSet(owner, HK_TABLE_DATA_SET_ID) {} + HkTableDataset(HasLocalDataPoolIF* owner) + : StaticLocalDataSet(owner, static_cast(::P60System::SetIds::ACU)) {} HkTableDataset(object_id_t objectId) - : StaticLocalDataSet(sid_t(objectId, HK_TABLE_DATA_SET_ID)) {} + : StaticLocalDataSet(sid_t(objectId, static_cast(::P60System::SetIds::ACU))) {} lp_var_t currentInChannel0 = lp_var_t(sid.objectId, P60System::pool::ACU_CURRENT_IN_CHANNEL0, this); diff --git a/tmtc b/tmtc index 8f2ff303..ab5cca85 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 8f2ff3034fff627b807f32c02fd9e676126bae5f +Subproject commit ab5cca85bfb71875ba0c49e8ed6ef575f851c0c5 From 64b3afae22c835e8d19ecd5822d2bd31d7e6f301 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 7 Apr 2022 13:07:28 +0200 Subject: [PATCH 36/65] new event for battery mode: broadcast and changed --- common/config/commonSubsystemIds.h | 4 ++++ mission/devices/P60DockHandler.cpp | 13 ++++++++++++- mission/devices/P60DockHandler.h | 9 +++++++++ .../devices/devicedefinitions/GomspaceDefinitions.h | 2 ++ 4 files changed, 27 insertions(+), 1 deletion(-) diff --git a/common/config/commonSubsystemIds.h b/common/config/commonSubsystemIds.h index a93986a1..f7a8ee3a 100644 --- a/common/config/commonSubsystemIds.h +++ b/common/config/commonSubsystemIds.h @@ -24,6 +24,10 @@ enum: uint8_t { ACS_BOARD_ASS = 123, SUS_BOARD_ASS = 124, TCS_BOARD_ASS = 125, + P60_DOCK_HANDLER = 126, + PDU1_HANDLER = 127, + PDU2_HANDLER = 128, + ACU_HANDLER = 129, COMMON_SUBSYSTEM_ID_END }; } diff --git a/mission/devices/P60DockHandler.cpp b/mission/devices/P60DockHandler.cpp index 9a337687..b7a84159 100644 --- a/mission/devices/P60DockHandler.cpp +++ b/mission/devices/P60DockHandler.cpp @@ -116,8 +116,16 @@ void P60DockHandler::parseHkTableReply(const uint8_t *packet) { *(packet + dataOffset + 2) << 8 | *(packet + dataOffset + 3); dataOffset += 6; auxHk.resetcause = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); + dataOffset += 4; - coreHk.battMode = *(packet + dataOffset); + uint8_t newBattMode = packet[dataOffset]; + if (firstHk) { + triggerEvent(BATT_MODE, newBattMode); + } else if (newBattMode != coreHk.battMode.value) { + triggerEvent(BATT_MODE_CHANGED, coreHk.battMode.value, newBattMode); + } + coreHk.battMode = newBattMode; + dataOffset += 3; auxHk.heaterOn = *(packet + dataOffset); /* + 13 because here begins a new gomspace csp data field */ @@ -195,6 +203,9 @@ void P60DockHandler::parseHkTableReply(const uint8_t *packet) { auxHk.ant6Depl = *(packet + dataOffset); dataOffset += 3; auxHk.ar6Depl = *(packet + dataOffset); + if (firstHk) { + firstHk = false; + } coreHk.setValidity(true, true); auxHk.setValidity(true, true); } diff --git a/mission/devices/P60DockHandler.h b/mission/devices/P60DockHandler.h index 47484680..feb52edc 100644 --- a/mission/devices/P60DockHandler.h +++ b/mission/devices/P60DockHandler.h @@ -4,6 +4,7 @@ #include #include "GomspaceDeviceHandler.h" +#include "commonSubsystemIds.h" /** * @brief Device handler for the P60Dock. The P60Dock serves as carrier for the ACU, PDU1 and @@ -11,6 +12,13 @@ */ class P60DockHandler : public GomspaceDeviceHandler { public: + static constexpr uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::P60_DOCK_HANDLER; + + //! [EXPORT] : [COMMENT] Battery mode is broadcasted at startup. P1: Mode + static constexpr Event BATT_MODE = event::makeEvent(SUBSYSTEM_ID, 0, severity::MEDIUM); + //! [EXPORT] : [COMMENT] Battery mode has changed. P1: Old mode. P2: New mode + static constexpr Event BATT_MODE_CHANGED = event::makeEvent(SUBSYSTEM_ID, 0, severity::MEDIUM); + P60DockHandler(object_id_t objectId, object_id_t comIF, CookieIF* comCookie); virtual ~P60DockHandler(); @@ -39,6 +47,7 @@ class P60DockHandler : public GomspaceDeviceHandler { private: P60Dock::CoreHkSet coreHk; P60Dock::HkTableDataset auxHk; + bool firstHk = true; static constexpr uint8_t MAX_CHANNEL_STR_WIDTH = 16; PoolEntry hkCurrents = PoolEntry(P60Dock::hk::CHNLS_LEN); diff --git a/mission/devices/devicedefinitions/GomspaceDefinitions.h b/mission/devices/devicedefinitions/GomspaceDefinitions.h index 93fe9e6b..8b19c909 100644 --- a/mission/devices/devicedefinitions/GomspaceDefinitions.h +++ b/mission/devices/devicedefinitions/GomspaceDefinitions.h @@ -43,6 +43,8 @@ static const DeviceCommandId_t PRINT_LATCHUPS = 33; namespace P60System { +enum class BatteryModes : uint8_t { CRITICAL = 1, SAFE = 2, NORMAL = 3, FULL = 4 }; + enum class SetIds : uint32_t { PDU_1 = 1, PDU_2 = 2, P60_CORE = 3, P60_AUX = 4, ACU = 5 }; namespace pool { From d570b5c4608cdaea8092c7a72eeff5dd5cb30267 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 7 Apr 2022 13:08:20 +0200 Subject: [PATCH 37/65] use different severities --- mission/devices/P60DockHandler.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mission/devices/P60DockHandler.h b/mission/devices/P60DockHandler.h index feb52edc..4f5589b6 100644 --- a/mission/devices/P60DockHandler.h +++ b/mission/devices/P60DockHandler.h @@ -15,9 +15,9 @@ class P60DockHandler : public GomspaceDeviceHandler { static constexpr uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::P60_DOCK_HANDLER; //! [EXPORT] : [COMMENT] Battery mode is broadcasted at startup. P1: Mode - static constexpr Event BATT_MODE = event::makeEvent(SUBSYSTEM_ID, 0, severity::MEDIUM); + static constexpr Event BATT_MODE = event::makeEvent(SUBSYSTEM_ID, 0, severity::INFO); //! [EXPORT] : [COMMENT] Battery mode has changed. P1: Old mode. P2: New mode - static constexpr Event BATT_MODE_CHANGED = event::makeEvent(SUBSYSTEM_ID, 0, severity::MEDIUM); + static constexpr Event BATT_MODE_CHANGED = event::makeEvent(SUBSYSTEM_ID, 1, severity::MEDIUM); P60DockHandler(object_id_t objectId, object_id_t comIF, CookieIF* comCookie); virtual ~P60DockHandler(); From 0e7cd7de6f2915ec57e2c65f674e088cb4cc5d24 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 7 Apr 2022 13:11:20 +0200 Subject: [PATCH 38/65] add p60 boot count broadcast --- mission/devices/P60DockHandler.cpp | 3 +++ mission/devices/P60DockHandler.h | 6 ++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/mission/devices/P60DockHandler.cpp b/mission/devices/P60DockHandler.cpp index b7a84159..d37673fc 100644 --- a/mission/devices/P60DockHandler.cpp +++ b/mission/devices/P60DockHandler.cpp @@ -111,6 +111,9 @@ void P60DockHandler::parseHkTableReply(const uint8_t *packet) { dataOffset += 6; coreHk.bootCount = *(packet + dataOffset) << 24 | *(packet + dataOffset + 1) << 16 | *(packet + dataOffset + 2) << 8 | *(packet + dataOffset + 3); + if(firstHk) { + triggerEvent(P60_BOOT_COUNT, coreHk.bootCount.value); + } dataOffset += 6; auxHk.uptime = *(packet + dataOffset) << 24 | *(packet + dataOffset + 1) << 16 | *(packet + dataOffset + 2) << 8 | *(packet + dataOffset + 3); diff --git a/mission/devices/P60DockHandler.h b/mission/devices/P60DockHandler.h index 4f5589b6..d08a46e0 100644 --- a/mission/devices/P60DockHandler.h +++ b/mission/devices/P60DockHandler.h @@ -14,10 +14,12 @@ class P60DockHandler : public GomspaceDeviceHandler { public: static constexpr uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::P60_DOCK_HANDLER; + //! [EXPORT] : [COMMENT] P60 boot count is broadcasted once at SW startup. P1: Boot count + static constexpr Event P60_BOOT_COUNT = event::makeEvent(SUBSYSTEM_ID, 0, severity::INFO); //! [EXPORT] : [COMMENT] Battery mode is broadcasted at startup. P1: Mode - static constexpr Event BATT_MODE = event::makeEvent(SUBSYSTEM_ID, 0, severity::INFO); + static constexpr Event BATT_MODE = event::makeEvent(SUBSYSTEM_ID, 1, severity::INFO); //! [EXPORT] : [COMMENT] Battery mode has changed. P1: Old mode. P2: New mode - static constexpr Event BATT_MODE_CHANGED = event::makeEvent(SUBSYSTEM_ID, 1, severity::MEDIUM); + static constexpr Event BATT_MODE_CHANGED = event::makeEvent(SUBSYSTEM_ID, 2, severity::MEDIUM); P60DockHandler(object_id_t objectId, object_id_t comIF, CookieIF* comCookie); virtual ~P60DockHandler(); From 796b814b49b07d9b38199356f105a7cfa36fa7de Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 7 Apr 2022 17:23:50 +0200 Subject: [PATCH 39/65] Add time file handling --- bsp_q7s/core/CoreController.cpp | 74 +++++++++++++++++++ bsp_q7s/core/CoreController.h | 10 +++ common/config/commonSubsystemIds.h | 38 +++++----- fsfw | 2 +- linux/devices/GPSHyperionLinuxController.cpp | 6 +- linux/devices/GPSHyperionLinuxController.h | 3 + .../devicedefinitions/GPSDefinitions.h | 13 ++++ tmtc | 2 +- 8 files changed, 127 insertions(+), 21 deletions(-) diff --git a/bsp_q7s/core/CoreController.cpp b/bsp_q7s/core/CoreController.cpp index b0b7213c..c39caa12 100644 --- a/bsp_q7s/core/CoreController.cpp +++ b/bsp_q7s/core/CoreController.cpp @@ -8,6 +8,7 @@ #include "fsfw/timemanager/Stopwatch.h" #include "fsfw/version.h" #include "watchdogConf.h" +#include #if OBSW_USE_TMTC_TCP_BRIDGE == 0 #include "fsfw/osal/common/UdpTmTcBridge.h" #else @@ -57,6 +58,16 @@ ReturnValue_t CoreController::handleCommandMessage(CommandMessage *message) { } void CoreController::performControlOperation() { + EventMessage event; + for (ReturnValue_t result = eventQueue->receiveMessage(&event); result == RETURN_OK; + result = eventQueue->receiveMessage(&event)) { + switch (event.getEvent()) { + case(GpsHyperion::GPS_FIX_CHANGE): { + gpsFix = static_cast(event.getParameter2()); + break; + } + } + } performWatchdogControlOperation(); sdStateMachine(); performMountedSdCardOperations(); @@ -91,6 +102,17 @@ ReturnValue_t CoreController::initialize() { sdStateMachine(); triggerEvent(REBOOT_SW, CURRENT_CHIP, CURRENT_COPY); + EventManagerIF* eventManager = ObjectManager::instance()->get( + objects::EVENT_MANAGER); + result = eventManager->registerListener(eventQueue->getId()); + if(result != HasReturnvaluesIF::RETURN_OK) { + sif::warning << "CoreController::initialize: Registering as event listener failed" << std::endl; + } + result = eventManager->subscribeToEvent(this->getCommandQueue(), + event::getEventId(GpsHyperion::GPS_FIX_CHANGE)); + if(result != HasReturnvaluesIF::RETURN_OK) { + sif::warning << "Subscribing for GPS GPS_FIX_CHANGE event failed" << std::endl; + } return ExtendedControllerBase::initialize(); } @@ -1211,6 +1233,7 @@ void CoreController::performMountedSdCardOperations() { doPerformMountedSdCardOps = false; } } + timeFileHandler(); } void CoreController::performRebootFileHandling(bool recreateFile) { @@ -1657,6 +1680,51 @@ void CoreController::setRebootMechanismLock(bool lock, xsc::Chip tgtChip, xsc::C rewriteRebootFile(rebootFile); } +ReturnValue_t CoreController::timeFileHandler() { + if(gpsFix == GpsHyperion::FixMode::FIX_2D or gpsFix == GpsHyperion::FixMode::FIX_3D) { + // It is assumed that the system time is set from the GPS time + timeval currentTime = {}; + ReturnValue_t result = Clock::getClock_timeval(¤tTime); + if(result != HasReturnvaluesIF::RETURN_OK) { + return result; + } + std::ofstream timeFile(TIME_FILE); + timeFile << "UNIX SECONDS: " << currentTime.tv_sec; + } + return RETURN_OK; +} + +ReturnValue_t CoreController::initClockFromTimeFile() { + using namespace GpsHyperion; + using namespace std; + if ((gpsFix == FixMode::UNKNOWN or gpsFix == FixMode::NOT_SEEN) and + std::filesystem::exists(TIME_FILE)) { + + ifstream timeFile(TIME_FILE); + string nextWord; + getline(timeFile, nextWord); + istringstream iss(nextWord); + iss >> nextWord; + if(iss.bad() or nextWord != "UNIX") { + return RETURN_FAILED; + } + iss >> nextWord; + if(iss.bad() or nextWord != "SECONDS:") { + return RETURN_FAILED; + } + iss >> nextWord; + timeval currentTime = {}; + char* checkPtr; + currentTime.tv_sec = strtol(nextWord.c_str(), &checkPtr, 10); + if(iss.bad() or *checkPtr) { + return RETURN_FAILED; + } + Clock::setClock(¤tTime); + return RETURN_OK; + } + return RETURN_OK; +} + void CoreController::readHkData() { ReturnValue_t result = RETURN_OK; result = hkSet.read(TIMEOUT_TYPE, MUTEX_TIMEOUT); @@ -1690,3 +1758,9 @@ void CoreController::readHkData() { return; } } + +bool CoreController::isNumber(const std::string& s) +{ + return !s.empty() && std::find_if(s.begin(), + s.end(), [](unsigned char c) { return !std::isdigit(c); }) == s.end(); +} diff --git a/bsp_q7s/core/CoreController.h b/bsp_q7s/core/CoreController.h index e31378ef..05ec6315 100644 --- a/bsp_q7s/core/CoreController.h +++ b/bsp_q7s/core/CoreController.h @@ -7,6 +7,7 @@ #include #include "CoreDefinitions.h" +#include "mission/devices/devicedefinitions/GPSDefinitions.h" #include "bsp_q7s/memory/SdCardManager.h" #include "events/subsystemIdRanges.h" #include "fsfw/controller/ExtendedControllerBase.h" @@ -53,10 +54,13 @@ class CoreController : public ExtendedControllerBase { static constexpr char CONF_FOLDER[] = "conf"; static constexpr char VERSION_FILE_NAME[] = "version.txt"; static constexpr char REBOOT_FILE_NAME[] = "reboot.txt"; + static constexpr char TIME_FILE_NAME[] = "time.txt"; const std::string VERSION_FILE = "/" + std::string(CONF_FOLDER) + "/" + std::string(VERSION_FILE_NAME); const std::string REBOOT_FILE = "/" + std::string(CONF_FOLDER) + "/" + std::string(REBOOT_FILE_NAME); + const std::string TIME_FILE = + "/" + std::string(CONF_FOLDER) + "/" + std::string(TIME_FILE_NAME); static constexpr ActionId_t LIST_DIRECTORY_INTO_FILE = 0; static constexpr ActionId_t SWITCH_REBOOT_FILE_HANDLING = 5; @@ -126,6 +130,7 @@ class CoreController : public ExtendedControllerBase { // Designated value for rechecking FIFO open static constexpr int RETRY_FIFO_OPEN = -2; int watchdogFifoFd = 0; + GpsHyperion::FixMode gpsFix = GpsHyperion::FixMode::UNKNOWN; // States for SD state machine, which is used in non-blocking mode enum class SdStates { @@ -151,6 +156,7 @@ class CoreController : public ExtendedControllerBase { static constexpr bool BLOCKING_SD_INIT = false; SdCardManager* sdcMan = nullptr; + MessageQueueIF* eventQueue = nullptr; struct SdInfo { sd::SdCard pref = sd::SdCard::NONE; @@ -192,6 +198,9 @@ class CoreController : public ExtendedControllerBase { ReturnValue_t checkModeCommand(Mode_t mode, Submode_t submode, uint32_t* msToReachTheMode); void performMountedSdCardOperations(); ReturnValue_t initVersionFile(); + + ReturnValue_t initClockFromTimeFile(); + ReturnValue_t timeFileHandler(); ReturnValue_t initBootCopy(); ReturnValue_t initWatchdogFifo(); ReturnValue_t initSdCardBlocking(); @@ -226,6 +235,7 @@ class CoreController : public ExtendedControllerBase { bool parseRebootFile(std::string path, RebootFile& file); void rewriteRebootFile(RebootFile file); void readHkData(); + bool isNumber(const std::string& s); }; #endif /* BSP_Q7S_CORE_CORECONTROLLER_H_ */ diff --git a/common/config/commonSubsystemIds.h b/common/config/commonSubsystemIds.h index a93986a1..aa86aae2 100644 --- a/common/config/commonSubsystemIds.h +++ b/common/config/commonSubsystemIds.h @@ -6,24 +6,26 @@ namespace SUBSYSTEM_ID { enum: uint8_t { COMMON_SUBSYSTEM_ID_START = FW_SUBSYSTEM_ID_RANGE, - PCDU_HANDLER = 108, - HEATER_HANDLER = 109, - SA_DEPL_HANDLER = 110, - PLOC_MPSOC_HANDLER = 111, - IMTQ_HANDLER = 112, - RW_HANDLER = 113, - STR_HANDLER = 114, - PLOC_SUPERVISOR_HANDLER = 115, - FILE_SYSTEM = 116, - PLOC_UPDATER = 117, - PLOC_MEMORY_DUMPER = 118, - PDEC_HANDLER = 119, - STR_HELPER = 120, - PLOC_MPSOC_HELPER = 121, - PL_PCDU_HANDLER = 122, - ACS_BOARD_ASS = 123, - SUS_BOARD_ASS = 124, - TCS_BOARD_ASS = 125, + ACS_SUBSYSTEM = 112, + PCDU_HANDLER = 113, + HEATER_HANDLER = 114, + SA_DEPL_HANDLER = 115, + PLOC_MPSOC_HANDLER = 116, + IMTQ_HANDLER = 117, + RW_HANDLER = 118, + STR_HANDLER = 119, + PLOC_SUPERVISOR_HANDLER = 120, + FILE_SYSTEM = 121, + PLOC_UPDATER = 122, + PLOC_MEMORY_DUMPER = 123, + PDEC_HANDLER = 124, + STR_HELPER = 125, + PLOC_MPSOC_HELPER = 126, + PL_PCDU_HANDLER = 127, + ACS_BOARD_ASS = 128, + SUS_BOARD_ASS = 129, + TCS_BOARD_ASS = 130, + GPS_HANDLER = 131, COMMON_SUBSYSTEM_ID_END }; } diff --git a/fsfw b/fsfw index a11d7455..5bda877d 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit a11d7455dfaf2e736f73f6c4dda1f8c06b9f1234 +Subproject commit 5bda877d97b41e82bf36d939c9f367cef611446a diff --git a/linux/devices/GPSHyperionLinuxController.cpp b/linux/devices/GPSHyperionLinuxController.cpp index 34e02001..6d19d274 100644 --- a/linux/devices/GPSHyperionLinuxController.cpp +++ b/linux/devices/GPSHyperionLinuxController.cpp @@ -132,7 +132,11 @@ void GPSHyperionLinuxController::readGpsDataFromGpsd() { } // 0: Not seen, 1: No fix, 2: 2D-Fix, 3: 3D-Fix - gpsSet.fixMode.value = gps->fix.mode; + int newFixMode = gps->fix.mode; + if(gpsSet.fixMode.value != newFixMode) { + triggerEvent(GpsHyperion::GPS_FIX_CHANGE, gpsSet.fixMode.value, newFixMode); + } + gpsSet.fixMode.value = newFixMode; if (gps->fix.mode == 0 or gps->fix.mode == 1) { if (modeCommanded and maxTimeToReachFix.hasTimedOut()) { // We are supposed to be on and functioning, but not fix was found diff --git a/linux/devices/GPSHyperionLinuxController.h b/linux/devices/GPSHyperionLinuxController.h index 46acb5fc..ac8a4735 100644 --- a/linux/devices/GPSHyperionLinuxController.h +++ b/linux/devices/GPSHyperionLinuxController.h @@ -2,6 +2,7 @@ #define MISSION_DEVICES_GPSHYPERIONHANDLER_H_ #include "fsfw/FSFW.h" +#include "commonSubsystemIds.h" #include "fsfw/controller/ExtendedControllerBase.h" #include "fsfw/devicehandlers/DeviceHandlerBase.h" #include "mission/devices/devicedefinitions/GPSDefinitions.h" @@ -22,6 +23,8 @@ class GPSHyperionLinuxController : public ExtendedControllerBase { public: static constexpr uint32_t MAX_SECONDS_TO_REACH_FIX = 60 * 60 * 5; + + GPSHyperionLinuxController(object_id_t objectId, object_id_t parentId, bool debugHyperionGps = false); virtual ~GPSHyperionLinuxController(); diff --git a/mission/devices/devicedefinitions/GPSDefinitions.h b/mission/devices/devicedefinitions/GPSDefinitions.h index 5a565fea..bf3fbe52 100644 --- a/mission/devices/devicedefinitions/GPSDefinitions.h +++ b/mission/devices/devicedefinitions/GPSDefinitions.h @@ -6,6 +6,19 @@ namespace GpsHyperion { +enum class FixMode: uint8_t { + NOT_SEEN = 0, + NO_FIX = 1, + FIX_2D = 2, + FIX_3D = 3, + UNKNOWN = 4 +}; + +static constexpr uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::GPS_HANDLER; +//! [EXPORT] : [COMMENT] Fix has changed. P1: Old fix. P2: New fix +//! 0: Not seen, 1: No Fix, 2: 2D-Fix, 3: 3D-Fix +static constexpr Event GPS_FIX_CHANGE = event::makeEvent(SUBSYSTEM_ID, 0, severity::INFO); + static constexpr DeviceCommandId_t GPS_REPLY = 0; static constexpr DeviceCommandId_t TRIGGER_RESET_PIN = 5; diff --git a/tmtc b/tmtc index 8f2ff303..25bab108 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 8f2ff3034fff627b807f32c02fd9e676126bae5f +Subproject commit 25bab108df76045e10af2efc26a0397f78574f9c From 45007d726dde08e7ffba3eea2d6ed6a6633f9506 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 7 Apr 2022 17:28:58 +0200 Subject: [PATCH 40/65] update translation files --- generators/bsp_q7s_events.csv | 198 +++--- generators/bsp_q7s_returnvalues.csv | 600 +++++++++--------- generators/events/translateEvents.cpp | 318 +++++----- generators/objects/translateObjects.cpp | 2 +- linux/fsfwconfig/events/translateEvents.cpp | 318 +++++----- linux/fsfwconfig/objects/translateObjects.cpp | 2 +- tmtc | 2 +- 7 files changed, 727 insertions(+), 713 deletions(-) diff --git a/generators/bsp_q7s_events.csv b/generators/bsp_q7s_events.csv index 994e7517..e66bc16d 100644 --- a/generators/bsp_q7s_events.csv +++ b/generators/bsp_q7s_events.csv @@ -77,104 +77,106 @@ 8901;0x22c5;CLOCK_SET_FAILURE;LOW;;fsfw/src/fsfw/pus/Service9TimeManagement.h 9700;0x25e4;TEST;INFO;;fsfw/src/fsfw/pus/Service17Test.h 10600;0x2968;CHANGE_OF_SETUP_PARAMETER;LOW;;fsfw/hal/src/fsfw_hal/devicehandlers/MgmLIS3MDLHandler.h -10800;0x2a30;SWITCH_CMD_SENT;INFO;Indicates that a FSFW object requested setting a switch P1: 1 if on was requested, 0 for off | P2: Switch Index;mission/devices/devicedefinitions/powerDefinitions.h -10801;0x2a31;SWITCH_HAS_CHANGED;INFO;Indicated that a swithc state has changed P1: New switch state, 1 for on, 0 for off | P2: Switch Index;mission/devices/devicedefinitions/powerDefinitions.h -10802;0x2a32;SWITCHING_Q7S_DENIED;MEDIUM;;mission/devices/devicedefinitions/powerDefinitions.h -10900;0x2a94;GPIO_PULL_HIGH_FAILED;LOW;;mission/devices/HeaterHandler.h -10901;0x2a95;GPIO_PULL_LOW_FAILED;LOW;;mission/devices/HeaterHandler.h -10902;0x2a96;SWITCH_ALREADY_ON;LOW;;mission/devices/HeaterHandler.h -10903;0x2a97;SWITCH_ALREADY_OFF;LOW;;mission/devices/HeaterHandler.h -10904;0x2a98;MAIN_SWITCH_TIMEOUT;LOW;;mission/devices/HeaterHandler.h -11000;0x2af8;MAIN_SWITCH_ON_TIMEOUT;LOW;;mission/devices/SolarArrayDeploymentHandler.h -11001;0x2af9;MAIN_SWITCH_OFF_TIMEOUT;LOW;;mission/devices/SolarArrayDeploymentHandler.h -11002;0x2afa;DEPLOYMENT_FAILED;HIGH;;mission/devices/SolarArrayDeploymentHandler.h -11003;0x2afb;DEPL_SA1_GPIO_SWTICH_ON_FAILED;HIGH;;mission/devices/SolarArrayDeploymentHandler.h -11004;0x2afc;DEPL_SA2_GPIO_SWTICH_ON_FAILED;HIGH;;mission/devices/SolarArrayDeploymentHandler.h -11101;0x2b5d;MEMORY_READ_RPT_CRC_FAILURE;LOW;PLOC crc failure in telemetry packet;linux/devices/ploc/PlocMPSoCHandler.h -11102;0x2b5e;ACK_FAILURE;LOW;PLOC receive acknowledgment failure report P1: Command Id which leads the acknowledgment failure report P2: The status field inserted by the MPSoC into the data field;linux/devices/ploc/PlocMPSoCHandler.h -11103;0x2b5f;EXE_FAILURE;LOW;PLOC receive execution failure report P1: Command Id which leads the execution failure report P2: The status field inserted by the MPSoC into the data field;linux/devices/ploc/PlocMPSoCHandler.h -11104;0x2b60;MPSOC_HANDLER_CRC_FAILURE;LOW;PLOC reply has invalid crc;linux/devices/ploc/PlocMPSoCHandler.h -11105;0x2b61;MPSOC_HANDLER_SEQ_CNT_MISMATCH;LOW;Packet sequence count in received space packet does not match expected count P1: Expected sequence count P2: Received sequence count;linux/devices/ploc/PlocMPSoCHandler.h -11201;0x2bc1;SELF_TEST_I2C_FAILURE;LOW;Get self test result returns I2C failure P1: Indicates on which axis the failure occurred. 0 -> INIT, 1 -> +X, 2 -> -X, 3 -> +Y, 4 -> -Y, 5 -> +Z, 6 -> -Z, 7 -> FINA;mission/devices/IMTQHandler.h -11202;0x2bc2;SELF_TEST_SPI_FAILURE;LOW;Get self test result returns SPI failure. This concerns the MTM connectivity. P1: Indicates on which axis the failure occurred. 0 -> INIT, 1 -> +X, 2 -> -X, 3 -> +Y, 4 -> -Y, 5 -> +Z, 6 -> -Z, 7 -> FINA;mission/devices/IMTQHandler.h -11203;0x2bc3;SELF_TEST_ADC_FAILURE;LOW;Get self test result returns failure in measurement of current and temperature. P1: Indicates on which axis the failure occurred. 0 -> INIT, 1 -> +X, 2 -> -X, 3 -> +Y, 4 -> -Y, 5 -> +Z, 6 -> -Z, 7 -> FINA;mission/devices/IMTQHandler.h -11204;0x2bc4;SELF_TEST_PWM_FAILURE;LOW;Get self test result returns PWM failure which concerns the coil actuation. P1: Indicates on which axis the failure occurred. 0 -> INIT, 1 -> +X, 2 -> -X, 3 -> +Y, 4 -> -Y, 5 -> +Z, 6 -> -Z, 7 -> FINA;mission/devices/IMTQHandler.h -11205;0x2bc5;SELF_TEST_TC_FAILURE;LOW;Get self test result returns TC failure (system failure) P1: Indicates on which axis the failure occurred. 0 -> INIT, 1 -> +X, 2 -> -X, 3 -> +Y, 4 -> -Y, 5 -> +Z, 6 -> -Z, 7 -> FINA;mission/devices/IMTQHandler.h -11206;0x2bc6;SELF_TEST_MTM_RANGE_FAILURE;LOW;Get self test result returns failure that MTM values were outside of the expected range. P1: Indicates on which axis the failure occurred. 0 -> INIT, 1 -> +X, 2 -> -X, 3 -> +Y, 4 -> -Y, 5 -> +Z, 6 -> -Z, 7 -> FINA;mission/devices/IMTQHandler.h -11207;0x2bc7;SELF_TEST_COIL_CURRENT_FAILURE;LOW;Get self test result returns failure indicating that the coil current was outside of the expected range P1: Indicates on which axis the failure occurred. 0 -> INIT, 1 -> +X, 2 -> -X, 3 -> +Y, 4 -> -Y, 5 -> +Z, 6 -> -Z, 7 -> FINA;mission/devices/IMTQHandler.h -11208;0x2bc8;INVALID_ERROR_BYTE;LOW;Received invalid error byte. This indicates an error of the communication link between IMTQ and OBC.;mission/devices/IMTQHandler.h -11301;0x2c25;ERROR_STATE;HIGH;Reaction wheel signals an error state;mission/devices/RwHandler.h -11401;0x2c89;BOOTING_FIRMWARE_FAILED;LOW;Failed to boot firmware;linux/devices/startracker/StarTrackerHandler.h -11402;0x2c8a;BOOTING_BOOTLOADER_FAILED;LOW;Failed to boot star tracker into bootloader mode;linux/devices/startracker/StarTrackerHandler.h -11501;0x2ced;SUPV_MEMORY_READ_RPT_CRC_FAILURE;LOW;PLOC supervisor crc failure in telemetry packet;linux/devices/ploc/PlocSupervisorHandler.h -11502;0x2cee;SUPV_ACK_FAILURE;LOW;PLOC supervisor received acknowledgment failure report;linux/devices/ploc/PlocSupervisorHandler.h -11503;0x2cef;SUPV_EXE_FAILURE;LOW;PLOC received execution failure report;linux/devices/ploc/PlocSupervisorHandler.h -11504;0x2cf0;SUPV_CRC_FAILURE_EVENT;LOW;PLOC supervisor reply has invalid crc;linux/devices/ploc/PlocSupervisorHandler.h -11600;0x2d50;SANITIZATION_FAILED;LOW;;bsp_q7s/memory/SdCardManager.h -11601;0x2d51;MOUNTED_SD_CARD;INFO;;bsp_q7s/memory/SdCardManager.h -11700;0x2db4;UPDATE_FILE_NOT_EXISTS;LOW;;linux/devices/ploc/PlocUpdater.h -11701;0x2db5;ACTION_COMMANDING_FAILED;LOW;Failed to send command to supervisor handler P1: Return value of CommandActionHelper::commandAction P2: Action ID of command to send;linux/devices/ploc/PlocUpdater.h -11702;0x2db6;UPDATE_AVAILABLE_FAILED;LOW;Supervisor handler replied action message indicating a command execution failure of the update available command;linux/devices/ploc/PlocUpdater.h -11703;0x2db7;UPDATE_TRANSFER_FAILED;LOW;Supervisor handler failed to transfer an update space packet. P1: Parameter holds the number of update packets already sent (inclusive the failed packet);linux/devices/ploc/PlocUpdater.h -11704;0x2db8;UPDATE_VERIFY_FAILED;LOW;Supervisor failed to execute the update verify command.;linux/devices/ploc/PlocUpdater.h -11705;0x2db9;UPDATE_FINISHED;INFO;MPSoC update successful completed;linux/devices/ploc/PlocUpdater.h -11800;0x2e18;SEND_MRAM_DUMP_FAILED;LOW;Failed to send mram dump command to supervisor handler P1: Return value of commandAction function P2: Start address of MRAM to dump with this command;linux/devices/ploc/PlocMemoryDumper.h -11801;0x2e19;MRAM_DUMP_FAILED;LOW;Received completion failure report form PLOC supervisor handler P1: MRAM start address of failing dump command;linux/devices/ploc/PlocMemoryDumper.h -11802;0x2e1a;MRAM_DUMP_FINISHED;LOW;MRAM dump finished successfully;linux/devices/ploc/PlocMemoryDumper.h -11901;0x2e7d;INVALID_TC_FRAME;HIGH;;linux/obc/PdecHandler.h -11902;0x2e7e;INVALID_FAR;HIGH;Read invalid FAR from PDEC after startup;linux/obc/PdecHandler.h -11903;0x2e7f;CARRIER_LOCK;INFO;Carrier lock detected;linux/obc/PdecHandler.h -11904;0x2e80;BIT_LOCK_PDEC;INFO;Bit lock detected (data valid);linux/obc/PdecHandler.h -12000;0x2ee0;IMAGE_UPLOAD_FAILED;LOW;Image upload failed;linux/devices/startracker/StrHelper.h -12001;0x2ee1;IMAGE_DOWNLOAD_FAILED;LOW;Image download failed;linux/devices/startracker/StrHelper.h -12002;0x2ee2;IMAGE_UPLOAD_SUCCESSFUL;LOW;Uploading image to star tracker was successfulop;linux/devices/startracker/StrHelper.h -12003;0x2ee3;IMAGE_DOWNLOAD_SUCCESSFUL;LOW;Image download was successful;linux/devices/startracker/StrHelper.h -12004;0x2ee4;FLASH_WRITE_SUCCESSFUL;LOW;Finished flash write procedure successfully;linux/devices/startracker/StrHelper.h -12005;0x2ee5;FLASH_READ_SUCCESSFUL;LOW;Finished flash read procedure successfully;linux/devices/startracker/StrHelper.h -12006;0x2ee6;FLASH_READ_FAILED;LOW;Flash read procedure failed;linux/devices/startracker/StrHelper.h -12007;0x2ee7;FIRMWARE_UPDATE_SUCCESSFUL;LOW;Firmware update was successful;linux/devices/startracker/StrHelper.h -12008;0x2ee8;FIRMWARE_UPDATE_FAILED;LOW;Firmware update failed;linux/devices/startracker/StrHelper.h -12009;0x2ee9;STR_HELPER_READING_REPLY_FAILED;LOW;Failed to read communication interface reply data P1: Return code of failed communication interface read call P1: Upload/download position for which the read call failed;linux/devices/startracker/StrHelper.h -12010;0x2eea;STR_HELPER_COM_ERROR;LOW;Unexpected stop of decoding sequence P1: Return code of failed communication interface read call P1: Upload/download position for which the read call failed;linux/devices/startracker/StrHelper.h -12011;0x2eeb;STR_HELPER_NO_REPLY;LOW;Star tracker did not send replies (maybe device is powered off) P1: Position of upload or download packet for which no reply was sent;linux/devices/startracker/StrHelper.h -12012;0x2eec;STR_HELPER_DEC_ERROR;LOW;Error during decoding of received reply occurred P1: Return value of decoding function P2: Position of upload/download packet, or address of flash write/read request;linux/devices/startracker/StrHelper.h -12013;0x2eed;POSITION_MISMATCH;LOW;Position mismatch P1: The expected position and thus the position for which the image upload/download failed;linux/devices/startracker/StrHelper.h -12014;0x2eee;STR_HELPER_FILE_NOT_EXISTS;LOW;Specified file does not exist P1: Internal state of str helper;linux/devices/startracker/StrHelper.h -12015;0x2eef;STR_HELPER_SENDING_PACKET_FAILED;LOW;;linux/devices/startracker/StrHelper.h -12016;0x2ef0;STR_HELPER_REQUESTING_MSG_FAILED;LOW;;linux/devices/startracker/StrHelper.h -12100;0x2f44;MPSOC_FLASH_WRITE_FAILED;LOW;Flash write fails;linux/devices/ploc/PlocMPSoCHelper.h -12101;0x2f45;MPSOC_FLASH_WRITE_SUCCESSFUL;LOW;Flash write successful;linux/devices/ploc/PlocMPSoCHelper.h -12102;0x2f46;SENDING_COMMAND_FAILED;LOW;;linux/devices/ploc/PlocMPSoCHelper.h -12103;0x2f47;MPSOC_HELPER_REQUESTING_REPLY_FAILED;LOW;Request receive message of communication interface failed P1: Return value returned by the communication interface requestReceiveMessage function P2: Internal state of MPSoC helper;linux/devices/ploc/PlocMPSoCHelper.h -12104;0x2f48;MPSOC_HELPER_READING_REPLY_FAILED;LOW;Reading receive message of communication interface failed P1: Return value returned by the communication interface readingReceivedMessage function P2: Internal state of MPSoC helper;linux/devices/ploc/PlocMPSoCHelper.h -12105;0x2f49;MISSING_ACK;LOW;Did not receive acknowledgement report P1: Number of bytes missing P2: Internal state of MPSoC helper;linux/devices/ploc/PlocMPSoCHelper.h -12106;0x2f4a;MISSING_EXE;LOW;Did not receive execution report P1: Number of bytes missing P2: Internal state of MPSoC helper;linux/devices/ploc/PlocMPSoCHelper.h -12107;0x2f4b;ACK_FAILURE_REPORT;LOW;Received acknowledgement failure report P1: Internal state of MPSoC;linux/devices/ploc/PlocMPSoCHelper.h -12108;0x2f4c;EXE_FAILURE_REPORT;LOW;Received execution failure report P1: Internal state of MPSoC;linux/devices/ploc/PlocMPSoCHelper.h -12109;0x2f4d;ACK_INVALID_APID;LOW;Expected acknowledgement report but received space packet with other apid P1: Apid of received space packet P2: Internal state of MPSoC;linux/devices/ploc/PlocMPSoCHelper.h -12110;0x2f4e;EXE_INVALID_APID;LOW;Expected execution report but received space packet with other apid P1: Apid of received space packet P2: Internal state of MPSoC;linux/devices/ploc/PlocMPSoCHelper.h -12111;0x2f4f;MPSOC_HELPER_SEQ_CNT_MISMATCH;LOW;Received sequence count does not match expected sequence count P1: Expected sequence count P2: Received sequence count;linux/devices/ploc/PlocMPSoCHelper.h -12200;0x2fa8;TRANSITION_BACK_TO_OFF;MEDIUM;Could not transition properly and went back to ALL OFF;mission/devices/PayloadPcduHandler.h -12201;0x2fa9;NEG_V_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission/devices/PayloadPcduHandler.h -12202;0x2faa;U_DRO_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission/devices/PayloadPcduHandler.h -12203;0x2fab;I_DRO_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission/devices/PayloadPcduHandler.h -12204;0x2fac;U_X8_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission/devices/PayloadPcduHandler.h -12205;0x2fad;I_X8_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission/devices/PayloadPcduHandler.h -12206;0x2fae;U_TX_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission/devices/PayloadPcduHandler.h -12207;0x2faf;I_TX_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission/devices/PayloadPcduHandler.h -12208;0x2fb0;U_MPA_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission/devices/PayloadPcduHandler.h -12209;0x2fb1;I_MPA_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission/devices/PayloadPcduHandler.h -12210;0x2fb2;U_HPA_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission/devices/PayloadPcduHandler.h -12211;0x2fb3;I_HPA_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission/devices/PayloadPcduHandler.h -12300;0x300c;TRANSITION_OTHER_SIDE_FAILED;HIGH;;mission/system/AcsBoardAssembly.h -12301;0x300d;NOT_ENOUGH_DEVICES_DUAL_MODE;HIGH;;mission/system/AcsBoardAssembly.h -12302;0x300e;POWER_STATE_MACHINE_TIMEOUT;MEDIUM;;mission/system/AcsBoardAssembly.h -12303;0x300f;SIDE_SWITCH_TRANSITION_NOT_ALLOWED;LOW;Not implemented, would increase already high complexity. Operator should instead command the assembly off first and then command the assembly on into the desired mode/submode combination;mission/system/AcsBoardAssembly.h -12400;0x3070;TRANSITION_OTHER_SIDE_FAILED;HIGH;;mission/system/SusAssembly.h -12401;0x3071;NOT_ENOUGH_DEVICES_DUAL_MODE;HIGH;;mission/system/SusAssembly.h -12402;0x3072;POWER_STATE_MACHINE_TIMEOUT;MEDIUM;;mission/system/SusAssembly.h -12403;0x3073;SIDE_SWITCH_TRANSITION_NOT_ALLOWED;LOW;Not implemented, would increase already high complexity. Operator should instead command the assembly off first and then command the assembly on into the desired mode/submode combination;mission/system/SusAssembly.h -12500;0x30d4;CHILDREN_LOST_MODE;MEDIUM;;mission/system/TcsBoardAssembly.h +11300;0x2c24;SWITCH_CMD_SENT;INFO;Indicates that a FSFW object requested setting a switch P1: 1 if on was requested, 0 for off | P2: Switch Index;mission/devices/devicedefinitions/powerDefinitions.h +11301;0x2c25;SWITCH_HAS_CHANGED;INFO;Indicated that a swithc state has changed P1: New switch state, 1 for on, 0 for off | P2: Switch Index;mission/devices/devicedefinitions/powerDefinitions.h +11302;0x2c26;SWITCHING_Q7S_DENIED;MEDIUM;;mission/devices/devicedefinitions/powerDefinitions.h +11400;0x2c88;GPIO_PULL_HIGH_FAILED;LOW;;mission/devices/HeaterHandler.h +11401;0x2c89;GPIO_PULL_LOW_FAILED;LOW;;mission/devices/HeaterHandler.h +11402;0x2c8a;SWITCH_ALREADY_ON;LOW;;mission/devices/HeaterHandler.h +11403;0x2c8b;SWITCH_ALREADY_OFF;LOW;;mission/devices/HeaterHandler.h +11404;0x2c8c;MAIN_SWITCH_TIMEOUT;LOW;;mission/devices/HeaterHandler.h +11500;0x2cec;MAIN_SWITCH_ON_TIMEOUT;LOW;;mission/devices/SolarArrayDeploymentHandler.h +11501;0x2ced;MAIN_SWITCH_OFF_TIMEOUT;LOW;;mission/devices/SolarArrayDeploymentHandler.h +11502;0x2cee;DEPLOYMENT_FAILED;HIGH;;mission/devices/SolarArrayDeploymentHandler.h +11503;0x2cef;DEPL_SA1_GPIO_SWTICH_ON_FAILED;HIGH;;mission/devices/SolarArrayDeploymentHandler.h +11504;0x2cf0;DEPL_SA2_GPIO_SWTICH_ON_FAILED;HIGH;;mission/devices/SolarArrayDeploymentHandler.h +11601;0x2d51;MEMORY_READ_RPT_CRC_FAILURE;LOW;PLOC crc failure in telemetry packet;linux/devices/ploc/PlocMPSoCHandler.h +11602;0x2d52;ACK_FAILURE;LOW;PLOC receive acknowledgment failure report P1: Command Id which leads the acknowledgment failure report P2: The status field inserted by the MPSoC into the data field;linux/devices/ploc/PlocMPSoCHandler.h +11603;0x2d53;EXE_FAILURE;LOW;PLOC receive execution failure report P1: Command Id which leads the execution failure report P2: The status field inserted by the MPSoC into the data field;linux/devices/ploc/PlocMPSoCHandler.h +11604;0x2d54;MPSOC_HANDLER_CRC_FAILURE;LOW;PLOC reply has invalid crc;linux/devices/ploc/PlocMPSoCHandler.h +11605;0x2d55;MPSOC_HANDLER_SEQ_CNT_MISMATCH;LOW;Packet sequence count in received space packet does not match expected count P1: Expected sequence count P2: Received sequence count;linux/devices/ploc/PlocMPSoCHandler.h +11606;0x2d56;MPSOC_SHUTDOWN_FAILED;HIGH;Supervisor fails to shutdown MPSoC. Requires to power off the PLOC and thus also to shutdown the supervisor.;linux/devices/ploc/PlocMPSoCHandler.h +11701;0x2db5;SELF_TEST_I2C_FAILURE;LOW;Get self test result returns I2C failure P1: Indicates on which axis the failure occurred. 0 -> INIT, 1 -> +X, 2 -> -X, 3 -> +Y, 4 -> -Y, 5 -> +Z, 6 -> -Z, 7 -> FINA;mission/devices/IMTQHandler.h +11702;0x2db6;SELF_TEST_SPI_FAILURE;LOW;Get self test result returns SPI failure. This concerns the MTM connectivity. P1: Indicates on which axis the failure occurred. 0 -> INIT, 1 -> +X, 2 -> -X, 3 -> +Y, 4 -> -Y, 5 -> +Z, 6 -> -Z, 7 -> FINA;mission/devices/IMTQHandler.h +11703;0x2db7;SELF_TEST_ADC_FAILURE;LOW;Get self test result returns failure in measurement of current and temperature. P1: Indicates on which axis the failure occurred. 0 -> INIT, 1 -> +X, 2 -> -X, 3 -> +Y, 4 -> -Y, 5 -> +Z, 6 -> -Z, 7 -> FINA;mission/devices/IMTQHandler.h +11704;0x2db8;SELF_TEST_PWM_FAILURE;LOW;Get self test result returns PWM failure which concerns the coil actuation. P1: Indicates on which axis the failure occurred. 0 -> INIT, 1 -> +X, 2 -> -X, 3 -> +Y, 4 -> -Y, 5 -> +Z, 6 -> -Z, 7 -> FINA;mission/devices/IMTQHandler.h +11705;0x2db9;SELF_TEST_TC_FAILURE;LOW;Get self test result returns TC failure (system failure) P1: Indicates on which axis the failure occurred. 0 -> INIT, 1 -> +X, 2 -> -X, 3 -> +Y, 4 -> -Y, 5 -> +Z, 6 -> -Z, 7 -> FINA;mission/devices/IMTQHandler.h +11706;0x2dba;SELF_TEST_MTM_RANGE_FAILURE;LOW;Get self test result returns failure that MTM values were outside of the expected range. P1: Indicates on which axis the failure occurred. 0 -> INIT, 1 -> +X, 2 -> -X, 3 -> +Y, 4 -> -Y, 5 -> +Z, 6 -> -Z, 7 -> FINA;mission/devices/IMTQHandler.h +11707;0x2dbb;SELF_TEST_COIL_CURRENT_FAILURE;LOW;Get self test result returns failure indicating that the coil current was outside of the expected range P1: Indicates on which axis the failure occurred. 0 -> INIT, 1 -> +X, 2 -> -X, 3 -> +Y, 4 -> -Y, 5 -> +Z, 6 -> -Z, 7 -> FINA;mission/devices/IMTQHandler.h +11708;0x2dbc;INVALID_ERROR_BYTE;LOW;Received invalid error byte. This indicates an error of the communication link between IMTQ and OBC.;mission/devices/IMTQHandler.h +11801;0x2e19;ERROR_STATE;HIGH;Reaction wheel signals an error state;mission/devices/RwHandler.h +11901;0x2e7d;BOOTING_FIRMWARE_FAILED;LOW;Failed to boot firmware;linux/devices/startracker/StarTrackerHandler.h +11902;0x2e7e;BOOTING_BOOTLOADER_FAILED;LOW;Failed to boot star tracker into bootloader mode;linux/devices/startracker/StarTrackerHandler.h +12001;0x2ee1;SUPV_MEMORY_READ_RPT_CRC_FAILURE;LOW;PLOC supervisor crc failure in telemetry packet;linux/devices/ploc/PlocSupervisorHandler.h +12002;0x2ee2;SUPV_ACK_FAILURE;LOW;PLOC supervisor received acknowledgment failure report;linux/devices/ploc/PlocSupervisorHandler.h +12003;0x2ee3;SUPV_EXE_FAILURE;LOW;PLOC received execution failure report;linux/devices/ploc/PlocSupervisorHandler.h +12004;0x2ee4;SUPV_CRC_FAILURE_EVENT;LOW;PLOC supervisor reply has invalid crc;linux/devices/ploc/PlocSupervisorHandler.h +12100;0x2f44;SANITIZATION_FAILED;LOW;;bsp_q7s/memory/SdCardManager.h +12101;0x2f45;MOUNTED_SD_CARD;INFO;;bsp_q7s/memory/SdCardManager.h +12200;0x2fa8;UPDATE_FILE_NOT_EXISTS;LOW;;linux/devices/ploc/PlocUpdater.h +12201;0x2fa9;ACTION_COMMANDING_FAILED;LOW;Failed to send command to supervisor handler P1: Return value of CommandActionHelper::commandAction P2: Action ID of command to send;linux/devices/ploc/PlocUpdater.h +12202;0x2faa;UPDATE_AVAILABLE_FAILED;LOW;Supervisor handler replied action message indicating a command execution failure of the update available command;linux/devices/ploc/PlocUpdater.h +12203;0x2fab;UPDATE_TRANSFER_FAILED;LOW;Supervisor handler failed to transfer an update space packet. P1: Parameter holds the number of update packets already sent (inclusive the failed packet);linux/devices/ploc/PlocUpdater.h +12204;0x2fac;UPDATE_VERIFY_FAILED;LOW;Supervisor failed to execute the update verify command.;linux/devices/ploc/PlocUpdater.h +12205;0x2fad;UPDATE_FINISHED;INFO;MPSoC update successful completed;linux/devices/ploc/PlocUpdater.h +12300;0x300c;SEND_MRAM_DUMP_FAILED;LOW;Failed to send mram dump command to supervisor handler P1: Return value of commandAction function P2: Start address of MRAM to dump with this command;linux/devices/ploc/PlocMemoryDumper.h +12301;0x300d;MRAM_DUMP_FAILED;LOW;Received completion failure report form PLOC supervisor handler P1: MRAM start address of failing dump command;linux/devices/ploc/PlocMemoryDumper.h +12302;0x300e;MRAM_DUMP_FINISHED;LOW;MRAM dump finished successfully;linux/devices/ploc/PlocMemoryDumper.h +12401;0x3071;INVALID_TC_FRAME;HIGH;;linux/obc/PdecHandler.h +12402;0x3072;INVALID_FAR;HIGH;Read invalid FAR from PDEC after startup;linux/obc/PdecHandler.h +12403;0x3073;CARRIER_LOCK;INFO;Carrier lock detected;linux/obc/PdecHandler.h +12404;0x3074;BIT_LOCK_PDEC;INFO;Bit lock detected (data valid);linux/obc/PdecHandler.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 +12502;0x30d6;IMAGE_UPLOAD_SUCCESSFUL;LOW;Uploading image to star tracker was successfulop;linux/devices/startracker/StrHelper.h +12503;0x30d7;IMAGE_DOWNLOAD_SUCCESSFUL;LOW;Image download was successful;linux/devices/startracker/StrHelper.h +12504;0x30d8;FLASH_WRITE_SUCCESSFUL;LOW;Finished flash write procedure successfully;linux/devices/startracker/StrHelper.h +12505;0x30d9;FLASH_READ_SUCCESSFUL;LOW;Finished flash read procedure successfully;linux/devices/startracker/StrHelper.h +12506;0x30da;FLASH_READ_FAILED;LOW;Flash read procedure failed;linux/devices/startracker/StrHelper.h +12507;0x30db;FIRMWARE_UPDATE_SUCCESSFUL;LOW;Firmware update was successful;linux/devices/startracker/StrHelper.h +12508;0x30dc;FIRMWARE_UPDATE_FAILED;LOW;Firmware update failed;linux/devices/startracker/StrHelper.h +12509;0x30dd;STR_HELPER_READING_REPLY_FAILED;LOW;Failed to read communication interface reply data P1: Return code of failed communication interface read call P1: Upload/download position for which the read call failed;linux/devices/startracker/StrHelper.h +12510;0x30de;STR_HELPER_COM_ERROR;LOW;Unexpected stop of decoding sequence P1: Return code of failed communication interface read call P1: Upload/download position for which the read call failed;linux/devices/startracker/StrHelper.h +12511;0x30df;STR_HELPER_NO_REPLY;LOW;Star tracker did not send replies (maybe device is powered off) P1: Position of upload or download packet for which no reply was sent;linux/devices/startracker/StrHelper.h +12512;0x30e0;STR_HELPER_DEC_ERROR;LOW;Error during decoding of received reply occurred P1: Return value of decoding function P2: Position of upload/download packet, or address of flash write/read request;linux/devices/startracker/StrHelper.h +12513;0x30e1;POSITION_MISMATCH;LOW;Position mismatch P1: The expected position and thus the position for which the image upload/download failed;linux/devices/startracker/StrHelper.h +12514;0x30e2;STR_HELPER_FILE_NOT_EXISTS;LOW;Specified file does not exist P1: Internal state of str helper;linux/devices/startracker/StrHelper.h +12515;0x30e3;STR_HELPER_SENDING_PACKET_FAILED;LOW;;linux/devices/startracker/StrHelper.h +12516;0x30e4;STR_HELPER_REQUESTING_MSG_FAILED;LOW;;linux/devices/startracker/StrHelper.h +12600;0x3138;MPSOC_FLASH_WRITE_FAILED;LOW;Flash write fails;linux/devices/ploc/PlocMPSoCHelper.h +12601;0x3139;MPSOC_FLASH_WRITE_SUCCESSFUL;LOW;Flash write successful;linux/devices/ploc/PlocMPSoCHelper.h +12602;0x313a;SENDING_COMMAND_FAILED;LOW;;linux/devices/ploc/PlocMPSoCHelper.h +12603;0x313b;MPSOC_HELPER_REQUESTING_REPLY_FAILED;LOW;Request receive message of communication interface failed P1: Return value returned by the communication interface requestReceiveMessage function P2: Internal state of MPSoC helper;linux/devices/ploc/PlocMPSoCHelper.h +12604;0x313c;MPSOC_HELPER_READING_REPLY_FAILED;LOW;Reading receive message of communication interface failed P1: Return value returned by the communication interface readingReceivedMessage function P2: Internal state of MPSoC helper;linux/devices/ploc/PlocMPSoCHelper.h +12605;0x313d;MISSING_ACK;LOW;Did not receive acknowledgement report P1: Number of bytes missing P2: Internal state of MPSoC helper;linux/devices/ploc/PlocMPSoCHelper.h +12606;0x313e;MISSING_EXE;LOW;Did not receive execution report P1: Number of bytes missing P2: Internal state of MPSoC helper;linux/devices/ploc/PlocMPSoCHelper.h +12607;0x313f;ACK_FAILURE_REPORT;LOW;Received acknowledgement failure report P1: Internal state of MPSoC;linux/devices/ploc/PlocMPSoCHelper.h +12608;0x3140;EXE_FAILURE_REPORT;LOW;Received execution failure report P1: Internal state of MPSoC;linux/devices/ploc/PlocMPSoCHelper.h +12609;0x3141;ACK_INVALID_APID;LOW;Expected acknowledgement report but received space packet with other apid P1: Apid of received space packet P2: Internal state of MPSoC;linux/devices/ploc/PlocMPSoCHelper.h +12610;0x3142;EXE_INVALID_APID;LOW;Expected execution report but received space packet with other apid P1: Apid of received space packet P2: Internal state of MPSoC;linux/devices/ploc/PlocMPSoCHelper.h +12611;0x3143;MPSOC_HELPER_SEQ_CNT_MISMATCH;LOW;Received sequence count does not match expected sequence count P1: Expected sequence count P2: Received sequence count;linux/devices/ploc/PlocMPSoCHelper.h +12700;0x319c;TRANSITION_BACK_TO_OFF;MEDIUM;Could not transition properly and went back to ALL OFF;mission/devices/PayloadPcduHandler.h +12701;0x319d;NEG_V_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission/devices/PayloadPcduHandler.h +12702;0x319e;U_DRO_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission/devices/PayloadPcduHandler.h +12703;0x319f;I_DRO_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission/devices/PayloadPcduHandler.h +12704;0x31a0;U_X8_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission/devices/PayloadPcduHandler.h +12705;0x31a1;I_X8_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission/devices/PayloadPcduHandler.h +12706;0x31a2;U_TX_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission/devices/PayloadPcduHandler.h +12707;0x31a3;I_TX_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission/devices/PayloadPcduHandler.h +12708;0x31a4;U_MPA_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission/devices/PayloadPcduHandler.h +12709;0x31a5;I_MPA_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission/devices/PayloadPcduHandler.h +12710;0x31a6;U_HPA_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission/devices/PayloadPcduHandler.h +12711;0x31a7;I_HPA_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission/devices/PayloadPcduHandler.h +12800;0x3200;TRANSITION_OTHER_SIDE_FAILED;HIGH;;mission/system/AcsBoardAssembly.h +12801;0x3201;NOT_ENOUGH_DEVICES_DUAL_MODE;HIGH;;mission/system/AcsBoardAssembly.h +12802;0x3202;POWER_STATE_MACHINE_TIMEOUT;MEDIUM;;mission/system/AcsBoardAssembly.h +12803;0x3203;SIDE_SWITCH_TRANSITION_NOT_ALLOWED;LOW;Not implemented, would increase already high complexity. Operator should instead command the assembly off first and then command the assembly on into the desired mode/submode combination;mission/system/AcsBoardAssembly.h +12900;0x3264;TRANSITION_OTHER_SIDE_FAILED;HIGH;;mission/system/SusAssembly.h +12901;0x3265;NOT_ENOUGH_DEVICES_DUAL_MODE;HIGH;;mission/system/SusAssembly.h +12902;0x3266;POWER_STATE_MACHINE_TIMEOUT;MEDIUM;;mission/system/SusAssembly.h +12903;0x3267;SIDE_SWITCH_TRANSITION_NOT_ALLOWED;LOW;Not implemented, would increase already high complexity. Operator should instead command the assembly off first and then command the assembly on into the desired mode/submode combination;mission/system/SusAssembly.h +13000;0x32c8;CHILDREN_LOST_MODE;MEDIUM;;mission/system/TcsBoardAssembly.h +13100;0x332c;GPS_FIX_CHANGE;INFO;Fix has changed. P1: Old fix. P2: New fix 0: Not seen, 1: No Fix, 2: 2D-Fix, 3: 3D-Fix;mission/devices/devicedefinitions/GPSDefinitions.h 13600;0x3520;ALLOC_FAILURE;MEDIUM;;bsp_q7s/core/CoreController.h 13601;0x3521;REBOOT_SW;MEDIUM; Software reboot occured. Can also be a systemd reboot. P1: Current Chip, P2: Current Copy;bsp_q7s/core/CoreController.h 13602;0x3522;REBOOT_MECHANISM_TRIGGERED;MEDIUM;The reboot mechanism was triggered. P1: First 16 bits: Last Chip, Last 16 bits: Last Copy, P2: Each byte is the respective reboot count for the slots;bsp_q7s/core/CoreController.h diff --git a/generators/bsp_q7s_returnvalues.csv b/generators/bsp_q7s_returnvalues.csv index 01b2f676..4d68f062 100644 --- a/generators/bsp_q7s_returnvalues.csv +++ b/generators/bsp_q7s_returnvalues.csv @@ -1,13 +1,12 @@ 0x0;OK;System-wide code for ok.;RETURN_OK;HasReturnvaluesIF.h;HasReturnvaluesIF 0x1;Failed;Unspecified system-wide code for failed.;RETURN_FAILED;HasReturnvaluesIF.h;HasReturnvaluesIF 0x62a0;CCSDS_CommandNotImplemented;Received action message with unknown action id;0xA0;mission/tmtc/CCSDSHandler.h;CCSDS_HANDLER -0x68a0;SADPL_CommandNotSupported;;0xA0;mission/devices/SolarArrayDeploymentHandler.h;SA_DEPL_HANDLER -0x68a1;SADPL_DeploymentAlreadyExecuting;;0xA1;mission/devices/SolarArrayDeploymentHandler.h;SA_DEPL_HANDLER -0x68a2;SADPL_MainSwitchTimeoutFailure;;0xA2;mission/devices/SolarArrayDeploymentHandler.h;SA_DEPL_HANDLER -0x68a3;SADPL_SwitchingDeplSa1Failed;;0xA3;mission/devices/SolarArrayDeploymentHandler.h;SA_DEPL_HANDLER -0x68a4;SADPL_SwitchingDeplSa2Failed;;0xA4;mission/devices/SolarArrayDeploymentHandler.h;SA_DEPL_HANDLER -0x5aa0;SUSS_ErrorUnlockMutex;;0xA0;mission/devices/SusHandler.h;SUS_HANDLER -0x5aa1;SUSS_ErrorLockMutex;;0xA1;mission/devices/SusHandler.h;SUS_HANDLER +0x5f00;GOMS_PacketTooLong;;0;mission/devices/GomspaceDeviceHandler.h;GOM_SPACE_HANDLER +0x5f01;GOMS_InvalidTableId;;1;mission/devices/GomspaceDeviceHandler.h;GOM_SPACE_HANDLER +0x5f02;GOMS_InvalidAddress;;2;mission/devices/GomspaceDeviceHandler.h;GOM_SPACE_HANDLER +0x5f03;GOMS_InvalidParamSize;;3;mission/devices/GomspaceDeviceHandler.h;GOM_SPACE_HANDLER +0x5f04;GOMS_InvalidPayloadSize;;4;mission/devices/GomspaceDeviceHandler.h;GOM_SPACE_HANDLER +0x5f05;GOMS_UnknownReplyId;;5;mission/devices/GomspaceDeviceHandler.h;GOM_SPACE_HANDLER 0x55b0;RWHA_SpiWriteFailure;;0xB0;mission/devices/RwHandler.h;RW_HANDLER 0x55b1;RWHA_SpiReadFailure;Used by the spi send function to tell a failing read call;0xB1;mission/devices/RwHandler.h;RW_HANDLER 0x55b2;RWHA_MissingStartSign;Can be used by the HDLC decoding mechanism to inform about a missing start sign 0x7E;0xB2;mission/devices/RwHandler.h;RW_HANDLER @@ -20,6 +19,13 @@ 0x55a2;RWHA_SetSpeedCommandInvalidLength;Received set speed command has invalid length. Should be 6.;0xA2;mission/devices/RwHandler.h;RW_HANDLER 0x55a3;RWHA_ExecutionFailed;Command execution failed;0xA3;mission/devices/RwHandler.h;RW_HANDLER 0x55a4;RWHA_CrcError;Reaction wheel reply has invalid crc;0xA4;mission/devices/RwHandler.h;RW_HANDLER +0x52a1;HEATER_CommandNotSupported;;0xA1;mission/devices/HeaterHandler.h;HEATER_HANDLER +0x52a2;HEATER_InitFailed;;0xA2;mission/devices/HeaterHandler.h;HEATER_HANDLER +0x52a3;HEATER_InvalidSwitchNr;;0xA3;mission/devices/HeaterHandler.h;HEATER_HANDLER +0x52a4;HEATER_MainSwitchSetTimeout;;0xA4;mission/devices/HeaterHandler.h;HEATER_HANDLER +0x52a5;HEATER_CommandAlreadyWaiting;;0xA5;mission/devices/HeaterHandler.h;HEATER_HANDLER +0x5aa0;SUSS_ErrorUnlockMutex;;0xA0;mission/devices/SusHandler.h;SUS_HANDLER +0x5aa1;SUSS_ErrorLockMutex;;0xA1;mission/devices/SusHandler.h;SUS_HANDLER 0x54a0;IMTQ_InvalidCommandCode;;0xA0;mission/devices/IMTQHandler.h;IMTQ_HANDLER 0x54a1;IMTQ_ParameterMissing;;0xA1;mission/devices/IMTQHandler.h;IMTQ_HANDLER 0x54a2;IMTQ_ParameterInvalid;;0xA2;mission/devices/IMTQHandler.h;IMTQ_HANDLER @@ -28,17 +34,6 @@ 0x54a5;IMTQ_RejectedWithoutReason;;0xA5;mission/devices/IMTQHandler.h;IMTQ_HANDLER 0x54a6;IMTQ_CmdErrUnknown;;0xA6;mission/devices/IMTQHandler.h;IMTQ_HANDLER 0x54a7;IMTQ_UnexpectedSelfTestReply;The status reply to a self test command was received but no self test command has been sent. This should normally never happen.;0xA7;mission/devices/IMTQHandler.h;IMTQ_HANDLER -0x52a1;HEATER_CommandNotSupported;;0xA1;mission/devices/HeaterHandler.h;HEATER_HANDLER -0x52a2;HEATER_InitFailed;;0xA2;mission/devices/HeaterHandler.h;HEATER_HANDLER -0x52a3;HEATER_InvalidSwitchNr;;0xA3;mission/devices/HeaterHandler.h;HEATER_HANDLER -0x52a4;HEATER_MainSwitchSetTimeout;;0xA4;mission/devices/HeaterHandler.h;HEATER_HANDLER -0x52a5;HEATER_CommandAlreadyWaiting;;0xA5;mission/devices/HeaterHandler.h;HEATER_HANDLER -0x5f00;GOMS_PacketTooLong;;0;mission/devices/GomspaceDeviceHandler.h;GOM_SPACE_HANDLER -0x5f01;GOMS_InvalidTableId;;1;mission/devices/GomspaceDeviceHandler.h;GOM_SPACE_HANDLER -0x5f02;GOMS_InvalidAddress;;2;mission/devices/GomspaceDeviceHandler.h;GOM_SPACE_HANDLER -0x5f03;GOMS_InvalidParamSize;;3;mission/devices/GomspaceDeviceHandler.h;GOM_SPACE_HANDLER -0x5f04;GOMS_InvalidPayloadSize;;4;mission/devices/GomspaceDeviceHandler.h;GOM_SPACE_HANDLER -0x5f05;GOMS_UnknownReplyId;;5;mission/devices/GomspaceDeviceHandler.h;GOM_SPACE_HANDLER 0x53a0;SYRLINKS_CrcFailure;;0xA0;mission/devices/SyrlinksHkHandler.h;SYRLINKS_HANDLER 0x53a1;SYRLINKS_UartFraminOrParityErrorAck;;0xA1;mission/devices/SyrlinksHkHandler.h;SYRLINKS_HANDLER 0x53a2;SYRLINKS_BadCharacterAck;;0xA2;mission/devices/SyrlinksHkHandler.h;SYRLINKS_HANDLER @@ -48,10 +43,15 @@ 0x53a6;SYRLINKS_BadCrcAck;;0xA6;mission/devices/SyrlinksHkHandler.h;SYRLINKS_HANDLER 0x53a7;SYRLINKS_ReplyWrongSize;;0xA7;mission/devices/SyrlinksHkHandler.h;SYRLINKS_HANDLER 0x53a8;SYRLINKS_MissingStartFrameCharacter;;0xA8;mission/devices/SyrlinksHkHandler.h;SYRLINKS_HANDLER +0x68a0;SADPL_CommandNotSupported;;0xA0;mission/devices/SolarArrayDeploymentHandler.h;SA_DEPL_HANDLER +0x68a1;SADPL_DeploymentAlreadyExecuting;;0xA1;mission/devices/SolarArrayDeploymentHandler.h;SA_DEPL_HANDLER +0x68a2;SADPL_MainSwitchTimeoutFailure;;0xA2;mission/devices/SolarArrayDeploymentHandler.h;SA_DEPL_HANDLER +0x68a3;SADPL_SwitchingDeplSa1Failed;;0xA3;mission/devices/SolarArrayDeploymentHandler.h;SA_DEPL_HANDLER +0x68a4;SADPL_SwitchingDeplSa2Failed;;0xA4;mission/devices/SolarArrayDeploymentHandler.h;SA_DEPL_HANDLER 0x65a0;NVMB_KeyNotExists;Specified key does not exist in json file;0xA0;mission/memory/NVMParameterBase.h;NVM_PARAM_BASE -0x4300; HSPI_OpeningFileFailed;;0;fsfw/hal/src/fsfw_hal/linux/spi/SpiComIF.h;HAL_SPI -0x4301; HSPI_FullDuplexTransferFailed;;1;fsfw/hal/src/fsfw_hal/linux/spi/SpiComIF.h;HAL_SPI -0x4302; HSPI_HalfDuplexTransferFailed;;2;fsfw/hal/src/fsfw_hal/linux/spi/SpiComIF.h;HAL_SPI +0x4300; HSPI_HalTimeoutRetval;;0;fsfw/hal/src/fsfw_hal/stm32h7/spi/spiDefinitions.h;HAL_SPI +0x4301; HSPI_HalBusyRetval;;1;fsfw/hal/src/fsfw_hal/stm32h7/spi/spiDefinitions.h;HAL_SPI +0x4302; HSPI_HalErrorRetval;;2;fsfw/hal/src/fsfw_hal/stm32h7/spi/spiDefinitions.h;HAL_SPI 0x4401; HURT_UartReadFailure;;1;fsfw/hal/src/fsfw_hal/linux/uart/UartComIF.h;HAL_UART 0x4402; HURT_UartReadSizeMissmatch;;2;fsfw/hal/src/fsfw_hal/linux/uart/UartComIF.h;HAL_UART 0x4403; HURT_UartRxBufferTooSmall;;3;fsfw/hal/src/fsfw_hal/linux/uart/UartComIF.h;HAL_UART @@ -66,119 +66,36 @@ 0x4203; UXOS_CommandError;Command execution failed;3;fsfw/hal/src/fsfw_hal/linux/CommandExecutor.h;LINUX_OSAL 0x4204; UXOS_NoCommandLoadedOrPending;;4;fsfw/hal/src/fsfw_hal/linux/CommandExecutor.h;LINUX_OSAL 0x4206; UXOS_PcloseCallError;;6;fsfw/hal/src/fsfw_hal/linux/CommandExecutor.h;LINUX_OSAL -0x3b00; LPIF_PoolEntryNotFound;;0x00;fsfw/src/fsfw/datapoollocal/localPoolDefinitions.h;LOCAL_POOL_OWNER_IF -0x3b01; LPIF_PoolEntryTypeConflict;;0x01;fsfw/src/fsfw/datapoollocal/localPoolDefinitions.h;LOCAL_POOL_OWNER_IF -0x3d00; HKM_QueueOrDestinationInvalid;;0;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h;HOUSEKEEPING_MANAGER -0x3d01; HKM_WrongHkPacketType;;1;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h;HOUSEKEEPING_MANAGER -0x3d02; HKM_ReportingStatusUnchanged;;2;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h;HOUSEKEEPING_MANAGER -0x3d03; HKM_PeriodicHelperInvalid;;3;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h;HOUSEKEEPING_MANAGER -0x3d04; HKM_PoolobjectNotFound;;4;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h;HOUSEKEEPING_MANAGER -0x3d05; HKM_DatasetNotFound;;5;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h;HOUSEKEEPING_MANAGER -0x3501; CFDP_InvalidTlvType;;1;fsfw/src/fsfw/cfdp/definitions.h;CFDP -0x3502; CFDP_InvalidDirectiveFields;;2;fsfw/src/fsfw/cfdp/definitions.h;CFDP -0x3503; CFDP_InvalidPduDatafieldLen;;3;fsfw/src/fsfw/cfdp/definitions.h;CFDP -0x3504; CFDP_InvalidAckDirectiveFields;;4;fsfw/src/fsfw/cfdp/definitions.h;CFDP -0x3505; CFDP_MetadataCantParseOptions;;5;fsfw/src/fsfw/cfdp/definitions.h;CFDP -0x3506; CFDP_FinishedCantParseFsResponses;;6;fsfw/src/fsfw/cfdp/definitions.h;CFDP -0x3508; CFDP_FilestoreRequiresSecondFile;;8;fsfw/src/fsfw/cfdp/definitions.h;CFDP -0x3509; CFDP_FilestoreResponseCantParseFsMessage;;9;fsfw/src/fsfw/cfdp/definitions.h;CFDP -0x3101; CF_ObjectHasNoFunctions;;1;fsfw/src/fsfw/action/CommandsActionsIF.h;COMMANDS_ACTIONS_IF -0x3102; CF_AlreadyCommanding;;2;fsfw/src/fsfw/action/CommandsActionsIF.h;COMMANDS_ACTIONS_IF -0x3201; HF_IsBusy;;1;fsfw/src/fsfw/action/HasActionsIF.h;HAS_ACTIONS_IF -0x3202; HF_InvalidParameters;;2;fsfw/src/fsfw/action/HasActionsIF.h;HAS_ACTIONS_IF -0x3203; HF_ExecutionFinished;;3;fsfw/src/fsfw/action/HasActionsIF.h;HAS_ACTIONS_IF -0x3204; HF_InvalidActionId;;4;fsfw/src/fsfw/action/HasActionsIF.h;HAS_ACTIONS_IF -0x2d01; HPA_InvalidIdentifierId;;0x01;fsfw/src/fsfw/parameters/HasParametersIF.h;HAS_PARAMETERS_IF -0x2d02; HPA_InvalidDomainId;;0x02;fsfw/src/fsfw/parameters/HasParametersIF.h;HAS_PARAMETERS_IF -0x2d03; HPA_InvalidValue;;0x03;fsfw/src/fsfw/parameters/HasParametersIF.h;HAS_PARAMETERS_IF -0x2d05; HPA_ReadOnly;;0x05;fsfw/src/fsfw/parameters/HasParametersIF.h;HAS_PARAMETERS_IF -0x2c01; PAW_UnknownDatatype;;0x01;fsfw/src/fsfw/parameters/ParameterWrapper.h;PARAMETER_WRAPPER -0x2c02; PAW_DatatypeMissmatch;;0x02;fsfw/src/fsfw/parameters/ParameterWrapper.h;PARAMETER_WRAPPER -0x2c03; PAW_Readonly;;0x03;fsfw/src/fsfw/parameters/ParameterWrapper.h;PARAMETER_WRAPPER -0x2c04; PAW_TooBig;;0x04;fsfw/src/fsfw/parameters/ParameterWrapper.h;PARAMETER_WRAPPER -0x2c05; PAW_SourceNotSet;;0x05;fsfw/src/fsfw/parameters/ParameterWrapper.h;PARAMETER_WRAPPER -0x2c06; PAW_OutOfBounds;;0x06;fsfw/src/fsfw/parameters/ParameterWrapper.h;PARAMETER_WRAPPER -0x2c07; PAW_NotSet;;0x07;fsfw/src/fsfw/parameters/ParameterWrapper.h;PARAMETER_WRAPPER -0x2c08; PAW_ColumnOrRowsZero;;0x08;fsfw/src/fsfw/parameters/ParameterWrapper.h;PARAMETER_WRAPPER -0x1701; HHI_ObjectNotHealthy;;1;fsfw/src/fsfw/health/HasHealthIF.h;HAS_HEALTH_IF -0x1702; HHI_InvalidHealthState;;2;fsfw/src/fsfw/health/HasHealthIF.h;HAS_HEALTH_IF -0x2701; SM_DataTooLarge;;1;fsfw/src/fsfw/storagemanager/StorageManagerIF.h;STORAGE_MANAGER_IF -0x2702; SM_DataStorageFull;;2;fsfw/src/fsfw/storagemanager/StorageManagerIF.h;STORAGE_MANAGER_IF -0x2703; SM_IllegalStorageId;;3;fsfw/src/fsfw/storagemanager/StorageManagerIF.h;STORAGE_MANAGER_IF -0x2704; SM_DataDoesNotExist;;4;fsfw/src/fsfw/storagemanager/StorageManagerIF.h;STORAGE_MANAGER_IF -0x2705; SM_IllegalAddress;;5;fsfw/src/fsfw/storagemanager/StorageManagerIF.h;STORAGE_MANAGER_IF -0x2706; SM_PoolTooLarge;;6;fsfw/src/fsfw/storagemanager/StorageManagerIF.h;STORAGE_MANAGER_IF -0x2301; MT_TooDetailedRequest;;1;fsfw/src/fsfw/globalfunctions/matching/MatchTree.h;MATCH_TREE_CLASS -0x2302; MT_TooGeneralRequest;;2;fsfw/src/fsfw/globalfunctions/matching/MatchTree.h;MATCH_TREE_CLASS -0x2303; MT_NoMatch;;3;fsfw/src/fsfw/globalfunctions/matching/MatchTree.h;MATCH_TREE_CLASS -0x2304; MT_Full;;4;fsfw/src/fsfw/globalfunctions/matching/MatchTree.h;MATCH_TREE_CLASS -0x2305; MT_NewNodeCreated;;5;fsfw/src/fsfw/globalfunctions/matching/MatchTree.h;MATCH_TREE_CLASS -0x3e01; DLEE_StreamTooShort;;0x01;fsfw/src/fsfw/globalfunctions/DleEncoder.h;DLE_ENCODER -0x3e02; DLEE_DecodingError;;0x02;fsfw/src/fsfw/globalfunctions/DleEncoder.h;DLE_ENCODER -0x2e01; ASC_TooLongForTargetType;;1;fsfw/src/fsfw/globalfunctions/AsciiConverter.h;ASCII_CONVERTER -0x2e02; ASC_InvalidCharacters;;2;fsfw/src/fsfw/globalfunctions/AsciiConverter.h;ASCII_CONVERTER -0x2e03; ASC_BufferTooSmall;;0x3;fsfw/src/fsfw/globalfunctions/AsciiConverter.h;ASCII_CONVERTER -0x1c01; TCD_PacketLost;;1;fsfw/src/fsfw/tcdistribution/TcDistributor.h;PACKET_DISTRIBUTION -0x1c02; TCD_DestinationNotFound;;2;fsfw/src/fsfw/tcdistribution/TcDistributor.h;PACKET_DISTRIBUTION -0x1c03; TCD_ServiceIdAlreadyExists;;3;fsfw/src/fsfw/tcdistribution/TcDistributor.h;PACKET_DISTRIBUTION -0x1b00; TCC_IllegalApid;;0;fsfw/src/fsfw/tcdistribution/TcPacketCheckPUS.h;TC_PACKET_CHECK -0x1b01; TCC_IncompletePacket;;1;fsfw/src/fsfw/tcdistribution/TcPacketCheckPUS.h;TC_PACKET_CHECK -0x1b02; TCC_IncorrectChecksum;;2;fsfw/src/fsfw/tcdistribution/TcPacketCheckPUS.h;TC_PACKET_CHECK -0x1b03; TCC_IllegalPacketType;;3;fsfw/src/fsfw/tcdistribution/TcPacketCheckPUS.h;TC_PACKET_CHECK -0x1b04; TCC_IllegalPacketSubtype;;4;fsfw/src/fsfw/tcdistribution/TcPacketCheckPUS.h;TC_PACKET_CHECK -0x1b05; TCC_IncorrectPrimaryHeader;;5;fsfw/src/fsfw/tcdistribution/TcPacketCheckPUS.h;TC_PACKET_CHECK -0x1b06; TCC_IncorrectSecondaryHeader;;6;fsfw/src/fsfw/tcdistribution/TcPacketCheckPUS.h;TC_PACKET_CHECK -0x3901; MQI_Empty;;1;fsfw/src/fsfw/ipc/MessageQueueIF.h;MESSAGE_QUEUE_IF -0x3902; MQI_Full;No space left for more messages;2;fsfw/src/fsfw/ipc/MessageQueueIF.h;MESSAGE_QUEUE_IF -0x3903; MQI_NoReplyPartner;Returned if a reply method was called without partner;3;fsfw/src/fsfw/ipc/MessageQueueIF.h;MESSAGE_QUEUE_IF -0x3904; MQI_DestinationInvalid;Returned if the target destination is invalid.;4;fsfw/src/fsfw/ipc/MessageQueueIF.h;MESSAGE_QUEUE_IF -0xf01; CM_UnknownCommand;;1;fsfw/src/fsfw/ipc/CommandMessageIF.h;COMMAND_MESSAGE -0x3801; MUX_NotEnoughResources;;1;fsfw/src/fsfw/ipc/MutexIF.h;MUTEX_IF -0x3802; MUX_InsufficientMemory;;2;fsfw/src/fsfw/ipc/MutexIF.h;MUTEX_IF -0x3803; MUX_NoPrivilege;;3;fsfw/src/fsfw/ipc/MutexIF.h;MUTEX_IF -0x3804; MUX_WrongAttributeSetting;;4;fsfw/src/fsfw/ipc/MutexIF.h;MUTEX_IF -0x3805; MUX_MutexAlreadyLocked;;5;fsfw/src/fsfw/ipc/MutexIF.h;MUTEX_IF -0x3806; MUX_MutexNotFound;;6;fsfw/src/fsfw/ipc/MutexIF.h;MUTEX_IF -0x3807; MUX_MutexMaxLocks;;7;fsfw/src/fsfw/ipc/MutexIF.h;MUTEX_IF -0x3808; MUX_CurrThreadAlreadyOwnsMutex;;8;fsfw/src/fsfw/ipc/MutexIF.h;MUTEX_IF -0x3809; MUX_CurrThreadDoesNotOwnMutex;;9;fsfw/src/fsfw/ipc/MutexIF.h;MUTEX_IF -0x380a; MUX_MutexTimeout;;10;fsfw/src/fsfw/ipc/MutexIF.h;MUTEX_IF -0x380b; MUX_MutexInvalidId;;11;fsfw/src/fsfw/ipc/MutexIF.h;MUTEX_IF -0x380c; MUX_MutexDestroyedWhileWaiting;;12;fsfw/src/fsfw/ipc/MutexIF.h;MUTEX_IF -0x2801; TC_InvalidTargetState;;1;fsfw/src/fsfw/thermal/ThermalComponentIF.h;THERMAL_COMPONENT_IF -0x28f1; TC_AboveOperationalLimit;;0xF1;fsfw/src/fsfw/thermal/ThermalComponentIF.h;THERMAL_COMPONENT_IF -0x28f2; TC_BelowOperationalLimit;;0xF2;fsfw/src/fsfw/thermal/ThermalComponentIF.h;THERMAL_COMPONENT_IF -0x801; DPS_InvalidParameterDefinition;;1;fsfw/src/fsfw/datapool/DataSetIF.h;DATA_SET_CLASS -0x802; DPS_SetWasAlreadyRead;;2;fsfw/src/fsfw/datapool/DataSetIF.h;DATA_SET_CLASS -0x803; DPS_CommitingWithoutReading;;3;fsfw/src/fsfw/datapool/DataSetIF.h;DATA_SET_CLASS -0x804; DPS_DataSetUninitialised;;4;fsfw/src/fsfw/datapool/DataSetIF.h;DATA_SET_CLASS -0x805; DPS_DataSetFull;;5;fsfw/src/fsfw/datapool/DataSetIF.h;DATA_SET_CLASS -0x806; DPS_PoolVarNull;;6;fsfw/src/fsfw/datapool/DataSetIF.h;DATA_SET_CLASS -0x3ca0; PVA_InvalidReadWriteMode;;0xA0;fsfw/src/fsfw/datapool/PoolVariableIF.h;POOL_VARIABLE_IF -0x3ca1; PVA_InvalidPoolEntry;;0xA1;fsfw/src/fsfw/datapool/PoolVariableIF.h;POOL_VARIABLE_IF -0xc02; MS_InvalidEntry;;0x02;fsfw/src/fsfw/subsystem/modes/ModeStoreIF.h;MODE_STORE_IF -0xc03; MS_TooManyElements;;0x03;fsfw/src/fsfw/subsystem/modes/ModeStoreIF.h;MODE_STORE_IF -0xc04; MS_CantStoreEmpty;;0x04;fsfw/src/fsfw/subsystem/modes/ModeStoreIF.h;MODE_STORE_IF -0xd01; SS_SequenceAlreadyExists;;0x01;fsfw/src/fsfw/subsystem/Subsystem.h;SUBSYSTEM -0xd02; SS_TableAlreadyExists;;0x02;fsfw/src/fsfw/subsystem/Subsystem.h;SUBSYSTEM -0xd03; SS_TableDoesNotExist;;0x03;fsfw/src/fsfw/subsystem/Subsystem.h;SUBSYSTEM -0xd04; SS_TableOrSequenceLengthInvalid;;0x04;fsfw/src/fsfw/subsystem/Subsystem.h;SUBSYSTEM -0xd05; SS_SequenceDoesNotExist;;0x05;fsfw/src/fsfw/subsystem/Subsystem.h;SUBSYSTEM -0xd06; SS_TableContainsInvalidObjectId;;0x06;fsfw/src/fsfw/subsystem/Subsystem.h;SUBSYSTEM -0xd07; SS_FallbackSequenceDoesNotExist;;0x07;fsfw/src/fsfw/subsystem/Subsystem.h;SUBSYSTEM -0xd08; SS_NoTargetTable;;0x08;fsfw/src/fsfw/subsystem/Subsystem.h;SUBSYSTEM -0xd09; SS_SequenceOrTableTooLong;;0x09;fsfw/src/fsfw/subsystem/Subsystem.h;SUBSYSTEM -0xd0b; SS_IsFallbackSequence;;0x0B;fsfw/src/fsfw/subsystem/Subsystem.h;SUBSYSTEM -0xd0c; SS_AccessDenied;;0x0C;fsfw/src/fsfw/subsystem/Subsystem.h;SUBSYSTEM -0xd0e; SS_TableInUse;;0x0E;fsfw/src/fsfw/subsystem/Subsystem.h;SUBSYSTEM -0xda1; SS_TargetTableNotReached;;0xA1;fsfw/src/fsfw/subsystem/Subsystem.h;SUBSYSTEM -0xda2; SS_TableCheckFailed;;0xA2;fsfw/src/fsfw/subsystem/Subsystem.h;SUBSYSTEM -0xb01; SB_ChildNotFound;;0x01;fsfw/src/fsfw/subsystem/SubsystemBase.h;SUBSYSTEM_BASE -0xb02; SB_ChildInfoUpdated;;0x02;fsfw/src/fsfw/subsystem/SubsystemBase.h;SUBSYSTEM_BASE -0xb03; SB_ChildDoesntHaveModes;;0x03;fsfw/src/fsfw/subsystem/SubsystemBase.h;SUBSYSTEM_BASE -0xb04; SB_CouldNotInsertChild;;0x04;fsfw/src/fsfw/subsystem/SubsystemBase.h;SUBSYSTEM_BASE -0xb05; SB_TableContainsInvalidObjectId;;0x05;fsfw/src/fsfw/subsystem/SubsystemBase.h;SUBSYSTEM_BASE -0xb00; SB_ConnBroken;;0;fsfw/src/fsfw/osal/common/TcpTmTcServer.h;SUBSYSTEM_BASE +0x2b01; CCS_BcIsSetVrCommand;;0x01;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF +0x2b02; CCS_BcIsUnlockCommand;;0x02;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF +0x2bb0; CCS_BcIllegalCommand;;0xB0;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF +0x2bb1; CCS_BoardReadingNotFinished;;0xB1;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF +0x2bf0; CCS_NsPositiveW;;0xF0;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF +0x2bf1; CCS_NsNegativeW;;0xF1;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF +0x2bf2; CCS_NsLockout;;0xF2;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF +0x2bf3; CCS_FarmInLockout;;0xF3;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF +0x2bf4; CCS_FarmInWait;;0xF4;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF +0x2be0; CCS_WrongSymbol;;0xE0;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF +0x2be1; CCS_DoubleStart;;0xE1;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF +0x2be2; CCS_StartSymbolMissed;;0xE2;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF +0x2be3; CCS_EndWithoutStart;;0xE3;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF +0x2be4; CCS_TooLarge;;0xE4;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF +0x2be5; CCS_TooShort;;0xE5;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF +0x2be6; CCS_WrongTfVersion;;0xE6;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF +0x2be7; CCS_WrongSpacecraftId;;0xE7;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF +0x2be8; CCS_NoValidFrameType;;0xE8;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF +0x2be9; CCS_CrcFailed;;0xE9;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF +0x2bea; CCS_VcNotFound;;0xEA;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF +0x2beb; CCS_ForwardingFailed;;0xEB;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF +0x2bec; CCS_ContentTooLarge;;0xEC;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF +0x2bed; CCS_ResidualData;;0xED;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF +0x2bee; CCS_DataCorrupted;;0xEE;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF +0x2bef; CCS_IllegalSegmentationFlag;;0xEF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF +0x2bd0; CCS_IllegalFlagCombination;;0xD0;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF +0x2bd1; CCS_ShorterThanHeader;;0xD1;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF +0x2bd2; CCS_TooShortBlockedPacket;;0xD2;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF +0x2bd3; CCS_TooShortMapExtraction;;0xD3;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF +0x3a00; SPH_ConnBroken;;0;fsfw/src/fsfw/osal/common/TcpTmTcServer.h;SEMAPHORE_IF 0x2901; IEC_NoConfigurationTable;;0x01;fsfw/src/fsfw/osal/InternalErrorCodes.h;INTERNAL_ERROR_CODES 0x2902; IEC_NoCpuTable;;0x02;fsfw/src/fsfw/osal/InternalErrorCodes.h;INTERNAL_ERROR_CODES 0x2903; IEC_InvalidWorkspaceAddress;;0x03;fsfw/src/fsfw/osal/InternalErrorCodes.h;INTERNAL_ERROR_CODES @@ -200,26 +117,69 @@ 0x2913; IEC_ImplementationBlockingOperationCancel;;0x13;fsfw/src/fsfw/osal/InternalErrorCodes.h;INTERNAL_ERROR_CODES 0x2914; IEC_MutexObtainFromBadState;;0x14;fsfw/src/fsfw/osal/InternalErrorCodes.h;INTERNAL_ERROR_CODES 0x2915; IEC_UnlimitedAndMaximumIs0;;0x15;fsfw/src/fsfw/osal/InternalErrorCodes.h;INTERNAL_ERROR_CODES -0x1401; SE_BufferTooShort;;1;fsfw/src/fsfw/serialize/SerializeIF.h;SERIALIZE_IF -0x1402; SE_StreamTooShort;;2;fsfw/src/fsfw/serialize/SerializeIF.h;SERIALIZE_IF -0x1403; SE_TooManyElements;;3;fsfw/src/fsfw/serialize/SerializeIF.h;SERIALIZE_IF -0x4a00; SPPA_NoPacketFound;;0x00;fsfw/src/fsfw/tmtcservices/SpacePacketParser.h;SPACE_PACKET_PARSER -0x4a01; SPPA_SplitPacket;;0x01;fsfw/src/fsfw/tmtcservices/SpacePacketParser.h;SPACE_PACKET_PARSER -0x1d01; PUS_ActivityStarted;;1;fsfw/src/fsfw/tmtcservices/AcceptsTelecommandsIF.h;ACCEPTS_TELECOMMANDS_IF -0x1d02; PUS_InvalidSubservice;;2;fsfw/src/fsfw/tmtcservices/AcceptsTelecommandsIF.h;ACCEPTS_TELECOMMANDS_IF -0x1d03; PUS_IllegalApplicationData;;3;fsfw/src/fsfw/tmtcservices/AcceptsTelecommandsIF.h;ACCEPTS_TELECOMMANDS_IF -0x1d04; PUS_SendTmFailed;;4;fsfw/src/fsfw/tmtcservices/AcceptsTelecommandsIF.h;ACCEPTS_TELECOMMANDS_IF -0x1d05; PUS_Timeout;;5;fsfw/src/fsfw/tmtcservices/AcceptsTelecommandsIF.h;ACCEPTS_TELECOMMANDS_IF -0x1f01; CSB_ExecutionComplete;;1;fsfw/src/fsfw/tmtcservices/CommandingServiceBase.h;COMMAND_SERVICE_BASE -0x1f02; CSB_NoStepMessage;;2;fsfw/src/fsfw/tmtcservices/CommandingServiceBase.h;COMMAND_SERVICE_BASE -0x1f03; CSB_ObjectBusy;;3;fsfw/src/fsfw/tmtcservices/CommandingServiceBase.h;COMMAND_SERVICE_BASE -0x1f04; CSB_Busy;;4;fsfw/src/fsfw/tmtcservices/CommandingServiceBase.h;COMMAND_SERVICE_BASE -0x1f05; CSB_InvalidTc;;5;fsfw/src/fsfw/tmtcservices/CommandingServiceBase.h;COMMAND_SERVICE_BASE -0x1f06; CSB_InvalidObject;;6;fsfw/src/fsfw/tmtcservices/CommandingServiceBase.h;COMMAND_SERVICE_BASE -0x1f07; CSB_InvalidReply;;7;fsfw/src/fsfw/tmtcservices/CommandingServiceBase.h;COMMAND_SERVICE_BASE +0xe01; HM_InvalidMode;;0x01;fsfw/src/fsfw/modes/HasModesIF.h;HAS_MODES_IF +0xe02; HM_TransNotAllowed;;0x02;fsfw/src/fsfw/modes/HasModesIF.h;HAS_MODES_IF +0xe03; HM_InTransition;;0x03;fsfw/src/fsfw/modes/HasModesIF.h;HAS_MODES_IF +0xe04; HM_InvalidSubmode;;0x04;fsfw/src/fsfw/modes/HasModesIF.h;HAS_MODES_IF +0x2d01; HPA_InvalidIdentifierId;;0x01;fsfw/src/fsfw/parameters/HasParametersIF.h;HAS_PARAMETERS_IF +0x2d02; HPA_InvalidDomainId;;0x02;fsfw/src/fsfw/parameters/HasParametersIF.h;HAS_PARAMETERS_IF +0x2d03; HPA_InvalidValue;;0x03;fsfw/src/fsfw/parameters/HasParametersIF.h;HAS_PARAMETERS_IF +0x2d05; HPA_ReadOnly;;0x05;fsfw/src/fsfw/parameters/HasParametersIF.h;HAS_PARAMETERS_IF +0x2c01; PAW_UnknownDatatype;;0x01;fsfw/src/fsfw/parameters/ParameterWrapper.h;PARAMETER_WRAPPER +0x2c02; PAW_DatatypeMissmatch;;0x02;fsfw/src/fsfw/parameters/ParameterWrapper.h;PARAMETER_WRAPPER +0x2c03; PAW_Readonly;;0x03;fsfw/src/fsfw/parameters/ParameterWrapper.h;PARAMETER_WRAPPER +0x2c04; PAW_TooBig;;0x04;fsfw/src/fsfw/parameters/ParameterWrapper.h;PARAMETER_WRAPPER +0x2c05; PAW_SourceNotSet;;0x05;fsfw/src/fsfw/parameters/ParameterWrapper.h;PARAMETER_WRAPPER +0x2c06; PAW_OutOfBounds;;0x06;fsfw/src/fsfw/parameters/ParameterWrapper.h;PARAMETER_WRAPPER +0x2c07; PAW_NotSet;;0x07;fsfw/src/fsfw/parameters/ParameterWrapper.h;PARAMETER_WRAPPER +0x2c08; PAW_ColumnOrRowsZero;;0x08;fsfw/src/fsfw/parameters/ParameterWrapper.h;PARAMETER_WRAPPER +0x3101; CF_ObjectHasNoFunctions;;1;fsfw/src/fsfw/action/CommandsActionsIF.h;COMMANDS_ACTIONS_IF +0x3102; CF_AlreadyCommanding;;2;fsfw/src/fsfw/action/CommandsActionsIF.h;COMMANDS_ACTIONS_IF +0x3201; HF_IsBusy;;1;fsfw/src/fsfw/action/HasActionsIF.h;HAS_ACTIONS_IF +0x3202; HF_InvalidParameters;;2;fsfw/src/fsfw/action/HasActionsIF.h;HAS_ACTIONS_IF +0x3203; HF_ExecutionFinished;;3;fsfw/src/fsfw/action/HasActionsIF.h;HAS_ACTIONS_IF +0x3204; HF_InvalidActionId;;4;fsfw/src/fsfw/action/HasActionsIF.h;HAS_ACTIONS_IF +0x201; OM_InsertionFailed;;1;fsfw/src/fsfw/objectmanager/ObjectManagerIF.h;OBJECT_MANAGER_IF +0x202; OM_NotFound;;2;fsfw/src/fsfw/objectmanager/ObjectManagerIF.h;OBJECT_MANAGER_IF +0x203; OM_ChildInitFailed;;3;fsfw/src/fsfw/objectmanager/ObjectManagerIF.h;OBJECT_MANAGER_IF +0x204; OM_InternalErrReporterUninit;;4;fsfw/src/fsfw/objectmanager/ObjectManagerIF.h;OBJECT_MANAGER_IF 0x2500; FDI_YourFault;;0;fsfw/src/fsfw/fdir/ConfirmsFailuresIF.h;HANDLES_FAILURES_IF 0x2501; FDI_MyFault;;1;fsfw/src/fsfw/fdir/ConfirmsFailuresIF.h;HANDLES_FAILURES_IF 0x2502; FDI_ConfirmLater;;2;fsfw/src/fsfw/fdir/ConfirmsFailuresIF.h;HANDLES_FAILURES_IF +0x2101; TMF_Busy;;1;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h;TM_STORE_FRONTEND_IF +0x2102; TMF_LastPacketFound;;2;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h;TM_STORE_FRONTEND_IF +0x2103; TMF_StopFetch;;3;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h;TM_STORE_FRONTEND_IF +0x2104; TMF_Timeout;;4;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h;TM_STORE_FRONTEND_IF +0x2105; TMF_TmChannelFull;;5;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h;TM_STORE_FRONTEND_IF +0x2106; TMF_NotStored;;6;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h;TM_STORE_FRONTEND_IF +0x2107; TMF_AllDeleted;;7;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h;TM_STORE_FRONTEND_IF +0x2108; TMF_InvalidData;;8;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h;TM_STORE_FRONTEND_IF +0x2109; TMF_NotReady;;9;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h;TM_STORE_FRONTEND_IF +0x2001; TMB_Busy;;1;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h;TM_STORE_BACKEND_IF +0x2002; TMB_Full;;2;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h;TM_STORE_BACKEND_IF +0x2003; TMB_Empty;;3;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h;TM_STORE_BACKEND_IF +0x2004; TMB_NullRequested;;4;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h;TM_STORE_BACKEND_IF +0x2005; TMB_TooLarge;;5;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h;TM_STORE_BACKEND_IF +0x2006; TMB_NotReady;;6;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h;TM_STORE_BACKEND_IF +0x2007; TMB_DumpError;;7;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h;TM_STORE_BACKEND_IF +0x2008; TMB_CrcError;;8;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h;TM_STORE_BACKEND_IF +0x2009; TMB_Timeout;;9;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h;TM_STORE_BACKEND_IF +0x200a; TMB_IdlePacketFound;;10;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h;TM_STORE_BACKEND_IF +0x200b; TMB_TelecommandFound;;11;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h;TM_STORE_BACKEND_IF +0x200c; TMB_NoPusATm;;12;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h;TM_STORE_BACKEND_IF +0x200d; TMB_TooSmall;;13;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h;TM_STORE_BACKEND_IF +0x200e; TMB_BlockNotFound;;14;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h;TM_STORE_BACKEND_IF +0x200f; TMB_InvalidRequest;;15;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h;TM_STORE_BACKEND_IF +0x1c01; TCD_PacketLost;;1;fsfw/src/fsfw/tcdistribution/TcDistributor.h;PACKET_DISTRIBUTION +0x1c02; TCD_DestinationNotFound;;2;fsfw/src/fsfw/tcdistribution/TcDistributor.h;PACKET_DISTRIBUTION +0x1c03; TCD_ServiceIdAlreadyExists;;3;fsfw/src/fsfw/tcdistribution/TcDistributor.h;PACKET_DISTRIBUTION +0x1b00; TCC_IllegalApid;;0;fsfw/src/fsfw/tcdistribution/TcPacketCheckPUS.h;TC_PACKET_CHECK +0x1b01; TCC_IncompletePacket;;1;fsfw/src/fsfw/tcdistribution/TcPacketCheckPUS.h;TC_PACKET_CHECK +0x1b02; TCC_IncorrectChecksum;;2;fsfw/src/fsfw/tcdistribution/TcPacketCheckPUS.h;TC_PACKET_CHECK +0x1b03; TCC_IllegalPacketType;;3;fsfw/src/fsfw/tcdistribution/TcPacketCheckPUS.h;TC_PACKET_CHECK +0x1b04; TCC_IllegalPacketSubtype;;4;fsfw/src/fsfw/tcdistribution/TcPacketCheckPUS.h;TC_PACKET_CHECK +0x1b05; TCC_IncorrectPrimaryHeader;;5;fsfw/src/fsfw/tcdistribution/TcPacketCheckPUS.h;TC_PACKET_CHECK +0x1b06; TCC_IncorrectSecondaryHeader;;6;fsfw/src/fsfw/tcdistribution/TcPacketCheckPUS.h;TC_PACKET_CHECK 0x4e1; RMP_CommandNoDescriptorsAvailable;;0xE1;fsfw/src/fsfw/rmap/RMAP.h;RMAP_CHANNEL 0x4e2; RMP_CommandBufferFull;;0xE2;fsfw/src/fsfw/rmap/RMAP.h;RMAP_CHANNEL 0x4e3; RMP_CommandChannelOutOfRange;;0xE3;fsfw/src/fsfw/rmap/RMAP.h;RMAP_CHANNEL @@ -260,35 +220,12 @@ 0x40a; RMP_ReplyCommandNotImplementedOrNotAuthorised;;10;fsfw/src/fsfw/rmap/RMAP.h;RMAP_CHANNEL 0x40b; RMP_ReplyRmwDataLengthError;;11;fsfw/src/fsfw/rmap/RMAP.h;RMAP_CHANNEL 0x40c; RMP_ReplyInvalidTargetLogicalAddress;;12;fsfw/src/fsfw/rmap/RMAP.h;RMAP_CHANNEL -0x2b01; CCS_BcIsSetVrCommand;;0x01;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF -0x2b02; CCS_BcIsUnlockCommand;;0x02;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF -0x2bb0; CCS_BcIllegalCommand;;0xB0;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF -0x2bb1; CCS_BoardReadingNotFinished;;0xB1;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF -0x2bf0; CCS_NsPositiveW;;0xF0;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF -0x2bf1; CCS_NsNegativeW;;0xF1;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF -0x2bf2; CCS_NsLockout;;0xF2;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF -0x2bf3; CCS_FarmInLockout;;0xF3;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF -0x2bf4; CCS_FarmInWait;;0xF4;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF -0x2be0; CCS_WrongSymbol;;0xE0;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF -0x2be1; CCS_DoubleStart;;0xE1;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF -0x2be2; CCS_StartSymbolMissed;;0xE2;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF -0x2be3; CCS_EndWithoutStart;;0xE3;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF -0x2be4; CCS_TooLarge;;0xE4;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF -0x2be5; CCS_TooShort;;0xE5;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF -0x2be6; CCS_WrongTfVersion;;0xE6;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF -0x2be7; CCS_WrongSpacecraftId;;0xE7;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF -0x2be8; CCS_NoValidFrameType;;0xE8;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF -0x2be9; CCS_CrcFailed;;0xE9;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF -0x2bea; CCS_VcNotFound;;0xEA;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF -0x2beb; CCS_ForwardingFailed;;0xEB;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF -0x2bec; CCS_ContentTooLarge;;0xEC;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF -0x2bed; CCS_ResidualData;;0xED;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF -0x2bee; CCS_DataCorrupted;;0xEE;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF -0x2bef; CCS_IllegalSegmentationFlag;;0xEF;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF -0x2bd0; CCS_IllegalFlagCombination;;0xD0;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF -0x2bd1; CCS_ShorterThanHeader;;0xD1;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF -0x2bd2; CCS_TooShortBlockedPacket;;0xD2;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF -0x2bd3; CCS_TooShortMapExtraction;;0xD3;fsfw/src/fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF +0x2701; SM_DataTooLarge;;1;fsfw/src/fsfw/storagemanager/StorageManagerIF.h;STORAGE_MANAGER_IF +0x2702; SM_DataStorageFull;;2;fsfw/src/fsfw/storagemanager/StorageManagerIF.h;STORAGE_MANAGER_IF +0x2703; SM_IllegalStorageId;;3;fsfw/src/fsfw/storagemanager/StorageManagerIF.h;STORAGE_MANAGER_IF +0x2704; SM_DataDoesNotExist;;4;fsfw/src/fsfw/storagemanager/StorageManagerIF.h;STORAGE_MANAGER_IF +0x2705; SM_IllegalAddress;;5;fsfw/src/fsfw/storagemanager/StorageManagerIF.h;STORAGE_MANAGER_IF +0x2706; SM_PoolTooLarge;;6;fsfw/src/fsfw/storagemanager/StorageManagerIF.h;STORAGE_MANAGER_IF 0x37a1; SGP4_InvalidEccentricity;;0xA1;fsfw/src/fsfw/coordinates/Sgp4Propagator.h;SGP4PROPAGATOR_CLASS 0x37a2; SGP4_InvalidMeanMotion;;0xA2;fsfw/src/fsfw/coordinates/Sgp4Propagator.h;SGP4PROPAGATOR_CLASS 0x37a3; SGP4_InvalidPerturbationElements;;0xA3;fsfw/src/fsfw/coordinates/Sgp4Propagator.h;SGP4PROPAGATOR_CLASS @@ -297,10 +234,142 @@ 0x37a6; SGP4_SatelliteHasDecayed;;0xA6;fsfw/src/fsfw/coordinates/Sgp4Propagator.h;SGP4PROPAGATOR_CLASS 0x37b1; SGP4_TleTooOld;;0xB1;fsfw/src/fsfw/coordinates/Sgp4Propagator.h;SGP4PROPAGATOR_CLASS 0x37b2; SGP4_TleNotInitialized;;0xB2;fsfw/src/fsfw/coordinates/Sgp4Propagator.h;SGP4PROPAGATOR_CLASS -0x13e0; MH_UnknownCmd;;0xE0;fsfw/src/fsfw/memory/MemoryHelper.h;MEMORY_HELPER -0x13e1; MH_InvalidAddress;;0xE1;fsfw/src/fsfw/memory/MemoryHelper.h;MEMORY_HELPER -0x13e2; MH_InvalidSize;;0xE2;fsfw/src/fsfw/memory/MemoryHelper.h;MEMORY_HELPER -0x13e3; MH_StateMismatch;;0xE3;fsfw/src/fsfw/memory/MemoryHelper.h;MEMORY_HELPER +0x2301; MT_TooDetailedRequest;;1;fsfw/src/fsfw/globalfunctions/matching/MatchTree.h;MATCH_TREE_CLASS +0x2302; MT_TooGeneralRequest;;2;fsfw/src/fsfw/globalfunctions/matching/MatchTree.h;MATCH_TREE_CLASS +0x2303; MT_NoMatch;;3;fsfw/src/fsfw/globalfunctions/matching/MatchTree.h;MATCH_TREE_CLASS +0x2304; MT_Full;;4;fsfw/src/fsfw/globalfunctions/matching/MatchTree.h;MATCH_TREE_CLASS +0x2305; MT_NewNodeCreated;;5;fsfw/src/fsfw/globalfunctions/matching/MatchTree.h;MATCH_TREE_CLASS +0x3e01; DLEE_StreamTooShort;;0x01;fsfw/src/fsfw/globalfunctions/DleEncoder.h;DLE_ENCODER +0x3e02; DLEE_DecodingError;;0x02;fsfw/src/fsfw/globalfunctions/DleEncoder.h;DLE_ENCODER +0x2e01; ASC_TooLongForTargetType;;1;fsfw/src/fsfw/globalfunctions/AsciiConverter.h;ASCII_CONVERTER +0x2e02; ASC_InvalidCharacters;;2;fsfw/src/fsfw/globalfunctions/AsciiConverter.h;ASCII_CONVERTER +0x2e03; ASC_BufferTooSmall;;0x3;fsfw/src/fsfw/globalfunctions/AsciiConverter.h;ASCII_CONVERTER +0xf01; CM_UnknownCommand;;1;fsfw/src/fsfw/ipc/CommandMessageIF.h;COMMAND_MESSAGE +0x3901; MQI_Empty;;1;fsfw/src/fsfw/ipc/MessageQueueIF.h;MESSAGE_QUEUE_IF +0x3902; MQI_Full;No space left for more messages;2;fsfw/src/fsfw/ipc/MessageQueueIF.h;MESSAGE_QUEUE_IF +0x3903; MQI_NoReplyPartner;Returned if a reply method was called without partner;3;fsfw/src/fsfw/ipc/MessageQueueIF.h;MESSAGE_QUEUE_IF +0x3904; MQI_DestinationInvalid;Returned if the target destination is invalid.;4;fsfw/src/fsfw/ipc/MessageQueueIF.h;MESSAGE_QUEUE_IF +0x3801; MUX_NotEnoughResources;;1;fsfw/src/fsfw/ipc/MutexIF.h;MUTEX_IF +0x3802; MUX_InsufficientMemory;;2;fsfw/src/fsfw/ipc/MutexIF.h;MUTEX_IF +0x3803; MUX_NoPrivilege;;3;fsfw/src/fsfw/ipc/MutexIF.h;MUTEX_IF +0x3804; MUX_WrongAttributeSetting;;4;fsfw/src/fsfw/ipc/MutexIF.h;MUTEX_IF +0x3805; MUX_MutexAlreadyLocked;;5;fsfw/src/fsfw/ipc/MutexIF.h;MUTEX_IF +0x3806; MUX_MutexNotFound;;6;fsfw/src/fsfw/ipc/MutexIF.h;MUTEX_IF +0x3807; MUX_MutexMaxLocks;;7;fsfw/src/fsfw/ipc/MutexIF.h;MUTEX_IF +0x3808; MUX_CurrThreadAlreadyOwnsMutex;;8;fsfw/src/fsfw/ipc/MutexIF.h;MUTEX_IF +0x3809; MUX_CurrThreadDoesNotOwnMutex;;9;fsfw/src/fsfw/ipc/MutexIF.h;MUTEX_IF +0x380a; MUX_MutexTimeout;;10;fsfw/src/fsfw/ipc/MutexIF.h;MUTEX_IF +0x380b; MUX_MutexInvalidId;;11;fsfw/src/fsfw/ipc/MutexIF.h;MUTEX_IF +0x380c; MUX_MutexDestroyedWhileWaiting;;12;fsfw/src/fsfw/ipc/MutexIF.h;MUTEX_IF +0x3a01; SPH_SemaphoreTimeout;;1;fsfw/src/fsfw/tasks/SemaphoreIF.h;SEMAPHORE_IF +0x3a02; SPH_SemaphoreNotOwned;;2;fsfw/src/fsfw/tasks/SemaphoreIF.h;SEMAPHORE_IF +0x3a03; SPH_SemaphoreInvalid;;3;fsfw/src/fsfw/tasks/SemaphoreIF.h;SEMAPHORE_IF +0x3501; CFDP_InvalidTlvType;;1;fsfw/src/fsfw/cfdp/definitions.h;CFDP +0x3502; CFDP_InvalidDirectiveFields;;2;fsfw/src/fsfw/cfdp/definitions.h;CFDP +0x3503; CFDP_InvalidPduDatafieldLen;;3;fsfw/src/fsfw/cfdp/definitions.h;CFDP +0x3504; CFDP_InvalidAckDirectiveFields;;4;fsfw/src/fsfw/cfdp/definitions.h;CFDP +0x3505; CFDP_MetadataCantParseOptions;;5;fsfw/src/fsfw/cfdp/definitions.h;CFDP +0x3506; CFDP_FinishedCantParseFsResponses;;6;fsfw/src/fsfw/cfdp/definitions.h;CFDP +0x3508; CFDP_FilestoreRequiresSecondFile;;8;fsfw/src/fsfw/cfdp/definitions.h;CFDP +0x3509; CFDP_FilestoreResponseCantParseFsMessage;;9;fsfw/src/fsfw/cfdp/definitions.h;CFDP +0x2801; TC_InvalidTargetState;;1;fsfw/src/fsfw/thermal/ThermalComponentIF.h;THERMAL_COMPONENT_IF +0x28f1; TC_AboveOperationalLimit;;0xF1;fsfw/src/fsfw/thermal/ThermalComponentIF.h;THERMAL_COMPONENT_IF +0x28f2; TC_BelowOperationalLimit;;0xF2;fsfw/src/fsfw/thermal/ThermalComponentIF.h;THERMAL_COMPONENT_IF +0xc02; MS_InvalidEntry;;0x02;fsfw/src/fsfw/subsystem/modes/ModeStoreIF.h;MODE_STORE_IF +0xc03; MS_TooManyElements;;0x03;fsfw/src/fsfw/subsystem/modes/ModeStoreIF.h;MODE_STORE_IF +0xc04; MS_CantStoreEmpty;;0x04;fsfw/src/fsfw/subsystem/modes/ModeStoreIF.h;MODE_STORE_IF +0xd01; SS_SequenceAlreadyExists;;0x01;fsfw/src/fsfw/subsystem/Subsystem.h;SUBSYSTEM +0xd02; SS_TableAlreadyExists;;0x02;fsfw/src/fsfw/subsystem/Subsystem.h;SUBSYSTEM +0xd03; SS_TableDoesNotExist;;0x03;fsfw/src/fsfw/subsystem/Subsystem.h;SUBSYSTEM +0xd04; SS_TableOrSequenceLengthInvalid;;0x04;fsfw/src/fsfw/subsystem/Subsystem.h;SUBSYSTEM +0xd05; SS_SequenceDoesNotExist;;0x05;fsfw/src/fsfw/subsystem/Subsystem.h;SUBSYSTEM +0xd06; SS_TableContainsInvalidObjectId;;0x06;fsfw/src/fsfw/subsystem/Subsystem.h;SUBSYSTEM +0xd07; SS_FallbackSequenceDoesNotExist;;0x07;fsfw/src/fsfw/subsystem/Subsystem.h;SUBSYSTEM +0xd08; SS_NoTargetTable;;0x08;fsfw/src/fsfw/subsystem/Subsystem.h;SUBSYSTEM +0xd09; SS_SequenceOrTableTooLong;;0x09;fsfw/src/fsfw/subsystem/Subsystem.h;SUBSYSTEM +0xd0b; SS_IsFallbackSequence;;0x0B;fsfw/src/fsfw/subsystem/Subsystem.h;SUBSYSTEM +0xd0c; SS_AccessDenied;;0x0C;fsfw/src/fsfw/subsystem/Subsystem.h;SUBSYSTEM +0xd0e; SS_TableInUse;;0x0E;fsfw/src/fsfw/subsystem/Subsystem.h;SUBSYSTEM +0xda1; SS_TargetTableNotReached;;0xA1;fsfw/src/fsfw/subsystem/Subsystem.h;SUBSYSTEM +0xda2; SS_TableCheckFailed;;0xA2;fsfw/src/fsfw/subsystem/Subsystem.h;SUBSYSTEM +0xb01; SB_ChildNotFound;;0x01;fsfw/src/fsfw/subsystem/SubsystemBase.h;SUBSYSTEM_BASE +0xb02; SB_ChildInfoUpdated;;0x02;fsfw/src/fsfw/subsystem/SubsystemBase.h;SUBSYSTEM_BASE +0xb03; SB_ChildDoesntHaveModes;;0x03;fsfw/src/fsfw/subsystem/SubsystemBase.h;SUBSYSTEM_BASE +0xb04; SB_CouldNotInsertChild;;0x04;fsfw/src/fsfw/subsystem/SubsystemBase.h;SUBSYSTEM_BASE +0xb05; SB_TableContainsInvalidObjectId;;0x05;fsfw/src/fsfw/subsystem/SubsystemBase.h;SUBSYSTEM_BASE +0x3d00; HKM_QueueOrDestinationInvalid;;0;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h;HOUSEKEEPING_MANAGER +0x3d01; HKM_WrongHkPacketType;;1;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h;HOUSEKEEPING_MANAGER +0x3d02; HKM_ReportingStatusUnchanged;;2;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h;HOUSEKEEPING_MANAGER +0x3d03; HKM_PeriodicHelperInvalid;;3;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h;HOUSEKEEPING_MANAGER +0x3d04; HKM_PoolobjectNotFound;;4;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h;HOUSEKEEPING_MANAGER +0x3d05; HKM_DatasetNotFound;;5;fsfw/src/fsfw/datapoollocal/LocalDataPoolManager.h;HOUSEKEEPING_MANAGER +0x3b00; LPIF_PoolEntryNotFound;;0x00;fsfw/src/fsfw/datapoollocal/localPoolDefinitions.h;LOCAL_POOL_OWNER_IF +0x3b01; LPIF_PoolEntryTypeConflict;;0x01;fsfw/src/fsfw/datapoollocal/localPoolDefinitions.h;LOCAL_POOL_OWNER_IF +0x3ca0; PVA_InvalidReadWriteMode;;0xA0;fsfw/src/fsfw/datapool/PoolVariableIF.h;POOL_VARIABLE_IF +0x3ca1; PVA_InvalidPoolEntry;;0xA1;fsfw/src/fsfw/datapool/PoolVariableIF.h;POOL_VARIABLE_IF +0x801; DPS_InvalidParameterDefinition;;1;fsfw/src/fsfw/datapool/DataSetIF.h;DATA_SET_CLASS +0x802; DPS_SetWasAlreadyRead;;2;fsfw/src/fsfw/datapool/DataSetIF.h;DATA_SET_CLASS +0x803; DPS_CommitingWithoutReading;;3;fsfw/src/fsfw/datapool/DataSetIF.h;DATA_SET_CLASS +0x804; DPS_DataSetUninitialised;;4;fsfw/src/fsfw/datapool/DataSetIF.h;DATA_SET_CLASS +0x805; DPS_DataSetFull;;5;fsfw/src/fsfw/datapool/DataSetIF.h;DATA_SET_CLASS +0x806; DPS_PoolVarNull;;6;fsfw/src/fsfw/datapool/DataSetIF.h;DATA_SET_CLASS +0x1000; TIM_UnsupportedTimeFormat;;0;fsfw/src/fsfw/timemanager/CCSDSTime.h;CCSDS_TIME_HELPER_CLASS +0x1001; TIM_NotEnoughInformationForTargetFormat;;1;fsfw/src/fsfw/timemanager/CCSDSTime.h;CCSDS_TIME_HELPER_CLASS +0x1002; TIM_LengthMismatch;;2;fsfw/src/fsfw/timemanager/CCSDSTime.h;CCSDS_TIME_HELPER_CLASS +0x1003; TIM_InvalidTimeFormat;;3;fsfw/src/fsfw/timemanager/CCSDSTime.h;CCSDS_TIME_HELPER_CLASS +0x1004; TIM_InvalidDayOfYear;;4;fsfw/src/fsfw/timemanager/CCSDSTime.h;CCSDS_TIME_HELPER_CLASS +0x1005; TIM_TimeDoesNotFitFormat;;5;fsfw/src/fsfw/timemanager/CCSDSTime.h;CCSDS_TIME_HELPER_CLASS +0x3601; TSI_BadTimestamp;;1;fsfw/src/fsfw/timemanager/TimeStamperIF.h;TIME_STAMPER_IF +0x1d01; PUS_ActivityStarted;;1;fsfw/src/fsfw/tmtcservices/AcceptsTelecommandsIF.h;ACCEPTS_TELECOMMANDS_IF +0x1d02; PUS_InvalidSubservice;;2;fsfw/src/fsfw/tmtcservices/AcceptsTelecommandsIF.h;ACCEPTS_TELECOMMANDS_IF +0x1d03; PUS_IllegalApplicationData;;3;fsfw/src/fsfw/tmtcservices/AcceptsTelecommandsIF.h;ACCEPTS_TELECOMMANDS_IF +0x1d04; PUS_SendTmFailed;;4;fsfw/src/fsfw/tmtcservices/AcceptsTelecommandsIF.h;ACCEPTS_TELECOMMANDS_IF +0x1d05; PUS_Timeout;;5;fsfw/src/fsfw/tmtcservices/AcceptsTelecommandsIF.h;ACCEPTS_TELECOMMANDS_IF +0x4a00; SPPA_NoPacketFound;;0x00;fsfw/src/fsfw/tmtcservices/SpacePacketParser.h;SPACE_PACKET_PARSER +0x4a01; SPPA_SplitPacket;;0x01;fsfw/src/fsfw/tmtcservices/SpacePacketParser.h;SPACE_PACKET_PARSER +0x1f01; CSB_ExecutionComplete;;1;fsfw/src/fsfw/tmtcservices/CommandingServiceBase.h;COMMAND_SERVICE_BASE +0x1f02; CSB_NoStepMessage;;2;fsfw/src/fsfw/tmtcservices/CommandingServiceBase.h;COMMAND_SERVICE_BASE +0x1f03; CSB_ObjectBusy;;3;fsfw/src/fsfw/tmtcservices/CommandingServiceBase.h;COMMAND_SERVICE_BASE +0x1f04; CSB_Busy;;4;fsfw/src/fsfw/tmtcservices/CommandingServiceBase.h;COMMAND_SERVICE_BASE +0x1f05; CSB_InvalidTc;;5;fsfw/src/fsfw/tmtcservices/CommandingServiceBase.h;COMMAND_SERVICE_BASE +0x1f06; CSB_InvalidObject;;6;fsfw/src/fsfw/tmtcservices/CommandingServiceBase.h;COMMAND_SERVICE_BASE +0x1f07; CSB_InvalidReply;;7;fsfw/src/fsfw/tmtcservices/CommandingServiceBase.h;COMMAND_SERVICE_BASE +0x1101; AL_Full;;0x01;fsfw/src/fsfw/container/ArrayList.h;ARRAY_LIST +0x1801; FF_Full;;1;fsfw/src/fsfw/container/FIFOBase.h;FIFO_CLASS +0x1802; FF_Empty;;2;fsfw/src/fsfw/container/FIFOBase.h;FIFO_CLASS +0x1601; FMM_MapFull;;0x01;fsfw/src/fsfw/container/FixedOrderedMultimap.h;FIXED_MULTIMAP +0x1602; FMM_KeyDoesNotExist;;0x02;fsfw/src/fsfw/container/FixedOrderedMultimap.h;FIXED_MULTIMAP +0x1501; FM_KeyAlreadyExists;;0x01;fsfw/src/fsfw/container/FixedMap.h;FIXED_MAP +0x1502; FM_MapFull;;0x02;fsfw/src/fsfw/container/FixedMap.h;FIXED_MAP +0x1503; FM_KeyDoesNotExist;;0x03;fsfw/src/fsfw/container/FixedMap.h;FIXED_MAP +0x2401; EV_ListenerNotFound;;1;fsfw/src/fsfw/events/EventManagerIF.h;EVENT_MANAGER_IF +0x1701; HHI_ObjectNotHealthy;;1;fsfw/src/fsfw/health/HasHealthIF.h;HAS_HEALTH_IF +0x1702; HHI_InvalidHealthState;;2;fsfw/src/fsfw/health/HasHealthIF.h;HAS_HEALTH_IF +0x2f01; POS_InPowerTransition;;1;fsfw/src/fsfw/power/PowerSwitcher.h;POWER_SWITCHER +0x2f02; POS_SwitchStateMismatch;;2;fsfw/src/fsfw/power/PowerSwitcher.h;POWER_SWITCHER +0x501; PS_SwitchOn;;1;fsfw/src/fsfw/power/PowerSwitchIF.h;POWER_SWITCH_IF +0x500; PS_SwitchOff;;0;fsfw/src/fsfw/power/PowerSwitchIF.h;POWER_SWITCH_IF +0x502; PS_SwitchTimeout;;2;fsfw/src/fsfw/power/PowerSwitchIF.h;POWER_SWITCH_IF +0x503; PS_FuseOn;;3;fsfw/src/fsfw/power/PowerSwitchIF.h;POWER_SWITCH_IF +0x504; PS_FuseOff;;4;fsfw/src/fsfw/power/PowerSwitchIF.h;POWER_SWITCH_IF +0x1a01; TRC_NotEnoughSensors;;1;fsfw/src/fsfw/monitoring/TriplexMonitor.h;TRIPLE_REDUNDACY_CHECK +0x1a02; TRC_LowestValueOol;;2;fsfw/src/fsfw/monitoring/TriplexMonitor.h;TRIPLE_REDUNDACY_CHECK +0x1a03; TRC_HighestValueOol;;3;fsfw/src/fsfw/monitoring/TriplexMonitor.h;TRIPLE_REDUNDACY_CHECK +0x1a04; TRC_BothValuesOol;;4;fsfw/src/fsfw/monitoring/TriplexMonitor.h;TRIPLE_REDUNDACY_CHECK +0x1a05; TRC_DuplexOol;;5;fsfw/src/fsfw/monitoring/TriplexMonitor.h;TRIPLE_REDUNDACY_CHECK +0x3001; LIM_Unchecked;;1;fsfw/src/fsfw/monitoring/MonitoringIF.h;LIMITS_IF +0x3002; LIM_Invalid;;2;fsfw/src/fsfw/monitoring/MonitoringIF.h;LIMITS_IF +0x3003; LIM_Unselected;;3;fsfw/src/fsfw/monitoring/MonitoringIF.h;LIMITS_IF +0x3004; LIM_BelowLowLimit;;4;fsfw/src/fsfw/monitoring/MonitoringIF.h;LIMITS_IF +0x3005; LIM_AboveHighLimit;;5;fsfw/src/fsfw/monitoring/MonitoringIF.h;LIMITS_IF +0x3006; LIM_UnexpectedValue;;6;fsfw/src/fsfw/monitoring/MonitoringIF.h;LIMITS_IF +0x3007; LIM_OutOfRange;;7;fsfw/src/fsfw/monitoring/MonitoringIF.h;LIMITS_IF +0x30a0; LIM_FirstSample;;0xA0;fsfw/src/fsfw/monitoring/MonitoringIF.h;LIMITS_IF +0x30e0; LIM_InvalidSize;;0xE0;fsfw/src/fsfw/monitoring/MonitoringIF.h;LIMITS_IF +0x30e1; LIM_WrongType;;0xE1;fsfw/src/fsfw/monitoring/MonitoringIF.h;LIMITS_IF +0x30e2; LIM_WrongPid;;0xE2;fsfw/src/fsfw/monitoring/MonitoringIF.h;LIMITS_IF +0x30e3; LIM_WrongLimitId;;0xE3;fsfw/src/fsfw/monitoring/MonitoringIF.h;LIMITS_IF +0x30ee; LIM_MonitorNotFound;;0xEE;fsfw/src/fsfw/monitoring/MonitoringIF.h;LIMITS_IF 0x4100; FILS_GenericFileError;;0;fsfw/src/fsfw/memory/HasFileSystemIF.h;FILE_SYSTEM 0x4101; FILS_IsBusy;;1;fsfw/src/fsfw/memory/HasFileSystemIF.h;FILE_SYSTEM 0x4102; FILS_InvalidParameters;;2;fsfw/src/fsfw/memory/HasFileSystemIF.h;FILE_SYSTEM @@ -326,60 +395,16 @@ 0x6e2; PP_InvalidContent;;0xE2;fsfw/src/fsfw/memory/HasMemoryIF.h;HAS_MEMORY_IF 0x6e3; PP_UnalignedAccess;;0xE3;fsfw/src/fsfw/memory/HasMemoryIF.h;HAS_MEMORY_IF 0x6e4; PP_WriteProtected;;0xE4;fsfw/src/fsfw/memory/HasMemoryIF.h;HAS_MEMORY_IF -0x201; OM_InsertionFailed;;1;fsfw/src/fsfw/objectmanager/ObjectManagerIF.h;OBJECT_MANAGER_IF -0x202; OM_NotFound;;2;fsfw/src/fsfw/objectmanager/ObjectManagerIF.h;OBJECT_MANAGER_IF -0x203; OM_ChildInitFailed;;3;fsfw/src/fsfw/objectmanager/ObjectManagerIF.h;OBJECT_MANAGER_IF -0x204; OM_InternalErrReporterUninit;;4;fsfw/src/fsfw/objectmanager/ObjectManagerIF.h;OBJECT_MANAGER_IF -0x501; PS_SwitchOn;;1;fsfw/src/fsfw/power/PowerSwitchIF.h;POWER_SWITCH_IF -0x500; PS_SwitchOff;;0;fsfw/src/fsfw/power/PowerSwitchIF.h;POWER_SWITCH_IF -0x502; PS_SwitchTimeout;;2;fsfw/src/fsfw/power/PowerSwitchIF.h;POWER_SWITCH_IF -0x503; PS_FuseOn;;3;fsfw/src/fsfw/power/PowerSwitchIF.h;POWER_SWITCH_IF -0x504; PS_FuseOff;;4;fsfw/src/fsfw/power/PowerSwitchIF.h;POWER_SWITCH_IF -0x2f01; POS_InPowerTransition;;1;fsfw/src/fsfw/power/PowerSwitcher.h;POWER_SWITCHER -0x2f02; POS_SwitchStateMismatch;;2;fsfw/src/fsfw/power/PowerSwitcher.h;POWER_SWITCHER -0x1000; TIM_UnsupportedTimeFormat;;0;fsfw/src/fsfw/timemanager/CCSDSTime.h;CCSDS_TIME_HELPER_CLASS -0x1001; TIM_NotEnoughInformationForTargetFormat;;1;fsfw/src/fsfw/timemanager/CCSDSTime.h;CCSDS_TIME_HELPER_CLASS -0x1002; TIM_LengthMismatch;;2;fsfw/src/fsfw/timemanager/CCSDSTime.h;CCSDS_TIME_HELPER_CLASS -0x1003; TIM_InvalidTimeFormat;;3;fsfw/src/fsfw/timemanager/CCSDSTime.h;CCSDS_TIME_HELPER_CLASS -0x1004; TIM_InvalidDayOfYear;;4;fsfw/src/fsfw/timemanager/CCSDSTime.h;CCSDS_TIME_HELPER_CLASS -0x1005; TIM_TimeDoesNotFitFormat;;5;fsfw/src/fsfw/timemanager/CCSDSTime.h;CCSDS_TIME_HELPER_CLASS -0x3601; TSI_BadTimestamp;;1;fsfw/src/fsfw/timemanager/TimeStamperIF.h;TIME_STAMPER_IF -0x2101; TMF_Busy;;1;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h;TM_STORE_FRONTEND_IF -0x2102; TMF_LastPacketFound;;2;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h;TM_STORE_FRONTEND_IF -0x2103; TMF_StopFetch;;3;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h;TM_STORE_FRONTEND_IF -0x2104; TMF_Timeout;;4;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h;TM_STORE_FRONTEND_IF -0x2105; TMF_TmChannelFull;;5;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h;TM_STORE_FRONTEND_IF -0x2106; TMF_NotStored;;6;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h;TM_STORE_FRONTEND_IF -0x2107; TMF_AllDeleted;;7;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h;TM_STORE_FRONTEND_IF -0x2108; TMF_InvalidData;;8;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h;TM_STORE_FRONTEND_IF -0x2109; TMF_NotReady;;9;fsfw/src/fsfw/tmstorage/TmStoreFrontendIF.h;TM_STORE_FRONTEND_IF -0x2001; TMB_Busy;;1;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h;TM_STORE_BACKEND_IF -0x2002; TMB_Full;;2;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h;TM_STORE_BACKEND_IF -0x2003; TMB_Empty;;3;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h;TM_STORE_BACKEND_IF -0x2004; TMB_NullRequested;;4;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h;TM_STORE_BACKEND_IF -0x2005; TMB_TooLarge;;5;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h;TM_STORE_BACKEND_IF -0x2006; TMB_NotReady;;6;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h;TM_STORE_BACKEND_IF -0x2007; TMB_DumpError;;7;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h;TM_STORE_BACKEND_IF -0x2008; TMB_CrcError;;8;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h;TM_STORE_BACKEND_IF -0x2009; TMB_Timeout;;9;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h;TM_STORE_BACKEND_IF -0x200a; TMB_IdlePacketFound;;10;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h;TM_STORE_BACKEND_IF -0x200b; TMB_TelecommandFound;;11;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h;TM_STORE_BACKEND_IF -0x200c; TMB_NoPusATm;;12;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h;TM_STORE_BACKEND_IF -0x200d; TMB_TooSmall;;13;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h;TM_STORE_BACKEND_IF -0x200e; TMB_BlockNotFound;;14;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h;TM_STORE_BACKEND_IF -0x200f; TMB_InvalidRequest;;15;fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h;TM_STORE_BACKEND_IF -0xe01; HM_InvalidMode;;0x01;fsfw/src/fsfw/modes/HasModesIF.h;HAS_MODES_IF -0xe02; HM_TransNotAllowed;;0x02;fsfw/src/fsfw/modes/HasModesIF.h;HAS_MODES_IF -0xe03; HM_InTransition;;0x03;fsfw/src/fsfw/modes/HasModesIF.h;HAS_MODES_IF -0xe04; HM_InvalidSubmode;;0x04;fsfw/src/fsfw/modes/HasModesIF.h;HAS_MODES_IF -0x1501; FM_KeyAlreadyExists;;0x01;fsfw/src/fsfw/container/FixedMap.h;FIXED_MAP -0x1502; FM_MapFull;;0x02;fsfw/src/fsfw/container/FixedMap.h;FIXED_MAP -0x1503; FM_KeyDoesNotExist;;0x03;fsfw/src/fsfw/container/FixedMap.h;FIXED_MAP -0x1101; AL_Full;;0x01;fsfw/src/fsfw/container/ArrayList.h;ARRAY_LIST -0x1601; FMM_MapFull;;0x01;fsfw/src/fsfw/container/FixedOrderedMultimap.h;FIXED_MULTIMAP -0x1602; FMM_KeyDoesNotExist;;0x02;fsfw/src/fsfw/container/FixedOrderedMultimap.h;FIXED_MULTIMAP -0x1801; FF_Full;;1;fsfw/src/fsfw/container/FIFOBase.h;FIFO_CLASS -0x1802; FF_Empty;;2;fsfw/src/fsfw/container/FIFOBase.h;FIFO_CLASS +0x13e0; MH_UnknownCmd;;0xE0;fsfw/src/fsfw/memory/MemoryHelper.h;MEMORY_HELPER +0x13e1; MH_InvalidAddress;;0xE1;fsfw/src/fsfw/memory/MemoryHelper.h;MEMORY_HELPER +0x13e2; MH_InvalidSize;;0xE2;fsfw/src/fsfw/memory/MemoryHelper.h;MEMORY_HELPER +0x13e3; MH_StateMismatch;;0xE3;fsfw/src/fsfw/memory/MemoryHelper.h;MEMORY_HELPER +0x1201; AB_NeedSecondStep;;0x01;fsfw/src/fsfw/devicehandlers/AssemblyBase.h;ASSEMBLY_BASE +0x1202; AB_NeedToReconfigure;;0x02;fsfw/src/fsfw/devicehandlers/AssemblyBase.h;ASSEMBLY_BASE +0x1203; AB_ModeFallback;;0x03;fsfw/src/fsfw/devicehandlers/AssemblyBase.h;ASSEMBLY_BASE +0x1204; AB_ChildNotCommandable;;0x04;fsfw/src/fsfw/devicehandlers/AssemblyBase.h;ASSEMBLY_BASE +0x1205; AB_NeedToChangeHealth;;0x05;fsfw/src/fsfw/devicehandlers/AssemblyBase.h;ASSEMBLY_BASE +0x12a1; AB_NotEnoughChildrenInCorrectState;;0xa1;fsfw/src/fsfw/devicehandlers/AssemblyBase.h;ASSEMBLY_BASE 0x3a0; DHB_InvalidChannel;;0xA0;fsfw/src/fsfw/devicehandlers/DeviceHandlerBase.h;DEVICE_HANDLER_BASE 0x3b0; DHB_AperiodicReply;;0xB0;fsfw/src/fsfw/devicehandlers/DeviceHandlerBase.h;DEVICE_HANDLER_BASE 0x3b1; DHB_IgnoreReplyData;;0xB1;fsfw/src/fsfw/devicehandlers/DeviceHandlerBase.h;DEVICE_HANDLER_BASE @@ -389,12 +414,12 @@ 0x3d0; DHB_NoSwitch;;0xD0;fsfw/src/fsfw/devicehandlers/DeviceHandlerBase.h;DEVICE_HANDLER_BASE 0x3e0; DHB_ChildTimeout;;0xE0;fsfw/src/fsfw/devicehandlers/DeviceHandlerBase.h;DEVICE_HANDLER_BASE 0x3e1; DHB_SwitchFailed;;0xE1;fsfw/src/fsfw/devicehandlers/DeviceHandlerBase.h;DEVICE_HANDLER_BASE -0x1201; AB_NeedSecondStep;;0x01;fsfw/src/fsfw/devicehandlers/AssemblyBase.h;ASSEMBLY_BASE -0x1202; AB_NeedToReconfigure;;0x02;fsfw/src/fsfw/devicehandlers/AssemblyBase.h;ASSEMBLY_BASE -0x1203; AB_ModeFallback;;0x03;fsfw/src/fsfw/devicehandlers/AssemblyBase.h;ASSEMBLY_BASE -0x1204; AB_ChildNotCommandable;;0x04;fsfw/src/fsfw/devicehandlers/AssemblyBase.h;ASSEMBLY_BASE -0x1205; AB_NeedToChangeHealth;;0x05;fsfw/src/fsfw/devicehandlers/AssemblyBase.h;ASSEMBLY_BASE -0x12a1; AB_NotEnoughChildrenInCorrectState;;0xa1;fsfw/src/fsfw/devicehandlers/AssemblyBase.h;ASSEMBLY_BASE +0x3301; DC_NoReplyReceived;;0x01;fsfw/src/fsfw/devicehandlers/DeviceCommunicationIF.h;DEVICE_COMMUNICATION_IF +0x3302; DC_ProtocolError;;0x02;fsfw/src/fsfw/devicehandlers/DeviceCommunicationIF.h;DEVICE_COMMUNICATION_IF +0x3303; DC_Nullpointer;;0x03;fsfw/src/fsfw/devicehandlers/DeviceCommunicationIF.h;DEVICE_COMMUNICATION_IF +0x3304; DC_InvalidCookieType;;0x04;fsfw/src/fsfw/devicehandlers/DeviceCommunicationIF.h;DEVICE_COMMUNICATION_IF +0x3305; DC_NotActive;;0x05;fsfw/src/fsfw/devicehandlers/DeviceCommunicationIF.h;DEVICE_COMMUNICATION_IF +0x3306; DC_TooMuchData;;0x06;fsfw/src/fsfw/devicehandlers/DeviceCommunicationIF.h;DEVICE_COMMUNICATION_IF 0x26a0; DHI_NoCommandData;;0xA0;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h;DEVICE_HANDLER_IF 0x26a1; DHI_CommandNotSupported;;0xA1;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h;DEVICE_HANDLER_IF 0x26a2; DHI_CommandAlreadySent;;0xA2;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h;DEVICE_HANDLER_IF @@ -416,34 +441,11 @@ 0x26c3; DHI_DeviceReplyInvalid;;0xC3;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h;DEVICE_HANDLER_IF 0x26d0; DHI_InvalidCommandParameter;;0xD0;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h;DEVICE_HANDLER_IF 0x26d1; DHI_InvalidNumberOrLengthOfParameters;;0xD1;fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h;DEVICE_HANDLER_IF -0x3301; DC_NoReplyReceived;;0x01;fsfw/src/fsfw/devicehandlers/DeviceCommunicationIF.h;DEVICE_COMMUNICATION_IF -0x3302; DC_ProtocolError;;0x02;fsfw/src/fsfw/devicehandlers/DeviceCommunicationIF.h;DEVICE_COMMUNICATION_IF -0x3303; DC_Nullpointer;;0x03;fsfw/src/fsfw/devicehandlers/DeviceCommunicationIF.h;DEVICE_COMMUNICATION_IF -0x3304; DC_InvalidCookieType;;0x04;fsfw/src/fsfw/devicehandlers/DeviceCommunicationIF.h;DEVICE_COMMUNICATION_IF -0x3305; DC_NotActive;;0x05;fsfw/src/fsfw/devicehandlers/DeviceCommunicationIF.h;DEVICE_COMMUNICATION_IF -0x3306; DC_TooMuchData;;0x06;fsfw/src/fsfw/devicehandlers/DeviceCommunicationIF.h;DEVICE_COMMUNICATION_IF -0x2401; EV_ListenerNotFound;;1;fsfw/src/fsfw/events/EventManagerIF.h;EVENT_MANAGER_IF -0x1a01; TRC_NotEnoughSensors;;1;fsfw/src/fsfw/monitoring/TriplexMonitor.h;TRIPLE_REDUNDACY_CHECK -0x1a02; TRC_LowestValueOol;;2;fsfw/src/fsfw/monitoring/TriplexMonitor.h;TRIPLE_REDUNDACY_CHECK -0x1a03; TRC_HighestValueOol;;3;fsfw/src/fsfw/monitoring/TriplexMonitor.h;TRIPLE_REDUNDACY_CHECK -0x1a04; TRC_BothValuesOol;;4;fsfw/src/fsfw/monitoring/TriplexMonitor.h;TRIPLE_REDUNDACY_CHECK -0x1a05; TRC_DuplexOol;;5;fsfw/src/fsfw/monitoring/TriplexMonitor.h;TRIPLE_REDUNDACY_CHECK -0x3001; LIM_Unchecked;;1;fsfw/src/fsfw/monitoring/MonitoringIF.h;LIMITS_IF -0x3002; LIM_Invalid;;2;fsfw/src/fsfw/monitoring/MonitoringIF.h;LIMITS_IF -0x3003; LIM_Unselected;;3;fsfw/src/fsfw/monitoring/MonitoringIF.h;LIMITS_IF -0x3004; LIM_BelowLowLimit;;4;fsfw/src/fsfw/monitoring/MonitoringIF.h;LIMITS_IF -0x3005; LIM_AboveHighLimit;;5;fsfw/src/fsfw/monitoring/MonitoringIF.h;LIMITS_IF -0x3006; LIM_UnexpectedValue;;6;fsfw/src/fsfw/monitoring/MonitoringIF.h;LIMITS_IF -0x3007; LIM_OutOfRange;;7;fsfw/src/fsfw/monitoring/MonitoringIF.h;LIMITS_IF -0x30a0; LIM_FirstSample;;0xA0;fsfw/src/fsfw/monitoring/MonitoringIF.h;LIMITS_IF -0x30e0; LIM_InvalidSize;;0xE0;fsfw/src/fsfw/monitoring/MonitoringIF.h;LIMITS_IF -0x30e1; LIM_WrongType;;0xE1;fsfw/src/fsfw/monitoring/MonitoringIF.h;LIMITS_IF -0x30e2; LIM_WrongPid;;0xE2;fsfw/src/fsfw/monitoring/MonitoringIF.h;LIMITS_IF -0x30e3; LIM_WrongLimitId;;0xE3;fsfw/src/fsfw/monitoring/MonitoringIF.h;LIMITS_IF -0x30ee; LIM_MonitorNotFound;;0xEE;fsfw/src/fsfw/monitoring/MonitoringIF.h;LIMITS_IF -0x3a01; SPH_SemaphoreTimeout;;1;fsfw/src/fsfw/tasks/SemaphoreIF.h;SEMAPHORE_IF -0x3a02; SPH_SemaphoreNotOwned;;2;fsfw/src/fsfw/tasks/SemaphoreIF.h;SEMAPHORE_IF -0x3a03; SPH_SemaphoreInvalid;;3;fsfw/src/fsfw/tasks/SemaphoreIF.h;SEMAPHORE_IF +0x1401; SE_BufferTooShort;;1;fsfw/src/fsfw/serialize/SerializeIF.h;SERIALIZE_IF +0x1402; SE_StreamTooShort;;2;fsfw/src/fsfw/serialize/SerializeIF.h;SERIALIZE_IF +0x1403; SE_TooManyElements;;3;fsfw/src/fsfw/serialize/SerializeIF.h;SERIALIZE_IF +0x66a0;FSHLP_SdNotMounted;SD card specified with path string not mounted;0xA0;bsp_q7s/memory/FilesystemHelper.h;FILE_SYSTEM_HELPER +0x66a1;FSHLP_FileNotExists;Specified file does not exist on filesystem;0xA1;bsp_q7s/memory/FilesystemHelper.h;FILE_SYSTEM_HELPER 0x7000; SDMA_OpOngoing;;0;bsp_q7s/memory/SdCardManager.h;SD_CARD_MANAGER 0x7001; SDMA_AlreadyOn;;1;bsp_q7s/memory/SdCardManager.h;SD_CARD_MANAGER 0x7002; SDMA_AlreadyMounted;;2;bsp_q7s/memory/SdCardManager.h;SD_CARD_MANAGER @@ -455,26 +457,6 @@ 0x700e; SDMA_SystemCallError;;14;bsp_q7s/memory/SdCardManager.h;SD_CARD_MANAGER 0x700f; SDMA_PopenCallError;;15;bsp_q7s/memory/SdCardManager.h;SD_CARD_MANAGER 0x7100; SCBU_KeyNotFound;;0;bsp_q7s/memory/scratchApi.h;SCRATCH_BUFFER -0x66a0;FSHLP_SdNotMounted;SD card specified with path string not mounted;0xA0;bsp_q7s/memory/FilesystemHelper.h;FILE_SYSTEM_HELPER -0x66a1;FSHLP_FileNotExists;Specified file does not exist on filesystem;0xA1;bsp_q7s/memory/FilesystemHelper.h;FILE_SYSTEM_HELPER -0x69a0;MPSOCRTVIF_CrcFailure;Space Packet received from PLOC has invalid CRC;0xA0;linux/devices/devicedefinitions/MPSoCReturnValuesIF.h;MPSOC_RETURN_VALUES_IF -0x69a1;MPSOCRTVIF_ReceivedAckFailure;Received ACK failure reply from PLOC;0xA1;linux/devices/devicedefinitions/MPSoCReturnValuesIF.h;MPSOC_RETURN_VALUES_IF -0x69a2;MPSOCRTVIF_ReceivedExeFailure;Received execution failure reply from PLOC;0xA2;linux/devices/devicedefinitions/MPSoCReturnValuesIF.h;MPSOC_RETURN_VALUES_IF -0x69a3;MPSOCRTVIF_InvalidApid;Received space packet with invalid APID from PLOC;0xA3;linux/devices/devicedefinitions/MPSoCReturnValuesIF.h;MPSOC_RETURN_VALUES_IF -0x69a4;MPSOCRTVIF_InvalidLength;Received command with invalid length;0xA4;linux/devices/devicedefinitions/MPSoCReturnValuesIF.h;MPSOC_RETURN_VALUES_IF -0x69a5;MPSOCRTVIF_FilenameTooLong;Filename of file in OBC filesystem is too long;0xA5;linux/devices/devicedefinitions/MPSoCReturnValuesIF.h;MPSOC_RETURN_VALUES_IF -0x69a6;MPSOCRTVIF_MpsocHelperExecuting;MPSoC helper is currently executing a command;0xA6;linux/devices/devicedefinitions/MPSoCReturnValuesIF.h;MPSOC_RETURN_VALUES_IF -0x69a7;MPSOCRTVIF_MpsocFilenameTooLong;Filename of MPSoC file is to long (max. 256 bytes);0xA7;linux/devices/devicedefinitions/MPSoCReturnValuesIF.h;MPSOC_RETURN_VALUES_IF -0x69a8;MPSOCRTVIF_InvalidParameter;Command has invalid parameter;0xA8;linux/devices/devicedefinitions/MPSoCReturnValuesIF.h;MPSOC_RETURN_VALUES_IF -0x57e0;DWLPWRON_InvalidMode;Received command has invalid JESD mode (valid modes are 0 - 5);0xE0;linux/devices/devicedefinitions/PlocMPSoCDefinitions.h;DWLPWRON_CMD -0x57e1;DWLPWRON_InvalidLaneRate;Received command has invalid lane rate (valid lane rate are 0 - 9);0xE1;linux/devices/devicedefinitions/PlocMPSoCDefinitions.h;DWLPWRON_CMD -0x60a0;PLMEMDUMP_MramAddressTooHigh;The capacity of the MRAM amounts to 512 kB. Thus the maximum address must not be higher than 0x7d000.;0xA0;linux/devices/ploc/PlocMemoryDumper.h;PLOC_MEMORY_DUMPER -0x60a1;PLMEMDUMP_MramInvalidAddressCombination;The specified end address is lower than the start address;0xA1;linux/devices/ploc/PlocMemoryDumper.h;PLOC_MEMORY_DUMPER -0x67a0; PLMPHLP_FileClosedAccidentally;File accidentally close;0xA0;linux/devices/ploc/PlocMPSoCHelper.h;PLOC_MPSOC_HELPER -0x5da0;PLUD_UpdaterBusy;Updater is already performing an update;0xA0;linux/devices/ploc/PlocUpdater.h;PLOC_UPDATER -0x5da1;PLUD_NameTooLong;Received update command with invalid path string (too long).;0xA1;linux/devices/ploc/PlocUpdater.h;PLOC_UPDATER -0x5da2;PLUD_SdNotMounted;Received command to initiate update but SD card with update image not mounted.;0xA2;linux/devices/ploc/PlocUpdater.h;PLOC_UPDATER -0x5da3;PLUD_FileNotExists;Update file received with update command does not exist.;0xA3;linux/devices/ploc/PlocUpdater.h;PLOC_UPDATER 0x59a0;PLSV_CrcFailure;Space Packet received from PLOC supervisor has invalid CRC;0xA0;linux/devices/ploc/PlocSupervisorHandler.h;PLOC_SUPERVISOR_HANDLER 0x59a1;PLSV_ReceivedAckFailure;Received ACK failure reply from PLOC supervisor;0xA1;linux/devices/ploc/PlocSupervisorHandler.h;PLOC_SUPERVISOR_HANDLER 0x59a2;PLSV_ReceivedExeFailure;Received execution failure reply from PLOC supervisor;0xA2;linux/devices/ploc/PlocSupervisorHandler.h;PLOC_SUPERVISOR_HANDLER @@ -490,13 +472,19 @@ 0x59ac;PLSV_NoMramPacket;Expect reception of an MRAM dump packet but received space packet with other apid.;0xAC;linux/devices/ploc/PlocSupervisorHandler.h;PLOC_SUPERVISOR_HANDLER 0x59ad;PLSV_PathDoesNotExist;Path to PLOC directory on SD card does not exist;0xAD;linux/devices/ploc/PlocSupervisorHandler.h;PLOC_SUPERVISOR_HANDLER 0x59ae;PLSV_MramFileNotExists;MRAM dump file does not exists. The file should actually already have been created with the reception of the first dump packet.;0xAE;linux/devices/ploc/PlocSupervisorHandler.h;PLOC_SUPERVISOR_HANDLER -0x59d0;PLSV_NameTooLong;Received command has file string with invalid length;0xD0;linux/devices/ploc/PlocMPSoCHandler.h;PLOC_SUPERVISOR_HANDLER -0x6401;JSONBASE_JsonFileNotExists;Specified json file does not exist;1;linux/devices/startracker/ArcsecJsonParamBase.h;ARCSEC_JSON_BASE -0x6402;JSONBASE_SetNotExists;Requested set does not exist in json file;2;linux/devices/startracker/ArcsecJsonParamBase.h;ARCSEC_JSON_BASE -0x6403;JSONBASE_ParamNotExists;Requested parameter does not exist in json file;3;linux/devices/startracker/ArcsecJsonParamBase.h;ARCSEC_JSON_BASE +0x67a0; PLMPHLP_FileClosedAccidentally;File accidentally close;0xA0;linux/devices/ploc/PlocMPSoCHelper.h;PLOC_MPSOC_HELPER +0x60a0;PLMEMDUMP_MramAddressTooHigh;The capacity of the MRAM amounts to 512 kB. Thus the maximum address must not be higher than 0x7d000.;0xA0;linux/devices/ploc/PlocMemoryDumper.h;PLOC_MEMORY_DUMPER +0x60a1;PLMEMDUMP_MramInvalidAddressCombination;The specified end address is lower than the start address;0xA1;linux/devices/ploc/PlocMemoryDumper.h;PLOC_MEMORY_DUMPER +0x5da0;PLUD_UpdaterBusy;Updater is already performing an update;0xA0;linux/devices/ploc/PlocUpdater.h;PLOC_UPDATER +0x5da1;PLUD_NameTooLong;Received update command with invalid path string (too long).;0xA1;linux/devices/ploc/PlocUpdater.h;PLOC_UPDATER +0x5da2;PLUD_SdNotMounted;Received command to initiate update but SD card with update image not mounted.;0xA2;linux/devices/ploc/PlocUpdater.h;PLOC_UPDATER +0x5da3;PLUD_FileNotExists;Update file received with update command does not exist.;0xA3;linux/devices/ploc/PlocUpdater.h;PLOC_UPDATER 0x56a0;STRH_TemperatureReqFailed;Status in temperature reply signals error;0xA0;linux/devices/startracker/StarTrackerHandler.h;STR_HANDLER 0x56a1;STRH_PingFailed;Ping command failed;0xA1;linux/devices/startracker/StarTrackerHandler.h;STR_HANDLER 0x56a2;STRH_VersionReqFailed;Status in version reply signals error;0xA2;linux/devices/startracker/StarTrackerHandler.h;STR_HANDLER +0x6401;JSONBASE_JsonFileNotExists;Specified json file does not exist;1;linux/devices/startracker/ArcsecJsonParamBase.h;ARCSEC_JSON_BASE +0x6402;JSONBASE_SetNotExists;Requested set does not exist in json file;2;linux/devices/startracker/ArcsecJsonParamBase.h;ARCSEC_JSON_BASE +0x6403;JSONBASE_ParamNotExists;Requested parameter does not exist in json file;3;linux/devices/startracker/ArcsecJsonParamBase.h;ARCSEC_JSON_BASE 0x56a3;STRH_InterfaceReqFailed;Status in interface reply signals error;0xA3;linux/devices/startracker/StarTrackerHandler.h;STR_HANDLER 0x56a4;STRH_PowerReqFailed;Status in power reply signals error;0xA4;linux/devices/startracker/StarTrackerHandler.h;STR_HANDLER 0x56a5;STRH_SetParamFailed;Status of reply to parameter set command signals error;0xA5;linux/devices/startracker/StarTrackerHandler.h;STR_HANDLER @@ -528,12 +516,20 @@ 0x5ea6;STRHLP_LengthMismatch;Length in flash write/read reply does not match expected length;0xA6;linux/devices/startracker/StrHelper.h;STR_HELPER 0x5ea7;STRHLP_StatusError;Status field in reply signals error;0xA7;linux/devices/startracker/StrHelper.h;STR_HELPER 0x5ea8;STRHLP_InvalidTypeId;Reply has invalid type ID (should be of action reply type);0xA8;linux/devices/startracker/StrHelper.h;STR_HELPER +0x69a0;MPSOCRTVIF_CrcFailure;Space Packet received from PLOC has invalid CRC;0xA0;linux/devices/devicedefinitions/MPSoCReturnValuesIF.h;MPSOC_RETURN_VALUES_IF +0x69a1;MPSOCRTVIF_ReceivedAckFailure;Received ACK failure reply from PLOC;0xA1;linux/devices/devicedefinitions/MPSoCReturnValuesIF.h;MPSOC_RETURN_VALUES_IF +0x69a2;MPSOCRTVIF_ReceivedExeFailure;Received execution failure reply from PLOC;0xA2;linux/devices/devicedefinitions/MPSoCReturnValuesIF.h;MPSOC_RETURN_VALUES_IF +0x69a3;MPSOCRTVIF_InvalidApid;Received space packet with invalid APID from PLOC;0xA3;linux/devices/devicedefinitions/MPSoCReturnValuesIF.h;MPSOC_RETURN_VALUES_IF +0x69a4;MPSOCRTVIF_InvalidLength;Received command with invalid length;0xA4;linux/devices/devicedefinitions/MPSoCReturnValuesIF.h;MPSOC_RETURN_VALUES_IF +0x69a5;MPSOCRTVIF_FilenameTooLong;Filename of file in OBC filesystem is too long;0xA5;linux/devices/devicedefinitions/MPSoCReturnValuesIF.h;MPSOC_RETURN_VALUES_IF +0x69a6;MPSOCRTVIF_MpsocHelperExecuting;MPSoC helper is currently executing a command;0xA6;linux/devices/devicedefinitions/MPSoCReturnValuesIF.h;MPSOC_RETURN_VALUES_IF +0x69a7;MPSOCRTVIF_MpsocFilenameTooLong;Filename of MPSoC file is to long (max. 256 bytes);0xA7;linux/devices/devicedefinitions/MPSoCReturnValuesIF.h;MPSOC_RETURN_VALUES_IF +0x69a8;MPSOCRTVIF_InvalidParameter;Command has invalid parameter;0xA8;linux/devices/devicedefinitions/MPSoCReturnValuesIF.h;MPSOC_RETURN_VALUES_IF +0x69a9;MPSOCRTVIF_NameTooLong;Received command has file string with invalid length;0xA9;linux/devices/devicedefinitions/MPSoCReturnValuesIF.h;MPSOC_RETURN_VALUES_IF +0x57e0;DWLPWRON_InvalidMode;Received command has invalid JESD mode (valid modes are 0 - 5);0xE0;linux/devices/devicedefinitions/PlocMPSoCDefinitions.h;DWLPWRON_CMD +0x57e1;DWLPWRON_InvalidLaneRate;Received command has invalid lane rate (valid lane rate are 0 - 9);0xE1;linux/devices/devicedefinitions/PlocMPSoCDefinitions.h;DWLPWRON_CMD 0x5ba0;IPCI_PapbBusy;;0xA0;linux/obc/PapbVcInterface.h;CCSDS_IP_CORE_BRIDGE 0x5ca0;PTME_UnknownVcId;;0xA0;linux/obc/Ptme.h;PTME -0x63a0;RS_RateNotSupported;The commanded rate is not supported by the current FPGA design;0xA0;linux/obc/PtmeConfig.h;RATE_SETTER -0x63a1;RS_BadBitRate;Bad bitrate has been commanded (e.g. 0);0xA1;linux/obc/PtmeConfig.h;RATE_SETTER -0x63a2;RS_ClkInversionFailed;Failed to invert clock and thus change the time the data is updated with respect to the tx clock;0xA2;linux/obc/PtmeConfig.h;RATE_SETTER -0x63a3;RS_TxManipulatorConfigFailed;Failed to change configuration bit of tx clock manipulator;0xA3;linux/obc/PtmeConfig.h;RATE_SETTER 0x61a0;PDEC_AbandonedCltu;;0xA0;linux/obc/PdecHandler.h;PDEC_HANDLER 0x61a1;PDEC_FrameDirty;;0xA1;linux/obc/PdecHandler.h;PDEC_HANDLER 0x61a2;PDEC_FrameIllegalMultipleReasons;;0xA2;linux/obc/PdecHandler.h;PDEC_HANDLER @@ -549,3 +545,7 @@ 0x61ab;PDEC_InvalidVcIdLsb;;0xAB;linux/obc/PdecHandler.h;PDEC_HANDLER 0x61ac;PDEC_NsNotZero;;0xAC;linux/obc/PdecHandler.h;PDEC_HANDLER 0x61ae;PDEC_InvalidBcCc;;0xAE;linux/obc/PdecHandler.h;PDEC_HANDLER +0x63a0;RS_RateNotSupported;The commanded rate is not supported by the current FPGA design;0xA0;linux/obc/PtmeConfig.h;RATE_SETTER +0x63a1;RS_BadBitRate;Bad bitrate has been commanded (e.g. 0);0xA1;linux/obc/PtmeConfig.h;RATE_SETTER +0x63a2;RS_ClkInversionFailed;Failed to invert clock and thus change the time the data is updated with respect to the tx clock;0xA2;linux/obc/PtmeConfig.h;RATE_SETTER +0x63a3;RS_TxManipulatorConfigFailed;Failed to change configuration bit of tx clock manipulator;0xA3;linux/obc/PtmeConfig.h;RATE_SETTER diff --git a/generators/events/translateEvents.cpp b/generators/events/translateEvents.cpp index ece0bf14..7112fa87 100644 --- a/generators/events/translateEvents.cpp +++ b/generators/events/translateEvents.cpp @@ -1,7 +1,7 @@ /** - * @brief Auto-generated event translation file. Contains 181 translations. + * @brief Auto-generated event translation file. Contains 183 translations. * @details - * Generated on: 2022-03-28 12:48:26 + * Generated on: 2022-04-07 17:27:42 */ #include "translateEvents.h" @@ -102,6 +102,7 @@ const char *ACK_FAILURE_STRING = "ACK_FAILURE"; const char *EXE_FAILURE_STRING = "EXE_FAILURE"; const char *MPSOC_HANDLER_CRC_FAILURE_STRING = "MPSOC_HANDLER_CRC_FAILURE"; const char *MPSOC_HANDLER_SEQ_CNT_MISMATCH_STRING = "MPSOC_HANDLER_SEQ_CNT_MISMATCH"; +const char *MPSOC_SHUTDOWN_FAILED_STRING = "MPSOC_SHUTDOWN_FAILED"; const char *SELF_TEST_I2C_FAILURE_STRING = "SELF_TEST_I2C_FAILURE"; const char *SELF_TEST_SPI_FAILURE_STRING = "SELF_TEST_SPI_FAILURE"; const char *SELF_TEST_ADC_FAILURE_STRING = "SELF_TEST_ADC_FAILURE"; @@ -178,6 +179,7 @@ const char *NOT_ENOUGH_DEVICES_DUAL_MODE_STRING = "NOT_ENOUGH_DEVICES_DUAL_MODE" const char *POWER_STATE_MACHINE_TIMEOUT_STRING = "POWER_STATE_MACHINE_TIMEOUT"; const char *SIDE_SWITCH_TRANSITION_NOT_ALLOWED_STRING = "SIDE_SWITCH_TRANSITION_NOT_ALLOWED"; const char *CHILDREN_LOST_MODE_STRING = "CHILDREN_LOST_MODE"; +const char *GPS_FIX_CHANGE_STRING = "GPS_FIX_CHANGE"; const char *ALLOC_FAILURE_STRING = "ALLOC_FAILURE"; const char *REBOOT_SW_STRING = "REBOOT_SW"; const char *REBOOT_MECHANISM_TRIGGERED_STRING = "REBOOT_MECHANISM_TRIGGERED"; @@ -343,194 +345,198 @@ const char *translateEvents(Event event) { return TEST_STRING; case (10600): return CHANGE_OF_SETUP_PARAMETER_STRING; - case (10800): + case (11300): return SWITCH_CMD_SENT_STRING; - case (10801): - return SWITCH_HAS_CHANGED_STRING; - case (10802): - return SWITCHING_Q7S_DENIED_STRING; - case (10900): - return GPIO_PULL_HIGH_FAILED_STRING; - case (10901): - return GPIO_PULL_LOW_FAILED_STRING; - case (10902): - return SWITCH_ALREADY_ON_STRING; - case (10903): - return SWITCH_ALREADY_OFF_STRING; - case (10904): - return MAIN_SWITCH_TIMEOUT_STRING; - case (11000): - return MAIN_SWITCH_ON_TIMEOUT_STRING; - case (11001): - return MAIN_SWITCH_OFF_TIMEOUT_STRING; - case (11002): - return DEPLOYMENT_FAILED_STRING; - case (11003): - return DEPL_SA1_GPIO_SWTICH_ON_FAILED_STRING; - case (11004): - return DEPL_SA2_GPIO_SWTICH_ON_FAILED_STRING; - case (11101): - return MEMORY_READ_RPT_CRC_FAILURE_STRING; - case (11102): - return ACK_FAILURE_STRING; - case (11103): - return EXE_FAILURE_STRING; - case (11104): - return MPSOC_HANDLER_CRC_FAILURE_STRING; - case (11105): - return MPSOC_HANDLER_SEQ_CNT_MISMATCH_STRING; - case (11201): - return SELF_TEST_I2C_FAILURE_STRING; - case (11202): - return SELF_TEST_SPI_FAILURE_STRING; - case (11203): - return SELF_TEST_ADC_FAILURE_STRING; - case (11204): - return SELF_TEST_PWM_FAILURE_STRING; - case (11205): - return SELF_TEST_TC_FAILURE_STRING; - case (11206): - return SELF_TEST_MTM_RANGE_FAILURE_STRING; - case (11207): - return SELF_TEST_COIL_CURRENT_FAILURE_STRING; - case (11208): - return INVALID_ERROR_BYTE_STRING; case (11301): - return ERROR_STATE_STRING; + return SWITCH_HAS_CHANGED_STRING; + case (11302): + return SWITCHING_Q7S_DENIED_STRING; + case (11400): + return GPIO_PULL_HIGH_FAILED_STRING; case (11401): - return BOOTING_FIRMWARE_FAILED_STRING; + return GPIO_PULL_LOW_FAILED_STRING; case (11402): - return BOOTING_BOOTLOADER_FAILED_STRING; + return SWITCH_ALREADY_ON_STRING; + case (11403): + return SWITCH_ALREADY_OFF_STRING; + case (11404): + return MAIN_SWITCH_TIMEOUT_STRING; + case (11500): + return MAIN_SWITCH_ON_TIMEOUT_STRING; case (11501): - return SUPV_MEMORY_READ_RPT_CRC_FAILURE_STRING; + return MAIN_SWITCH_OFF_TIMEOUT_STRING; case (11502): - return SUPV_ACK_FAILURE_STRING; + return DEPLOYMENT_FAILED_STRING; case (11503): - return SUPV_EXE_FAILURE_STRING; + return DEPL_SA1_GPIO_SWTICH_ON_FAILED_STRING; case (11504): - return SUPV_CRC_FAILURE_EVENT_STRING; - case (11600): - return SANITIZATION_FAILED_STRING; + return DEPL_SA2_GPIO_SWTICH_ON_FAILED_STRING; case (11601): - return MOUNTED_SD_CARD_STRING; - case (11700): - return UPDATE_FILE_NOT_EXISTS_STRING; + return MEMORY_READ_RPT_CRC_FAILURE_STRING; + case (11602): + return ACK_FAILURE_STRING; + case (11603): + return EXE_FAILURE_STRING; + case (11604): + return MPSOC_HANDLER_CRC_FAILURE_STRING; + case (11605): + return MPSOC_HANDLER_SEQ_CNT_MISMATCH_STRING; + case (11606): + return MPSOC_SHUTDOWN_FAILED_STRING; case (11701): - return ACTION_COMMANDING_FAILED_STRING; + return SELF_TEST_I2C_FAILURE_STRING; case (11702): - return UPDATE_AVAILABLE_FAILED_STRING; + return SELF_TEST_SPI_FAILURE_STRING; case (11703): - return UPDATE_TRANSFER_FAILED_STRING; + return SELF_TEST_ADC_FAILURE_STRING; case (11704): - return UPDATE_VERIFY_FAILED_STRING; + return SELF_TEST_PWM_FAILURE_STRING; case (11705): - return UPDATE_FINISHED_STRING; - case (11800): - return SEND_MRAM_DUMP_FAILED_STRING; + return SELF_TEST_TC_FAILURE_STRING; + case (11706): + return SELF_TEST_MTM_RANGE_FAILURE_STRING; + case (11707): + return SELF_TEST_COIL_CURRENT_FAILURE_STRING; + case (11708): + return INVALID_ERROR_BYTE_STRING; case (11801): - return MRAM_DUMP_FAILED_STRING; - case (11802): - return MRAM_DUMP_FINISHED_STRING; + return ERROR_STATE_STRING; case (11901): - return INVALID_TC_FRAME_STRING; + return BOOTING_FIRMWARE_FAILED_STRING; case (11902): - return INVALID_FAR_STRING; - case (11903): - return CARRIER_LOCK_STRING; - case (11904): - return BIT_LOCK_PDEC_STRING; - case (12000): - return IMAGE_UPLOAD_FAILED_STRING; + return BOOTING_BOOTLOADER_FAILED_STRING; case (12001): - return IMAGE_DOWNLOAD_FAILED_STRING; + return SUPV_MEMORY_READ_RPT_CRC_FAILURE_STRING; case (12002): - return IMAGE_UPLOAD_SUCCESSFUL_STRING; + return SUPV_ACK_FAILURE_STRING; case (12003): - return IMAGE_DOWNLOAD_SUCCESSFUL_STRING; + return SUPV_EXE_FAILURE_STRING; case (12004): - return FLASH_WRITE_SUCCESSFUL_STRING; - case (12005): - return FLASH_READ_SUCCESSFUL_STRING; - case (12006): - return FLASH_READ_FAILED_STRING; - case (12007): - return FIRMWARE_UPDATE_SUCCESSFUL_STRING; - case (12008): - return FIRMWARE_UPDATE_FAILED_STRING; - case (12009): - return STR_HELPER_READING_REPLY_FAILED_STRING; - case (12010): - return STR_HELPER_COM_ERROR_STRING; - case (12011): - return STR_HELPER_NO_REPLY_STRING; - case (12012): - return STR_HELPER_DEC_ERROR_STRING; - case (12013): - return POSITION_MISMATCH_STRING; - case (12014): - return STR_HELPER_FILE_NOT_EXISTS_STRING; - case (12015): - return STR_HELPER_SENDING_PACKET_FAILED_STRING; - case (12016): - return STR_HELPER_REQUESTING_MSG_FAILED_STRING; + return SUPV_CRC_FAILURE_EVENT_STRING; case (12100): - return MPSOC_FLASH_WRITE_FAILED_STRING; + return SANITIZATION_FAILED_STRING; case (12101): - return MPSOC_FLASH_WRITE_SUCCESSFUL_STRING; - case (12102): - return SENDING_COMMAND_FAILED_STRING; - case (12103): - return MPSOC_HELPER_REQUESTING_REPLY_FAILED_STRING; - case (12104): - return MPSOC_HELPER_READING_REPLY_FAILED_STRING; - case (12105): - return MISSING_ACK_STRING; - case (12106): - return MISSING_EXE_STRING; - case (12107): - return ACK_FAILURE_REPORT_STRING; - case (12108): - return EXE_FAILURE_REPORT_STRING; - case (12109): - return ACK_INVALID_APID_STRING; - case (12110): - return EXE_INVALID_APID_STRING; - case (12111): - return MPSOC_HELPER_SEQ_CNT_MISMATCH_STRING; + return MOUNTED_SD_CARD_STRING; case (12200): - return TRANSITION_BACK_TO_OFF_STRING; + return UPDATE_FILE_NOT_EXISTS_STRING; case (12201): - return NEG_V_OUT_OF_BOUNDS_STRING; + return ACTION_COMMANDING_FAILED_STRING; case (12202): - return U_DRO_OUT_OF_BOUNDS_STRING; + return UPDATE_AVAILABLE_FAILED_STRING; case (12203): - return I_DRO_OUT_OF_BOUNDS_STRING; + return UPDATE_TRANSFER_FAILED_STRING; case (12204): - return U_X8_OUT_OF_BOUNDS_STRING; + return UPDATE_VERIFY_FAILED_STRING; case (12205): - return I_X8_OUT_OF_BOUNDS_STRING; - case (12206): - return U_TX_OUT_OF_BOUNDS_STRING; - case (12207): - return I_TX_OUT_OF_BOUNDS_STRING; - case (12208): - return U_MPA_OUT_OF_BOUNDS_STRING; - case (12209): - return I_MPA_OUT_OF_BOUNDS_STRING; - case (12210): - return U_HPA_OUT_OF_BOUNDS_STRING; - case (12211): - return I_HPA_OUT_OF_BOUNDS_STRING; + return UPDATE_FINISHED_STRING; case (12300): - return TRANSITION_OTHER_SIDE_FAILED_STRING; + return SEND_MRAM_DUMP_FAILED_STRING; case (12301): - return NOT_ENOUGH_DEVICES_DUAL_MODE_STRING; + return MRAM_DUMP_FAILED_STRING; case (12302): - return POWER_STATE_MACHINE_TIMEOUT_STRING; - case (12303): - return SIDE_SWITCH_TRANSITION_NOT_ALLOWED_STRING; + return MRAM_DUMP_FINISHED_STRING; + case (12401): + return INVALID_TC_FRAME_STRING; + case (12402): + return INVALID_FAR_STRING; + case (12403): + return CARRIER_LOCK_STRING; + case (12404): + return BIT_LOCK_PDEC_STRING; case (12500): + return IMAGE_UPLOAD_FAILED_STRING; + case (12501): + return IMAGE_DOWNLOAD_FAILED_STRING; + case (12502): + return IMAGE_UPLOAD_SUCCESSFUL_STRING; + case (12503): + return IMAGE_DOWNLOAD_SUCCESSFUL_STRING; + case (12504): + return FLASH_WRITE_SUCCESSFUL_STRING; + case (12505): + return FLASH_READ_SUCCESSFUL_STRING; + case (12506): + return FLASH_READ_FAILED_STRING; + case (12507): + return FIRMWARE_UPDATE_SUCCESSFUL_STRING; + case (12508): + return FIRMWARE_UPDATE_FAILED_STRING; + case (12509): + return STR_HELPER_READING_REPLY_FAILED_STRING; + case (12510): + return STR_HELPER_COM_ERROR_STRING; + case (12511): + return STR_HELPER_NO_REPLY_STRING; + case (12512): + return STR_HELPER_DEC_ERROR_STRING; + case (12513): + return POSITION_MISMATCH_STRING; + case (12514): + return STR_HELPER_FILE_NOT_EXISTS_STRING; + case (12515): + return STR_HELPER_SENDING_PACKET_FAILED_STRING; + case (12516): + return STR_HELPER_REQUESTING_MSG_FAILED_STRING; + case (12600): + return MPSOC_FLASH_WRITE_FAILED_STRING; + case (12601): + return MPSOC_FLASH_WRITE_SUCCESSFUL_STRING; + case (12602): + return SENDING_COMMAND_FAILED_STRING; + case (12603): + return MPSOC_HELPER_REQUESTING_REPLY_FAILED_STRING; + case (12604): + return MPSOC_HELPER_READING_REPLY_FAILED_STRING; + case (12605): + return MISSING_ACK_STRING; + case (12606): + return MISSING_EXE_STRING; + case (12607): + return ACK_FAILURE_REPORT_STRING; + case (12608): + return EXE_FAILURE_REPORT_STRING; + case (12609): + return ACK_INVALID_APID_STRING; + case (12610): + return EXE_INVALID_APID_STRING; + case (12611): + return MPSOC_HELPER_SEQ_CNT_MISMATCH_STRING; + case (12700): + return TRANSITION_BACK_TO_OFF_STRING; + case (12701): + return NEG_V_OUT_OF_BOUNDS_STRING; + case (12702): + return U_DRO_OUT_OF_BOUNDS_STRING; + case (12703): + return I_DRO_OUT_OF_BOUNDS_STRING; + case (12704): + return U_X8_OUT_OF_BOUNDS_STRING; + case (12705): + return I_X8_OUT_OF_BOUNDS_STRING; + case (12706): + return U_TX_OUT_OF_BOUNDS_STRING; + case (12707): + return I_TX_OUT_OF_BOUNDS_STRING; + case (12708): + return U_MPA_OUT_OF_BOUNDS_STRING; + case (12709): + return I_MPA_OUT_OF_BOUNDS_STRING; + case (12710): + return U_HPA_OUT_OF_BOUNDS_STRING; + case (12711): + return I_HPA_OUT_OF_BOUNDS_STRING; + case (12800): + return TRANSITION_OTHER_SIDE_FAILED_STRING; + case (12801): + return NOT_ENOUGH_DEVICES_DUAL_MODE_STRING; + case (12802): + return POWER_STATE_MACHINE_TIMEOUT_STRING; + case (12803): + return SIDE_SWITCH_TRANSITION_NOT_ALLOWED_STRING; + case (13000): return CHILDREN_LOST_MODE_STRING; + case (13100): + return GPS_FIX_CHANGE_STRING; case (13600): return ALLOC_FAILURE_STRING; case (13601): diff --git a/generators/objects/translateObjects.cpp b/generators/objects/translateObjects.cpp index 32799af0..78113fd9 100644 --- a/generators/objects/translateObjects.cpp +++ b/generators/objects/translateObjects.cpp @@ -2,7 +2,7 @@ * @brief Auto-generated object translation file. * @details * Contains 117 translations. - * Generated on: 2022-03-28 12:48:33 + * Generated on: 2022-04-07 17:27:42 */ #include "translateObjects.h" diff --git a/linux/fsfwconfig/events/translateEvents.cpp b/linux/fsfwconfig/events/translateEvents.cpp index ece0bf14..7112fa87 100644 --- a/linux/fsfwconfig/events/translateEvents.cpp +++ b/linux/fsfwconfig/events/translateEvents.cpp @@ -1,7 +1,7 @@ /** - * @brief Auto-generated event translation file. Contains 181 translations. + * @brief Auto-generated event translation file. Contains 183 translations. * @details - * Generated on: 2022-03-28 12:48:26 + * Generated on: 2022-04-07 17:27:42 */ #include "translateEvents.h" @@ -102,6 +102,7 @@ const char *ACK_FAILURE_STRING = "ACK_FAILURE"; const char *EXE_FAILURE_STRING = "EXE_FAILURE"; const char *MPSOC_HANDLER_CRC_FAILURE_STRING = "MPSOC_HANDLER_CRC_FAILURE"; const char *MPSOC_HANDLER_SEQ_CNT_MISMATCH_STRING = "MPSOC_HANDLER_SEQ_CNT_MISMATCH"; +const char *MPSOC_SHUTDOWN_FAILED_STRING = "MPSOC_SHUTDOWN_FAILED"; const char *SELF_TEST_I2C_FAILURE_STRING = "SELF_TEST_I2C_FAILURE"; const char *SELF_TEST_SPI_FAILURE_STRING = "SELF_TEST_SPI_FAILURE"; const char *SELF_TEST_ADC_FAILURE_STRING = "SELF_TEST_ADC_FAILURE"; @@ -178,6 +179,7 @@ const char *NOT_ENOUGH_DEVICES_DUAL_MODE_STRING = "NOT_ENOUGH_DEVICES_DUAL_MODE" const char *POWER_STATE_MACHINE_TIMEOUT_STRING = "POWER_STATE_MACHINE_TIMEOUT"; const char *SIDE_SWITCH_TRANSITION_NOT_ALLOWED_STRING = "SIDE_SWITCH_TRANSITION_NOT_ALLOWED"; const char *CHILDREN_LOST_MODE_STRING = "CHILDREN_LOST_MODE"; +const char *GPS_FIX_CHANGE_STRING = "GPS_FIX_CHANGE"; const char *ALLOC_FAILURE_STRING = "ALLOC_FAILURE"; const char *REBOOT_SW_STRING = "REBOOT_SW"; const char *REBOOT_MECHANISM_TRIGGERED_STRING = "REBOOT_MECHANISM_TRIGGERED"; @@ -343,194 +345,198 @@ const char *translateEvents(Event event) { return TEST_STRING; case (10600): return CHANGE_OF_SETUP_PARAMETER_STRING; - case (10800): + case (11300): return SWITCH_CMD_SENT_STRING; - case (10801): - return SWITCH_HAS_CHANGED_STRING; - case (10802): - return SWITCHING_Q7S_DENIED_STRING; - case (10900): - return GPIO_PULL_HIGH_FAILED_STRING; - case (10901): - return GPIO_PULL_LOW_FAILED_STRING; - case (10902): - return SWITCH_ALREADY_ON_STRING; - case (10903): - return SWITCH_ALREADY_OFF_STRING; - case (10904): - return MAIN_SWITCH_TIMEOUT_STRING; - case (11000): - return MAIN_SWITCH_ON_TIMEOUT_STRING; - case (11001): - return MAIN_SWITCH_OFF_TIMEOUT_STRING; - case (11002): - return DEPLOYMENT_FAILED_STRING; - case (11003): - return DEPL_SA1_GPIO_SWTICH_ON_FAILED_STRING; - case (11004): - return DEPL_SA2_GPIO_SWTICH_ON_FAILED_STRING; - case (11101): - return MEMORY_READ_RPT_CRC_FAILURE_STRING; - case (11102): - return ACK_FAILURE_STRING; - case (11103): - return EXE_FAILURE_STRING; - case (11104): - return MPSOC_HANDLER_CRC_FAILURE_STRING; - case (11105): - return MPSOC_HANDLER_SEQ_CNT_MISMATCH_STRING; - case (11201): - return SELF_TEST_I2C_FAILURE_STRING; - case (11202): - return SELF_TEST_SPI_FAILURE_STRING; - case (11203): - return SELF_TEST_ADC_FAILURE_STRING; - case (11204): - return SELF_TEST_PWM_FAILURE_STRING; - case (11205): - return SELF_TEST_TC_FAILURE_STRING; - case (11206): - return SELF_TEST_MTM_RANGE_FAILURE_STRING; - case (11207): - return SELF_TEST_COIL_CURRENT_FAILURE_STRING; - case (11208): - return INVALID_ERROR_BYTE_STRING; case (11301): - return ERROR_STATE_STRING; + return SWITCH_HAS_CHANGED_STRING; + case (11302): + return SWITCHING_Q7S_DENIED_STRING; + case (11400): + return GPIO_PULL_HIGH_FAILED_STRING; case (11401): - return BOOTING_FIRMWARE_FAILED_STRING; + return GPIO_PULL_LOW_FAILED_STRING; case (11402): - return BOOTING_BOOTLOADER_FAILED_STRING; + return SWITCH_ALREADY_ON_STRING; + case (11403): + return SWITCH_ALREADY_OFF_STRING; + case (11404): + return MAIN_SWITCH_TIMEOUT_STRING; + case (11500): + return MAIN_SWITCH_ON_TIMEOUT_STRING; case (11501): - return SUPV_MEMORY_READ_RPT_CRC_FAILURE_STRING; + return MAIN_SWITCH_OFF_TIMEOUT_STRING; case (11502): - return SUPV_ACK_FAILURE_STRING; + return DEPLOYMENT_FAILED_STRING; case (11503): - return SUPV_EXE_FAILURE_STRING; + return DEPL_SA1_GPIO_SWTICH_ON_FAILED_STRING; case (11504): - return SUPV_CRC_FAILURE_EVENT_STRING; - case (11600): - return SANITIZATION_FAILED_STRING; + return DEPL_SA2_GPIO_SWTICH_ON_FAILED_STRING; case (11601): - return MOUNTED_SD_CARD_STRING; - case (11700): - return UPDATE_FILE_NOT_EXISTS_STRING; + return MEMORY_READ_RPT_CRC_FAILURE_STRING; + case (11602): + return ACK_FAILURE_STRING; + case (11603): + return EXE_FAILURE_STRING; + case (11604): + return MPSOC_HANDLER_CRC_FAILURE_STRING; + case (11605): + return MPSOC_HANDLER_SEQ_CNT_MISMATCH_STRING; + case (11606): + return MPSOC_SHUTDOWN_FAILED_STRING; case (11701): - return ACTION_COMMANDING_FAILED_STRING; + return SELF_TEST_I2C_FAILURE_STRING; case (11702): - return UPDATE_AVAILABLE_FAILED_STRING; + return SELF_TEST_SPI_FAILURE_STRING; case (11703): - return UPDATE_TRANSFER_FAILED_STRING; + return SELF_TEST_ADC_FAILURE_STRING; case (11704): - return UPDATE_VERIFY_FAILED_STRING; + return SELF_TEST_PWM_FAILURE_STRING; case (11705): - return UPDATE_FINISHED_STRING; - case (11800): - return SEND_MRAM_DUMP_FAILED_STRING; + return SELF_TEST_TC_FAILURE_STRING; + case (11706): + return SELF_TEST_MTM_RANGE_FAILURE_STRING; + case (11707): + return SELF_TEST_COIL_CURRENT_FAILURE_STRING; + case (11708): + return INVALID_ERROR_BYTE_STRING; case (11801): - return MRAM_DUMP_FAILED_STRING; - case (11802): - return MRAM_DUMP_FINISHED_STRING; + return ERROR_STATE_STRING; case (11901): - return INVALID_TC_FRAME_STRING; + return BOOTING_FIRMWARE_FAILED_STRING; case (11902): - return INVALID_FAR_STRING; - case (11903): - return CARRIER_LOCK_STRING; - case (11904): - return BIT_LOCK_PDEC_STRING; - case (12000): - return IMAGE_UPLOAD_FAILED_STRING; + return BOOTING_BOOTLOADER_FAILED_STRING; case (12001): - return IMAGE_DOWNLOAD_FAILED_STRING; + return SUPV_MEMORY_READ_RPT_CRC_FAILURE_STRING; case (12002): - return IMAGE_UPLOAD_SUCCESSFUL_STRING; + return SUPV_ACK_FAILURE_STRING; case (12003): - return IMAGE_DOWNLOAD_SUCCESSFUL_STRING; + return SUPV_EXE_FAILURE_STRING; case (12004): - return FLASH_WRITE_SUCCESSFUL_STRING; - case (12005): - return FLASH_READ_SUCCESSFUL_STRING; - case (12006): - return FLASH_READ_FAILED_STRING; - case (12007): - return FIRMWARE_UPDATE_SUCCESSFUL_STRING; - case (12008): - return FIRMWARE_UPDATE_FAILED_STRING; - case (12009): - return STR_HELPER_READING_REPLY_FAILED_STRING; - case (12010): - return STR_HELPER_COM_ERROR_STRING; - case (12011): - return STR_HELPER_NO_REPLY_STRING; - case (12012): - return STR_HELPER_DEC_ERROR_STRING; - case (12013): - return POSITION_MISMATCH_STRING; - case (12014): - return STR_HELPER_FILE_NOT_EXISTS_STRING; - case (12015): - return STR_HELPER_SENDING_PACKET_FAILED_STRING; - case (12016): - return STR_HELPER_REQUESTING_MSG_FAILED_STRING; + return SUPV_CRC_FAILURE_EVENT_STRING; case (12100): - return MPSOC_FLASH_WRITE_FAILED_STRING; + return SANITIZATION_FAILED_STRING; case (12101): - return MPSOC_FLASH_WRITE_SUCCESSFUL_STRING; - case (12102): - return SENDING_COMMAND_FAILED_STRING; - case (12103): - return MPSOC_HELPER_REQUESTING_REPLY_FAILED_STRING; - case (12104): - return MPSOC_HELPER_READING_REPLY_FAILED_STRING; - case (12105): - return MISSING_ACK_STRING; - case (12106): - return MISSING_EXE_STRING; - case (12107): - return ACK_FAILURE_REPORT_STRING; - case (12108): - return EXE_FAILURE_REPORT_STRING; - case (12109): - return ACK_INVALID_APID_STRING; - case (12110): - return EXE_INVALID_APID_STRING; - case (12111): - return MPSOC_HELPER_SEQ_CNT_MISMATCH_STRING; + return MOUNTED_SD_CARD_STRING; case (12200): - return TRANSITION_BACK_TO_OFF_STRING; + return UPDATE_FILE_NOT_EXISTS_STRING; case (12201): - return NEG_V_OUT_OF_BOUNDS_STRING; + return ACTION_COMMANDING_FAILED_STRING; case (12202): - return U_DRO_OUT_OF_BOUNDS_STRING; + return UPDATE_AVAILABLE_FAILED_STRING; case (12203): - return I_DRO_OUT_OF_BOUNDS_STRING; + return UPDATE_TRANSFER_FAILED_STRING; case (12204): - return U_X8_OUT_OF_BOUNDS_STRING; + return UPDATE_VERIFY_FAILED_STRING; case (12205): - return I_X8_OUT_OF_BOUNDS_STRING; - case (12206): - return U_TX_OUT_OF_BOUNDS_STRING; - case (12207): - return I_TX_OUT_OF_BOUNDS_STRING; - case (12208): - return U_MPA_OUT_OF_BOUNDS_STRING; - case (12209): - return I_MPA_OUT_OF_BOUNDS_STRING; - case (12210): - return U_HPA_OUT_OF_BOUNDS_STRING; - case (12211): - return I_HPA_OUT_OF_BOUNDS_STRING; + return UPDATE_FINISHED_STRING; case (12300): - return TRANSITION_OTHER_SIDE_FAILED_STRING; + return SEND_MRAM_DUMP_FAILED_STRING; case (12301): - return NOT_ENOUGH_DEVICES_DUAL_MODE_STRING; + return MRAM_DUMP_FAILED_STRING; case (12302): - return POWER_STATE_MACHINE_TIMEOUT_STRING; - case (12303): - return SIDE_SWITCH_TRANSITION_NOT_ALLOWED_STRING; + return MRAM_DUMP_FINISHED_STRING; + case (12401): + return INVALID_TC_FRAME_STRING; + case (12402): + return INVALID_FAR_STRING; + case (12403): + return CARRIER_LOCK_STRING; + case (12404): + return BIT_LOCK_PDEC_STRING; case (12500): + return IMAGE_UPLOAD_FAILED_STRING; + case (12501): + return IMAGE_DOWNLOAD_FAILED_STRING; + case (12502): + return IMAGE_UPLOAD_SUCCESSFUL_STRING; + case (12503): + return IMAGE_DOWNLOAD_SUCCESSFUL_STRING; + case (12504): + return FLASH_WRITE_SUCCESSFUL_STRING; + case (12505): + return FLASH_READ_SUCCESSFUL_STRING; + case (12506): + return FLASH_READ_FAILED_STRING; + case (12507): + return FIRMWARE_UPDATE_SUCCESSFUL_STRING; + case (12508): + return FIRMWARE_UPDATE_FAILED_STRING; + case (12509): + return STR_HELPER_READING_REPLY_FAILED_STRING; + case (12510): + return STR_HELPER_COM_ERROR_STRING; + case (12511): + return STR_HELPER_NO_REPLY_STRING; + case (12512): + return STR_HELPER_DEC_ERROR_STRING; + case (12513): + return POSITION_MISMATCH_STRING; + case (12514): + return STR_HELPER_FILE_NOT_EXISTS_STRING; + case (12515): + return STR_HELPER_SENDING_PACKET_FAILED_STRING; + case (12516): + return STR_HELPER_REQUESTING_MSG_FAILED_STRING; + case (12600): + return MPSOC_FLASH_WRITE_FAILED_STRING; + case (12601): + return MPSOC_FLASH_WRITE_SUCCESSFUL_STRING; + case (12602): + return SENDING_COMMAND_FAILED_STRING; + case (12603): + return MPSOC_HELPER_REQUESTING_REPLY_FAILED_STRING; + case (12604): + return MPSOC_HELPER_READING_REPLY_FAILED_STRING; + case (12605): + return MISSING_ACK_STRING; + case (12606): + return MISSING_EXE_STRING; + case (12607): + return ACK_FAILURE_REPORT_STRING; + case (12608): + return EXE_FAILURE_REPORT_STRING; + case (12609): + return ACK_INVALID_APID_STRING; + case (12610): + return EXE_INVALID_APID_STRING; + case (12611): + return MPSOC_HELPER_SEQ_CNT_MISMATCH_STRING; + case (12700): + return TRANSITION_BACK_TO_OFF_STRING; + case (12701): + return NEG_V_OUT_OF_BOUNDS_STRING; + case (12702): + return U_DRO_OUT_OF_BOUNDS_STRING; + case (12703): + return I_DRO_OUT_OF_BOUNDS_STRING; + case (12704): + return U_X8_OUT_OF_BOUNDS_STRING; + case (12705): + return I_X8_OUT_OF_BOUNDS_STRING; + case (12706): + return U_TX_OUT_OF_BOUNDS_STRING; + case (12707): + return I_TX_OUT_OF_BOUNDS_STRING; + case (12708): + return U_MPA_OUT_OF_BOUNDS_STRING; + case (12709): + return I_MPA_OUT_OF_BOUNDS_STRING; + case (12710): + return U_HPA_OUT_OF_BOUNDS_STRING; + case (12711): + return I_HPA_OUT_OF_BOUNDS_STRING; + case (12800): + return TRANSITION_OTHER_SIDE_FAILED_STRING; + case (12801): + return NOT_ENOUGH_DEVICES_DUAL_MODE_STRING; + case (12802): + return POWER_STATE_MACHINE_TIMEOUT_STRING; + case (12803): + return SIDE_SWITCH_TRANSITION_NOT_ALLOWED_STRING; + case (13000): return CHILDREN_LOST_MODE_STRING; + case (13100): + return GPS_FIX_CHANGE_STRING; case (13600): return ALLOC_FAILURE_STRING; case (13601): diff --git a/linux/fsfwconfig/objects/translateObjects.cpp b/linux/fsfwconfig/objects/translateObjects.cpp index 32799af0..78113fd9 100644 --- a/linux/fsfwconfig/objects/translateObjects.cpp +++ b/linux/fsfwconfig/objects/translateObjects.cpp @@ -2,7 +2,7 @@ * @brief Auto-generated object translation file. * @details * Contains 117 translations. - * Generated on: 2022-03-28 12:48:33 + * Generated on: 2022-04-07 17:27:42 */ #include "translateObjects.h" diff --git a/tmtc b/tmtc index 25bab108..aa25b400 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 25bab108df76045e10af2efc26a0397f78574f9c +Subproject commit aa25b400706ae580621f835b778d57546f2a7c04 From 59d58da4f291d91bbfeb9dfa9a6a05fb07df3d4d Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 7 Apr 2022 19:48:09 +0200 Subject: [PATCH 41/65] splitting pdu1 and pdu2 sets done --- bsp_q7s/callbacks/pcduSwitchCb.cpp | 8 +- bsp_q7s/core/ObjectFactory.cpp | 14 +- common/config/devices/powerSwitcherList.h | 68 +- fsfw | 2 +- linux/ObjectFactory.cpp | 2 +- mission/devices/GomspaceDeviceHandler.cpp | 150 ++++ mission/devices/GomspaceDeviceHandler.h | 6 + mission/devices/P60DockHandler.cpp | 8 +- mission/devices/PCDUHandler.cpp | 350 ++------ mission/devices/PCDUHandler.h | 19 +- mission/devices/PDU1Handler.cpp | 463 ++--------- mission/devices/PDU1Handler.h | 3 +- mission/devices/PDU2Handler.cpp | 439 ++-------- mission/devices/PDU2Handler.h | 3 +- .../devices/SolarArrayDeploymentHandler.cpp | 2 +- mission/devices/SolarArrayDeploymentHandler.h | 4 +- .../devicedefinitions/GomspaceDefinitions.h | 751 ++++++------------ mission/system/AcsBoardAssembly.cpp | 2 + mission/system/AcsBoardAssembly.h | 6 +- mission/system/DualLaneAssemblyBase.cpp | 7 +- mission/system/DualLaneAssemblyBase.h | 5 +- mission/system/SusAssembly.h | 6 +- 22 files changed, 634 insertions(+), 1684 deletions(-) diff --git a/bsp_q7s/callbacks/pcduSwitchCb.cpp b/bsp_q7s/callbacks/pcduSwitchCb.cpp index ec5f4dc5..f9b6c761 100644 --- a/bsp_q7s/callbacks/pcduSwitchCb.cpp +++ b/bsp_q7s/callbacks/pcduSwitchCb.cpp @@ -10,8 +10,8 @@ void pcdu::switchCallback(GOMSPACE::Pdu pdu, uint8_t channel, bool state, void* return; } if (pdu == GOMSPACE::Pdu::PDU1) { - PDU1::SwitchChannels typedChannel = static_cast(channel); - if (typedChannel == PDU1::SwitchChannels::ACS_A_SIDE) { + PDU1::Channels typedChannel = static_cast(channel); + if (typedChannel == PDU1::Channels::ACS_A_SIDE) { if (state) { gpioComIF->pullHigh(gpioIds::GNSS_0_NRESET); } else { @@ -20,8 +20,8 @@ void pcdu::switchCallback(GOMSPACE::Pdu pdu, uint8_t channel, bool state, void* } } else if (pdu == GOMSPACE::Pdu::PDU2) { - PDU2::SwitchChannels typedChannel = static_cast(channel); - if (typedChannel == PDU2::SwitchChannels::ACS_B_SIDE) { + PDU2::Channels typedChannel = static_cast(channel); + if (typedChannel == PDU2::Channels::ACS_B_SIDE) { if (state) { gpioComIF->pullHigh(gpioIds::GNSS_1_NRESET); } else { diff --git a/bsp_q7s/core/ObjectFactory.cpp b/bsp_q7s/core/ObjectFactory.cpp index d72beb8d..c155e705 100644 --- a/bsp_q7s/core/ObjectFactory.cpp +++ b/bsp_q7s/core/ObjectFactory.cpp @@ -192,7 +192,7 @@ void ObjectFactory::produce(void* args) { starTrackerCookie->setNoFixedSizeReply(); StrHelper* strHelper = new StrHelper(objects::STR_HELPER); new StarTrackerHandler(objects::STAR_TRACKER, objects::UART_COM_IF, starTrackerCookie, strHelper, - pcduSwitches::PDU1_CH2_STAR_TRACKER_5V); + pcdu::PDU1_CH2_STAR_TRACKER_5V); #endif /* OBSW_ADD_STAR_TRACKER == 1 */ @@ -601,7 +601,7 @@ void ObjectFactory::createHeaterComponents() { heaterGpiosCookie->addGpio(gpioIds::HEATER_7, gpio); new HeaterHandler(objects::HEATER_HANDLER, objects::GPIO_IF, heaterGpiosCookie, - objects::PCDU_HANDLER, pcduSwitches::Switches::PDU2_CH3_TCS_BOARD_HEATER_IN_8V); + objects::PCDU_HANDLER, pcdu::Switches::PDU2_CH3_TCS_BOARD_HEATER_IN_8V); } void ObjectFactory::createSolarArrayDeploymentComponents() { @@ -621,7 +621,7 @@ void ObjectFactory::createSolarArrayDeploymentComponents() { // TODO: Find out burn time. For now set to 1000 ms. new SolarArrayDeploymentHandler(objects::SOLAR_ARRAY_DEPL_HANDLER, objects::GPIO_IF, solarArrayDeplCookie, objects::PCDU_HANDLER, - pcduSwitches::Switches::PDU2_CH5_DEPLOYMENT_MECHANISM_8V, + pcdu::Switches::PDU2_CH5_DEPLOYMENT_MECHANISM_8V, gpioIds::DEPLSA1, gpioIds::DEPLSA2, 1000); } @@ -632,7 +632,7 @@ void ObjectFactory::createSyrlinksComponents() { syrlinksUartCookie->setParityEven(); new SyrlinksHkHandler(objects::SYRLINKS_HK_HANDLER, objects::UART_COM_IF, syrlinksUartCookie, - pcduSwitches::PDU1_CH1_SYRLINKS_12V); + pcdu::PDU1_CH1_SYRLINKS_12V); } void ObjectFactory::createPayloadComponents(LinuxLibgpioIF* gpioComIF) { @@ -668,7 +668,7 @@ void ObjectFactory::createPayloadComponents(LinuxLibgpioIF* gpioComIF) { supervisorCookie->setNoFixedSizeReply(); new PlocSupervisorHandler(objects::PLOC_SUPERVISOR_HANDLER, objects::UART_COM_IF, supervisorCookie, Gpio(gpioIds::ENABLE_SUPV_UART, gpioComIF), - pcduSwitches::PDU1_CH6_PLOC_12V); + pcdu::PDU1_CH6_PLOC_12V); #endif /* OBSW_ADD_PLOC_SUPERVISOR == 1 */ static_cast(consumer); } @@ -925,8 +925,8 @@ void ObjectFactory::createPlPcduComponents(LinuxLibgpioIF* gpioComIF, SpiComIF* // Create device handler components auto plPcduHandler = new PayloadPcduHandler( objects::PLPCDU_HANDLER, objects::SPI_COM_IF, spiCookie, gpioComIF, SdCardManager::instance(), - pwrSwitcher, pcduSwitches::Switches::PDU2_CH1_PL_PCDU_BATT_0_14V8, - pcduSwitches::Switches::PDU2_CH6_PL_PCDU_BATT_1_14V8, false); + pwrSwitcher, pcdu::Switches::PDU2_CH1_PL_PCDU_BATT_0_14V8, + pcdu::Switches::PDU2_CH6_PL_PCDU_BATT_1_14V8, false); spiCookie->setCallbackMode(PayloadPcduHandler::extConvAsTwoCallback, plPcduHandler); // plPcduHandler->enablePeriodicPrintout(true, 5); // static_cast(plPcduHandler); diff --git a/common/config/devices/powerSwitcherList.h b/common/config/devices/powerSwitcherList.h index 1981bb9c..d032428b 100644 --- a/common/config/devices/powerSwitcherList.h +++ b/common/config/devices/powerSwitcherList.h @@ -1,72 +1,6 @@ #ifndef FSFWCONFIG_DEVICES_POWERSWITCHERLIST_H_ #define FSFWCONFIG_DEVICES_POWERSWITCHERLIST_H_ -#include "OBSWConfig.h" - -#include - -#include -#include - -namespace pcduSwitches { - -/* Switches are uint8_t datatype and go from 0 to 255 */ -enum Switches: power::Switch_t { - PDU1_CH0_TCS_BOARD_3V3, - PDU1_CH1_SYRLINKS_12V, - PDU1_CH2_STAR_TRACKER_5V, - PDU1_CH3_MGT_5V, - PDU1_CH4_SUS_NOMINAL_3V3, - PDU1_CH5_SOLAR_CELL_EXP_5V, - PDU1_CH6_PLOC_12V, - PDU1_CH7_ACS_A_SIDE_3V3, - PDU1_CH8_UNOCCUPIED, - - PDU2_CH0_Q7S, - PDU2_CH1_PL_PCDU_BATT_0_14V8, - PDU2_CH2_RW_5V, - PDU2_CH3_TCS_BOARD_HEATER_IN_8V, - PDU2_CH4_SUS_REDUNDANT_3V3, - PDU2_CH5_DEPLOYMENT_MECHANISM_8V, - PDU2_CH6_PL_PCDU_BATT_1_14V8, - PDU2_CH7_ACS_BOARD_SIDE_B_3V3, - PDU2_CH8_PAYLOAD_CAMERA, - NUMBER_OF_SWITCHES -}; - -static const uint8_t ON = 1; -static const uint8_t OFF = 0; - -// Output states after reboot of the PDUs - -const std::array INIT_SWITCH_STATES = { - // PDU 1 -// Because the TE0720 is not connected to the PCDU, this switch is always on -#ifdef TE0720_1CFA - ON, -#else - OFF, -#endif - OFF, - OFF, - OFF, - OFF, - OFF, - OFF, - OFF, - OFF, - - // PDU 2 - ON, - OFF, - OFF, - OFF, - OFF, - OFF, - OFF, - OFF, - OFF -}; -} +#include "mission/devices/devicedefinitions/GomspaceDefinitions.h" #endif /* FSFWCONFIG_DEVICES_POWERSWITCHERLIST_H_ */ diff --git a/fsfw b/fsfw index a11d7455..94ed5822 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit a11d7455dfaf2e736f73f6c4dda1f8c06b9f1234 +Subproject commit 94ed5822971575e9715c39c86ab4466c81718441 diff --git a/linux/ObjectFactory.cpp b/linux/ObjectFactory.cpp index 267b5f4d..7811fdbe 100644 --- a/linux/ObjectFactory.cpp +++ b/linux/ObjectFactory.cpp @@ -280,7 +280,7 @@ void ObjectFactory::createRtdComponents(std::string spiDev, GpioIF* gpioComIF, TcsBoardHelper helper(rtdIds); TcsBoardAssembly* tcsBoardAss = new TcsBoardAssembly(objects::TCS_BOARD_ASS, objects::NO_OBJECT, pwrSwitcher, - pcduSwitches::Switches::PDU1_CH0_TCS_BOARD_3V3, helper); + pcdu::Switches::PDU1_CH0_TCS_BOARD_3V3, helper); static_cast(tcsBoardAss); #endif // OBSW_ADD_RTD_DEVICES == 1 } diff --git a/mission/devices/GomspaceDeviceHandler.cpp b/mission/devices/GomspaceDeviceHandler.cpp index 26c09901..fd11a8a2 100644 --- a/mission/devices/GomspaceDeviceHandler.cpp +++ b/mission/devices/GomspaceDeviceHandler.cpp @@ -1,6 +1,7 @@ #include "GomspaceDeviceHandler.h" #include +#include #include "devicedefinitions/GomSpacePackets.h" #include "devicedefinitions/powerDefinitions.h" @@ -356,6 +357,46 @@ ReturnValue_t GomspaceDeviceHandler::setParamCallback(SetParamMessageUnpacker& u return HasReturnvaluesIF::RETURN_OK; } +ReturnValue_t GomspaceDeviceHandler::initializePduPool( + localpool::DataPool& localDataPoolMap, LocalDataPoolManager& poolManager, + std::array initOutEnb) { + localDataPoolMap.emplace(P60System::pool::PDU_CURRENTS, new PoolEntry(9)); + localDataPoolMap.emplace(P60System::pool::PDU_VOLTAGES, new PoolEntry(9)); + + localDataPoolMap.emplace(P60System::pool::PDU_VCC, new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU_VBAT, new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU_TEMPERATURE, new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU_CONV_EN_1, new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU_CONV_EN_2, new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU_CONV_EN_3, new PoolEntry({0})); + + localDataPoolMap.emplace(P60System::pool::PDU_OUT_ENABLE, + new PoolEntry(initOutEnb.data(), initOutEnb.size())); + + localDataPoolMap.emplace(P60System::pool::PDU_BOOTCAUSE, new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU_BOOTCNT, new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU_UPTIME, new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU_RESETCAUSE, new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU_BATT_MODE, new PoolEntry({0})); + + localDataPoolMap.emplace(P60System::pool::PDU_LATCHUPS, new PoolEntry(9)); + + localDataPoolMap.emplace(P60System::pool::PDU_DEVICES, new PoolEntry(8)); + localDataPoolMap.emplace(P60System::pool::PDU_STATUSES, new PoolEntry(8)); + + localDataPoolMap.emplace(P60System::pool::PDU_WDT_CNT_GND, new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU_WDT_CNT_I2C, new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU_WDT_CNT_CAN, new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU_WDT_CNT_CSP1, new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU_WDT_CNT_CSP2, new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU_WDT_GND_LEFT, new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU_WDT_I2C_LEFT, new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU_WDT_CAN_LEFT, new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU_WDT_CSP_LEFT1, new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU_WDT_CSP_LEFT2, new PoolEntry({0})); + return RETURN_OK; +} + ReturnValue_t GomspaceDeviceHandler::generateResetWatchdogCmd() { WatchdogResetCommand watchdogResetCommand; size_t cspPacketLen = 0; @@ -405,3 +446,112 @@ ReturnValue_t GomspaceDeviceHandler::printStatus(DeviceCommandId_t cmd) { sif::info << "No printHkTable implementation given.." << std::endl; return HasReturnvaluesIF::RETURN_OK; } + +ReturnValue_t GomspaceDeviceHandler::parsePduHkTable(PDU::PduCoreHk& coreHk, PDU::PduAuxHk& auxHk, + const uint8_t* packet) { + uint16_t dataOffset = 0; + PoolReadGuard pg0(&coreHk); + PoolReadGuard pg1(&auxHk); + if (pg0.getReadResult() != HasReturnvaluesIF::RETURN_OK or + pg1.getReadResult() != HasReturnvaluesIF::RETURN_OK) { + sif::warning << "Reading PDU1 datasets failed!" << std::endl; + return HasReturnvaluesIF::RETURN_FAILED; + } + /* Fist 10 bytes contain the gomspace header. Each variable is preceded by the 16-bit table + * address. */ + dataOffset += 12; + for (uint8_t idx = 0; idx < PDU::CHANNELS_LEN; idx++) { + coreHk.currents[idx] = (packet[dataOffset] << 8) | packet[dataOffset + 1]; + dataOffset += 4; + } + for (uint8_t idx = 0; idx < PDU::CHANNELS_LEN; idx++) { + coreHk.voltages[idx] = (packet[dataOffset] << 8) | packet[dataOffset + 1]; + dataOffset += 4; + } + + auxHk.vcc = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); + dataOffset += 4; + auxHk.vbat = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); + dataOffset += 4; + coreHk.temperature = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); + dataOffset += 4; + + auxHk.converterEnable1 = *(packet + dataOffset); + dataOffset += 3; + auxHk.converterEnable2 = *(packet + dataOffset); + dataOffset += 3; + auxHk.converterEnable3 = *(packet + dataOffset); + dataOffset += 3; + + for (uint8_t idx = 0; idx < PDU::CHANNELS_LEN; idx++) { + coreHk.outputEnables[idx] = packet[dataOffset]; + dataOffset += 3; + } + + auxHk.bootcause = *(packet + dataOffset) << 24 | *(packet + dataOffset + 1) << 16 | + *(packet + dataOffset + 2) << 8 | *(packet + dataOffset + 3); + dataOffset += 6; + coreHk.bootcount = *(packet + dataOffset) << 24 | *(packet + dataOffset + 1) << 16 | + *(packet + dataOffset + 2) << 8 | *(packet + dataOffset + 3); + dataOffset += 6; + auxHk.uptime = *(packet + dataOffset) << 24 | *(packet + dataOffset + 1) << 16 | + *(packet + dataOffset + 2) << 8 | *(packet + dataOffset + 3); + dataOffset += 6; + auxHk.resetcause = *(packet + dataOffset + 1) << 8 | *(packet + dataOffset); + dataOffset += 4; + coreHk.battMode = *(packet + dataOffset); + /* +10 because here begins the second gomspace csp packet */ + dataOffset += 3 + 10; + + for (uint8_t idx = 0; idx < PDU::CHANNELS_LEN; idx++) { + auxHk.latchups[idx] = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); + dataOffset += 4; + } + + for (uint8_t idx = 0; idx < PDU::DEVICES_NUM; idx++) { + auxHk.deviceTypes[idx] = *(packet + dataOffset); + dataOffset += 3; + } + for (uint8_t idx = 0; idx < PDU::DEVICES_NUM; idx++) { + auxHk.devicesStatus[idx] = *(packet + dataOffset); + dataOffset += 3; + } + + auxHk.gndWdtReboots = *(packet + dataOffset) << 24 | *(packet + dataOffset + 1) << 16 | + *(packet + dataOffset + 2) << 8 | *(packet + dataOffset + 3); + dataOffset += 6; + auxHk.i2cWdtReboots = *(packet + dataOffset) << 24 | *(packet + dataOffset + 1) << 16 | + *(packet + dataOffset + 2) << 8 | *(packet + dataOffset + 3); + dataOffset += 6; + auxHk.canWdtReboots = *(packet + dataOffset) << 24 | *(packet + dataOffset + 1) << 16 | + *(packet + dataOffset + 2) << 8 | *(packet + dataOffset + 3); + dataOffset += 6; + auxHk.csp1WdtReboots = *(packet + dataOffset) << 24 | *(packet + dataOffset + 1) << 16 | + *(packet + dataOffset + 2) << 8 | *(packet + dataOffset + 3); + dataOffset += 6; + auxHk.csp2WdtReboots = *(packet + dataOffset) << 24 | *(packet + dataOffset + 1) << 16 | + *(packet + dataOffset + 2) << 8 | *(packet + dataOffset + 3); + dataOffset += 6; + auxHk.groundWatchdogSecondsLeft = *(packet + dataOffset) << 24 | + *(packet + dataOffset + 1) << 16 | + *(packet + dataOffset + 2) << 8 | *(packet + dataOffset + 3); + dataOffset += 6; + auxHk.i2cWatchdogSecondsLeft = *(packet + dataOffset) << 24 | *(packet + dataOffset + 1) << 16 | + *(packet + dataOffset + 2) << 8 | *(packet + dataOffset + 3); + dataOffset += 6; + auxHk.canWatchdogSecondsLeft = *(packet + dataOffset) << 24 | *(packet + dataOffset + 1) << 16 | + *(packet + dataOffset + 2) << 8 | *(packet + dataOffset + 3); + dataOffset += 6; + auxHk.csp1WatchdogPingsLeft = *(packet + dataOffset); + dataOffset += 3; + auxHk.csp2WatchdogPingsLeft = *(packet + dataOffset); + + coreHk.setChanged(true); + if (not coreHk.isValid()) { + coreHk.setValidity(true, true); + } + if (not auxHk.isValid()) { + auxHk.setValidity(true, true); + } + return RETURN_OK; +} diff --git a/mission/devices/GomspaceDeviceHandler.h b/mission/devices/GomspaceDeviceHandler.h index fedc91d9..7c1555bc 100644 --- a/mission/devices/GomspaceDeviceHandler.h +++ b/mission/devices/GomspaceDeviceHandler.h @@ -110,6 +110,12 @@ class GomspaceDeviceHandler : public DeviceHandlerBase { virtual ReturnValue_t childCommandHook(DeviceCommandId_t cmd, const uint8_t *commandData, size_t commandDataLen); + ReturnValue_t parsePduHkTable(PDU::PduCoreHk &coreHk, PDU::PduAuxHk &auxHk, + const uint8_t *packet); + ReturnValue_t initializePduPool(localpool::DataPool &localDataPoolMap, + LocalDataPoolManager &poolManager, + std::array initOutEnb); + private: SetParamMessageUnpacker setParamCacher; /** diff --git a/mission/devices/P60DockHandler.cpp b/mission/devices/P60DockHandler.cpp index d37673fc..83275e37 100644 --- a/mission/devices/P60DockHandler.cpp +++ b/mission/devices/P60DockHandler.cpp @@ -111,7 +111,7 @@ void P60DockHandler::parseHkTableReply(const uint8_t *packet) { dataOffset += 6; coreHk.bootCount = *(packet + dataOffset) << 24 | *(packet + dataOffset + 1) << 16 | *(packet + dataOffset + 2) << 8 | *(packet + dataOffset + 3); - if(firstHk) { + if (firstHk) { triggerEvent(P60_BOOT_COUNT, coreHk.bootCount.value); } dataOffset += 6; @@ -216,11 +216,11 @@ void P60DockHandler::parseHkTableReply(const uint8_t *packet) { ReturnValue_t P60DockHandler::initializeLocalDataPool(localpool::DataPool &localDataPoolMap, LocalDataPoolManager &poolManager) { using namespace P60System; - localDataPoolMap.emplace(pool::CURRENTS, &hkCurrents); + localDataPoolMap.emplace(pool::P60_CURRENTS, &hkCurrents); - localDataPoolMap.emplace(pool::VOLTAGES, &hkVoltages); + localDataPoolMap.emplace(pool::P60_VOLTAGES, &hkVoltages); - localDataPoolMap.emplace(pool::OUTPUT_ENABLE, &outputEnables); + localDataPoolMap.emplace(pool::P60_OUTPUT_ENABLE, &outputEnables); localDataPoolMap.emplace(pool::P60DOCK_TEMPERATURE_1, new PoolEntry({0})); localDataPoolMap.emplace(pool::P60DOCK_TEMPERATURE_2, new PoolEntry({0})); diff --git a/mission/devices/PCDUHandler.cpp b/mission/devices/PCDUHandler.cpp index c819b223..218293e2 100644 --- a/mission/devices/PCDUHandler.cpp +++ b/mission/devices/PCDUHandler.cpp @@ -11,8 +11,9 @@ PCDUHandler::PCDUHandler(object_id_t setObjectId, size_t cmdQueueSize) : SystemObject(setObjectId), poolManager(this, nullptr), - pdu2HkTableDataset(this), - pdu1HkTableDataset(this), + pdu1CoreHk(this), + pdu2CoreHk(this), + switcherSet(this), cmdQueueSize(cmdQueueSize) { auto mqArgs = MqArgs(setObjectId, static_cast(this)); commandQueue = QueueFactory::instance()->createMessageQueue( @@ -51,8 +52,8 @@ ReturnValue_t PCDUHandler::initialize() { return RETURN_FAILED; } result = pdu2Handler->getSubscriptionInterface()->subscribeForSetUpdateMessage( - static_cast(P60System::SetIds::PDU_2), this->getObjectId(), commandQueue->getId(), - true); + static_cast(P60System::SetIds::PDU_2_CORE), this->getObjectId(), + commandQueue->getId(), true); if (result != RETURN_OK) { sif::error << "PCDUHandler::initialize: Failed to subscribe for set update messages from " << "PDU2Handler" << std::endl; @@ -67,8 +68,8 @@ ReturnValue_t PCDUHandler::initialize() { return RETURN_FAILED; } result = pdu1Handler->getSubscriptionInterface()->subscribeForSetUpdateMessage( - static_cast(P60System::SetIds::PDU_1), this->getObjectId(), commandQueue->getId(), - true); + static_cast(P60System::SetIds::PDU_1_CORE), this->getObjectId(), + commandQueue->getId(), true); if (result != RETURN_OK) { sif::error << "PCDUHandler::initialize: Failed to subscribe for set update messages from " << "PDU1Handler" << std::endl; @@ -79,9 +80,13 @@ ReturnValue_t PCDUHandler::initialize() { } void PCDUHandler::initializeSwitchStates() { - using namespace pcduSwitches; - for (uint8_t idx = 0; idx < Switches::NUMBER_OF_SWITCHES; idx++) { - switchStates[idx] = INIT_SWITCH_STATES[idx]; + using namespace pcdu; + for (uint8_t idx = 0; idx < NUMBER_OF_SWITCHES; idx++) { + if (idx < PDU::CHANNELS_LEN) { + switchStates[idx] = INIT_SWITCHES_PDU1[idx]; + } else { + switchStates[idx] = INIT_SWITCHES_PDU2[idx]; + } } } @@ -103,11 +108,12 @@ void PCDUHandler::readCommandQueue() { MessageQueueId_t PCDUHandler::getCommandQueue() const { return commandQueue->getId(); } void PCDUHandler::handleChangedDataset(sid_t sid, store_address_t storeId, bool* clearMessage) { - if (sid == sid_t(objects::PDU2_HANDLER, static_cast(P60System::SetIds::PDU_2))) { - updateHkTableDataset(storeId, &pdu2HkTableDataset, &timeStampPdu2HkDataset); + if (sid == sid_t(objects::PDU2_HANDLER, static_cast(P60System::SetIds::PDU_2_CORE))) { + updateHkTableDataset(storeId, &pdu2CoreHk, &timeStampPdu2HkDataset); updatePdu2SwitchStates(); - } else if (sid == sid_t(objects::PDU1_HANDLER, static_cast(P60System::SetIds::PDU_1))) { - updateHkTableDataset(storeId, &pdu1HkTableDataset, &timeStampPdu1HkDataset); + } else if (sid == + sid_t(objects::PDU1_HANDLER, static_cast(P60System::SetIds::PDU_1_CORE))) { + updateHkTableDataset(storeId, &pdu1CoreHk, &timeStampPdu1HkDataset); updatePdu1SwitchStates(); } else { sif::error << "PCDUHandler::handleChangedDataset: Invalid sid" << std::endl; @@ -143,29 +149,33 @@ void PCDUHandler::updateHkTableDataset(store_address_t storeId, LocalPoolDataSet } void PCDUHandler::updatePdu2SwitchStates() { - using namespace pcduSwitches; + using namespace pcdu; + using namespace PDU2; GOMSPACE::Pdu pdu = GOMSPACE::Pdu::PDU2; - PoolReadGuard rg(&pdu2HkTableDataset); - if (rg.getReadResult() == RETURN_OK) { + PoolReadGuard rg0(&switcherSet); + PoolReadGuard rg1(&pdu2CoreHk); + if (rg0.getReadResult() == RETURN_OK and rg1.getReadResult() == RETURN_OK) { + for (uint8_t idx = 0; idx < PDU::CHANNELS_LEN; idx++) { + switcherSet.pdu2Switches[idx] = pdu2CoreHk.outputEnables[idx]; + } MutexGuard mg(pwrMutex); - checkAndUpdateSwitch(pdu, Switches::PDU2_CH0_Q7S, pdu2HkTableDataset.outEnabledQ7S.value); + checkAndUpdateSwitch(pdu, Switches::PDU2_CH0_Q7S, pdu2CoreHk.outputEnables[Channels::Q7S]); checkAndUpdateSwitch(pdu, Switches::PDU2_CH1_PL_PCDU_BATT_0_14V8, - pdu2HkTableDataset.outEnabledPlPCDUCh1.value); - checkAndUpdateSwitch(pdu, Switches::PDU2_CH2_RW_5V, - pdu2HkTableDataset.outEnabledReactionWheels.value); + pdu2CoreHk.outputEnables[Channels::PAYLOAD_PCDU_CH1]); + checkAndUpdateSwitch(pdu, Switches::PDU2_CH2_RW_5V, pdu2CoreHk.outputEnables[Channels::RW]); checkAndUpdateSwitch(pdu, Switches::PDU2_CH3_TCS_BOARD_HEATER_IN_8V, - pdu2HkTableDataset.outEnabledTCSBoardHeaterIn.value); + pdu2CoreHk.outputEnables[Channels::TCS_HEATER_IN]); checkAndUpdateSwitch(pdu, Switches::PDU2_CH4_SUS_REDUNDANT_3V3, - pdu2HkTableDataset.outEnabledSUSRedundant.value); + pdu2CoreHk.outputEnables[Channels::SUS_REDUNDANT]); checkAndUpdateSwitch(pdu, Switches::PDU2_CH5_DEPLOYMENT_MECHANISM_8V, - pdu2HkTableDataset.outEnabledDeplMechanism.value); + pdu2CoreHk.outputEnables[Channels::DEPY_MECHANISM]); checkAndUpdateSwitch(pdu, Switches::PDU2_CH6_PL_PCDU_BATT_1_14V8, - pdu2HkTableDataset.outEnabledPlPCDUCh6.value); + pdu2CoreHk.outputEnables[Channels::PAYLOAD_PCDU_CH6]); checkAndUpdateSwitch(pdu, Switches::PDU2_CH7_ACS_BOARD_SIDE_B_3V3, - pdu2HkTableDataset.outEnabledAcsBoardSideB.value); + pdu2CoreHk.outputEnables[Channels::ACS_B_SIDE]); checkAndUpdateSwitch(pdu, Switches::PDU2_CH8_PAYLOAD_CAMERA, - pdu2HkTableDataset.outEnabledPayloadCamera.value); + pdu2CoreHk.outputEnables[Channels::PAYLOAD_CAMERA]); if (firstSwitchInfoPdu2) { firstSwitchInfoPdu2 = false; } @@ -176,27 +186,33 @@ void PCDUHandler::updatePdu2SwitchStates() { } void PCDUHandler::updatePdu1SwitchStates() { - using namespace pcduSwitches; - PoolReadGuard rg(&pdu1HkTableDataset); + using namespace pcdu; + using namespace PDU1; + PoolReadGuard rg0(&switcherSet); + PoolReadGuard rg1(&pdu1CoreHk); GOMSPACE::Pdu pdu = GOMSPACE::Pdu::PDU1; - if (rg.getReadResult() == RETURN_OK) { + if (rg0.getReadResult() == RETURN_OK and rg1.getReadResult() == RETURN_OK) { + for (uint8_t idx = 0; idx < PDU::CHANNELS_LEN; idx++) { + switcherSet.pdu1Switches[idx] = pdu1CoreHk.outputEnables[idx]; + } MutexGuard mg(pwrMutex); checkAndUpdateSwitch(pdu, Switches::PDU1_CH0_TCS_BOARD_3V3, - pdu1HkTableDataset.outEnabledTCSBoard3V3.value); + pdu1CoreHk.outputEnables[Channels::TCS_BOARD_3V3]); checkAndUpdateSwitch(pdu, Switches::PDU1_CH1_SYRLINKS_12V, - pdu1HkTableDataset.outEnabledSyrlinks.value); + pdu1CoreHk.outputEnables[Channels::SYRLINKS]); checkAndUpdateSwitch(pdu, Switches::PDU1_CH2_STAR_TRACKER_5V, - pdu1HkTableDataset.outEnabledStarTracker.value); - checkAndUpdateSwitch(pdu, Switches::PDU1_CH3_MGT_5V, pdu1HkTableDataset.outEnabledMGT.value); + pdu1CoreHk.outputEnables[Channels::STR]); + checkAndUpdateSwitch(pdu, Switches::PDU1_CH3_MGT_5V, pdu1CoreHk.outputEnables[Channels::MGT]); checkAndUpdateSwitch(pdu, Switches::PDU1_CH4_SUS_NOMINAL_3V3, - pdu1HkTableDataset.outEnabledSUSNominal.value); + pdu1CoreHk.outputEnables[Channels::SUS_NOMINAL]); checkAndUpdateSwitch(pdu, Switches::PDU1_CH5_SOLAR_CELL_EXP_5V, - pdu1HkTableDataset.outEnabledSolarCellExp.value); - checkAndUpdateSwitch(pdu, Switches::PDU1_CH6_PLOC_12V, pdu1HkTableDataset.outEnabledPLOC.value); + pdu1CoreHk.outputEnables[Channels::SOL_CELL_EXPERIMENT]); + checkAndUpdateSwitch(pdu, Switches::PDU1_CH6_PLOC_12V, + pdu1CoreHk.outputEnables[Channels::PLOC]); checkAndUpdateSwitch(pdu, Switches::PDU1_CH7_ACS_A_SIDE_3V3, - pdu1HkTableDataset.outEnabledAcsBoardSideA.value); + pdu1CoreHk.outputEnables[Channels::ACS_A_SIDE]); checkAndUpdateSwitch(pdu, Switches::PDU1_CH8_UNOCCUPIED, - pdu1HkTableDataset.outEnabledChannel8.value); + pdu1CoreHk.outputEnables[Channels::UNUSED]); if (firstSwitchInfoPdu1) { firstSwitchInfoPdu1 = false; } @@ -208,7 +224,7 @@ void PCDUHandler::updatePdu1SwitchStates() { LocalDataPoolManager* PCDUHandler::getHkManagerHandle() { return &poolManager; } ReturnValue_t PCDUHandler::sendSwitchCommand(uint8_t switchNr, ReturnValue_t onOff) { - using namespace pcduSwitches; + using namespace pcdu; ReturnValue_t result; uint16_t memoryAddress = 0; size_t parameterValueSize = sizeof(uint8_t); @@ -216,94 +232,94 @@ ReturnValue_t PCDUHandler::sendSwitchCommand(uint8_t switchNr, ReturnValue_t onO GomspaceDeviceHandler* pdu = nullptr; switch (switchNr) { - case pcduSwitches::PDU1_CH0_TCS_BOARD_3V3: { + case pcdu::PDU1_CH0_TCS_BOARD_3V3: { memoryAddress = PDU1::CONFIG_ADDRESS_OUT_EN_TCS_BOARD_3V3; pdu = ObjectManager::instance()->get(objects::PDU1_HANDLER); break; } - case pcduSwitches::PDU1_CH1_SYRLINKS_12V: { + case pcdu::PDU1_CH1_SYRLINKS_12V: { memoryAddress = PDU1::CONFIG_ADDRESS_OUT_EN_SYRLINKS; pdu = ObjectManager::instance()->get(objects::PDU1_HANDLER); break; } - case pcduSwitches::PDU1_CH2_STAR_TRACKER_5V: { + case pcdu::PDU1_CH2_STAR_TRACKER_5V: { memoryAddress = PDU1::CONFIG_ADDRESS_OUT_EN_STAR_TRACKER; pdu = ObjectManager::instance()->get(objects::PDU1_HANDLER); break; } - case pcduSwitches::PDU1_CH3_MGT_5V: { + case pcdu::PDU1_CH3_MGT_5V: { memoryAddress = PDU1::CONFIG_ADDRESS_OUT_EN_MGT; pdu = ObjectManager::instance()->get(objects::PDU1_HANDLER); break; } - case pcduSwitches::PDU1_CH4_SUS_NOMINAL_3V3: { + case pcdu::PDU1_CH4_SUS_NOMINAL_3V3: { memoryAddress = PDU1::CONFIG_ADDRESS_OUT_EN_SUS_NOMINAL; pdu = ObjectManager::instance()->get(objects::PDU1_HANDLER); break; } - case pcduSwitches::PDU1_CH5_SOLAR_CELL_EXP_5V: { + case pcdu::PDU1_CH5_SOLAR_CELL_EXP_5V: { memoryAddress = PDU1::CONFIG_ADDRESS_OUT_EN_SOLAR_CELL_EXP; pdu = ObjectManager::instance()->get(objects::PDU1_HANDLER); break; } - case pcduSwitches::PDU1_CH6_PLOC_12V: { + case pcdu::PDU1_CH6_PLOC_12V: { memoryAddress = PDU1::CONFIG_ADDRESS_OUT_EN_PLOC; pdu = ObjectManager::instance()->get(objects::PDU1_HANDLER); break; } - case pcduSwitches::PDU1_CH7_ACS_A_SIDE_3V3: { + case pcdu::PDU1_CH7_ACS_A_SIDE_3V3: { memoryAddress = PDU1::CONFIG_ADDRESS_OUT_EN_ACS_BOARD_SIDE_A; pdu = ObjectManager::instance()->get(objects::PDU1_HANDLER); break; } - case pcduSwitches::PDU1_CH8_UNOCCUPIED: { + case pcdu::PDU1_CH8_UNOCCUPIED: { memoryAddress = PDU1::CONFIG_ADDRESS_OUT_EN_CHANNEL8; pdu = ObjectManager::instance()->get(objects::PDU1_HANDLER); break; } // This is a dangerous command. Reject/Igore it for now - case pcduSwitches::PDU2_CH0_Q7S: { + case pcdu::PDU2_CH0_Q7S: { return RETURN_FAILED; // memoryAddress = PDU2::CONFIG_ADDRESS_OUT_EN_Q7S; // pdu = ObjectManager::instance()->get(objects::PDU2_HANDLER); // break; } - case pcduSwitches::PDU2_CH1_PL_PCDU_BATT_0_14V8: { + case pcdu::PDU2_CH1_PL_PCDU_BATT_0_14V8: { memoryAddress = PDU2::CONFIG_ADDRESS_OUT_EN_PAYLOAD_PCDU_CH1; pdu = ObjectManager::instance()->get(objects::PDU2_HANDLER); break; } - case pcduSwitches::PDU2_CH2_RW_5V: { + case pcdu::PDU2_CH2_RW_5V: { memoryAddress = PDU2::CONFIG_ADDRESS_OUT_EN_RW; pdu = ObjectManager::instance()->get(objects::PDU2_HANDLER); break; } - case pcduSwitches::PDU2_CH3_TCS_BOARD_HEATER_IN_8V: { + case pcdu::PDU2_CH3_TCS_BOARD_HEATER_IN_8V: { memoryAddress = PDU2::CONFIG_ADDRESS_OUT_EN_TCS_BOARD_HEATER_IN; pdu = ObjectManager::instance()->get(objects::PDU2_HANDLER); break; } - case pcduSwitches::PDU2_CH4_SUS_REDUNDANT_3V3: { + case pcdu::PDU2_CH4_SUS_REDUNDANT_3V3: { memoryAddress = PDU2::CONFIG_ADDRESS_OUT_EN_SUS_REDUNDANT; pdu = ObjectManager::instance()->get(objects::PDU2_HANDLER); break; } - case pcduSwitches::PDU2_CH5_DEPLOYMENT_MECHANISM_8V: { + case pcdu::PDU2_CH5_DEPLOYMENT_MECHANISM_8V: { memoryAddress = PDU2::CONFIG_ADDRESS_OUT_EN_DEPLOYMENT_MECHANISM; pdu = ObjectManager::instance()->get(objects::PDU2_HANDLER); break; } - case pcduSwitches::PDU2_CH6_PL_PCDU_BATT_1_14V8: { + case pcdu::PDU2_CH6_PL_PCDU_BATT_1_14V8: { memoryAddress = PDU2::CONFIG_ADDRESS_OUT_EN_PAYLOAD_PCDU_CH6; pdu = ObjectManager::instance()->get(objects::PDU2_HANDLER); break; } - case pcduSwitches::PDU2_CH7_ACS_BOARD_SIDE_B_3V3: { + case pcdu::PDU2_CH7_ACS_BOARD_SIDE_B_3V3: { memoryAddress = PDU2::CONFIG_ADDRESS_OUT_EN_ACS_BOARD_SIDE_B; pdu = ObjectManager::instance()->get(objects::PDU2_HANDLER); break; } - case pcduSwitches::PDU2_CH8_PAYLOAD_CAMERA: { + case pcdu::PDU2_CH8_PAYLOAD_CAMERA: { memoryAddress = PDU2::CONFIG_ADDRESS_OUT_EN_PAYLOAD_CAMERA; pdu = ObjectManager::instance()->get(objects::PDU2_HANDLER); break; @@ -355,7 +371,7 @@ ReturnValue_t PCDUHandler::sendSwitchCommand(uint8_t switchNr, ReturnValue_t onO ReturnValue_t PCDUHandler::sendFuseOnCommand(uint8_t fuseNr) { return RETURN_OK; } ReturnValue_t PCDUHandler::getSwitchState(uint8_t switchNr) const { - if (switchNr >= pcduSwitches::NUMBER_OF_SWITCHES) { + if (switchNr >= pcdu::NUMBER_OF_SWITCHES) { sif::debug << "PCDUHandler::getSwitchState: Invalid switch number" << std::endl; return RETURN_FAILED; } @@ -377,212 +393,10 @@ object_id_t PCDUHandler::getObjectId() const { return SystemObject::getObjectId( ReturnValue_t PCDUHandler::initializeLocalDataPool(localpool::DataPool& localDataPoolMap, LocalDataPoolManager& poolManager) { - using namespace pcduSwitches; - using namespace P60System; - localDataPoolMap.emplace(pool::PDU2_CURRENT_OUT_Q7S, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU2_CURRENT_OUT_PAYLOAD_PCDU_CH1, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU2_CURRENT_OUT_RW, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU2_CURRENT_OUT_TCS_BOARD_HEATER_IN, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU2_CURRENT_OUT_SUS_REDUNDANT, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU2_CURRENT_OUT_DEPLOYMENT_MECHANISM, - new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU2_CURRENT_OUT_PAYLOAD_PCDU_CH6, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU2_CURRENT_OUT_ACS_BOARD_SIDE_B, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU2_CURRENT_OUT_PAYLOAD_CAMERA, new PoolEntry({0})); - - localDataPoolMap.emplace(pool::PDU2_VOLTAGE_OUT_Q7S, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU2_VOLTAGE_OUT_PAYLOAD_PCDU_CH1, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU2_VOLTAGE_OUT_RW, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU2_VOLTAGE_OUT_TCS_BOARD_HEATER_IN, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU2_VOLTAGE_OUT_SUS_REDUNDANT, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU2_VOLTAGE_OUT_DEPLOYMENT_MECHANISM, - new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU2_VOLTAGE_OUT_PAYLOAD_PCDU_CH6, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU2_VOLTAGE_OUT_ACS_BOARD_SIDE_B, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU2_VOLTAGE_OUT_PAYLOAD_CAMERA, new PoolEntry({0})); - - localDataPoolMap.emplace(pool::PDU2_VCC, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU2_VBAT, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU2_TEMPERATURE, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU2_CONV_EN_1, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU2_CONV_EN_2, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU2_CONV_EN_3, new PoolEntry({0})); - - localDataPoolMap.emplace(pool::PDU2_OUT_EN_Q7S, - new PoolEntry({INIT_SWITCH_STATES[Switches::PDU2_CH0_Q7S]})); - localDataPoolMap.emplace( - pool::PDU2_OUT_EN_PAYLOAD_PCDU_CH1, - new PoolEntry({INIT_SWITCH_STATES[Switches::PDU2_CH1_PL_PCDU_BATT_0_14V8]})); - localDataPoolMap.emplace(pool::PDU2_OUT_EN_RW, - new PoolEntry({INIT_SWITCH_STATES[Switches::PDU2_CH2_RW_5V]})); -#ifdef TE0720_1CFA - localDataPoolMap.emplace(pool::PDU2_OUT_EN_TCS_BOARD_HEATER_IN, new PoolEntry({1})); -#else - localDataPoolMap.emplace( - pool::PDU2_OUT_EN_TCS_BOARD_HEATER_IN, - new PoolEntry({INIT_SWITCH_STATES[Switches::PDU2_CH3_TCS_BOARD_HEATER_IN_8V]})); -#endif - localDataPoolMap.emplace( - pool::PDU2_OUT_EN_SUS_REDUNDANT, - new PoolEntry({INIT_SWITCH_STATES[Switches::PDU2_CH4_SUS_REDUNDANT_3V3]})); - localDataPoolMap.emplace( - pool::PDU2_OUT_EN_DEPLOYMENT_MECHANISM, - new PoolEntry({INIT_SWITCH_STATES[Switches::PDU2_CH5_DEPLOYMENT_MECHANISM_8V]})); - localDataPoolMap.emplace( - pool::PDU2_OUT_EN_PAYLOAD_PCDU_CH6, - new PoolEntry({INIT_SWITCH_STATES[Switches::PDU2_CH6_PL_PCDU_BATT_1_14V8]})); - localDataPoolMap.emplace( - pool::PDU2_OUT_EN_ACS_BOARD_SIDE_B, - new PoolEntry({INIT_SWITCH_STATES[Switches::PDU2_CH7_ACS_BOARD_SIDE_B_3V3]})); - localDataPoolMap.emplace( - pool::PDU2_OUT_EN_PAYLOAD_CAMERA, - new PoolEntry({INIT_SWITCH_STATES[Switches::PDU2_CH8_PAYLOAD_CAMERA]})); - - localDataPoolMap.emplace(pool::PDU2_BOOTCAUSE, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU2_BOOTCNT, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU2_UPTIME, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU2_RESETCAUSE, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU2_BATT_MODE, new PoolEntry({0})); - - localDataPoolMap.emplace(pool::PDU2_LATCHUP_Q7S, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU2_LATCHUP_PAYLOAD_PCDU_CH1, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU2_LATCHUP_RW, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU2_LATCHUP_TCS_BOARD_HEATER_IN, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU2_LATCHUP_TCS_BOARD_HEATER_IN, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU2_LATCHUP_SUS_REDUNDANT, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU2_LATCHUP_DEPLOYMENT_MECHANISM, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU2_LATCHUP_PAYLOAD_PCDU_CH6, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU2_LATCHUP_ACS_BOARD_SIDE_B, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU2_LATCHUP_PAYLOAD_CAMERA, new PoolEntry({0})); - - localDataPoolMap.emplace(pool::PDU2_DEVICE_0, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU2_DEVICE_1, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU2_DEVICE_2, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU2_DEVICE_3, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU2_DEVICE_4, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU2_DEVICE_5, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU2_DEVICE_6, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU2_DEVICE_7, new PoolEntry({0})); - - localDataPoolMap.emplace(pool::PDU2_DEVICE_0_STATUS, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU2_DEVICE_1_STATUS, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU2_DEVICE_2_STATUS, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU2_DEVICE_3_STATUS, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU2_DEVICE_4_STATUS, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU2_DEVICE_5_STATUS, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU2_DEVICE_6_STATUS, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU2_DEVICE_7_STATUS, new PoolEntry({0})); - - localDataPoolMap.emplace(pool::PDU2_WDT_CNT_GND, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU2_WDT_CNT_I2C, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU2_WDT_CNT_CAN, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU2_WDT_CNT_CSP1, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU2_WDT_CNT_CSP2, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU2_WDT_GND_LEFT, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU2_WDT_I2C_LEFT, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU2_WDT_CAN_LEFT, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU2_WDT_CSP_LEFT1, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU2_WDT_CSP_LEFT2, new PoolEntry({0})); - - localDataPoolMap.emplace(pool::PDU1_CURRENT_OUT_TCS_BOARD_3V3, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU1_CURRENT_OUT_SYRLINKS, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU1_CURRENT_OUT_STAR_TRACKER, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU1_CURRENT_OUT_MGT, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU1_CURRENT_OUT_SUS_NOMINAL, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU1_CURRENT_OUT_SOLAR_CELL_EXP, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU1_CURRENT_OUT_PLOC, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU1_CURRENT_OUT_ACS_BOARD_SIDE_A, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU1_CURRENT_OUT_CHANNEL8, new PoolEntry({0})); - - localDataPoolMap.emplace( - pool::PDU1_VOLTAGE_OUT_TCS_BOARD_3V3, - new PoolEntry({INIT_SWITCH_STATES[Switches::PDU1_CH0_TCS_BOARD_3V3]})); - localDataPoolMap.emplace( - pool::PDU1_VOLTAGE_OUT_SYRLINKS, - new PoolEntry({INIT_SWITCH_STATES[Switches::PDU1_CH1_SYRLINKS_12V]})); - localDataPoolMap.emplace( - pool::PDU1_VOLTAGE_OUT_STAR_TRACKER, - new PoolEntry({INIT_SWITCH_STATES[Switches::PDU1_CH2_STAR_TRACKER_5V]})); - localDataPoolMap.emplace(pool::PDU1_VOLTAGE_OUT_MGT, - new PoolEntry({INIT_SWITCH_STATES[Switches::PDU1_CH3_MGT_5V]})); - localDataPoolMap.emplace( - pool::PDU1_VOLTAGE_OUT_SUS_NOMINAL, - new PoolEntry({INIT_SWITCH_STATES[Switches::PDU1_CH4_SUS_NOMINAL_3V3]})); - localDataPoolMap.emplace( - pool::PDU1_VOLTAGE_OUT_SOLAR_CELL_EXP, - new PoolEntry({INIT_SWITCH_STATES[Switches::PDU1_CH5_SOLAR_CELL_EXP_5V]})); - localDataPoolMap.emplace( - pool::PDU1_VOLTAGE_OUT_PLOC, - new PoolEntry({INIT_SWITCH_STATES[Switches::PDU1_CH6_PLOC_12V]})); - localDataPoolMap.emplace( - pool::PDU1_VOLTAGE_OUT_ACS_BOARD_SIDE_A, - new PoolEntry({INIT_SWITCH_STATES[Switches::PDU1_CH7_ACS_A_SIDE_3V3]})); - localDataPoolMap.emplace( - pool::PDU1_VOLTAGE_OUT_CHANNEL8, - new PoolEntry({INIT_SWITCH_STATES[Switches::PDU1_CH8_UNOCCUPIED]})); - - localDataPoolMap.emplace(pool::PDU1_VCC, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU1_VBAT, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU1_TEMPERATURE, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU1_CONV_EN_1, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU1_CONV_EN_2, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU1_CONV_EN_3, new PoolEntry({0})); - - localDataPoolMap.emplace(pool::PDU1_OUT_EN_TCS_BOARD_3V3, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU1_OUT_EN_SYRLINKS, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU1_OUT_EN_STAR_TRACKER, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU1_OUT_EN_MGT, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU1_OUT_EN_SUS_NOMINAL, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU1_OUT_EN_SOLAR_CELL_EXP, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU1_OUT_EN_PLOC, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU1_OUT_EN_ACS_BOARD_SIDE_A, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU1_OUT_EN_CHANNEL8, new PoolEntry({0})); - - localDataPoolMap.emplace(pool::PDU1_BOOTCAUSE, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU1_BOOTCNT, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU1_UPTIME, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU1_RESETCAUSE, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU1_BATT_MODE, new PoolEntry({0})); - - localDataPoolMap.emplace(pool::PDU1_LATCHUP_TCS_BOARD_3V3, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU1_LATCHUP_SYRLINKS, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU1_LATCHUP_STAR_TRACKER, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU1_LATCHUP_MGT, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU1_LATCHUP_SUS_NOMINAL, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU1_LATCHUP_SOLAR_CELL_EXP, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU1_LATCHUP_PLOC, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU1_LATCHUP_ACS_BOARD_SIDE_A, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU1_LATCHUP_CHANNEL8, new PoolEntry({0})); - - localDataPoolMap.emplace(pool::PDU1_DEVICE_0, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU1_DEVICE_1, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU1_DEVICE_2, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU1_DEVICE_3, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU1_DEVICE_4, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU1_DEVICE_5, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU1_DEVICE_6, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU1_DEVICE_7, new PoolEntry({0})); - - localDataPoolMap.emplace(pool::PDU1_DEVICE_0_STATUS, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU1_DEVICE_1_STATUS, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU1_DEVICE_2_STATUS, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU1_DEVICE_3_STATUS, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU1_DEVICE_4_STATUS, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU1_DEVICE_5_STATUS, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU1_DEVICE_6_STATUS, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU1_DEVICE_7_STATUS, new PoolEntry({0})); - - localDataPoolMap.emplace(pool::PDU1_WDT_CNT_GND, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU1_WDT_CNT_I2C, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU1_WDT_CNT_CAN, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU1_WDT_CNT_CSP1, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU1_WDT_CNT_CSP2, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU1_WDT_GND_LEFT, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU1_WDT_I2C_LEFT, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU1_WDT_CAN_LEFT, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU1_WDT_CSP_LEFT1, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU1_WDT_CSP_LEFT2, new PoolEntry({0})); - + using namespace pcdu; + localDataPoolMap.emplace(PoolIds::PDU1_SWITCHES, &pdu1Switches); + localDataPoolMap.emplace(PoolIds::PDU1_SWITCHES, &pdu2Switches); + poolManager.subscribeForPeriodicPacket(switcherSet.getSid(), false, 5.0, true); return HasReturnvaluesIF::RETURN_OK; } @@ -602,17 +416,17 @@ uint32_t PCDUHandler::getPeriodicOperationFrequency() const { return pstInterval void PCDUHandler::setTaskIF(PeriodicTaskIF* task) { executingTask = task; } LocalPoolDataSetBase* PCDUHandler::getDataSetHandle(sid_t sid) { - if (sid == pdu2HkTableDataset.getSid()) { - return &pdu2HkTableDataset; + if (sid == switcherSet.getSid()) { + return &switcherSet; } else { sif::error << "PCDUHandler::getDataSetHandle: Invalid sid" << std::endl; return nullptr; } } -void PCDUHandler::checkAndUpdateSwitch(GOMSPACE::Pdu pdu, pcduSwitches::Switches switchIdx, +void PCDUHandler::checkAndUpdateSwitch(GOMSPACE::Pdu pdu, pcdu::Switches switchIdx, uint8_t setValue) { - using namespace pcduSwitches; + using namespace pcdu; if (switchStates[switchIdx] != setValue) { #if OBSW_INITIALIZE_SWITCHES == 1 // This code initializes the switches to the default init switch states on every reboot. diff --git a/mission/devices/PCDUHandler.h b/mission/devices/PCDUHandler.h index c44052bb..8f589751 100644 --- a/mission/devices/PCDUHandler.h +++ b/mission/devices/PCDUHandler.h @@ -2,6 +2,7 @@ #define MISSION_DEVICES_PCDUHANDLER_H_ #include +#include #include #include #include @@ -56,21 +57,29 @@ class PCDUHandler : public PowerSwitchIF, /** Housekeeping manager. Handles updates of local pool variables. */ LocalDataPoolManager poolManager; + /** Hk table dataset of PDU1 */ + PDU1::Pdu1CoreHk pdu1CoreHk; /** * The dataset holding the hk table of PDU2. This dataset is a copy of the PDU2 HK dataset * of the PDU2Handler. Each time the PDU2Handler updates his HK dataset, a copy is sent * to this object via a HousekeepingMessage. */ - PDU2::PDU2HkTableDataset pdu2HkTableDataset; + PDU2::Pdu2CoreHk pdu2CoreHk; + + pcdu::SwitcherStates switcherSet; + + PoolEntry pdu1Switches = + PoolEntry(pcdu::INIT_SWITCHES_PDU1.data(), pcdu::INIT_SWITCHES_PDU1.size()); + PoolEntry pdu2Switches = + PoolEntry(pcdu::INIT_SWITCHES_PDU2.data(), pcdu::INIT_SWITCHES_PDU2.size()); + /** The timeStamp of the current pdu2HkTableDataset */ CCSDSTime::CDS_short timeStampPdu2HkDataset; - /** Hk table dataset of PDU1 */ - PDU1::PDU1HkTableDataset pdu1HkTableDataset; /** The timeStamp of the current pdu1HkTableDataset */ CCSDSTime::CDS_short timeStampPdu1HkDataset; - uint8_t switchStates[pcduSwitches::NUMBER_OF_SWITCHES]; + uint8_t switchStates[pcdu::NUMBER_OF_SWITCHES]; /** * Pointer to the IPCStore. * This caches the pointer received from the objectManager in the constructor. @@ -119,7 +128,7 @@ class PCDUHandler : public PowerSwitchIF, */ void updateHkTableDataset(store_address_t storeId, LocalPoolDataSetBase* dataset, CCSDSTime::CDS_short* datasetTimeStamp); - void checkAndUpdateSwitch(GOMSPACE::Pdu pdu, pcduSwitches::Switches switchIdx, uint8_t setValue); + void checkAndUpdateSwitch(GOMSPACE::Pdu pdu, pcdu::Switches switchIdx, uint8_t setValue); }; #endif /* MISSION_DEVICES_PCDUHANDLER_H_ */ diff --git a/mission/devices/PDU1Handler.cpp b/mission/devices/PDU1Handler.cpp index be26d984..0f7bbfe1 100644 --- a/mission/devices/PDU1Handler.cpp +++ b/mission/devices/PDU1Handler.cpp @@ -3,12 +3,13 @@ #include #include -#include "OBSWConfig.h" +#include "devices/powerSwitcherList.h" PDU1Handler::PDU1Handler(object_id_t objectId, object_id_t comIF, CookieIF *comCookie) : GomspaceDeviceHandler(objectId, comIF, comCookie, PDU::MAX_CONFIGTABLE_ADDRESS, PDU::MAX_HKTABLE_ADDRESS, PDU::HK_TABLE_REPLY_SIZE), - pdu1HkTableDataset(this) {} + coreHk(this), + auxHk(this) {} PDU1Handler::~PDU1Handler() {} @@ -19,52 +20,7 @@ ReturnValue_t PDU1Handler::buildNormalDeviceCommand(DeviceCommandId_t *id) { void PDU1Handler::letChildHandleHkReply(DeviceCommandId_t id, const uint8_t *packet) { parseHkTableReply(packet); - handleDeviceTM(&pdu1HkTableDataset, id, true); - -#if OBSW_VERBOSE_LEVEL >= 1 && OBSW_DEBUG_PDU1 == 1 - pdu1HkTableDataset.read(); - sif::info << "PDU1 TCS Board voltage: " << pdu1HkTableDataset.voltageOutTCSBoard3V3 << std::endl; - sif::info << "PDU1 Syrlinks voltage: " << pdu1HkTableDataset.voltageOutSyrlinks << std::endl; - sif::info << "PDU1 star tracker voltage: " << pdu1HkTableDataset.voltageOutStarTracker - << std::endl; - sif::info << "PDU1 MGT voltage: " << pdu1HkTableDataset.voltageOutMGT << std::endl; - sif::info << "PDU1 SUS nominal voltage: " << pdu1HkTableDataset.voltageOutSUSNominal << std::endl; - sif::info << "PDU1 solar cell experiment voltage: " << pdu1HkTableDataset.voltageOutSolarCellExp - << std::endl; - sif::info << "PDU1 PLOC voltage: " << pdu1HkTableDataset.voltageOutPLOC << std::endl; - sif::info << "PDU1 ACS Side A voltage: " << pdu1HkTableDataset.voltageOutACSBoardSideA - << std::endl; - sif::info << "PDU1 channel 8 voltage: " << pdu1HkTableDataset.voltageOutACSBoardSideA - << std::endl; - - sif::info << "PDU1 TCS Board current: " << pdu1HkTableDataset.currentOutTCSBoard3V3 << std::endl; - sif::info << "PDU1 Syrlinks current: " << pdu1HkTableDataset.currentOutSyrlinks << std::endl; - sif::info << "PDU1 star tracker current: " << pdu1HkTableDataset.currentOutStarTracker - << std::endl; - sif::info << "PDU1 MGT current: " << pdu1HkTableDataset.currentOutMGT << std::endl; - sif::info << "PDU1 SUS nominal current: " << pdu1HkTableDataset.currentOutSUSNominal << std::endl; - sif::info << "PDU1 solar cell experiment current: " << pdu1HkTableDataset.currentOutSolarCellExp - << std::endl; - sif::info << "PDU1 PLOC current: " << pdu1HkTableDataset.currentOutPLOC << std::endl; - sif::info << "PDU1 ACS Side A current: " << pdu1HkTableDataset.currentOutACSBoardSideA - << std::endl; - sif::info << "PDU1 channel 8 current: " << pdu1HkTableDataset.currentOutChannel8 << std::endl; - printOutputSwitchStates(); - sif::info << "PDU1 battery mode: " << static_cast(pdu1HkTableDataset.battMode.value) - << std::endl; - sif::info << "PDU1 VCC: " << pdu1HkTableDataset.vcc << " mV" << std::endl; - float vbat = pdu1HkTableDataset.vbat.value * 0.001; - sif::info << "PDU1 VBAT: " << vbat << "V" << std::endl; - float temperatureC = pdu1HkTableDataset.temperature.value * 0.1; - sif::info << "PDU1 Temperature: " << temperatureC << " °C" << std::endl; - sif::info << "PDU1 csp1 watchdog pings before reboot: " - << static_cast(pdu1HkTableDataset.csp1WatchdogPingsLeft.value) - << std::endl; - sif::info << "PDU1 csp2 watchdog pings before reboot: " - << static_cast(pdu1HkTableDataset.csp2WatchdogPingsLeft.value) - << std::endl; - pdu1HkTableDataset.commit(); -#endif + handleDeviceTM(&coreHk, id, true); } void PDU1Handler::assignChannelHookFunction(GOMSPACE::ChannelSwitchHook hook, void *args) { @@ -123,315 +79,22 @@ ReturnValue_t PDU1Handler::setParamCallback(SetParamMessageUnpacker &unpacker, } void PDU1Handler::parseHkTableReply(const uint8_t *packet) { - uint16_t dataOffset = 0; - PoolReadGuard pg(&pdu1HkTableDataset); - ReturnValue_t readResult = pg.getReadResult(); - if (readResult != HasReturnvaluesIF::RETURN_OK) { - sif::warning << "Reading PDU1 HK table failed!" << std::endl; - return; - } - /* Fist 10 bytes contain the gomspace header. Each variable is preceded by the 16-bit table - * address. */ - dataOffset += 12; - pdu1HkTableDataset.currentOutTCSBoard3V3 = - *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - pdu1HkTableDataset.currentOutSyrlinks = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - pdu1HkTableDataset.currentOutStarTracker = - *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - pdu1HkTableDataset.currentOutMGT = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - pdu1HkTableDataset.currentOutSUSNominal = - *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - pdu1HkTableDataset.currentOutSolarCellExp = - *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - pdu1HkTableDataset.currentOutPLOC = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - pdu1HkTableDataset.currentOutACSBoardSideA = - *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - pdu1HkTableDataset.currentOutChannel8 = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - - pdu1HkTableDataset.voltageOutTCSBoard3V3 = - *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - pdu1HkTableDataset.voltageOutSyrlinks = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - pdu1HkTableDataset.voltageOutStarTracker = - *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - pdu1HkTableDataset.voltageOutMGT = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - pdu1HkTableDataset.voltageOutSUSNominal = - *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - pdu1HkTableDataset.voltageOutSolarCellExp = - *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - pdu1HkTableDataset.voltageOutPLOC = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - pdu1HkTableDataset.voltageOutACSBoardSideA = - *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - pdu1HkTableDataset.voltageOutChannel8 = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - - pdu1HkTableDataset.vcc = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - pdu1HkTableDataset.vbat = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - pdu1HkTableDataset.temperature = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - - pdu1HkTableDataset.converterEnable1 = *(packet + dataOffset); - dataOffset += 3; - pdu1HkTableDataset.converterEnable2 = *(packet + dataOffset); - dataOffset += 3; - pdu1HkTableDataset.converterEnable3 = *(packet + dataOffset); - dataOffset += 3; - - pdu1HkTableDataset.outEnabledTCSBoard3V3 = *(packet + dataOffset); - dataOffset += 3; - pdu1HkTableDataset.outEnabledSyrlinks = *(packet + dataOffset); - dataOffset += 3; - pdu1HkTableDataset.outEnabledStarTracker = *(packet + dataOffset); - dataOffset += 3; - pdu1HkTableDataset.outEnabledMGT = *(packet + dataOffset); - dataOffset += 3; - pdu1HkTableDataset.outEnabledSUSNominal = *(packet + dataOffset); - dataOffset += 3; - pdu1HkTableDataset.outEnabledSolarCellExp = *(packet + dataOffset); - dataOffset += 3; - pdu1HkTableDataset.outEnabledPLOC = *(packet + dataOffset); - dataOffset += 3; - pdu1HkTableDataset.outEnabledAcsBoardSideA = *(packet + dataOffset); - dataOffset += 3; - pdu1HkTableDataset.outEnabledChannel8 = *(packet + dataOffset); - dataOffset += 3; - - pdu1HkTableDataset.bootcause = *(packet + dataOffset) << 24 | *(packet + dataOffset + 1) << 16 | - *(packet + dataOffset + 2) << 8 | *(packet + dataOffset + 3); - dataOffset += 6; - pdu1HkTableDataset.bootcount = *(packet + dataOffset) << 24 | *(packet + dataOffset + 1) << 16 | - *(packet + dataOffset + 2) << 8 | *(packet + dataOffset + 3); - dataOffset += 6; - pdu1HkTableDataset.uptime = *(packet + dataOffset) << 24 | *(packet + dataOffset + 1) << 16 | - *(packet + dataOffset + 2) << 8 | *(packet + dataOffset + 3); - dataOffset += 6; - pdu1HkTableDataset.resetcause = *(packet + dataOffset + 1) << 8 | *(packet + dataOffset); - dataOffset += 4; - pdu1HkTableDataset.battMode = *(packet + dataOffset); - /* +10 because here begins the second gomspace csp packet */ - dataOffset += 3 + 10; - - pdu1HkTableDataset.latchupsTcsBoard3V3 = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - pdu1HkTableDataset.latchupsSyrlinks = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - pdu1HkTableDataset.latchupsStarTracker = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - pdu1HkTableDataset.latchupsMgt = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - pdu1HkTableDataset.latchupsSusNominal = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - pdu1HkTableDataset.latchupsSolarCellExp = - *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - pdu1HkTableDataset.latchupsPloc = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - pdu1HkTableDataset.latchupsAcsBoardSideA = - *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - pdu1HkTableDataset.latchupsChannel8 = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - - pdu1HkTableDataset.device0 = *(packet + dataOffset); - dataOffset += 3; - pdu1HkTableDataset.device1 = *(packet + dataOffset); - dataOffset += 3; - pdu1HkTableDataset.device2 = *(packet + dataOffset); - dataOffset += 3; - pdu1HkTableDataset.device3 = *(packet + dataOffset); - dataOffset += 3; - pdu1HkTableDataset.device4 = *(packet + dataOffset); - dataOffset += 3; - pdu1HkTableDataset.device5 = *(packet + dataOffset); - dataOffset += 3; - pdu1HkTableDataset.device6 = *(packet + dataOffset); - dataOffset += 3; - pdu1HkTableDataset.device7 = *(packet + dataOffset); - dataOffset += 3; - - pdu1HkTableDataset.device0Status = *(packet + dataOffset); - dataOffset += 3; - pdu1HkTableDataset.device1Status = *(packet + dataOffset); - dataOffset += 3; - pdu1HkTableDataset.device2Status = *(packet + dataOffset); - dataOffset += 3; - pdu1HkTableDataset.device3Status = *(packet + dataOffset); - dataOffset += 3; - pdu1HkTableDataset.device4Status = *(packet + dataOffset); - dataOffset += 3; - pdu1HkTableDataset.device5Status = *(packet + dataOffset); - dataOffset += 3; - pdu1HkTableDataset.device6Status = *(packet + dataOffset); - dataOffset += 3; - pdu1HkTableDataset.device7Status = *(packet + dataOffset); - dataOffset += 3; - - pdu1HkTableDataset.gndWdtReboots = *(packet + dataOffset) << 24 | - *(packet + dataOffset + 1) << 16 | - *(packet + dataOffset + 2) << 8 | *(packet + dataOffset + 3); - dataOffset += 6; - pdu1HkTableDataset.i2cWdtReboots = *(packet + dataOffset) << 24 | - *(packet + dataOffset + 1) << 16 | - *(packet + dataOffset + 2) << 8 | *(packet + dataOffset + 3); - dataOffset += 6; - pdu1HkTableDataset.canWdtReboots = *(packet + dataOffset) << 24 | - *(packet + dataOffset + 1) << 16 | - *(packet + dataOffset + 2) << 8 | *(packet + dataOffset + 3); - dataOffset += 6; - pdu1HkTableDataset.csp1WdtReboots = *(packet + dataOffset) << 24 | - *(packet + dataOffset + 1) << 16 | - *(packet + dataOffset + 2) << 8 | *(packet + dataOffset + 3); - dataOffset += 6; - pdu1HkTableDataset.csp2WdtReboots = *(packet + dataOffset) << 24 | - *(packet + dataOffset + 1) << 16 | - *(packet + dataOffset + 2) << 8 | *(packet + dataOffset + 3); - dataOffset += 6; - pdu1HkTableDataset.groundWatchdogSecondsLeft = - *(packet + dataOffset) << 24 | *(packet + dataOffset + 1) << 16 | - *(packet + dataOffset + 2) << 8 | *(packet + dataOffset + 3); - dataOffset += 6; - pdu1HkTableDataset.i2cWatchdogSecondsLeft = - *(packet + dataOffset) << 24 | *(packet + dataOffset + 1) << 16 | - *(packet + dataOffset + 2) << 8 | *(packet + dataOffset + 3); - dataOffset += 6; - pdu1HkTableDataset.canWatchdogSecondsLeft = - *(packet + dataOffset) << 24 | *(packet + dataOffset + 1) << 16 | - *(packet + dataOffset + 2) << 8 | *(packet + dataOffset + 3); - dataOffset += 6; - pdu1HkTableDataset.csp1WatchdogPingsLeft = *(packet + dataOffset); - dataOffset += 3; - pdu1HkTableDataset.csp2WatchdogPingsLeft = *(packet + dataOffset); - - pdu1HkTableDataset.setChanged(true); - if (not pdu1HkTableDataset.isValid()) { - pdu1HkTableDataset.setValidity(true, true); - } + GomspaceDeviceHandler::parsePduHkTable(coreHk, auxHk, packet); } ReturnValue_t PDU1Handler::initializeLocalDataPool(localpool::DataPool &localDataPoolMap, LocalDataPoolManager &poolManager) { - localDataPoolMap.emplace(P60System::pool::PDU1_CURRENT_OUT_TCS_BOARD_3V3, - new PoolEntry({0})); - localDataPoolMap.emplace(P60System::pool::PDU1_CURRENT_OUT_SYRLINKS, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::pool::PDU1_CURRENT_OUT_STAR_TRACKER, - new PoolEntry({0})); - localDataPoolMap.emplace(P60System::pool::PDU1_CURRENT_OUT_MGT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::pool::PDU1_CURRENT_OUT_SUS_NOMINAL, - new PoolEntry({0})); - localDataPoolMap.emplace(P60System::pool::PDU1_CURRENT_OUT_SOLAR_CELL_EXP, - new PoolEntry({0})); - localDataPoolMap.emplace(P60System::pool::PDU1_CURRENT_OUT_PLOC, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::pool::PDU1_CURRENT_OUT_ACS_BOARD_SIDE_A, - new PoolEntry({0})); - localDataPoolMap.emplace(P60System::pool::PDU1_CURRENT_OUT_CHANNEL8, new PoolEntry({0})); - - localDataPoolMap.emplace(P60System::pool::PDU1_VOLTAGE_OUT_TCS_BOARD_3V3, - new PoolEntry({0})); - localDataPoolMap.emplace(P60System::pool::PDU1_VOLTAGE_OUT_SYRLINKS, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::pool::PDU1_VOLTAGE_OUT_STAR_TRACKER, - new PoolEntry({0})); - localDataPoolMap.emplace(P60System::pool::PDU1_VOLTAGE_OUT_MGT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::pool::PDU1_VOLTAGE_OUT_SUS_NOMINAL, - new PoolEntry({0})); - localDataPoolMap.emplace(P60System::pool::PDU1_VOLTAGE_OUT_SOLAR_CELL_EXP, - new PoolEntry({0})); - localDataPoolMap.emplace(P60System::pool::PDU1_VOLTAGE_OUT_PLOC, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::pool::PDU1_VOLTAGE_OUT_ACS_BOARD_SIDE_A, - new PoolEntry({0})); - localDataPoolMap.emplace(P60System::pool::PDU1_VOLTAGE_OUT_CHANNEL8, new PoolEntry({0})); - - localDataPoolMap.emplace(P60System::pool::PDU1_VCC, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::pool::PDU1_VBAT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::pool::PDU1_TEMPERATURE, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::pool::PDU1_CONV_EN_1, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::pool::PDU1_CONV_EN_2, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::pool::PDU1_CONV_EN_3, new PoolEntry({0})); - - localDataPoolMap.emplace(P60System::pool::PDU1_OUT_EN_TCS_BOARD_3V3, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::pool::PDU1_OUT_EN_SYRLINKS, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::pool::PDU1_OUT_EN_STAR_TRACKER, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::pool::PDU1_OUT_EN_MGT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::pool::PDU1_OUT_EN_SUS_NOMINAL, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::pool::PDU1_OUT_EN_SOLAR_CELL_EXP, - new PoolEntry({0})); - localDataPoolMap.emplace(P60System::pool::PDU1_OUT_EN_PLOC, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::pool::PDU1_OUT_EN_ACS_BOARD_SIDE_A, - new PoolEntry({0})); - localDataPoolMap.emplace(P60System::pool::PDU1_OUT_EN_CHANNEL8, new PoolEntry({0})); - - localDataPoolMap.emplace(P60System::pool::PDU1_BOOTCAUSE, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::pool::PDU1_BOOTCNT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::pool::PDU1_UPTIME, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::pool::PDU1_RESETCAUSE, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::pool::PDU1_BATT_MODE, new PoolEntry({0})); - - localDataPoolMap.emplace(P60System::pool::PDU1_LATCHUP_TCS_BOARD_3V3, - new PoolEntry({0})); - localDataPoolMap.emplace(P60System::pool::PDU1_LATCHUP_SYRLINKS, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::pool::PDU1_LATCHUP_STAR_TRACKER, - new PoolEntry({0})); - localDataPoolMap.emplace(P60System::pool::PDU1_LATCHUP_MGT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::pool::PDU1_LATCHUP_SUS_NOMINAL, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::pool::PDU1_LATCHUP_SOLAR_CELL_EXP, - new PoolEntry({0})); - localDataPoolMap.emplace(P60System::pool::PDU1_LATCHUP_PLOC, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::pool::PDU1_LATCHUP_ACS_BOARD_SIDE_A, - new PoolEntry({0})); - localDataPoolMap.emplace(P60System::pool::PDU1_LATCHUP_CHANNEL8, new PoolEntry({0})); - - localDataPoolMap.emplace(P60System::pool::PDU1_DEVICE_0, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::pool::PDU1_DEVICE_1, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::pool::PDU1_DEVICE_2, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::pool::PDU1_DEVICE_3, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::pool::PDU1_DEVICE_4, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::pool::PDU1_DEVICE_5, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::pool::PDU1_DEVICE_6, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::pool::PDU1_DEVICE_7, new PoolEntry({0})); - - localDataPoolMap.emplace(P60System::pool::PDU1_DEVICE_0_STATUS, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::pool::PDU1_DEVICE_1_STATUS, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::pool::PDU1_DEVICE_2_STATUS, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::pool::PDU1_DEVICE_3_STATUS, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::pool::PDU1_DEVICE_4_STATUS, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::pool::PDU1_DEVICE_5_STATUS, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::pool::PDU1_DEVICE_6_STATUS, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::pool::PDU1_DEVICE_7_STATUS, new PoolEntry({0})); - - localDataPoolMap.emplace(P60System::pool::PDU1_WDT_CNT_GND, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::pool::PDU1_WDT_CNT_I2C, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::pool::PDU1_WDT_CNT_CAN, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::pool::PDU1_WDT_CNT_CSP1, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::pool::PDU1_WDT_CNT_CSP2, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::pool::PDU1_WDT_GND_LEFT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::pool::PDU1_WDT_I2C_LEFT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::pool::PDU1_WDT_CAN_LEFT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::pool::PDU1_WDT_CSP_LEFT1, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::pool::PDU1_WDT_CSP_LEFT2, new PoolEntry({0})); - poolManager.subscribeForPeriodicPacket(pdu1HkTableDataset.getSid(), false, 0.4, true); + initializePduPool(localDataPoolMap, poolManager, pcdu::INIT_SWITCHES_PDU1); + poolManager.subscribeForPeriodicPacket(coreHk.getSid(), false, 10.0, false); + poolManager.subscribeForPeriodicPacket(auxHk.getSid(), false, 30.0, false); return HasReturnvaluesIF::RETURN_OK; } LocalPoolDataSetBase *PDU1Handler::getDataSetHandle(sid_t sid) { - if (sid == pdu1HkTableDataset.getSid()) { - return &pdu1HkTableDataset; + if (sid == coreHk.getSid()) { + return &coreHk; + } else if (sid == auxHk.getSid()) { + return &auxHk; } return nullptr; } @@ -440,7 +103,7 @@ ReturnValue_t PDU1Handler::printStatus(DeviceCommandId_t cmd) { ReturnValue_t result = RETURN_OK; switch (cmd) { case (GOMSPACE::PRINT_SWITCH_V_I): { - PoolReadGuard pg(&pdu1HkTableDataset); + PoolReadGuard pg(&coreHk); result = pg.getReadResult(); if (result != HasReturnvaluesIF::RETURN_OK) { break; @@ -449,7 +112,7 @@ ReturnValue_t PDU1Handler::printStatus(DeviceCommandId_t cmd) { break; } case (GOMSPACE::PRINT_LATCHUPS): { - PoolReadGuard pg(&pdu1HkTableDataset); + PoolReadGuard pg(&auxHk); result = pg.getReadResult(); if (result != HasReturnvaluesIF::RETURN_OK) { break; @@ -468,72 +131,46 @@ ReturnValue_t PDU1Handler::printStatus(DeviceCommandId_t cmd) { } void PDU1Handler::printHkTableSwitchVI() { + using namespace PDU1; sif::info << "PDU1 Info: " << std::endl; - sif::info << "Boot Cause: " << pdu1HkTableDataset.bootcause << " | Boot Count: " << std::setw(4) - << std::right << pdu1HkTableDataset.bootcount << std::endl; - sif::info << "Reset Cause: " << pdu1HkTableDataset.resetcause - << " | Battery Mode: " << static_cast(pdu1HkTableDataset.battMode.value) - << std::endl; + sif::info << "Boot Cause: " << auxHk.bootcause << " | Boot Count: " << std::setw(4) << std::right + << coreHk.bootcount << std::endl; + sif::info << "Reset Cause: " << auxHk.resetcause + << " | Battery Mode: " << static_cast(coreHk.battMode.value) << std::endl; sif::info << "SwitchState, Currents [mA], Voltages [mV]:" << std::endl; - sif::info << std::setw(30) << std::left << "TCS Board" << std::dec << "| " - << unsigned(pdu1HkTableDataset.outEnabledTCSBoard3V3.value) << ", " << std::setw(4) - << std::right << pdu1HkTableDataset.currentOutTCSBoard3V3.value << ", " << std::setw(4) - << pdu1HkTableDataset.voltageOutTCSBoard3V3.value << std::endl; - sif::info << std::setw(30) << std::left << "Syrlinks" << std::dec << "| " - << unsigned(pdu1HkTableDataset.outEnabledSyrlinks.value) << ", " << std::setw(4) - << std::right << pdu1HkTableDataset.currentOutSyrlinks.value << ", " << std::setw(4) - << pdu1HkTableDataset.voltageOutSyrlinks.value << std::endl; - sif::info << std::setw(30) << std::left << "Star Tracker" << std::dec << "| " - << static_cast(pdu1HkTableDataset.outEnabledStarTracker.value) << ", " - << std::setw(4) << std::right << pdu1HkTableDataset.currentOutStarTracker.value << ", " - << std::setw(4) << pdu1HkTableDataset.voltageOutStarTracker.value << std::endl; - sif::info << std::setw(30) << std::left << "MGT" << std::dec << "| " - << static_cast(pdu1HkTableDataset.outEnabledMGT.value) << ", " - << std::setw(4) << std::right << pdu1HkTableDataset.currentOutMGT.value << ", " - << std::setw(4) << pdu1HkTableDataset.voltageOutMGT.value << std::endl; - sif::info << std::setw(30) << std::left << "SuS nominal" << std::dec << "| " - << static_cast(pdu1HkTableDataset.outEnabledSUSNominal.value) << ", " - << std::setw(4) << std::right << pdu1HkTableDataset.currentOutSUSNominal.value << ", " - << std::setw(4) << pdu1HkTableDataset.voltageOutSUSNominal.value << std::endl; - sif::info << std::setw(30) << std::left << "Solar Cell Experiment" << std::dec << "| " - << static_cast(pdu1HkTableDataset.outEnabledSolarCellExp.value) << ", " - << std::setw(4) << std::right << pdu1HkTableDataset.currentOutSolarCellExp.value << ", " - << std::setw(4) << pdu1HkTableDataset.voltageOutSolarCellExp.value << std::endl; - sif::info << std::setw(30) << std::left << "PLOC" << std::dec << "| " - << static_cast(pdu1HkTableDataset.outEnabledPLOC.value) << ", " - << std::setw(4) << std::right << pdu1HkTableDataset.currentOutPLOC.value << ", " - << std::setw(4) << pdu1HkTableDataset.voltageOutPLOC.value << std::endl; - sif::info << std::setw(30) << std::left << "ACS Side A" << std::dec << "| " - << static_cast(pdu1HkTableDataset.outEnabledAcsBoardSideA.value) << ", " - << std::setw(4) << std::right << pdu1HkTableDataset.currentOutACSBoardSideA.value - << ", " << std::setw(4) << pdu1HkTableDataset.voltageOutACSBoardSideA.value - << std::endl; - sif::info << std::setw(30) << std::left << "Channel 8" << std::dec << "| " - << static_cast(pdu1HkTableDataset.outEnabledChannel8.value) << ", " - << std::setw(4) << std::right << pdu1HkTableDataset.currentOutChannel8.value << ", " - << std::setw(4) << pdu1HkTableDataset.voltageOutChannel8.value << std::right - << std::endl; + auto printerHelper = [&](std::string channelStr, Channels idx) { + sif::info << std::setw(30) << std::left << channelStr << std::dec << "| " + << unsigned(coreHk.outputEnables[idx]) << ", " << std::setw(4) << std::right + << coreHk.currents[idx] << ", " << std::setw(4) << coreHk.voltages[idx] << std::endl; + }; + + printerHelper("TCS Board", Channels::TCS_BOARD_3V3); + printerHelper("Syrlinks", Channels::SYRLINKS); + printerHelper("Star Tracker", Channels::STR); + printerHelper("MGT", Channels::MGT); + printerHelper("SUS Nominal", Channels::SUS_NOMINAL); + printerHelper("SCEX", Channels::SOL_CELL_EXPERIMENT); + printerHelper("PLOC", Channels::PLOC); + printerHelper("ACS Board A Side", Channels::ACS_A_SIDE); + printerHelper("Channel 8", Channels::UNUSED); + printerHelper("Syrlinks", Channels::SYRLINKS); } void PDU1Handler::printHkTableLatchups() { + using namespace PDU1; sif::info << "PDU1 Latchup Information" << std::endl; - sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "TCS Board" << std::dec << "| " - << std::setw(4) << std::right << pdu1HkTableDataset.latchupsTcsBoard3V3 << std::endl; - sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "Syrlinks" << std::dec << "| " - << std::setw(4) << std::right << pdu1HkTableDataset.latchupsSyrlinks << std::endl; - sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "Star Tracker" << std::dec << "| " - << std::setw(4) << std::right << pdu1HkTableDataset.latchupsStarTracker << std::endl; - sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "MGT" << std::dec << "| " - << std::setw(4) << std::right << pdu1HkTableDataset.latchupsMgt << std::endl; - sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "SuS Nominal" << std::dec << "| " - << std::setw(4) << std::right << pdu1HkTableDataset.latchupsSusNominal << std::endl; - sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "Solar Cell Experiment" << std::dec - << "| " << std::setw(4) << std::right << pdu1HkTableDataset.latchupsSolarCellExp - << std::endl; - sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "PLOC" << std::dec << "| " - << std::setw(4) << std::right << pdu1HkTableDataset.latchupsPloc << std::endl; - sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "ACS A Side" << std::dec << "| " - << std::setw(4) << std::right << pdu1HkTableDataset.latchupsAcsBoardSideA << std::endl; - sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "Channel 8" << std::dec << "| " - << std::setw(4) << std::right << pdu1HkTableDataset.latchupsChannel8 << std::endl; + auto printerHelper = [&](std::string channelStr, Channels idx) { + sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "TCS Board" << std::dec << "| " + << std::setw(4) << std::right << auxHk.latchups[idx] << std::endl; + }; + printerHelper("TCS Board", Channels::TCS_BOARD_3V3); + printerHelper("Syrlinks", Channels::SYRLINKS); + printerHelper("Star Tracker", Channels::STR); + printerHelper("MGT", Channels::MGT); + printerHelper("SUS Nominal", Channels::SUS_NOMINAL); + printerHelper("SCEX", Channels::SOL_CELL_EXPERIMENT); + printerHelper("PLOC", Channels::PLOC); + printerHelper("ACS Board A Side", Channels::ACS_A_SIDE); + printerHelper("Channel 8", Channels::UNUSED); + printerHelper("Syrlinks", Channels::SYRLINKS); } diff --git a/mission/devices/PDU1Handler.h b/mission/devices/PDU1Handler.h index 67afc922..845f57ec 100644 --- a/mission/devices/PDU1Handler.h +++ b/mission/devices/PDU1Handler.h @@ -43,7 +43,8 @@ class PDU1Handler : public GomspaceDeviceHandler { static constexpr uint8_t MAX_CHANNEL_STR_WIDTH = 24; /** Dataset for the housekeeping table of the PDU1 */ - PDU1::PDU1HkTableDataset pdu1HkTableDataset; + PDU1::Pdu1CoreHk coreHk; + PDU1::Pdu1AuxHk auxHk; GOMSPACE::ChannelSwitchHook channelSwitchHook = nullptr; void* hookArgs = nullptr; diff --git a/mission/devices/PDU2Handler.cpp b/mission/devices/PDU2Handler.cpp index 69a8f3fd..38cdb9e5 100644 --- a/mission/devices/PDU2Handler.cpp +++ b/mission/devices/PDU2Handler.cpp @@ -3,12 +3,13 @@ #include #include -#include "OBSWConfig.h" +#include "devices/powerSwitcherList.h" PDU2Handler::PDU2Handler(object_id_t objectId, object_id_t comIF, CookieIF *comCookie) : GomspaceDeviceHandler(objectId, comIF, comCookie, PDU::MAX_CONFIGTABLE_ADDRESS, PDU::MAX_HKTABLE_ADDRESS, PDU::HK_TABLE_REPLY_SIZE), - pdu2HkTableDataset(this) {} + coreHk(this), + auxHk(this) {} PDU2Handler::~PDU2Handler() {} @@ -23,29 +24,7 @@ void PDU2Handler::letChildHandleHkReply(DeviceCommandId_t id, const uint8_t *pac * Hk table will be sent to the commander if hk table request was not triggered by the * PDU2Handler itself. */ - handleDeviceTM(&pdu2HkTableDataset, id, true); - -#if OBSW_VERBOSE_LEVEL >= 1 && OBSW_DEBUG_PDU2 == 1 - pdu2HkTableDataset.read(); - sif::info << "PDU2 Q7S current voltage: " << pdu2HkTableDataset.voltageOutQ7S << " mV" - << std::endl; - sif::info << "PDU2 VCC: " << pdu2HkTableDataset.vcc << " mV" << std::endl; - float vbat = pdu2HkTableDataset.vbat.value * 0.1; - sif::info << "PDU2 VBAT: " << vbat << std::endl; - float temperatureC = pdu2HkTableDataset.temperature.value * 0.1; - sif::info << "PDU2 Temperature: " << temperatureC << " °C" << std::endl; - printOutputSwitchStates(); - sif::info << "PDU2 uptime: " << pdu2HkTableDataset.uptime << " seconds" << std::endl; - sif::info << "PDU2 battery mode: " << unsigned(pdu2HkTableDataset.battMode.value) << std::endl; - sif::info << "PDU2 ground watchdog reboots: " << pdu2HkTableDataset.gndWdtReboots << std::endl; - sif::info << "PDU2 ground watchdog timer seconds left: " - << pdu2HkTableDataset.groundWatchdogSecondsLeft << " seconds" << std::endl; - sif::info << "PDU2 csp1 watchdog pings before reboot: " - << unsigned(pdu2HkTableDataset.csp1WatchdogPingsLeft.value) << std::endl; - sif::info << "PDU2 csp2 watchdog pings before reboot: " - << unsigned(pdu2HkTableDataset.csp2WatchdogPingsLeft.value) << std::endl; - pdu2HkTableDataset.commit(); -#endif + handleDeviceTM(&coreHk, id, true); } void PDU2Handler::assignChannelHookFunction(GOMSPACE::ChannelSwitchHook hook, void *args) { @@ -54,315 +33,23 @@ void PDU2Handler::assignChannelHookFunction(GOMSPACE::ChannelSwitchHook hook, vo } LocalPoolDataSetBase *PDU2Handler::getDataSetHandle(sid_t sid) { - if (sid == pdu2HkTableDataset.getSid()) { - return &pdu2HkTableDataset; + if (sid == coreHk.getSid()) { + return &coreHk; + } else if (sid == auxHk.getSid()) { + return &auxHk; } return nullptr; } void PDU2Handler::parseHkTableReply(const uint8_t *packet) { - uint16_t dataOffset = 0; - pdu2HkTableDataset.read(); - /** - * Fist 10 bytes contain the gomspace header. Each variable is preceded by the 16-bit table - * address. - */ - dataOffset += 12; - pdu2HkTableDataset.currentOutQ7S = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - pdu2HkTableDataset.currentOutPayloadPCDUCh1 = - *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - pdu2HkTableDataset.currentOutReactionWheels = - *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - pdu2HkTableDataset.currentOutTCSBoardHeaterIn = - *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - pdu2HkTableDataset.currentOutSUSRedundant = - *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - pdu2HkTableDataset.currentOutDeplMechanism = - *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - pdu2HkTableDataset.currentOutPayloadPCDUCh6 = - *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - pdu2HkTableDataset.currentOutACSBoardSideB = - *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - pdu2HkTableDataset.currentOutPayloadCamera = - *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - - pdu2HkTableDataset.voltageOutQ7S = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - pdu2HkTableDataset.voltageOutPayloadPCDUCh1 = - *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - pdu2HkTableDataset.voltageOutReactionWheels = - *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - pdu2HkTableDataset.voltageOutTCSBoardHeaterIn = - *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - pdu2HkTableDataset.voltageOutSUSRedundant = - *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - pdu2HkTableDataset.voltageOutDeplMechanism = - *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - pdu2HkTableDataset.voltageOutPayloadPCDUCh6 = - *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - pdu2HkTableDataset.voltageOutACSBoardSideB = - *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - pdu2HkTableDataset.voltageOutPayloadCamera = - *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - - pdu2HkTableDataset.vcc = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - pdu2HkTableDataset.vbat = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - pdu2HkTableDataset.temperature = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - - pdu2HkTableDataset.converterEnable1 = *(packet + dataOffset); - dataOffset += 3; - pdu2HkTableDataset.converterEnable2 = *(packet + dataOffset); - dataOffset += 3; - pdu2HkTableDataset.converterEnable3 = *(packet + dataOffset); - dataOffset += 3; - - pdu2HkTableDataset.outEnabledQ7S = *(packet + dataOffset); - dataOffset += 3; - pdu2HkTableDataset.outEnabledPlPCDUCh1 = *(packet + dataOffset); - dataOffset += 3; - pdu2HkTableDataset.outEnabledReactionWheels = *(packet + dataOffset); - dataOffset += 3; - pdu2HkTableDataset.outEnabledTCSBoardHeaterIn = *(packet + dataOffset); - dataOffset += 3; - pdu2HkTableDataset.outEnabledSUSRedundant = *(packet + dataOffset); - dataOffset += 3; - pdu2HkTableDataset.outEnabledDeplMechanism = *(packet + dataOffset); - dataOffset += 3; - pdu2HkTableDataset.outEnabledPlPCDUCh6 = *(packet + dataOffset); - dataOffset += 3; - pdu2HkTableDataset.outEnabledAcsBoardSideB = *(packet + dataOffset); - dataOffset += 3; - pdu2HkTableDataset.outEnabledPayloadCamera = *(packet + dataOffset); - dataOffset += 3; - - pdu2HkTableDataset.bootcause = *(packet + dataOffset) << 24 | *(packet + dataOffset + 1) << 16 | - *(packet + dataOffset + 2) << 8 | *(packet + dataOffset + 3); - dataOffset += 6; - pdu2HkTableDataset.bootcount = *(packet + dataOffset) << 24 | *(packet + dataOffset + 1) << 16 | - *(packet + dataOffset + 2) << 8 | *(packet + dataOffset + 3); - dataOffset += 6; - pdu2HkTableDataset.uptime = *(packet + dataOffset) << 24 | *(packet + dataOffset + 1) << 16 | - *(packet + dataOffset + 2) << 8 | *(packet + dataOffset + 3); - dataOffset += 6; - pdu2HkTableDataset.resetcause = *(packet + dataOffset + 1) << 8 | *(packet + dataOffset); - dataOffset += 4; - pdu2HkTableDataset.battMode = *(packet + dataOffset); - /* +10 because here begins the second gomspace csp packet */ - dataOffset += 3 + 10; - - pdu2HkTableDataset.latchupsQ7S = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - pdu2HkTableDataset.latchupsPayloadPcduCh1 = - *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - pdu2HkTableDataset.latchupsRw = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - pdu2HkTableDataset.latchupsTcsBoardHeaterIn = - *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - pdu2HkTableDataset.latchupsSusRedundant = - *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - pdu2HkTableDataset.latchupsDeplMenchanism = - *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - pdu2HkTableDataset.latchupsPayloadPcduCh6 = - *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - pdu2HkTableDataset.latchupsAcsBoardSideB = - *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - pdu2HkTableDataset.latchupsPayloadCamera = - *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - - pdu2HkTableDataset.device0 = *(packet + dataOffset); - dataOffset += 3; - pdu2HkTableDataset.device1 = *(packet + dataOffset); - dataOffset += 3; - pdu2HkTableDataset.device2 = *(packet + dataOffset); - dataOffset += 3; - pdu2HkTableDataset.device3 = *(packet + dataOffset); - dataOffset += 3; - pdu2HkTableDataset.device4 = *(packet + dataOffset); - dataOffset += 3; - pdu2HkTableDataset.device5 = *(packet + dataOffset); - dataOffset += 3; - pdu2HkTableDataset.device6 = *(packet + dataOffset); - dataOffset += 3; - pdu2HkTableDataset.device7 = *(packet + dataOffset); - dataOffset += 3; - - pdu2HkTableDataset.device0Status = *(packet + dataOffset); - dataOffset += 3; - pdu2HkTableDataset.device1Status = *(packet + dataOffset); - dataOffset += 3; - pdu2HkTableDataset.device2Status = *(packet + dataOffset); - dataOffset += 3; - pdu2HkTableDataset.device3Status = *(packet + dataOffset); - dataOffset += 3; - pdu2HkTableDataset.device4Status = *(packet + dataOffset); - dataOffset += 3; - pdu2HkTableDataset.device5Status = *(packet + dataOffset); - dataOffset += 3; - pdu2HkTableDataset.device6Status = *(packet + dataOffset); - dataOffset += 3; - pdu2HkTableDataset.device7Status = *(packet + dataOffset); - dataOffset += 3; - - pdu2HkTableDataset.gndWdtReboots = *(packet + dataOffset) << 24 | - *(packet + dataOffset + 1) << 16 | - *(packet + dataOffset + 2) << 8 | *(packet + dataOffset + 3); - dataOffset += 6; - pdu2HkTableDataset.i2cWdtReboots = *(packet + dataOffset) << 24 | - *(packet + dataOffset + 1) << 16 | - *(packet + dataOffset + 2) << 8 | *(packet + dataOffset + 3); - dataOffset += 6; - pdu2HkTableDataset.canWdtReboots = *(packet + dataOffset) << 24 | - *(packet + dataOffset + 1) << 16 | - *(packet + dataOffset + 2) << 8 | *(packet + dataOffset + 3); - dataOffset += 6; - pdu2HkTableDataset.csp1WdtReboots = *(packet + dataOffset) << 24 | - *(packet + dataOffset + 1) << 16 | - *(packet + dataOffset + 2) << 8 | *(packet + dataOffset + 3); - dataOffset += 6; - pdu2HkTableDataset.csp2WdtReboots = *(packet + dataOffset) << 24 | - *(packet + dataOffset + 1) << 16 | - *(packet + dataOffset + 2) << 8 | *(packet + dataOffset + 3); - dataOffset += 6; - pdu2HkTableDataset.groundWatchdogSecondsLeft = - *(packet + dataOffset) << 24 | *(packet + dataOffset + 1) << 16 | - *(packet + dataOffset + 2) << 8 | *(packet + dataOffset + 3); - dataOffset += 6; - pdu2HkTableDataset.i2cWatchdogSecondsLeft = - *(packet + dataOffset) << 24 | *(packet + dataOffset + 1) << 16 | - *(packet + dataOffset + 2) << 8 | *(packet + dataOffset + 3); - dataOffset += 6; - pdu2HkTableDataset.canWatchdogSecondsLeft = - *(packet + dataOffset) << 24 | *(packet + dataOffset + 1) << 16 | - *(packet + dataOffset + 2) << 8 | *(packet + dataOffset + 3); - dataOffset += 6; - pdu2HkTableDataset.csp1WatchdogPingsLeft = *(packet + dataOffset); - dataOffset += 3; - pdu2HkTableDataset.csp2WatchdogPingsLeft = *(packet + dataOffset); - - pdu2HkTableDataset.commit(); - pdu2HkTableDataset.setChanged(true); + GomspaceDeviceHandler::parsePduHkTable(coreHk, auxHk, packet); } ReturnValue_t PDU2Handler::initializeLocalDataPool(localpool::DataPool &localDataPoolMap, LocalDataPoolManager &poolManager) { - using namespace P60System; - localDataPoolMap.emplace(pool::PDU2_CURRENT_OUT_Q7S, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU2_CURRENT_OUT_PAYLOAD_PCDU_CH1, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU2_CURRENT_OUT_RW, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU2_CURRENT_OUT_TCS_BOARD_HEATER_IN, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU2_CURRENT_OUT_SUS_REDUNDANT, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU2_CURRENT_OUT_DEPLOYMENT_MECHANISM, - new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU2_CURRENT_OUT_PAYLOAD_PCDU_CH6, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU2_CURRENT_OUT_ACS_BOARD_SIDE_B, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU2_CURRENT_OUT_PAYLOAD_CAMERA, new PoolEntry({0})); - - localDataPoolMap.emplace(pool::PDU2_VOLTAGE_OUT_Q7S, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU2_VOLTAGE_OUT_PAYLOAD_PCDU_CH1, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU2_VOLTAGE_OUT_RW, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU2_VOLTAGE_OUT_TCS_BOARD_HEATER_IN, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU2_VOLTAGE_OUT_SUS_REDUNDANT, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU2_VOLTAGE_OUT_DEPLOYMENT_MECHANISM, - new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU2_VOLTAGE_OUT_PAYLOAD_PCDU_CH6, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU2_VOLTAGE_OUT_ACS_BOARD_SIDE_B, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU2_VOLTAGE_OUT_PAYLOAD_CAMERA, new PoolEntry({0})); - - localDataPoolMap.emplace(pool::PDU2_VCC, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU2_VBAT, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU2_TEMPERATURE, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU2_CONV_EN_1, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU2_CONV_EN_2, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU2_CONV_EN_3, new PoolEntry({0})); - - localDataPoolMap.emplace(pool::PDU2_OUT_EN_Q7S, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU2_OUT_EN_PAYLOAD_PCDU_CH1, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU2_OUT_EN_RW, new PoolEntry({0})); -#ifdef TE0720_1CFA - localDataPoolMap.emplace(pool::PDU2_OUT_EN_TCS_BOARD_HEATER_IN, new PoolEntry({1})); -#else - localDataPoolMap.emplace(pool::PDU2_OUT_EN_TCS_BOARD_HEATER_IN, new PoolEntry({0})); -#endif - localDataPoolMap.emplace(pool::PDU2_OUT_EN_SUS_REDUNDANT, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU2_OUT_EN_DEPLOYMENT_MECHANISM, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU2_OUT_EN_PAYLOAD_PCDU_CH6, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU2_OUT_EN_ACS_BOARD_SIDE_B, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU2_OUT_EN_PAYLOAD_CAMERA, new PoolEntry({0})); - - localDataPoolMap.emplace(pool::PDU2_BOOTCAUSE, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU2_BOOTCNT, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU2_UPTIME, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU2_RESETCAUSE, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU2_BATT_MODE, new PoolEntry({0})); - - localDataPoolMap.emplace(pool::PDU2_LATCHUP_Q7S, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU2_LATCHUP_PAYLOAD_PCDU_CH1, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU2_LATCHUP_RW, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU2_LATCHUP_TCS_BOARD_HEATER_IN, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU2_LATCHUP_SUS_REDUNDANT, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU2_LATCHUP_DEPLOYMENT_MECHANISM, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU2_LATCHUP_PAYLOAD_PCDU_CH6, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU2_LATCHUP_ACS_BOARD_SIDE_B, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU2_LATCHUP_PAYLOAD_CAMERA, new PoolEntry({0})); - - localDataPoolMap.emplace(pool::PDU2_DEVICE_0, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU2_DEVICE_1, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU2_DEVICE_2, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU2_DEVICE_3, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU2_DEVICE_4, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU2_DEVICE_5, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU2_DEVICE_6, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU2_DEVICE_7, new PoolEntry({0})); - - localDataPoolMap.emplace(pool::PDU2_DEVICE_0_STATUS, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU2_DEVICE_1_STATUS, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU2_DEVICE_2_STATUS, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU2_DEVICE_3_STATUS, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU2_DEVICE_4_STATUS, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU2_DEVICE_5_STATUS, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU2_DEVICE_6_STATUS, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU2_DEVICE_7_STATUS, new PoolEntry({0})); - - localDataPoolMap.emplace(pool::PDU2_WDT_CNT_GND, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU2_WDT_CNT_I2C, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU2_WDT_CNT_CAN, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU2_WDT_CNT_CSP1, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU2_WDT_CNT_CSP2, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU2_WDT_GND_LEFT, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU2_WDT_I2C_LEFT, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU2_WDT_CAN_LEFT, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU2_WDT_CSP_LEFT1, new PoolEntry({0})); - localDataPoolMap.emplace(pool::PDU2_WDT_CSP_LEFT2, new PoolEntry({0})); -#if OBSW_ENABLE_PERIODIC_HK == 1 - poolManager.subscribeForPeriodicPacket(pdu2HkTableDataset.getSid(), false, 0.4, true); -#endif + initializePduPool(localDataPoolMap, poolManager, pcdu::INIT_SWITCHES_PDU1); + poolManager.subscribeForPeriodicPacket(coreHk.getSid(), false, 10.0, false); + poolManager.subscribeForPeriodicPacket(auxHk.getSid(), false, 30.0, false); return HasReturnvaluesIF::RETURN_OK; } @@ -370,7 +57,7 @@ ReturnValue_t PDU2Handler::printStatus(DeviceCommandId_t cmd) { ReturnValue_t result = RETURN_OK; switch (cmd) { case (GOMSPACE::PRINT_SWITCH_V_I): { - PoolReadGuard pg(&pdu2HkTableDataset); + PoolReadGuard pg(&coreHk); result = pg.getReadResult(); if (result != HasReturnvaluesIF::RETURN_OK) { break; @@ -379,7 +66,7 @@ ReturnValue_t PDU2Handler::printStatus(DeviceCommandId_t cmd) { break; } case (GOMSPACE::PRINT_LATCHUPS): { - PoolReadGuard pg(&pdu2HkTableDataset); + PoolReadGuard pg(&auxHk); result = pg.getReadResult(); if (result != HasReturnvaluesIF::RETURN_OK) { break; @@ -398,77 +85,45 @@ ReturnValue_t PDU2Handler::printStatus(DeviceCommandId_t cmd) { } void PDU2Handler::printHkTableSwitchVI() { + using namespace PDU2; sif::info << "PDU2 Info:" << std::endl; - sif::info << "Boot Cause: " << pdu2HkTableDataset.bootcause << " | Boot Count: " << std::setw(4) - << std::right << pdu2HkTableDataset.bootcount << std::endl; - sif::info << "Reset Cause: " << pdu2HkTableDataset.resetcause - << " | Battery Mode: " << static_cast(pdu2HkTableDataset.battMode.value) - << std::endl; + sif::info << "Boot Cause: " << auxHk.bootcause << " | Boot Count: " << std::setw(4) << std::right + << coreHk.bootcount << std::endl; + sif::info << "Reset Cause: " << auxHk.resetcause + << " | Battery Mode: " << static_cast(coreHk.battMode.value) << std::endl; sif::info << "SwitchState, Currents [mA], Voltages [mV]: " << std::endl; - sif::info << std::setw(30) << std::left << "Q7S" << std::dec << "| " - << unsigned(pdu2HkTableDataset.outEnabledQ7S.value) << ", " << std::setw(4) - << std::right << pdu2HkTableDataset.currentOutQ7S.value << ", " << std::setw(4) - << pdu2HkTableDataset.voltageOutQ7S.value << std::endl; - sif::info << std::setw(30) << std::left << "Payload PCDU Channel 1" << std::dec << "| " - << unsigned(pdu2HkTableDataset.outEnabledPlPCDUCh1.value) << ", " << std::setw(4) - << std::right << pdu2HkTableDataset.currentOutPayloadPCDUCh1.value << ", " - << std::setw(4) << pdu2HkTableDataset.voltageOutPayloadPCDUCh1.value << std::endl; - sif::info << std::setw(30) << std::left << "Reaction Wheels" << std::dec << "| " - << unsigned(pdu2HkTableDataset.outEnabledReactionWheels.value) << ", " << std::setw(4) - << std::right << pdu2HkTableDataset.currentOutReactionWheels.value << ", " - << std::setw(4) << pdu2HkTableDataset.voltageOutReactionWheels.value << std::endl; - sif::info << std::setw(30) << std::left << "TCS Board Heater Input" << std::dec << "| " - << unsigned(pdu2HkTableDataset.outEnabledTCSBoardHeaterIn.value) << ", " << std::setw(4) - << std::right << pdu2HkTableDataset.currentOutTCSBoardHeaterIn.value << ", " - << std::setw(4) << pdu2HkTableDataset.voltageOutTCSBoardHeaterIn.value << std::endl; - sif::info << std::setw(30) << std::left << "SuS Redundant" << std::dec << "| " - << unsigned(pdu2HkTableDataset.outEnabledSUSRedundant.value) << ", " << std::setw(4) - << std::right << pdu2HkTableDataset.currentOutSUSRedundant.value << ", " << std::setw(4) - << pdu2HkTableDataset.voltageOutSUSRedundant.value << std::endl; - sif::info << std::setw(30) << std::left << "Deployment mechanism" << std::dec << "| " - << unsigned(pdu2HkTableDataset.outEnabledDeplMechanism.value) << ", " << std::setw(4) - << std::right << pdu2HkTableDataset.currentOutDeplMechanism.value << ", " - << std::setw(4) << pdu2HkTableDataset.voltageOutDeplMechanism.value << std::endl; - sif::info << std::setw(30) << std::left << "Payload PCDU Channel 6" << std::dec << "| " - << unsigned(pdu2HkTableDataset.outEnabledPlPCDUCh6.value) << ", " << std::setw(4) - << std::right << pdu2HkTableDataset.currentOutPayloadPCDUCh6.value << ", " - << std::setw(4) << pdu2HkTableDataset.voltageOutPayloadPCDUCh6.value << std::endl; - sif::info << std::setw(30) << std::left << "ACS Board Side B" << std::dec << "| " - << unsigned(pdu2HkTableDataset.outEnabledAcsBoardSideB.value) << ", " << std::setw(4) - << std::right << pdu2HkTableDataset.currentOutACSBoardSideB.value << ", " - << std::setw(4) << pdu2HkTableDataset.voltageOutACSBoardSideB.value << std::endl; - sif::info << std::setw(30) << std::left << "Payload Camera" << std::dec << "| " - << unsigned(pdu2HkTableDataset.outEnabledPayloadCamera.value) << ", " << std::setw(4) - << std::right << pdu2HkTableDataset.currentOutPayloadCamera.value << ", " - << std::setw(4) << pdu2HkTableDataset.voltageOutPayloadCamera.value << std::right - << std::endl; + auto printerHelper = [&](std::string channelStr, Channels idx) { + sif::info << std::setw(30) << std::left << channelStr << std::dec << "| " + << unsigned(coreHk.outputEnables[idx]) << ", " << std::setw(4) << std::right + << coreHk.currents[idx] << ", " << std::setw(4) << coreHk.voltages[idx] << std::endl; + }; + printerHelper("Q7S", Channels::Q7S); + printerHelper("PL PCDU CH1", Channels::PAYLOAD_PCDU_CH1); + printerHelper("Reaction Wheels", Channels::RW); + printerHelper("TCS Board Heater Input", Channels::TCS_HEATER_IN); + printerHelper("SUS Redundant", Channels::SUS_REDUNDANT); + printerHelper("Deployment Mechanism", Channels::DEPY_MECHANISM); + printerHelper("PL PCDU CH6", Channels::PAYLOAD_PCDU_CH6); + printerHelper("ACS Board B Side", Channels::ACS_B_SIDE); + printerHelper("Payload Camera", Channels::PAYLOAD_CAMERA); } void PDU2Handler::printHkTableLatchups() { + using namespace PDU2; sif::info << "PDU2 Latchup Information" << std::endl; - sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "Q7S" << std::dec << "| " - << std::setw(4) << std::right << pdu2HkTableDataset.latchupsQ7S << std::endl; - sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "Payload PCDU Channel 1" << std::dec - << "| " << std::setw(4) << std::right << pdu2HkTableDataset.latchupsPayloadPcduCh1 - << std::endl; - sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "Reaction Wheels" << std::dec - << "| " << std::setw(4) << std::right << pdu2HkTableDataset.latchupsRw << std::endl; - sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "TCS Board Heater Input" << std::dec - << "| " << std::setw(4) << std::right << pdu2HkTableDataset.latchupsTcsBoardHeaterIn - << std::endl; - sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "SuS Nominal" << std::dec << "| " - << std::setw(4) << std::right << pdu2HkTableDataset.latchupsSusRedundant << std::endl; - sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "Deployment mechanism" << std::dec - << "| " << std::setw(4) << std::right << pdu2HkTableDataset.latchupsDeplMenchanism - << std::endl; - sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "Payload PCDU Channel 6" << std::dec - << "| " << std::setw(4) << std::right << pdu2HkTableDataset.latchupsPayloadPcduCh6 - << std::endl; - sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "ACS Board Side B" << std::dec - << "| " << std::setw(4) << std::right << pdu2HkTableDataset.latchupsAcsBoardSideB - << std::endl; - sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "Payload Camera" << std::dec << "| " - << std::setw(4) << std::right << pdu2HkTableDataset.latchupsPayloadCamera << std::endl; + auto printerHelper = [&](std::string channelStr, Channels idx) { + sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "TCS Board" << std::dec << "| " + << std::setw(4) << std::right << auxHk.latchups[idx] << std::endl; + }; + printerHelper("Q7S", Channels::Q7S); + printerHelper("PL PCDU CH1", Channels::PAYLOAD_PCDU_CH1); + printerHelper("Reaction Wheels", Channels::RW); + printerHelper("TCS Board Heater Input", Channels::TCS_HEATER_IN); + printerHelper("SUS Redundant", Channels::SUS_REDUNDANT); + printerHelper("Deployment Mechanism", Channels::DEPY_MECHANISM); + printerHelper("PL PCDU CH6", Channels::PAYLOAD_PCDU_CH6); + printerHelper("ACS Board B Side", Channels::ACS_B_SIDE); + printerHelper("Payload Camera", Channels::PAYLOAD_CAMERA); } ReturnValue_t PDU2Handler::setParamCallback(SetParamMessageUnpacker &unpacker, diff --git a/mission/devices/PDU2Handler.h b/mission/devices/PDU2Handler.h index ab113dda..2680c80e 100644 --- a/mission/devices/PDU2Handler.h +++ b/mission/devices/PDU2Handler.h @@ -42,7 +42,8 @@ class PDU2Handler : public GomspaceDeviceHandler { static constexpr uint8_t MAX_CHANNEL_STR_WIDTH = 24; /** Dataset for the housekeeping table of the PDU2 */ - PDU2::PDU2HkTableDataset pdu2HkTableDataset; + PDU2::Pdu2CoreHk coreHk; + PDU2::Pdu2AuxHk auxHk; GOMSPACE::ChannelSwitchHook channelSwitchHook = nullptr; void* hookArgs = nullptr; diff --git a/mission/devices/SolarArrayDeploymentHandler.cpp b/mission/devices/SolarArrayDeploymentHandler.cpp index 9bb016b7..2b24ba07 100644 --- a/mission/devices/SolarArrayDeploymentHandler.cpp +++ b/mission/devices/SolarArrayDeploymentHandler.cpp @@ -7,7 +7,7 @@ SolarArrayDeploymentHandler::SolarArrayDeploymentHandler( object_id_t setObjectId_, object_id_t gpioDriverId_, CookieIF* gpioCookie_, - object_id_t mainLineSwitcherObjectId_, pcduSwitches::Switches mainLineSwitch_, gpioId_t deplSA1, + object_id_t mainLineSwitcherObjectId_, pcdu::Switches mainLineSwitch_, gpioId_t deplSA1, gpioId_t deplSA2, uint32_t burnTimeMs) : SystemObject(setObjectId_), gpioDriverId(gpioDriverId_), diff --git a/mission/devices/SolarArrayDeploymentHandler.h b/mission/devices/SolarArrayDeploymentHandler.h index e5d91d3d..d66a0509 100644 --- a/mission/devices/SolarArrayDeploymentHandler.h +++ b/mission/devices/SolarArrayDeploymentHandler.h @@ -43,8 +43,8 @@ class SolarArrayDeploymentHandler : public ExecutableObjectIF, */ SolarArrayDeploymentHandler(object_id_t setObjectId, object_id_t gpioDriverId, CookieIF* gpioCookie, object_id_t mainLineSwitcherObjectId, - pcduSwitches::Switches mainLineSwitch, gpioId_t deplSA1, - gpioId_t deplSA2, uint32_t burnTimeMs); + pcdu::Switches mainLineSwitch, gpioId_t deplSA1, gpioId_t deplSA2, + uint32_t burnTimeMs); virtual ~SolarArrayDeploymentHandler(); diff --git a/mission/devices/devicedefinitions/GomspaceDefinitions.h b/mission/devices/devicedefinitions/GomspaceDefinitions.h index 8b19c909..e0d73d22 100644 --- a/mission/devices/devicedefinitions/GomspaceDefinitions.h +++ b/mission/devices/devicedefinitions/GomspaceDefinitions.h @@ -4,9 +4,12 @@ #include #include #include +#include #include +#include "devices/powerSwitcherList.h" + namespace GOMSPACE { enum class Pdu { PDU1, PDU2 }; @@ -45,14 +48,22 @@ namespace P60System { enum class BatteryModes : uint8_t { CRITICAL = 1, SAFE = 2, NORMAL = 3, FULL = 4 }; -enum class SetIds : uint32_t { PDU_1 = 1, PDU_2 = 2, P60_CORE = 3, P60_AUX = 4, ACU = 5 }; +enum class SetIds : uint32_t { + PDU_1_CORE = 1, + PDU_1_AUX = 2, + PDU_2_CORE = 3, + PDU_2_AUX = 4, + P60_CORE = 5, + P60_AUX = 6, + ACU = 7 +}; namespace pool { enum Ids : lp_id_t { - CURRENTS, - VOLTAGES, - OUTPUT_ENABLE, + P60_CURRENTS, + P60_VOLTAGES, + P60_OUTPUT_ENABLE, P60DOCK_TEMPERATURE_1, P60DOCK_TEMPERATURE_2, P60DOCK_BOOT_CAUSE, @@ -90,154 +101,34 @@ enum Ids : lp_id_t { P60DOCK_ANT6_DEPL, P60DOCK_AR6_DEPL, - PDU1_CURRENT_OUT_TCS_BOARD_3V3, - PDU1_CURRENT_OUT_SYRLINKS, - PDU1_CURRENT_OUT_STAR_TRACKER, - PDU1_CURRENT_OUT_MGT, - PDU1_CURRENT_OUT_SUS_NOMINAL, - PDU1_CURRENT_OUT_SOLAR_CELL_EXP, - PDU1_CURRENT_OUT_PLOC, - PDU1_CURRENT_OUT_ACS_BOARD_SIDE_A, - PDU1_CURRENT_OUT_CHANNEL8, - PDU1_VOLTAGE_OUT_TCS_BOARD_3V3, - PDU1_VOLTAGE_OUT_SYRLINKS, - PDU1_VOLTAGE_OUT_STAR_TRACKER, - PDU1_VOLTAGE_OUT_MGT, - PDU1_VOLTAGE_OUT_SUS_NOMINAL, - PDU1_VOLTAGE_OUT_SOLAR_CELL_EXP, - PDU1_VOLTAGE_OUT_PLOC, - PDU1_VOLTAGE_OUT_ACS_BOARD_SIDE_A, - PDU1_VOLTAGE_OUT_CHANNEL8, - PDU1_VCC, - PDU1_VBAT, - PDU1_TEMPERATURE, - PDU1_CONV_EN_1, - PDU1_CONV_EN_2, - PDU1_CONV_EN_3, - PDU1_OUT_EN_TCS_BOARD_3V3, - PDU1_OUT_EN_SYRLINKS, - PDU1_OUT_EN_STAR_TRACKER, - PDU1_OUT_EN_MGT, - PDU1_OUT_EN_SUS_NOMINAL, - PDU1_OUT_EN_SOLAR_CELL_EXP, - PDU1_OUT_EN_PLOC, - PDU1_OUT_EN_ACS_BOARD_SIDE_A, - PDU1_OUT_EN_CHANNEL8, - PDU1_BOOTCAUSE, - PDU1_BOOTCNT, - PDU1_UPTIME, - PDU1_RESETCAUSE, - PDU1_BATT_MODE, - PDU1_LATCHUP_TCS_BOARD_3V3, - PDU1_LATCHUP_SYRLINKS, - PDU1_LATCHUP_STAR_TRACKER, - PDU1_LATCHUP_MGT, - PDU1_LATCHUP_SUS_NOMINAL, - PDU1_LATCHUP_SOLAR_CELL_EXP, - PDU1_LATCHUP_PLOC, - PDU1_LATCHUP_ACS_BOARD_SIDE_A, - PDU1_LATCHUP_CHANNEL8, - PDU1_DEVICE_0, - PDU1_DEVICE_1, - PDU1_DEVICE_2, - PDU1_DEVICE_3, - PDU1_DEVICE_4, - PDU1_DEVICE_5, - PDU1_DEVICE_6, - PDU1_DEVICE_7, - PDU1_DEVICE_0_STATUS, - PDU1_DEVICE_1_STATUS, - PDU1_DEVICE_2_STATUS, - PDU1_DEVICE_3_STATUS, - PDU1_DEVICE_4_STATUS, - PDU1_DEVICE_5_STATUS, - PDU1_DEVICE_6_STATUS, - PDU1_DEVICE_7_STATUS, - PDU1_WDT_CNT_GND, - PDU1_WDT_CNT_I2C, - PDU1_WDT_CNT_CAN, - PDU1_WDT_CNT_CSP1, - PDU1_WDT_CNT_CSP2, - PDU1_WDT_GND_LEFT, - PDU1_WDT_I2C_LEFT, - PDU1_WDT_CAN_LEFT, - PDU1_WDT_CSP_LEFT1, - PDU1_WDT_CSP_LEFT2, - - /** PDU2 Ids */ - PDU2_CURRENT_OUT_Q7S, - PDU2_CURRENT_OUT_PAYLOAD_PCDU_CH1, - PDU2_CURRENT_OUT_RW, - PDU2_CURRENT_OUT_TCS_BOARD_HEATER_IN, - PDU2_CURRENT_OUT_SUS_REDUNDANT, - PDU2_CURRENT_OUT_DEPLOYMENT_MECHANISM, - PDU2_CURRENT_OUT_PAYLOAD_PCDU_CH6, - PDU2_CURRENT_OUT_ACS_BOARD_SIDE_B, - PDU2_CURRENT_OUT_PAYLOAD_CAMERA, - PDU2_VOLTAGE_OUT_Q7S, - PDU2_VOLTAGE_OUT_PAYLOAD_PCDU_CH1, - PDU2_VOLTAGE_OUT_RW, - PDU2_VOLTAGE_OUT_TCS_BOARD_HEATER_IN, - PDU2_VOLTAGE_OUT_SUS_REDUNDANT, - PDU2_VOLTAGE_OUT_DEPLOYMENT_MECHANISM, - PDU2_VOLTAGE_OUT_PAYLOAD_PCDU_CH6, - PDU2_VOLTAGE_OUT_ACS_BOARD_SIDE_B, - PDU2_VOLTAGE_OUT_PAYLOAD_CAMERA, - PDU2_VCC, - PDU2_VBAT, - PDU2_TEMPERATURE, - PDU2_CONV_EN_1, - PDU2_CONV_EN_2, - PDU2_CONV_EN_3, - PDU2_OUT_EN_Q7S, - PDU2_OUT_EN_PAYLOAD_PCDU_CH1, - PDU2_OUT_EN_RW, - PDU2_OUT_EN_TCS_BOARD_HEATER_IN, - PDU2_OUT_EN_SUS_REDUNDANT, - PDU2_OUT_EN_DEPLOYMENT_MECHANISM, - PDU2_OUT_EN_PAYLOAD_PCDU_CH6, - PDU2_OUT_EN_ACS_BOARD_SIDE_B, - PDU2_OUT_EN_PAYLOAD_CAMERA, - PDU2_BOOTCAUSE, - PDU2_BOOTCNT, - PDU2_UPTIME, - PDU2_RESETCAUSE, - PDU2_BATT_MODE, - PDU2_LATCHUP_Q7S, - PDU2_LATCHUP_PAYLOAD_PCDU_CH1, - PDU2_LATCHUP_RW, - PDU2_LATCHUP_TCS_BOARD_HEATER_IN, - PDU2_LATCHUP_SUS_REDUNDANT, - PDU2_LATCHUP_DEPLOYMENT_MECHANISM, - PDU2_LATCHUP_PAYLOAD_PCDU_CH6, - PDU2_LATCHUP_ACS_BOARD_SIDE_B, - PDU2_LATCHUP_PAYLOAD_CAMERA, - PDU2_DEVICE_0, - PDU2_DEVICE_1, - PDU2_DEVICE_2, - PDU2_DEVICE_3, - PDU2_DEVICE_4, - PDU2_DEVICE_5, - PDU2_DEVICE_6, - PDU2_DEVICE_7, - PDU2_DEVICE_0_STATUS, - PDU2_DEVICE_1_STATUS, - PDU2_DEVICE_2_STATUS, - PDU2_DEVICE_3_STATUS, - PDU2_DEVICE_4_STATUS, - PDU2_DEVICE_5_STATUS, - PDU2_DEVICE_6_STATUS, - PDU2_DEVICE_7_STATUS, - PDU2_WDT_CNT_GND, - PDU2_WDT_CNT_I2C, - PDU2_WDT_CNT_CAN, - PDU2_WDT_CNT_CSP1, - PDU2_WDT_CNT_CSP2, - PDU2_WDT_GND_LEFT, - PDU2_WDT_I2C_LEFT, - PDU2_WDT_CAN_LEFT, - PDU2_WDT_CSP_LEFT1, - PDU2_WDT_CSP_LEFT2, + // IDs for both PDUs + PDU_CURRENTS, + PDU_VOLTAGES, + PDU_VCC, + PDU_VBAT, + PDU_TEMPERATURE, + PDU_CONV_EN_1, + PDU_CONV_EN_2, + PDU_CONV_EN_3, + PDU_OUT_ENABLE, + PDU_BOOTCAUSE, + PDU_BOOTCNT, + PDU_UPTIME, + PDU_RESETCAUSE, + PDU_BATT_MODE, + PDU_LATCHUPS, + PDU_DEVICES, + PDU_STATUSES, + PDU_WDT_CNT_GND, + PDU_WDT_CNT_I2C, + PDU_WDT_CNT_CAN, + PDU_WDT_CNT_CSP1, + PDU_WDT_CNT_CSP2, + PDU_WDT_GND_LEFT, + PDU_WDT_I2C_LEFT, + PDU_WDT_CAN_LEFT, + PDU_WDT_CSP_LEFT1, + PDU_WDT_CSP_LEFT2, /** ACU Ids */ ACU_CURRENT_IN_CHANNEL0, @@ -302,7 +193,7 @@ enum Ids : lp_id_t { ACU_DEVICE_6_STATUS, ACU_DEVICE_7_STATUS, ACU_WDT_CNT_GND, - ACU_WDT_GND_LEFT + ACU_WDT_GND_LEFT, }; } } // namespace P60System @@ -373,18 +264,18 @@ class CoreHkSet : public StaticLocalDataSet<16> { /** Measured output currents */ lp_vec_t currents = - lp_vec_t(sid.objectId, P60System::pool::CURRENTS, + lp_vec_t(sid.objectId, P60System::pool::P60_CURRENTS, this); /** Measured output voltages */ lp_vec_t voltages = - lp_vec_t(sid.objectId, P60System::pool::VOLTAGES, + lp_vec_t(sid.objectId, P60System::pool::P60_VOLTAGES, this); /** Output enable states */ lp_vec_t outputEnables = - lp_vec_t(sid.objectId, P60System::pool::OUTPUT_ENABLE, - this); + lp_vec_t(sid.objectId, + P60System::pool::P60_OUTPUT_ENABLE, this); lp_var_t bootCount = lp_var_t(sid.objectId, P60System::pool::P60DOCK_BOOT_CNT, this); lp_var_t battMode = @@ -495,11 +386,114 @@ static const uint16_t MAX_HKTABLE_ADDRESS = 141; /** The size of the csp reply containing the housekeeping table data */ static const uint16_t HK_TABLE_REPLY_SIZE = 303; static const uint8_t HK_TABLE_ENTRIES = 73; + +static constexpr uint8_t CHANNELS_LEN = 9; +static constexpr uint8_t DEVICES_NUM = 8; + +class PduCoreHk : public StaticLocalDataSet<9> { + public: + PduCoreHk(HasLocalDataPoolIF* owner, uint32_t setId) : StaticLocalDataSet(owner, setId) {} + + PduCoreHk(object_id_t objectId, uint32_t setId) : StaticLocalDataSet(sid_t(objectId, setId)) {} + + /** Measured output currents */ + lp_vec_t currents = + lp_vec_t(sid.objectId, P60System::pool::PDU_CURRENTS, this); + /** Measured output currents */ + lp_vec_t voltages = + lp_vec_t(sid.objectId, P60System::pool::PDU_VOLTAGES, this); + /** Output switch states */ + lp_vec_t outputEnables = + lp_vec_t(sid.objectId, P60System::pool::PDU_VOLTAGES, this); + /** Number of reboots */ + lp_var_t bootcount = + lp_var_t(sid.objectId, P60System::pool::PDU_BOOTCNT, this); + /** Battery mode: 1 = Critical, 2 = Safe, 3 = Normal, 4 = Full */ + lp_var_t battMode = + lp_var_t(sid.objectId, P60System::pool::PDU_BATT_MODE, this); + lp_var_t temperature = + lp_var_t(sid.objectId, P60System::pool::PDU_TEMPERATURE, this); +}; + +/** + * @brief This class defines a dataset for the hk table of a PDU + */ +class PduAuxHk : public StaticLocalDataSet<36> { + public: + PduAuxHk(HasLocalDataPoolIF* owner, uint32_t setId) : StaticLocalDataSet(owner, setId) {} + + PduAuxHk(object_id_t objectId, uint32_t setId) : StaticLocalDataSet(sid_t(objectId, setId)) {} + + /** Measured VCC */ + lp_var_t vcc = lp_var_t(sid.objectId, P60System::pool::PDU_VCC, this); + /** Measured VBAT */ + lp_var_t vbat = lp_var_t(sid.objectId, P60System::pool::PDU_VBAT, this); + + /** Output converter enable status */ + lp_var_t converterEnable1 = + lp_var_t(sid.objectId, P60System::pool::PDU_CONV_EN_1, this); + lp_var_t converterEnable2 = + lp_var_t(sid.objectId, P60System::pool::PDU_CONV_EN_2, this); + lp_var_t converterEnable3 = + lp_var_t(sid.objectId, P60System::pool::PDU_CONV_EN_3, this); + + lp_var_t bootcause = + lp_var_t(sid.objectId, P60System::pool::PDU_BOOTCAUSE, this); + + /** Uptime in seconds */ + lp_var_t uptime = lp_var_t(sid.objectId, P60System::pool::PDU_UPTIME, this); + lp_var_t resetcause = + lp_var_t(sid.objectId, P60System::pool::PDU_RESETCAUSE, this); + + /** Number of detected latchups on each output channel */ + lp_vec_t latchups = + lp_vec_t(sid.objectId, P60System::pool::PDU_LATCHUPS, this); + + /** + * There are 8 devices on the PDU. FRAM, ADCs, temperature sensor etc. Each device is + * identified by an ID. Refer also to gs-man-nanopower-p60-pdu-200-1.pdf on pages 17 and 18. + */ + lp_vec_t deviceTypes = + lp_vec_t(sid.objectId, P60System::pool::PDU_DEVICES, this); + /** The status of each device. 0 = None, 1 = Ok, 2 = Error, 3 = Not found */ + lp_vec_t devicesStatus = + lp_vec_t(sid.objectId, P60System::pool::PDU_STATUSES, this); + + /** Number of reboots triggered by the ground watchdog */ + lp_var_t gndWdtReboots = + lp_var_t(sid.objectId, P60System::pool::PDU_WDT_CNT_GND, this); + /** Number of reboots triggered through the I2C watchdog. Not relevant for EIVE. */ + lp_var_t i2cWdtReboots = + lp_var_t(sid.objectId, P60System::pool::PDU_WDT_CNT_I2C, this); + /** Number of reboots triggered through the CAN watchdog */ + lp_var_t canWdtReboots = + lp_var_t(sid.objectId, P60System::pool::PDU_WDT_CNT_CAN, this); + /** Number of reboots triggered through the CSP watchdog */ + lp_var_t csp1WdtReboots = + lp_var_t(sid.objectId, P60System::pool::PDU_WDT_CNT_CSP1, this); + lp_var_t csp2WdtReboots = + lp_var_t(sid.objectId, P60System::pool::PDU_WDT_CNT_CSP2, this); + /** Ground watchdog remaining seconds before rebooting */ + lp_var_t groundWatchdogSecondsLeft = + lp_var_t(sid.objectId, P60System::pool::PDU_WDT_GND_LEFT, this); + /** I2C watchdog remaining seconds before rebooting. Not relevant for EIVE. */ + lp_var_t i2cWatchdogSecondsLeft = + lp_var_t(sid.objectId, P60System::pool::PDU_WDT_I2C_LEFT, this); + /** CAN watchdog remaining seconds before rebooting. */ + lp_var_t canWatchdogSecondsLeft = + lp_var_t(sid.objectId, P60System::pool::PDU_WDT_CAN_LEFT, this); + /** CSP watchdogs remaining pings before rebooting. */ + lp_var_t csp2WatchdogPingsLeft = + lp_var_t(sid.objectId, P60System::pool::PDU_WDT_CSP_LEFT1, this); + lp_var_t csp1WatchdogPingsLeft = + lp_var_t(sid.objectId, P60System::pool::PDU_WDT_CSP_LEFT2, this); +}; + } // namespace PDU namespace PDU1 { -enum SwitchChannels : uint8_t { +enum Channels : uint8_t { TCS_BOARD_3V3 = 0, SYRLINKS = 1, STR = 2, @@ -508,7 +502,8 @@ enum SwitchChannels : uint8_t { SOL_CELL_EXPERIMENT = 5, PLOC = 6, ACS_A_SIDE = 7, - UNUSED = 8 + UNUSED = 8, + LEN = 9 }; /** @@ -525,185 +520,29 @@ static const uint16_t CONFIG_ADDRESS_OUT_EN_PLOC = 0x4E; static const uint16_t CONFIG_ADDRESS_OUT_EN_ACS_BOARD_SIDE_A = 0x4F; static const uint16_t CONFIG_ADDRESS_OUT_EN_CHANNEL8 = 0x50; -/** - * @brief This class defines a dataset for the hk table of the PDU1. - */ -class PDU1HkTableDataset : public StaticLocalDataSet { +class Pdu1CoreHk : public ::PDU::PduCoreHk { public: - PDU1HkTableDataset(HasLocalDataPoolIF* owner) - : StaticLocalDataSet(owner, static_cast(::P60System::SetIds::PDU_1)) {} + Pdu1CoreHk(HasLocalDataPoolIF* owner) + : PduCoreHk(owner, static_cast(::P60System::SetIds::PDU_1_CORE)) {} - PDU1HkTableDataset(object_id_t objectId) - : StaticLocalDataSet(sid_t(objectId, static_cast(::P60System::SetIds::PDU_1))) {} - - /** Measured output currents */ - lp_var_t currentOutTCSBoard3V3 = - lp_var_t(sid.objectId, P60System::pool::PDU1_CURRENT_OUT_TCS_BOARD_3V3, this); - lp_var_t currentOutSyrlinks = - lp_var_t(sid.objectId, P60System::pool::PDU1_CURRENT_OUT_SYRLINKS, this); - lp_var_t currentOutStarTracker = - lp_var_t(sid.objectId, P60System::pool::PDU1_CURRENT_OUT_STAR_TRACKER, this); - lp_var_t currentOutMGT = - lp_var_t(sid.objectId, P60System::pool::PDU1_CURRENT_OUT_MGT, this); - lp_var_t currentOutSUSNominal = - lp_var_t(sid.objectId, P60System::pool::PDU1_CURRENT_OUT_SUS_NOMINAL, this); - lp_var_t currentOutSolarCellExp = - lp_var_t(sid.objectId, P60System::pool::PDU1_CURRENT_OUT_SOLAR_CELL_EXP, this); - lp_var_t currentOutPLOC = - lp_var_t(sid.objectId, P60System::pool::PDU1_CURRENT_OUT_PLOC, this); - lp_var_t currentOutACSBoardSideA = - lp_var_t(sid.objectId, P60System::pool::PDU1_CURRENT_OUT_ACS_BOARD_SIDE_A, this); - lp_var_t currentOutChannel8 = - lp_var_t(sid.objectId, P60System::pool::PDU1_CURRENT_OUT_CHANNEL8, this); - /** Measured voltage of output channels */ - lp_var_t voltageOutTCSBoard3V3 = - lp_var_t(sid.objectId, P60System::pool::PDU1_VOLTAGE_OUT_TCS_BOARD_3V3, this); - lp_var_t voltageOutSyrlinks = - lp_var_t(sid.objectId, P60System::pool::PDU1_VOLTAGE_OUT_SYRLINKS, this); - lp_var_t voltageOutStarTracker = - lp_var_t(sid.objectId, P60System::pool::PDU1_VOLTAGE_OUT_STAR_TRACKER, this); - lp_var_t voltageOutMGT = - lp_var_t(sid.objectId, P60System::pool::PDU1_VOLTAGE_OUT_MGT, this); - lp_var_t voltageOutSUSNominal = - lp_var_t(sid.objectId, P60System::pool::PDU1_VOLTAGE_OUT_SUS_NOMINAL, this); - lp_var_t voltageOutSolarCellExp = - lp_var_t(sid.objectId, P60System::pool::PDU1_VOLTAGE_OUT_SOLAR_CELL_EXP, this); - lp_var_t voltageOutPLOC = - lp_var_t(sid.objectId, P60System::pool::PDU1_VOLTAGE_OUT_PLOC, this); - lp_var_t voltageOutACSBoardSideA = - lp_var_t(sid.objectId, P60System::pool::PDU1_VOLTAGE_OUT_ACS_BOARD_SIDE_A, this); - lp_var_t voltageOutChannel8 = - lp_var_t(sid.objectId, P60System::pool::PDU1_VOLTAGE_OUT_CHANNEL8, this); - /** Measured VCC */ - lp_var_t vcc = lp_var_t(sid.objectId, P60System::pool::PDU1_VCC, this); - /** Measured VBAT */ - lp_var_t vbat = lp_var_t(sid.objectId, P60System::pool::PDU1_VBAT, this); - lp_var_t temperature = - lp_var_t(sid.objectId, P60System::pool::PDU1_TEMPERATURE, this); - /** Output converter enable status */ - lp_var_t converterEnable1 = - lp_var_t(sid.objectId, P60System::pool::PDU1_CONV_EN_1, this); - lp_var_t converterEnable2 = - lp_var_t(sid.objectId, P60System::pool::PDU1_CONV_EN_2, this); - lp_var_t converterEnable3 = - lp_var_t(sid.objectId, P60System::pool::PDU1_CONV_EN_3, this); - - /** Output channels enable status */ - lp_var_t outEnabledTCSBoard3V3 = - lp_var_t(sid.objectId, P60System::pool::PDU1_OUT_EN_TCS_BOARD_3V3, this); - lp_var_t outEnabledSyrlinks = - lp_var_t(sid.objectId, P60System::pool::PDU1_OUT_EN_SYRLINKS, this); - lp_var_t outEnabledStarTracker = - lp_var_t(sid.objectId, P60System::pool::PDU1_OUT_EN_STAR_TRACKER, this); - lp_var_t outEnabledMGT = - lp_var_t(sid.objectId, P60System::pool::PDU1_OUT_EN_MGT, this); - lp_var_t outEnabledSUSNominal = - lp_var_t(sid.objectId, P60System::pool::PDU1_OUT_EN_SUS_NOMINAL, this); - lp_var_t outEnabledSolarCellExp = - lp_var_t(sid.objectId, P60System::pool::PDU1_OUT_EN_SOLAR_CELL_EXP, this); - lp_var_t outEnabledPLOC = - lp_var_t(sid.objectId, P60System::pool::PDU1_OUT_EN_PLOC, this); - lp_var_t outEnabledAcsBoardSideA = - lp_var_t(sid.objectId, P60System::pool::PDU1_OUT_EN_ACS_BOARD_SIDE_A, this); - lp_var_t outEnabledChannel8 = - lp_var_t(sid.objectId, P60System::pool::PDU1_OUT_EN_CHANNEL8, this); - lp_var_t bootcause = - lp_var_t(sid.objectId, P60System::pool::PDU1_BOOTCAUSE, this); - /** Number of reboots */ - lp_var_t bootcount = - lp_var_t(sid.objectId, P60System::pool::PDU1_BOOTCNT, this); - /** Uptime in seconds */ - lp_var_t uptime = lp_var_t(sid.objectId, P60System::pool::PDU1_UPTIME, this); - lp_var_t resetcause = - lp_var_t(sid.objectId, P60System::pool::PDU1_RESETCAUSE, this); - /** Battery mode: 1 = Critical, 2 = Safe, 3 = Normal, 4 = Full */ - lp_var_t battMode = - lp_var_t(sid.objectId, P60System::pool::PDU1_BATT_MODE, this); - - /** Number of detected latchups on each output channel */ - lp_var_t latchupsTcsBoard3V3 = - lp_var_t(sid.objectId, P60System::pool::PDU1_LATCHUP_TCS_BOARD_3V3, this); - lp_var_t latchupsSyrlinks = - lp_var_t(sid.objectId, P60System::pool::PDU1_LATCHUP_SYRLINKS, this); - lp_var_t latchupsStarTracker = - lp_var_t(sid.objectId, P60System::pool::PDU1_LATCHUP_STAR_TRACKER, this); - lp_var_t latchupsMgt = - lp_var_t(sid.objectId, P60System::pool::PDU1_LATCHUP_MGT, this); - lp_var_t latchupsSusNominal = - lp_var_t(sid.objectId, P60System::pool::PDU1_LATCHUP_SUS_NOMINAL, this); - lp_var_t latchupsSolarCellExp = - lp_var_t(sid.objectId, P60System::pool::PDU1_LATCHUP_SOLAR_CELL_EXP, this); - lp_var_t latchupsPloc = - lp_var_t(sid.objectId, P60System::pool::PDU1_LATCHUP_PLOC, this); - lp_var_t latchupsAcsBoardSideA = - lp_var_t(sid.objectId, P60System::pool::PDU1_LATCHUP_ACS_BOARD_SIDE_A, this); - lp_var_t latchupsChannel8 = - lp_var_t(sid.objectId, P60System::pool::PDU1_LATCHUP_CHANNEL8, this); - - /** - * There are 8 devices on the PDU. FRAM, ADCs, temperature sensor etc. Each device is - * identified by an ID. Refer also to gs-man-nanopower-p60-pdu-200-1.pdf on pages 17 and 18. - */ - lp_var_t device0 = lp_var_t(sid.objectId, P60System::pool::PDU1_DEVICE_0, this); - lp_var_t device1 = lp_var_t(sid.objectId, P60System::pool::PDU1_DEVICE_1, this); - lp_var_t device2 = lp_var_t(sid.objectId, P60System::pool::PDU1_DEVICE_2, this); - lp_var_t device3 = lp_var_t(sid.objectId, P60System::pool::PDU1_DEVICE_3, this); - lp_var_t device4 = lp_var_t(sid.objectId, P60System::pool::PDU1_DEVICE_4, this); - lp_var_t device5 = lp_var_t(sid.objectId, P60System::pool::PDU1_DEVICE_5, this); - lp_var_t device6 = lp_var_t(sid.objectId, P60System::pool::PDU1_DEVICE_6, this); - lp_var_t device7 = lp_var_t(sid.objectId, P60System::pool::PDU1_DEVICE_7, this); - /** The status of each device. 0 = None, 1 = Ok, 2 = Error, 3 = Not found */ - lp_var_t device0Status = - lp_var_t(sid.objectId, P60System::pool::PDU1_DEVICE_0_STATUS, this); - lp_var_t device1Status = - lp_var_t(sid.objectId, P60System::pool::PDU1_DEVICE_1_STATUS, this); - lp_var_t device2Status = - lp_var_t(sid.objectId, P60System::pool::PDU1_DEVICE_2_STATUS, this); - lp_var_t device3Status = - lp_var_t(sid.objectId, P60System::pool::PDU1_DEVICE_3_STATUS, this); - lp_var_t device4Status = - lp_var_t(sid.objectId, P60System::pool::PDU1_DEVICE_4_STATUS, this); - lp_var_t device5Status = - lp_var_t(sid.objectId, P60System::pool::PDU1_DEVICE_5_STATUS, this); - lp_var_t device6Status = - lp_var_t(sid.objectId, P60System::pool::PDU1_DEVICE_6_STATUS, this); - lp_var_t device7Status = - lp_var_t(sid.objectId, P60System::pool::PDU1_DEVICE_7_STATUS, this); - - /** Number of reboots triggered by the ground watchdog */ - lp_var_t gndWdtReboots = - lp_var_t(sid.objectId, P60System::pool::PDU1_WDT_CNT_GND, this); - /** Number of reboots triggered through the I2C watchdog. Not relevant for EIVE. */ - lp_var_t i2cWdtReboots = - lp_var_t(sid.objectId, P60System::pool::PDU1_WDT_CNT_I2C, this); - /** Number of reboots triggered through the CAN watchdog */ - lp_var_t canWdtReboots = - lp_var_t(sid.objectId, P60System::pool::PDU1_WDT_CNT_CAN, this); - /** Number of reboots triggered through the CSP watchdog */ - lp_var_t csp1WdtReboots = - lp_var_t(sid.objectId, P60System::pool::PDU1_WDT_CNT_CSP1, this); - lp_var_t csp2WdtReboots = - lp_var_t(sid.objectId, P60System::pool::PDU1_WDT_CNT_CSP2, this); - /** Ground watchdog remaining seconds before rebooting */ - lp_var_t groundWatchdogSecondsLeft = - lp_var_t(sid.objectId, P60System::pool::PDU1_WDT_GND_LEFT, this); - /** I2C watchdog remaining seconds before rebooting. Not relevant for EIVE. */ - lp_var_t i2cWatchdogSecondsLeft = - lp_var_t(sid.objectId, P60System::pool::PDU1_WDT_I2C_LEFT, this); - /** CAN watchdog remaining seconds before rebooting. */ - lp_var_t canWatchdogSecondsLeft = - lp_var_t(sid.objectId, P60System::pool::PDU1_WDT_CAN_LEFT, this); - /** CSP watchdogs remaining pings before rebooting. */ - lp_var_t csp2WatchdogPingsLeft = - lp_var_t(sid.objectId, P60System::pool::PDU1_WDT_CSP_LEFT1, this); - lp_var_t csp1WatchdogPingsLeft = - lp_var_t(sid.objectId, P60System::pool::PDU1_WDT_CSP_LEFT2, this); + Pdu1CoreHk(object_id_t objectId) + : PduCoreHk(objectId, static_cast(::P60System::SetIds::PDU_1_CORE)) {} }; + +class Pdu1AuxHk : public ::PDU::PduAuxHk { + public: + Pdu1AuxHk(HasLocalDataPoolIF* owner) + : PduAuxHk(owner, static_cast(::P60System::SetIds::PDU_1_AUX)) {} + + Pdu1AuxHk(object_id_t objectId) + : PduAuxHk(objectId, static_cast(::P60System::SetIds::PDU_1_AUX)) {} +}; + } // namespace PDU1 namespace PDU2 { -enum SwitchChannels : uint8_t { +enum Channels : uint8_t { Q7S = 0, PAYLOAD_PCDU_CH1 = 1, RW = 2, @@ -712,7 +551,8 @@ enum SwitchChannels : uint8_t { DEPY_MECHANISM = 5, PAYLOAD_PCDU_CH6 = 6, ACS_B_SIDE = 7, - PAYLOAD_CAMERA = 8 + PAYLOAD_CAMERA = 8, + LEN = 9 }; /** @@ -729,180 +569,24 @@ static const uint16_t CONFIG_ADDRESS_OUT_EN_PAYLOAD_PCDU_CH6 = 0x4E; static const uint16_t CONFIG_ADDRESS_OUT_EN_ACS_BOARD_SIDE_B = 0x4F; static const uint16_t CONFIG_ADDRESS_OUT_EN_PAYLOAD_CAMERA = 0x50; -/** - * @brief This class defines a dataset for the hk table of the PDU2. - */ -class PDU2HkTableDataset : public StaticLocalDataSet { +class Pdu2CoreHk : public ::PDU::PduCoreHk { public: - PDU2HkTableDataset(HasLocalDataPoolIF* owner) - : StaticLocalDataSet(owner, static_cast(::P60System::SetIds::PDU_2)) {} + Pdu2CoreHk(HasLocalDataPoolIF* owner) + : PduCoreHk(owner, static_cast(::P60System::SetIds::PDU_2_CORE)) {} - PDU2HkTableDataset(object_id_t objectId) - : StaticLocalDataSet(sid_t(objectId, static_cast(::P60System::SetIds::PDU_2))) {} - - /** Measured output currents */ - lp_var_t currentOutQ7S = - lp_var_t(sid.objectId, P60System::pool::PDU2_CURRENT_OUT_Q7S, this); - lp_var_t currentOutPayloadPCDUCh1 = - lp_var_t(sid.objectId, P60System::pool::PDU2_CURRENT_OUT_PAYLOAD_PCDU_CH1, this); - lp_var_t currentOutReactionWheels = - lp_var_t(sid.objectId, P60System::pool::PDU2_CURRENT_OUT_RW, this); - lp_var_t currentOutTCSBoardHeaterIn = - lp_var_t(sid.objectId, P60System::pool::PDU2_CURRENT_OUT_TCS_BOARD_HEATER_IN, this); - lp_var_t currentOutSUSRedundant = - lp_var_t(sid.objectId, P60System::pool::PDU2_CURRENT_OUT_SUS_REDUNDANT, this); - lp_var_t currentOutDeplMechanism = - lp_var_t(sid.objectId, P60System::pool::PDU2_CURRENT_OUT_DEPLOYMENT_MECHANISM, this); - lp_var_t currentOutPayloadPCDUCh6 = - lp_var_t(sid.objectId, P60System::pool::PDU2_CURRENT_OUT_PAYLOAD_PCDU_CH6, this); - lp_var_t currentOutACSBoardSideB = - lp_var_t(sid.objectId, P60System::pool::PDU2_CURRENT_OUT_ACS_BOARD_SIDE_B, this); - lp_var_t currentOutPayloadCamera = - lp_var_t(sid.objectId, P60System::pool::PDU2_CURRENT_OUT_PAYLOAD_CAMERA, this); - /** Measured voltage of output channels */ - lp_var_t voltageOutQ7S = - lp_var_t(sid.objectId, P60System::pool::PDU2_VOLTAGE_OUT_Q7S, this); - lp_var_t voltageOutPayloadPCDUCh1 = - lp_var_t(sid.objectId, P60System::pool::PDU2_VOLTAGE_OUT_PAYLOAD_PCDU_CH1, this); - lp_var_t voltageOutReactionWheels = - lp_var_t(sid.objectId, P60System::pool::PDU2_VOLTAGE_OUT_RW, this); - lp_var_t voltageOutTCSBoardHeaterIn = - lp_var_t(sid.objectId, P60System::pool::PDU2_VOLTAGE_OUT_TCS_BOARD_HEATER_IN, this); - lp_var_t voltageOutSUSRedundant = - lp_var_t(sid.objectId, P60System::pool::PDU2_VOLTAGE_OUT_SUS_REDUNDANT, this); - lp_var_t voltageOutDeplMechanism = - lp_var_t(sid.objectId, P60System::pool::PDU2_VOLTAGE_OUT_DEPLOYMENT_MECHANISM, this); - lp_var_t voltageOutPayloadPCDUCh6 = - lp_var_t(sid.objectId, P60System::pool::PDU2_VOLTAGE_OUT_PAYLOAD_PCDU_CH6, this); - lp_var_t voltageOutACSBoardSideB = - lp_var_t(sid.objectId, P60System::pool::PDU2_VOLTAGE_OUT_ACS_BOARD_SIDE_B, this); - lp_var_t voltageOutPayloadCamera = - lp_var_t(sid.objectId, P60System::pool::PDU2_VOLTAGE_OUT_PAYLOAD_CAMERA, this); - /** Measured VCC */ - lp_var_t vcc = lp_var_t(sid.objectId, P60System::pool::PDU2_VCC, this); - /** Measured VBAT */ - lp_var_t vbat = lp_var_t(sid.objectId, P60System::pool::PDU2_VBAT, this); - lp_var_t temperature = - lp_var_t(sid.objectId, P60System::pool::PDU2_TEMPERATURE, this); - /** Output converter enable status */ - lp_var_t converterEnable1 = - lp_var_t(sid.objectId, P60System::pool::PDU2_CONV_EN_1, this); - lp_var_t converterEnable2 = - lp_var_t(sid.objectId, P60System::pool::PDU2_CONV_EN_2, this); - lp_var_t converterEnable3 = - lp_var_t(sid.objectId, P60System::pool::PDU2_CONV_EN_3, this); - /** Output channels enable status */ - lp_var_t outEnabledQ7S = - lp_var_t(sid.objectId, P60System::pool::PDU2_OUT_EN_Q7S, this); - lp_var_t outEnabledPlPCDUCh1 = - lp_var_t(sid.objectId, P60System::pool::PDU2_OUT_EN_PAYLOAD_PCDU_CH1, this); - lp_var_t outEnabledReactionWheels = - lp_var_t(sid.objectId, P60System::pool::PDU2_OUT_EN_RW, this); - lp_var_t outEnabledTCSBoardHeaterIn = - lp_var_t(sid.objectId, P60System::pool::PDU2_OUT_EN_TCS_BOARD_HEATER_IN, this); - lp_var_t outEnabledSUSRedundant = - lp_var_t(sid.objectId, P60System::pool::PDU2_OUT_EN_SUS_REDUNDANT, this); - lp_var_t outEnabledDeplMechanism = - lp_var_t(sid.objectId, P60System::pool::PDU2_OUT_EN_DEPLOYMENT_MECHANISM, this); - lp_var_t outEnabledPlPCDUCh6 = - lp_var_t(sid.objectId, P60System::pool::PDU2_OUT_EN_PAYLOAD_PCDU_CH6, this); - lp_var_t outEnabledAcsBoardSideB = - lp_var_t(sid.objectId, P60System::pool::PDU2_OUT_EN_ACS_BOARD_SIDE_B, this); - lp_var_t outEnabledPayloadCamera = - lp_var_t(sid.objectId, P60System::pool::PDU2_OUT_EN_PAYLOAD_CAMERA, this); - - lp_var_t bootcause = - lp_var_t(sid.objectId, P60System::pool::PDU2_BOOTCAUSE, this); - /** Number of reboots */ - lp_var_t bootcount = - lp_var_t(sid.objectId, P60System::pool::PDU2_BOOTCNT, this); - /** Uptime in seconds */ - lp_var_t uptime = lp_var_t(sid.objectId, P60System::pool::PDU2_UPTIME, this); - lp_var_t resetcause = - lp_var_t(sid.objectId, P60System::pool::PDU2_RESETCAUSE, this); - /** Battery mode: 1 = Critical, 2 = Safe, 3 = Normal, 4 = Full */ - lp_var_t battMode = - lp_var_t(sid.objectId, P60System::pool::PDU2_BATT_MODE, this); - - /** Number of detected latchups on each output channel */ - lp_var_t latchupsQ7S = - lp_var_t(sid.objectId, P60System::pool::PDU2_LATCHUP_Q7S, this); - lp_var_t latchupsPayloadPcduCh1 = - lp_var_t(sid.objectId, P60System::pool::PDU2_LATCHUP_PAYLOAD_PCDU_CH1, this); - lp_var_t latchupsRw = - lp_var_t(sid.objectId, P60System::pool::PDU2_LATCHUP_RW, this); - lp_var_t latchupsTcsBoardHeaterIn = - lp_var_t(sid.objectId, P60System::pool::PDU2_LATCHUP_TCS_BOARD_HEATER_IN, this); - lp_var_t latchupsSusRedundant = - lp_var_t(sid.objectId, P60System::pool::PDU2_LATCHUP_SUS_REDUNDANT, this); - lp_var_t latchupsDeplMenchanism = - lp_var_t(sid.objectId, P60System::pool::PDU2_LATCHUP_DEPLOYMENT_MECHANISM, this); - lp_var_t latchupsPayloadPcduCh6 = - lp_var_t(sid.objectId, P60System::pool::PDU2_LATCHUP_PAYLOAD_PCDU_CH6, this); - lp_var_t latchupsAcsBoardSideB = - lp_var_t(sid.objectId, P60System::pool::PDU2_LATCHUP_ACS_BOARD_SIDE_B, this); - lp_var_t latchupsPayloadCamera = - lp_var_t(sid.objectId, P60System::pool::PDU2_LATCHUP_PAYLOAD_CAMERA, this); - - /** - * There are 8 devices on the PDU. FRAM, ADCs, temperature sensor etc. Each device is - * identified by an ID. Refer also to gs-man-nanopower-p60-pdu-200-1.pdf on pages 17 and 18. - */ - lp_var_t device0 = lp_var_t(sid.objectId, P60System::pool::PDU2_DEVICE_0, this); - lp_var_t device1 = lp_var_t(sid.objectId, P60System::pool::PDU2_DEVICE_1, this); - lp_var_t device2 = lp_var_t(sid.objectId, P60System::pool::PDU2_DEVICE_2, this); - lp_var_t device3 = lp_var_t(sid.objectId, P60System::pool::PDU2_DEVICE_3, this); - lp_var_t device4 = lp_var_t(sid.objectId, P60System::pool::PDU2_DEVICE_4, this); - lp_var_t device5 = lp_var_t(sid.objectId, P60System::pool::PDU2_DEVICE_5, this); - lp_var_t device6 = lp_var_t(sid.objectId, P60System::pool::PDU2_DEVICE_6, this); - lp_var_t device7 = lp_var_t(sid.objectId, P60System::pool::PDU2_DEVICE_7, this); - /** The status of each device. 0 = None, 1 = Ok, 2 = Error, 3 = Not found */ - lp_var_t device0Status = - lp_var_t(sid.objectId, P60System::pool::PDU2_DEVICE_0_STATUS, this); - lp_var_t device1Status = - lp_var_t(sid.objectId, P60System::pool::PDU2_DEVICE_1_STATUS, this); - lp_var_t device2Status = - lp_var_t(sid.objectId, P60System::pool::PDU2_DEVICE_2_STATUS, this); - lp_var_t device3Status = - lp_var_t(sid.objectId, P60System::pool::PDU2_DEVICE_3_STATUS, this); - lp_var_t device4Status = - lp_var_t(sid.objectId, P60System::pool::PDU2_DEVICE_4_STATUS, this); - lp_var_t device5Status = - lp_var_t(sid.objectId, P60System::pool::PDU2_DEVICE_5_STATUS, this); - lp_var_t device6Status = - lp_var_t(sid.objectId, P60System::pool::PDU2_DEVICE_6_STATUS, this); - lp_var_t device7Status = - lp_var_t(sid.objectId, P60System::pool::PDU2_DEVICE_7_STATUS, this); - - /** Number of reboots triggered by the ground watchdog */ - lp_var_t gndWdtReboots = - lp_var_t(sid.objectId, P60System::pool::PDU2_WDT_CNT_GND, this); - /** Number of reboots triggered through the I2C watchdog. Not relevant for EIVE. */ - lp_var_t i2cWdtReboots = - lp_var_t(sid.objectId, P60System::pool::PDU2_WDT_CNT_I2C, this); - /** Number of reboots triggered through the CAN watchdog */ - lp_var_t canWdtReboots = - lp_var_t(sid.objectId, P60System::pool::PDU2_WDT_CNT_CAN, this); - /** Number of reboots triggered through the CSP watchdog */ - lp_var_t csp1WdtReboots = - lp_var_t(sid.objectId, P60System::pool::PDU2_WDT_CNT_CSP1, this); - lp_var_t csp2WdtReboots = - lp_var_t(sid.objectId, P60System::pool::PDU2_WDT_CNT_CSP2, this); - /** Ground watchdog remaining seconds before rebooting */ - lp_var_t groundWatchdogSecondsLeft = - lp_var_t(sid.objectId, P60System::pool::PDU2_WDT_GND_LEFT, this); - /** I2C watchdog remaining seconds before rebooting. Not relevant for EIVE. */ - lp_var_t i2cWatchdogSecondsLeft = - lp_var_t(sid.objectId, P60System::pool::PDU2_WDT_I2C_LEFT, this); - /** CAN watchdog remaining seconds before rebooting. */ - lp_var_t canWatchdogSecondsLeft = - lp_var_t(sid.objectId, P60System::pool::PDU2_WDT_CAN_LEFT, this); - /** CSP watchdog remaining pings before rebooting. */ - lp_var_t csp1WatchdogPingsLeft = - lp_var_t(sid.objectId, P60System::pool::PDU2_WDT_CSP_LEFT1, this); - lp_var_t csp2WatchdogPingsLeft = - lp_var_t(sid.objectId, P60System::pool::PDU2_WDT_CSP_LEFT2, this); + Pdu2CoreHk(object_id_t objectId) + : PduCoreHk(objectId, static_cast(::P60System::SetIds::PDU_2_CORE)) {} }; + +class Pdu2AuxHk : public ::PDU::PduAuxHk { + public: + Pdu2AuxHk(HasLocalDataPoolIF* owner) + : PduAuxHk(owner, static_cast(::P60System::SetIds::PDU_2_AUX)) {} + + Pdu2AuxHk(object_id_t objectId) + : PduAuxHk(objectId, static_cast(::P60System::SetIds::PDU_2_AUX)) {} +}; + } // namespace PDU2 namespace ACU { @@ -1054,4 +738,65 @@ class HkTableDataset : public StaticLocalDataSet { }; } // namespace ACU +namespace pcdu { + +enum PoolIds : uint32_t { PDU1_SWITCHES, PDU2_SWITCHES }; + +/* Switches are uint8_t datatype and go from 0 to 255 */ +enum Switches : power::Switch_t { + PDU1_CH0_TCS_BOARD_3V3, + PDU1_CH1_SYRLINKS_12V, + PDU1_CH2_STAR_TRACKER_5V, + PDU1_CH3_MGT_5V, + PDU1_CH4_SUS_NOMINAL_3V3, + PDU1_CH5_SOLAR_CELL_EXP_5V, + PDU1_CH6_PLOC_12V, + PDU1_CH7_ACS_A_SIDE_3V3, + PDU1_CH8_UNOCCUPIED, + + PDU2_CH0_Q7S, + PDU2_CH1_PL_PCDU_BATT_0_14V8, + PDU2_CH2_RW_5V, + PDU2_CH3_TCS_BOARD_HEATER_IN_8V, + PDU2_CH4_SUS_REDUNDANT_3V3, + PDU2_CH5_DEPLOYMENT_MECHANISM_8V, + PDU2_CH6_PL_PCDU_BATT_1_14V8, + PDU2_CH7_ACS_BOARD_SIDE_B_3V3, + PDU2_CH8_PAYLOAD_CAMERA +}; + +static constexpr uint8_t NUMBER_OF_SWITCHES = 18; + +static const uint8_t ON = 1; +static const uint8_t OFF = 0; + +// Output states after reboot of the PDUs + +const std::array INIT_SWITCHES_PDU1 = { +// Because the TE0720 is not connected to the PCDU, this switch is always on +#ifdef TE0720_1CFA + ON, +#else + OFF, +#endif + OFF, OFF, OFF, OFF, OFF, OFF, OFF, OFF, +}; +const std::array INIT_SWITCHES_PDU2 = {ON, OFF, OFF, OFF, OFF, + OFF, OFF, OFF, OFF}; + +static constexpr uint32_t SWITCHER_SET_ID = 0; + +class SwitcherStates : public StaticLocalDataSet { + public: + SwitcherStates(HasLocalDataPoolIF* owner) : StaticLocalDataSet(owner, SWITCHER_SET_ID) {} + + SwitcherStates(object_id_t objectId) : StaticLocalDataSet(sid_t(objectId, SWITCHER_SET_ID)) {} + + lp_vec_t pdu1Switches = + lp_vec_t(sid.objectId, PDU1_SWITCHES, this); + lp_vec_t pdu2Switches = + lp_vec_t(sid.objectId, PDU2_SWITCHES, this); +}; + +} // namespace pcdu #endif /* MISSION_DEVICES_DEVICEDEFINITIONS_GOMSPACEDEFINITIONS_H_ */ diff --git a/mission/system/AcsBoardAssembly.cpp b/mission/system/AcsBoardAssembly.cpp index 0d65d20e..5e9076b2 100644 --- a/mission/system/AcsBoardAssembly.cpp +++ b/mission/system/AcsBoardAssembly.cpp @@ -4,6 +4,8 @@ #include #include +#include "OBSWConfig.h" + AcsBoardAssembly::AcsBoardAssembly(object_id_t objectId, object_id_t parentId, PowerSwitchIF* switcher, AcsBoardHelper helper, GpioIF* gpioIF) : DualLaneAssemblyBase(objectId, parentId, switcher, SWITCH_A, SWITCH_B, diff --git a/mission/system/AcsBoardAssembly.h b/mission/system/AcsBoardAssembly.h index 0ed65227..412cb273 100644 --- a/mission/system/AcsBoardAssembly.h +++ b/mission/system/AcsBoardAssembly.h @@ -105,10 +105,8 @@ class AcsBoardAssembly : public DualLaneAssemblyBase { void selectGpsInDualMode(duallane::Submodes side); private: - static constexpr pcduSwitches::Switches SWITCH_A = - pcduSwitches::Switches::PDU1_CH7_ACS_A_SIDE_3V3; - static constexpr pcduSwitches::Switches SWITCH_B = - pcduSwitches::Switches::PDU2_CH7_ACS_BOARD_SIDE_B_3V3; + static constexpr pcdu::Switches SWITCH_A = pcdu::Switches::PDU1_CH7_ACS_A_SIDE_3V3; + static constexpr pcdu::Switches SWITCH_B = pcdu::Switches::PDU2_CH7_ACS_BOARD_SIDE_B_3V3; bool tryingOtherSide = false; bool dualModeErrorSwitch = true; diff --git a/mission/system/DualLaneAssemblyBase.cpp b/mission/system/DualLaneAssemblyBase.cpp index fbd69d8f..020ce1ff 100644 --- a/mission/system/DualLaneAssemblyBase.cpp +++ b/mission/system/DualLaneAssemblyBase.cpp @@ -2,10 +2,11 @@ #include +#include "OBSWConfig.h" + DualLaneAssemblyBase::DualLaneAssemblyBase(object_id_t objectId, object_id_t parentId, - PowerSwitchIF* pwrSwitcher, - pcduSwitches::Switches switch1, - pcduSwitches::Switches switch2, Event pwrTimeoutEvent, + PowerSwitchIF* pwrSwitcher, pcdu::Switches switch1, + pcdu::Switches switch2, Event pwrTimeoutEvent, Event sideSwitchNotAllowedEvent, Event transitionOtherSideFailedEvent) : AssemblyBase(objectId, parentId, 20), diff --git a/mission/system/DualLaneAssemblyBase.h b/mission/system/DualLaneAssemblyBase.h index 3017afc0..4233d860 100644 --- a/mission/system/DualLaneAssemblyBase.h +++ b/mission/system/DualLaneAssemblyBase.h @@ -19,9 +19,8 @@ class DualLaneAssemblyBase : public AssemblyBase, public ConfirmsFailuresIF { static constexpr UniqueEventId_t SIDE_SWITCH_TRANSITION_NOT_ALLOWED_ID = 3; DualLaneAssemblyBase(object_id_t objectId, object_id_t parentId, PowerSwitchIF* pwrSwitcher, - pcduSwitches::Switches switch1, pcduSwitches::Switches switch2, - Event pwrSwitchTimeoutEvent, Event sideSwitchNotAllowedEvent, - Event transitionOtherSideFailedEvent); + pcdu::Switches switch1, pcdu::Switches switch2, Event pwrSwitchTimeoutEvent, + Event sideSwitchNotAllowedEvent, Event transitionOtherSideFailedEvent); protected: // This helper object complete encapsulates power switching diff --git a/mission/system/SusAssembly.h b/mission/system/SusAssembly.h index 58394709..b9216072 100644 --- a/mission/system/SusAssembly.h +++ b/mission/system/SusAssembly.h @@ -43,10 +43,8 @@ class SusAssembly : public DualLaneAssemblyBase { private: enum class States { IDLE, SWITCHING_POWER, MODE_COMMANDING } state = States::IDLE; - static constexpr pcduSwitches::Switches SWITCH_NOM = - pcduSwitches::Switches::PDU1_CH4_SUS_NOMINAL_3V3; - static constexpr pcduSwitches::Switches SWITCH_RED = - pcduSwitches::Switches::PDU2_CH4_SUS_REDUNDANT_3V3; + static constexpr pcdu::Switches SWITCH_NOM = pcdu::Switches::PDU1_CH4_SUS_NOMINAL_3V3; + static constexpr pcdu::Switches SWITCH_RED = pcdu::Switches::PDU2_CH4_SUS_REDUNDANT_3V3; FixedArrayList modeTable; SusAssHelper helper; From 4a6840f0987bc895d8e1fb808b763b83bf2fd40e Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 8 Apr 2022 11:22:16 +0200 Subject: [PATCH 42/65] bugfixes and improvements - Tests finished --- bsp_q7s/core/CoreController.cpp | 87 ++++++++------ bsp_q7s/core/CoreController.h | 6 +- generators/events/translateEvents.cpp | 2 +- generators/objects/translateObjects.cpp | 2 +- linux/devices/GPSHyperionLinuxController.cpp | 19 ++- linux/devices/GPSHyperionLinuxController.h | 4 +- linux/fsfwconfig/events/translateEvents.cpp | 2 +- linux/fsfwconfig/objects/translateObjects.cpp | 2 +- linux/utility/utility.cpp | 13 ++ linux/utility/utility.h | 4 +- .../devicedefinitions/GPSDefinitions.h | 8 +- mission/utility/compileTime.h | 113 ++++++++---------- 12 files changed, 144 insertions(+), 118 deletions(-) diff --git a/bsp_q7s/core/CoreController.cpp b/bsp_q7s/core/CoreController.cpp index c39caa12..ef6e4fa0 100644 --- a/bsp_q7s/core/CoreController.cpp +++ b/bsp_q7s/core/CoreController.cpp @@ -1,6 +1,9 @@ #include "CoreController.h" #include +#include + +#include #include "OBSWConfig.h" #include "OBSWVersion.h" @@ -8,7 +11,6 @@ #include "fsfw/timemanager/Stopwatch.h" #include "fsfw/version.h" #include "watchdogConf.h" -#include #if OBSW_USE_TMTC_TCP_BRIDGE == 0 #include "fsfw/osal/common/UdpTmTcBridge.h" #else @@ -22,6 +24,7 @@ #include "bsp_q7s/memory/SdCardManager.h" #include "bsp_q7s/memory/scratchApi.h" #include "bsp_q7s/xadc/Xadc.h" +#include "linux/utility/utility.h" xsc::Chip CoreController::CURRENT_CHIP = xsc::Chip::NO_CHIP; xsc::Copy CoreController::CURRENT_COPY = xsc::Copy::NO_COPY; @@ -51,6 +54,7 @@ CoreController::CoreController(object_id_t objectId) } catch (const std::filesystem::filesystem_error &e) { sif::error << "CoreController::CoreController: Failed with exception " << e.what() << std::endl; } + eventQueue = QueueFactory::instance()->createMessageQueue(5, EventMessage::MAX_MESSAGE_SIZE); } ReturnValue_t CoreController::handleCommandMessage(CommandMessage *message) { @@ -62,10 +66,10 @@ void CoreController::performControlOperation() { for (ReturnValue_t result = eventQueue->receiveMessage(&event); result == RETURN_OK; result = eventQueue->receiveMessage(&event)) { switch (event.getEvent()) { - case(GpsHyperion::GPS_FIX_CHANGE): { - gpsFix = static_cast(event.getParameter2()); - break; - } + case (GpsHyperion::GPS_FIX_CHANGE): { + gpsFix = static_cast(event.getParameter2()); + break; + } } } performWatchdogControlOperation(); @@ -90,8 +94,10 @@ LocalPoolDataSetBase *CoreController::getDataSetHandle(sid_t sid) { } ReturnValue_t CoreController::initialize() { - ReturnValue_t result = HasReturnvaluesIF::RETURN_OK; - + ReturnValue_t result = ExtendedControllerBase::initialize(); + if (result != HasReturnvaluesIF::RETURN_OK) { + sif::warning << "CoreController::initialize: Base init failed" << std::endl; + } result = scratch::writeNumber(scratch::ALLOC_FAILURE_COUNT, 0); if (result != HasReturnvaluesIF::RETURN_OK) { sif::warning << "CoreController::initialize: Setting up alloc failure " @@ -102,18 +108,23 @@ ReturnValue_t CoreController::initialize() { sdStateMachine(); triggerEvent(REBOOT_SW, CURRENT_CHIP, CURRENT_COPY); - EventManagerIF* eventManager = ObjectManager::instance()->get( - objects::EVENT_MANAGER); + EventManagerIF *eventManager = + ObjectManager::instance()->get(objects::EVENT_MANAGER); + if (eventManager == nullptr or eventQueue == nullptr) { + sif::warning << "CoreController::initialize: No valid event manager found or " + "queue invalid" + << std::endl; + } result = eventManager->registerListener(eventQueue->getId()); - if(result != HasReturnvaluesIF::RETURN_OK) { + if (result != HasReturnvaluesIF::RETURN_OK) { sif::warning << "CoreController::initialize: Registering as event listener failed" << std::endl; } - result = eventManager->subscribeToEvent(this->getCommandQueue(), - event::getEventId(GpsHyperion::GPS_FIX_CHANGE)); - if(result != HasReturnvaluesIF::RETURN_OK) { + result = eventManager->subscribeToEvent(eventQueue->getId(), + event::getEventId(GpsHyperion::GPS_FIX_CHANGE)); + if (result != HasReturnvaluesIF::RETURN_OK) { sif::warning << "Subscribing for GPS GPS_FIX_CHANGE event failed" << std::endl; } - return ExtendedControllerBase::initialize(); + return RETURN_OK; } ReturnValue_t CoreController::initializeAfterTaskCreation() { @@ -661,8 +672,7 @@ ReturnValue_t CoreController::initVersionFile() { fsfw::FSFW_VERSION.getVersion(versionString, sizeof(versionString)); std::string fullFsfwVersionString = "FSFW: v" + std::string(versionString); std::string systemString = "System: " + unameLine; - std::string mountPrefix = SdCardManager::instance()->getCurrentMountPrefix(); - std::string versionFilePath = mountPrefix + VERSION_FILE; + std::string versionFilePath = currMntPrefix + VERSION_FILE; std::fstream versionFile; if (not std::filesystem::exists(versionFilePath)) { @@ -1220,15 +1230,17 @@ void CoreController::performWatchdogControlOperation() { } void CoreController::performMountedSdCardOperations() { + currMntPrefix = sdcMan->getCurrentMountPrefix(); if (doPerformMountedSdCardOps) { bool sdCardMounted = false; sdCardMounted = sdcMan->isSdCardMounted(sdInfo.pref); if (sdCardMounted) { - std::string path = sdcMan->getCurrentMountPrefix(sdInfo.pref) + "/" + CONF_FOLDER; + std::string path = currMntPrefix + "/" + CONF_FOLDER; if (not std::filesystem::exists(path)) { std::filesystem::create_directory(path); } initVersionFile(); + initClockFromTimeFile(); performRebootFileHandling(false); doPerformMountedSdCardOps = false; } @@ -1238,7 +1250,7 @@ void CoreController::performMountedSdCardOperations() { void CoreController::performRebootFileHandling(bool recreateFile) { using namespace std; - std::string path = sdcMan->getCurrentMountPrefix(sdInfo.pref) + REBOOT_FILE; + std::string path = currMntPrefix + REBOOT_FILE; if (not std::filesystem::exists(path) or recreateFile) { #if OBSW_VERBOSE_LEVEL >= 1 sif::info << "CoreController::performRebootFileHandling: Recreating reboot file" << std::endl; @@ -1617,7 +1629,7 @@ bool CoreController::parseRebootFile(std::string path, RebootFile &rf) { } void CoreController::resetRebootCount(xsc::Chip tgtChip, xsc::Copy tgtCopy) { - std::string path = sdcMan->getCurrentMountPrefix(sdInfo.pref) + REBOOT_FILE; + std::string path = currMntPrefix + REBOOT_FILE; // Disable the reboot file mechanism parseRebootFile(path, rebootFile); if (tgtChip == xsc::ALL_CHIP and tgtCopy == xsc::ALL_COPY) { @@ -1644,7 +1656,7 @@ void CoreController::resetRebootCount(xsc::Chip tgtChip, xsc::Copy tgtCopy) { } void CoreController::rewriteRebootFile(RebootFile file) { - std::string path = sdcMan->getCurrentMountPrefix(sdInfo.pref) + REBOOT_FILE; + std::string path = currMntPrefix + REBOOT_FILE; std::ofstream rebootFile(path); if (rebootFile.is_open()) { // Initiate reboot file first. Reboot handling will be on on initialization @@ -1681,15 +1693,15 @@ void CoreController::setRebootMechanismLock(bool lock, xsc::Chip tgtChip, xsc::C } ReturnValue_t CoreController::timeFileHandler() { - if(gpsFix == GpsHyperion::FixMode::FIX_2D or gpsFix == GpsHyperion::FixMode::FIX_3D) { + if (gpsFix == GpsHyperion::FixMode::FIX_2D or gpsFix == GpsHyperion::FixMode::FIX_3D) { // It is assumed that the system time is set from the GPS time timeval currentTime = {}; ReturnValue_t result = Clock::getClock_timeval(¤tTime); - if(result != HasReturnvaluesIF::RETURN_OK) { + if (result != HasReturnvaluesIF::RETURN_OK) { return result; } - std::ofstream timeFile(TIME_FILE); - timeFile << "UNIX SECONDS: " << currentTime.tv_sec; + std::ofstream timeFile(currMntPrefix + TIME_FILE); + timeFile << "UNIX SECONDS: " << currentTime.tv_sec << std::endl; } return RETURN_OK; } @@ -1697,30 +1709,30 @@ ReturnValue_t CoreController::timeFileHandler() { ReturnValue_t CoreController::initClockFromTimeFile() { using namespace GpsHyperion; using namespace std; - if ((gpsFix == FixMode::UNKNOWN or gpsFix == FixMode::NOT_SEEN) and - std::filesystem::exists(TIME_FILE)) { - - ifstream timeFile(TIME_FILE); + std::string fileName = currMntPrefix + TIME_FILE; + if (std::filesystem::exists(fileName) and + ((gpsFix == FixMode::UNKNOWN or gpsFix == FixMode::NOT_SEEN) or + not utility::timeSanityCheck())) { + ifstream timeFile(fileName); string nextWord; getline(timeFile, nextWord); istringstream iss(nextWord); iss >> nextWord; - if(iss.bad() or nextWord != "UNIX") { + if (iss.bad() or nextWord != "UNIX") { return RETURN_FAILED; } iss >> nextWord; - if(iss.bad() or nextWord != "SECONDS:") { + if (iss.bad() or nextWord != "SECONDS:") { return RETURN_FAILED; } iss >> nextWord; timeval currentTime = {}; - char* checkPtr; + char *checkPtr; currentTime.tv_sec = strtol(nextWord.c_str(), &checkPtr, 10); - if(iss.bad() or *checkPtr) { + if (iss.bad() or *checkPtr) { return RETURN_FAILED; } - Clock::setClock(¤tTime); - return RETURN_OK; + return Clock::setClock(¤tTime); } return RETURN_OK; } @@ -1759,8 +1771,7 @@ void CoreController::readHkData() { } } -bool CoreController::isNumber(const std::string& s) -{ - return !s.empty() && std::find_if(s.begin(), - s.end(), [](unsigned char c) { return !std::isdigit(c); }) == s.end(); +bool CoreController::isNumber(const std::string &s) { + return !s.empty() && std::find_if(s.begin(), s.end(), + [](unsigned char c) { return !std::isdigit(c); }) == s.end(); } diff --git a/bsp_q7s/core/CoreController.h b/bsp_q7s/core/CoreController.h index 05ec6315..b5e4e511 100644 --- a/bsp_q7s/core/CoreController.h +++ b/bsp_q7s/core/CoreController.h @@ -7,10 +7,10 @@ #include #include "CoreDefinitions.h" -#include "mission/devices/devicedefinitions/GPSDefinitions.h" #include "bsp_q7s/memory/SdCardManager.h" #include "events/subsystemIdRanges.h" #include "fsfw/controller/ExtendedControllerBase.h" +#include "mission/devices/devicedefinitions/GPSDefinitions.h" class Timer; class SdCardManager; @@ -59,8 +59,7 @@ class CoreController : public ExtendedControllerBase { "/" + std::string(CONF_FOLDER) + "/" + std::string(VERSION_FILE_NAME); const std::string REBOOT_FILE = "/" + std::string(CONF_FOLDER) + "/" + std::string(REBOOT_FILE_NAME); - const std::string TIME_FILE = - "/" + std::string(CONF_FOLDER) + "/" + std::string(TIME_FILE_NAME); + const std::string TIME_FILE = "/" + std::string(CONF_FOLDER) + "/" + std::string(TIME_FILE_NAME); static constexpr ActionId_t LIST_DIRECTORY_INTO_FILE = 0; static constexpr ActionId_t SWITCH_REBOOT_FILE_HANDLING = 5; @@ -179,6 +178,7 @@ class CoreController : public ExtendedControllerBase { sd::SdState commandedState = sd::SdState::OFF; } sdInfo; RebootFile rebootFile = {}; + std::string currMntPrefix; bool doPerformMountedSdCardOps = true; /** diff --git a/generators/events/translateEvents.cpp b/generators/events/translateEvents.cpp index 7112fa87..aeebd2cb 100644 --- a/generators/events/translateEvents.cpp +++ b/generators/events/translateEvents.cpp @@ -1,7 +1,7 @@ /** * @brief Auto-generated event translation file. Contains 183 translations. * @details - * Generated on: 2022-04-07 17:27:42 + * Generated on: 2022-04-08 11:21:58 */ #include "translateEvents.h" diff --git a/generators/objects/translateObjects.cpp b/generators/objects/translateObjects.cpp index 78113fd9..bed40c70 100644 --- a/generators/objects/translateObjects.cpp +++ b/generators/objects/translateObjects.cpp @@ -2,7 +2,7 @@ * @brief Auto-generated object translation file. * @details * Contains 117 translations. - * Generated on: 2022-04-07 17:27:42 + * Generated on: 2022-04-08 11:21:58 */ #include "translateObjects.h" diff --git a/linux/devices/GPSHyperionLinuxController.cpp b/linux/devices/GPSHyperionLinuxController.cpp index 2b49e0d0..22f3affd 100644 --- a/linux/devices/GPSHyperionLinuxController.cpp +++ b/linux/devices/GPSHyperionLinuxController.cpp @@ -3,7 +3,7 @@ #include "OBSWConfig.h" #include "fsfw/datapool/PoolReadGuard.h" #include "fsfw/timemanager/Clock.h" - +#include "linux/utility/utility.h" #include "mission/utility/compileTime.h" #if FSFW_DEV_HYPERION_GPS_CREATE_NMEA_CSV == 1 @@ -127,9 +127,14 @@ void GPSHyperionLinuxController::readGpsDataFromGpsd() { return; } + bool validFix = false; + static_cast(validFix); // 0: Not seen, 1: No fix, 2: 2D-Fix, 3: 3D-Fix int newFixMode = gps->fix.mode; - if(gpsSet.fixMode.value != newFixMode) { + if (newFixMode == 2 or newFixMode == 3) { + validFix = true; + } + if (gpsSet.fixMode.value != newFixMode) { triggerEvent(GpsHyperion::GPS_FIX_CHANGE, gpsSet.fixMode.value, newFixMode); } gpsSet.fixMode.value = newFixMode; @@ -185,11 +190,19 @@ void GPSHyperionLinuxController::readGpsDataFromGpsd() { } else { timeIsConstantCounter = 0; } + if (timeInit) { + if (not utility::timeSanityCheck()) { + sif::info << "Setting init clock in gps ctrl" << std::endl; + // For some reason, the clock needs to be somewhat correct for NTP to work. Really dumb.. + Clock::setClock(&time); + } + timeInit = false; + } // If the received time does not change anymore for whatever reason, do not set it here // to avoid stale times. Also, don't do it too often often to avoid jumping times if (timeIsConstantCounter < 20 and timeUpdateCd.hasTimedOut()) { // Update the system time here for now. NTP seems to be unable to do so for whatever reason. - // Further tests have shown that the time seems to be set by NTPD after sme time.. + // Further tests have shown that the time seems to be set by NTPD after some time.. // Clock::setClock(&time); timeUpdateCd.resetTimer(); } diff --git a/linux/devices/GPSHyperionLinuxController.h b/linux/devices/GPSHyperionLinuxController.h index ac8a4735..dedd782c 100644 --- a/linux/devices/GPSHyperionLinuxController.h +++ b/linux/devices/GPSHyperionLinuxController.h @@ -1,8 +1,8 @@ #ifndef MISSION_DEVICES_GPSHYPERIONHANDLER_H_ #define MISSION_DEVICES_GPSHYPERIONHANDLER_H_ -#include "fsfw/FSFW.h" #include "commonSubsystemIds.h" +#include "fsfw/FSFW.h" #include "fsfw/controller/ExtendedControllerBase.h" #include "fsfw/devicehandlers/DeviceHandlerBase.h" #include "mission/devices/devicedefinitions/GPSDefinitions.h" @@ -24,7 +24,6 @@ class GPSHyperionLinuxController : public ExtendedControllerBase { public: static constexpr uint32_t MAX_SECONDS_TO_REACH_FIX = 60 * 60 * 5; - GPSHyperionLinuxController(object_id_t objectId, object_id_t parentId, bool debugHyperionGps = false); virtual ~GPSHyperionLinuxController(); @@ -52,6 +51,7 @@ class GPSHyperionLinuxController : public ExtendedControllerBase { GpsPrimaryDataset gpsSet; Countdown maxTimeToReachFix = Countdown(MAX_SECONDS_TO_REACH_FIX * 1000); bool modeCommanded = true; + bool timeInit = true; gpsmm myGpsmm; bool debugHyperionGps = false; uint32_t timeIsConstantCounter = 0; diff --git a/linux/fsfwconfig/events/translateEvents.cpp b/linux/fsfwconfig/events/translateEvents.cpp index 7112fa87..aeebd2cb 100644 --- a/linux/fsfwconfig/events/translateEvents.cpp +++ b/linux/fsfwconfig/events/translateEvents.cpp @@ -1,7 +1,7 @@ /** * @brief Auto-generated event translation file. Contains 183 translations. * @details - * Generated on: 2022-04-07 17:27:42 + * Generated on: 2022-04-08 11:21:58 */ #include "translateEvents.h" diff --git a/linux/fsfwconfig/objects/translateObjects.cpp b/linux/fsfwconfig/objects/translateObjects.cpp index 78113fd9..bed40c70 100644 --- a/linux/fsfwconfig/objects/translateObjects.cpp +++ b/linux/fsfwconfig/objects/translateObjects.cpp @@ -2,7 +2,7 @@ * @brief Auto-generated object translation file. * @details * Contains 117 translations. - * Generated on: 2022-04-07 17:27:42 + * Generated on: 2022-04-08 11:21:58 */ #include "translateObjects.h" diff --git a/linux/utility/utility.cpp b/linux/utility/utility.cpp index cd0d47ef..fb58109b 100644 --- a/linux/utility/utility.cpp +++ b/linux/utility/utility.cpp @@ -1,3 +1,4 @@ + #include "utility.h" #include @@ -5,6 +6,7 @@ #include "FSFWConfig.h" #include "OBSWConfig.h" #include "fsfw/serviceinterface/ServiceInterface.h" +#include "fsfw/timemanager/Clock.h" void utility::handleSystemError(int retcode, std::string function) { #if OBSW_VERBOSE_LEVEL >= 1 @@ -12,3 +14,14 @@ void utility::handleSystemError(int retcode, std::string function) { << strerror(retcode) << std::endl; #endif } + +bool utility::timeSanityCheck() { + timeval currentTime = {}; + Clock::getUptime(¤tTime); + Clock::TimeOfDay_t currTimeOfDay = {}; + Clock::convertTimevalToTimeOfDay(¤tTime, &currTimeOfDay); + if (currTimeOfDay.year == 2000) { + return false; + } + return true; +} diff --git a/linux/utility/utility.h b/linux/utility/utility.h index 8f7df04f..b4c4fe8b 100644 --- a/linux/utility/utility.h +++ b/linux/utility/utility.h @@ -9,6 +9,8 @@ namespace utility { void handleSystemError(int retcode, std::string function); -} +bool timeSanityCheck(); + +} // namespace utility #endif /* LINUX_UTILITY_UTILITY_H_ */ diff --git a/mission/devices/devicedefinitions/GPSDefinitions.h b/mission/devices/devicedefinitions/GPSDefinitions.h index bf3fbe52..f953da22 100644 --- a/mission/devices/devicedefinitions/GPSDefinitions.h +++ b/mission/devices/devicedefinitions/GPSDefinitions.h @@ -6,13 +6,7 @@ namespace GpsHyperion { -enum class FixMode: uint8_t { - NOT_SEEN = 0, - NO_FIX = 1, - FIX_2D = 2, - FIX_3D = 3, - UNKNOWN = 4 -}; +enum class FixMode : uint8_t { NOT_SEEN = 0, NO_FIX = 1, FIX_2D = 2, FIX_3D = 3, UNKNOWN = 4 }; static constexpr uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::GPS_HANDLER; //! [EXPORT] : [COMMENT] Fix has changed. P1: Old fix. P2: New fix diff --git a/mission/utility/compileTime.h b/mission/utility/compileTime.h index c55673f6..0e367248 100644 --- a/mission/utility/compileTime.h +++ b/mission/utility/compileTime.h @@ -5,14 +5,17 @@ * Authors: * * Assembled from the code released on Stackoverflow by: - * Dennis (instructable.com/member/nqtronix) | https://stackoverflow.com/questions/23032002/c-c-how-to-get-integer-unix-timestamp-of-build-time-not-string + * Dennis (instructable.com/member/nqtronix) | + * https://stackoverflow.com/questions/23032002/c-c-how-to-get-integer-unix-timestamp-of-build-time-not-string * and - * Alexis Wilke | https://stackoverflow.com/questions/10538444/do-you-know-of-a-c-macro-to-compute-unix-time-and-date + * Alexis Wilke | + * https://stackoverflow.com/questions/10538444/do-you-know-of-a-c-macro-to-compute-unix-time-and-date * * Assembled by Jean Rabault * - * UNIX_TIMESTAMP gives the UNIX timestamp (unsigned long integer of seconds since 1st Jan 1970) of compilation from macros using the compiler defined __TIME__ macro. - * This should include Gregorian calendar leap days, in particular the 29ths of February, 100 and 400 years modulo leaps. + * UNIX_TIMESTAMP gives the UNIX timestamp (unsigned long integer of seconds since 1st Jan 1970) of + * compilation from macros using the compiler defined __TIME__ macro. This should include Gregorian + * calendar leap days, in particular the 29ths of February, 100 and 400 years modulo leaps. * * Careful: __TIME__ is the local time of the computer, NOT the UTC time in general! * @@ -22,76 +25,66 @@ #define COMPILE_TIME_H_ // Some definitions for calculation -#define SEC_PER_MIN 60UL -#define SEC_PER_HOUR 3600UL -#define SEC_PER_DAY 86400UL -#define SEC_PER_YEAR (SEC_PER_DAY*365) +#define SEC_PER_MIN 60UL +#define SEC_PER_HOUR 3600UL +#define SEC_PER_DAY 86400UL +#define SEC_PER_YEAR (SEC_PER_DAY * 365) // extracts 1..4 characters from a string and interprets it as a decimal value -#define CONV_STR2DEC_1(str, i) (str[i]>'0'?str[i]-'0':0) -#define CONV_STR2DEC_2(str, i) (CONV_STR2DEC_1(str, i)*10 + str[i+1]-'0') -#define CONV_STR2DEC_3(str, i) (CONV_STR2DEC_2(str, i)*10 + str[i+2]-'0') -#define CONV_STR2DEC_4(str, i) (CONV_STR2DEC_3(str, i)*10 + str[i+3]-'0') +#define CONV_STR2DEC_1(str, i) (str[i] > '0' ? str[i] - '0' : 0) +#define CONV_STR2DEC_2(str, i) (CONV_STR2DEC_1(str, i) * 10 + str[i + 1] - '0') +#define CONV_STR2DEC_3(str, i) (CONV_STR2DEC_2(str, i) * 10 + str[i + 2] - '0') +#define CONV_STR2DEC_4(str, i) (CONV_STR2DEC_3(str, i) * 10 + str[i + 3] - '0') // Custom "glue logic" to convert the month name to a usable number -#define GET_MONTH(str, i) (str[i]=='J' && str[i+1]=='a' && str[i+2]=='n' ? 1 : \ - str[i]=='F' && str[i+1]=='e' && str[i+2]=='b' ? 2 : \ - str[i]=='M' && str[i+1]=='a' && str[i+2]=='r' ? 3 : \ - str[i]=='A' && str[i+1]=='p' && str[i+2]=='r' ? 4 : \ - str[i]=='M' && str[i+1]=='a' && str[i+2]=='y' ? 5 : \ - str[i]=='J' && str[i+1]=='u' && str[i+2]=='n' ? 6 : \ - str[i]=='J' && str[i+1]=='u' && str[i+2]=='l' ? 7 : \ - str[i]=='A' && str[i+1]=='u' && str[i+2]=='g' ? 8 : \ - str[i]=='S' && str[i+1]=='e' && str[i+2]=='p' ? 9 : \ - str[i]=='O' && str[i+1]=='c' && str[i+2]=='t' ? 10 : \ - str[i]=='N' && str[i+1]=='o' && str[i+2]=='v' ? 11 : \ - str[i]=='D' && str[i+1]=='e' && str[i+2]=='c' ? 12 : 0) +#define GET_MONTH(str, i) \ + (str[i] == 'J' && str[i + 1] == 'a' && str[i + 2] == 'n' ? 1 \ + : str[i] == 'F' && str[i + 1] == 'e' && str[i + 2] == 'b' ? 2 \ + : str[i] == 'M' && str[i + 1] == 'a' && str[i + 2] == 'r' ? 3 \ + : str[i] == 'A' && str[i + 1] == 'p' && str[i + 2] == 'r' ? 4 \ + : str[i] == 'M' && str[i + 1] == 'a' && str[i + 2] == 'y' ? 5 \ + : str[i] == 'J' && str[i + 1] == 'u' && str[i + 2] == 'n' ? 6 \ + : str[i] == 'J' && str[i + 1] == 'u' && str[i + 2] == 'l' ? 7 \ + : str[i] == 'A' && str[i + 1] == 'u' && str[i + 2] == 'g' ? 8 \ + : str[i] == 'S' && str[i + 1] == 'e' && str[i + 2] == 'p' ? 9 \ + : str[i] == 'O' && str[i + 1] == 'c' && str[i + 2] == 't' ? 10 \ + : str[i] == 'N' && str[i + 1] == 'o' && str[i + 2] == 'v' ? 11 \ + : str[i] == 'D' && str[i + 1] == 'e' && str[i + 2] == 'c' ? 12 \ + : 0) // extract the information from the time string given by __TIME__ and __DATE__ -#define __TIME_SECONDS__ CONV_STR2DEC_2(__TIME__, 6) -#define __TIME_MINUTES__ CONV_STR2DEC_2(__TIME__, 3) -#define __TIME_HOURS__ CONV_STR2DEC_2(__TIME__, 0) -#define __TIME_DAYS__ CONV_STR2DEC_2(__DATE__, 4) -#define __TIME_MONTH__ GET_MONTH(__DATE__, 0) -#define __TIME_YEARS__ CONV_STR2DEC_4(__DATE__, 7) +#define __TIME_SECONDS__ CONV_STR2DEC_2(__TIME__, 6) +#define __TIME_MINUTES__ CONV_STR2DEC_2(__TIME__, 3) +#define __TIME_HOURS__ CONV_STR2DEC_2(__TIME__, 0) +#define __TIME_DAYS__ CONV_STR2DEC_2(__DATE__, 4) +#define __TIME_MONTH__ GET_MONTH(__DATE__, 0) +#define __TIME_YEARS__ CONV_STR2DEC_4(__DATE__, 7) // Days in February #define _UNIX_TIMESTAMP_FDAY(year) \ - (((year) % 400) == 0UL ? 29UL : \ - (((year) % 100) == 0UL ? 28UL : \ - (((year) % 4) == 0UL ? 29UL : \ - 28UL))) + (((year) % 400) == 0UL ? 29UL \ + : (((year) % 100) == 0UL ? 28UL : (((year) % 4) == 0UL ? 29UL : 28UL))) // Days in the year -#define _UNIX_TIMESTAMP_YDAY(year, month, day) \ - ( \ - /* January */ day \ - /* February */ + (month >= 2 ? 31UL : 0UL) \ - /* March */ + (month >= 3 ? _UNIX_TIMESTAMP_FDAY(year) : 0UL) \ - /* April */ + (month >= 4 ? 31UL : 0UL) \ - /* May */ + (month >= 5 ? 30UL : 0UL) \ - /* June */ + (month >= 6 ? 31UL : 0UL) \ - /* July */ + (month >= 7 ? 30UL : 0UL) \ - /* August */ + (month >= 8 ? 31UL : 0UL) \ - /* September */+ (month >= 9 ? 31UL : 0UL) \ - /* October */ + (month >= 10 ? 30UL : 0UL) \ - /* November */ + (month >= 11 ? 31UL : 0UL) \ - /* December */ + (month >= 12 ? 30UL : 0UL) \ - ) +#define _UNIX_TIMESTAMP_YDAY(year, month, day) \ + (/* January */ day /* February */ + (month >= 2 ? 31UL : 0UL) /* March */ + \ + (month >= 3 ? _UNIX_TIMESTAMP_FDAY(year) : 0UL) /* April */ + \ + (month >= 4 ? 31UL : 0UL) /* May */ + (month >= 5 ? 30UL : 0UL) /* June */ + \ + (month >= 6 ? 31UL : 0UL) /* July */ + (month >= 7 ? 30UL : 0UL) /* August */ + \ + (month >= 8 ? 31UL : 0UL) /* September */ + (month >= 9 ? 31UL : 0UL) /* October */ + \ + (month >= 10 ? 30UL : 0UL) /* November */ + (month >= 11 ? 31UL : 0UL) /* December */ + \ + (month >= 12 ? 30UL : 0UL)) // get the UNIX timestamp from a digits representation -#define _UNIX_TIMESTAMP(year, month, day, hour, minute, second) \ - ( /* time */ second \ - + minute * SEC_PER_MIN \ - + hour * SEC_PER_HOUR \ - + /* year day (month + day) */ (_UNIX_TIMESTAMP_YDAY(year, month, day) - 1) * SEC_PER_DAY \ - + /* year */ (year - 1970UL) * SEC_PER_YEAR \ - + ((year - 1969UL) / 4UL) * SEC_PER_DAY \ - - ((year - 1901UL) / 100UL) * SEC_PER_DAY \ - + ((year - 1601UL) / 400UL) * SEC_PER_DAY \ - ) +#define _UNIX_TIMESTAMP(year, month, day, hour, minute, second) \ + (/* time */ second + minute * SEC_PER_MIN + hour * SEC_PER_HOUR + \ + /* year day (month + day) */ (_UNIX_TIMESTAMP_YDAY(year, month, day) - 1) * SEC_PER_DAY + \ + /* year */ (year - 1970UL) * SEC_PER_YEAR + ((year - 1969UL) / 4UL) * SEC_PER_DAY - \ + ((year - 1901UL) / 100UL) * SEC_PER_DAY + ((year - 1601UL) / 400UL) * SEC_PER_DAY) // the UNIX timestamp -#define UNIX_TIMESTAMP (_UNIX_TIMESTAMP(__TIME_YEARS__, __TIME_MONTH__, __TIME_DAYS__, __TIME_HOURS__, __TIME_MINUTES__, __TIME_SECONDS__)) +#define UNIX_TIMESTAMP \ + (_UNIX_TIMESTAMP(__TIME_YEARS__, __TIME_MONTH__, __TIME_DAYS__, __TIME_HOURS__, \ + __TIME_MINUTES__, __TIME_SECONDS__)) #endif From 351920aa7bb52450c7d93f11923a17d4bdc552a5 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 8 Apr 2022 11:31:29 +0200 Subject: [PATCH 43/65] some tweaks --- bsp_q7s/core/CoreController.cpp | 4 +--- linux/devices/GPSHyperionLinuxController.cpp | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/bsp_q7s/core/CoreController.cpp b/bsp_q7s/core/CoreController.cpp index ef6e4fa0..f89230b3 100644 --- a/bsp_q7s/core/CoreController.cpp +++ b/bsp_q7s/core/CoreController.cpp @@ -3,8 +3,6 @@ #include #include -#include - #include "OBSWConfig.h" #include "OBSWVersion.h" #include "fsfw/serviceinterface/ServiceInterface.h" @@ -18,7 +16,7 @@ #endif #include #include - +#include #include #include "bsp_q7s/memory/SdCardManager.h" diff --git a/linux/devices/GPSHyperionLinuxController.cpp b/linux/devices/GPSHyperionLinuxController.cpp index 22f3affd..4dbb8f9c 100644 --- a/linux/devices/GPSHyperionLinuxController.cpp +++ b/linux/devices/GPSHyperionLinuxController.cpp @@ -190,7 +190,7 @@ void GPSHyperionLinuxController::readGpsDataFromGpsd() { } else { timeIsConstantCounter = 0; } - if (timeInit) { + if (timeInit and validFix) { if (not utility::timeSanityCheck()) { sif::info << "Setting init clock in gps ctrl" << std::endl; // For some reason, the clock needs to be somewhat correct for NTP to work. Really dumb.. From 6ae9e539a61c9d9fce28d70b9948f3fbeb8f142d Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 8 Apr 2022 11:40:35 +0200 Subject: [PATCH 44/65] more useful printout --- bsp_q7s/core/CoreController.cpp | 7 +++++++ linux/devices/GPSHyperionLinuxController.cpp | 7 ++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/bsp_q7s/core/CoreController.cpp b/bsp_q7s/core/CoreController.cpp index f89230b3..42ba4307 100644 --- a/bsp_q7s/core/CoreController.cpp +++ b/bsp_q7s/core/CoreController.cpp @@ -16,6 +16,7 @@ #endif #include #include + #include #include @@ -1730,6 +1731,12 @@ ReturnValue_t CoreController::initClockFromTimeFile() { if (iss.bad() or *checkPtr) { return RETURN_FAILED; } +#if OBSW_VERBOSE_LEVEL >= 1 + time_t timeRaw = currentTime.tv_sec; + std::tm *time = std::gmtime(&timeRaw); + sif::info << "Setting system time from time files: " << std::put_time(time, "%c %Z") + << std::endl; +#endif return Clock::setClock(¤tTime); } return RETURN_OK; diff --git a/linux/devices/GPSHyperionLinuxController.cpp b/linux/devices/GPSHyperionLinuxController.cpp index 4dbb8f9c..0947e396 100644 --- a/linux/devices/GPSHyperionLinuxController.cpp +++ b/linux/devices/GPSHyperionLinuxController.cpp @@ -192,7 +192,12 @@ void GPSHyperionLinuxController::readGpsDataFromGpsd() { } if (timeInit and validFix) { if (not utility::timeSanityCheck()) { - sif::info << "Setting init clock in gps ctrl" << std::endl; +#if OBSW_VERBOSE_LEVEL >= 1 + time_t timeRaw = time.tv_sec; + std::tm *time = std::gmtime(&timeRaw); + sif::info << "Setting invalid system time from GPS data directly: " + << std::put_time(time, "%c %Z") << std::endl; +#endif // For some reason, the clock needs to be somewhat correct for NTP to work. Really dumb.. Clock::setClock(&time); } From c83efd149ec8e8f8ddb46f4c6bcfe10742d4cc81 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 8 Apr 2022 11:41:17 +0200 Subject: [PATCH 45/65] small tweak --- linux/devices/GPSHyperionLinuxController.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/linux/devices/GPSHyperionLinuxController.cpp b/linux/devices/GPSHyperionLinuxController.cpp index 0947e396..20860211 100644 --- a/linux/devices/GPSHyperionLinuxController.cpp +++ b/linux/devices/GPSHyperionLinuxController.cpp @@ -194,9 +194,9 @@ void GPSHyperionLinuxController::readGpsDataFromGpsd() { if (not utility::timeSanityCheck()) { #if OBSW_VERBOSE_LEVEL >= 1 time_t timeRaw = time.tv_sec; - std::tm *time = std::gmtime(&timeRaw); + std::tm *timeTm = std::gmtime(&timeRaw); sif::info << "Setting invalid system time from GPS data directly: " - << std::put_time(time, "%c %Z") << std::endl; + << std::put_time(timeTm, "%c %Z") << std::endl; #endif // For some reason, the clock needs to be somewhat correct for NTP to work. Really dumb.. Clock::setClock(&time); From a9419cd3288e8c8855203094b7e1337e4eb78b4f Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 8 Apr 2022 14:51:47 +0200 Subject: [PATCH 46/65] tmtc update --- tmtc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tmtc b/tmtc index 5189b20b..3a1c7c62 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 5189b20b0e732c0a504bd0d1278eef8653b10293 +Subproject commit 3a1c7c62887eb377c498bd9cdac47b93f40c85ba From 1d98582bbd9d9a99bcc42941d79ebf0c8597918c Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 11 Apr 2022 08:56:04 +0200 Subject: [PATCH 47/65] update tmtc submodule --- tmtc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tmtc b/tmtc index 3a1c7c62..091cf2dd 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 3a1c7c62887eb377c498bd9cdac47b93f40c85ba +Subproject commit 091cf2dd632c71a0fa8000312bb11e84f1a755db From 8a0999851fa491be9dbd7009f87362b212aa8f1b Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 11 Apr 2022 14:56:20 +0200 Subject: [PATCH 48/65] update for new fsfw API - Apply auto-formatter --- common/config/devConf.h | 11 ++++++----- fsfw | 2 +- linux/devices/GPSHyperionLinuxController.cpp | 1 - mission/devices/P60DockHandler.cpp | 2 +- tmtc | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/common/config/devConf.h b/common/config/devConf.h index 7e09b50f..abb3b3e1 100644 --- a/common/config/devConf.h +++ b/common/config/devConf.h @@ -3,6 +3,7 @@ #include #include +#include /** * SPI configuration will be contained here to let the device handlers remain independent @@ -49,11 +50,11 @@ static constexpr spi::SpiModes RTD_MODE = spi::SpiModes::MODE_3; namespace uart { static constexpr size_t HYPERION_GPS_REPLY_MAX_BUFFER = 1024; -static constexpr uint32_t SYRLINKS_BAUD = 38400; -static constexpr uint32_t GNSS_BAUD = 9600; -static constexpr uint32_t PLOC_MPSOC_BAUD = 115200; -static constexpr uint32_t PLOC_SUPERVISOR_BAUD = 115200; -static constexpr uint32_t STAR_TRACKER_BAUD = 921600; +static constexpr UartBaudRate SYRLINKS_BAUD = UartBaudRate::RATE_38400; +static constexpr UartBaudRate GNSS_BAUD = UartBaudRate::RATE_9600; +static constexpr UartBaudRate PLOC_MPSOC_BAUD = UartBaudRate::RATE_115200; +static constexpr UartBaudRate PLOC_SUPERVISOR_BAUD = UartBaudRate::RATE_115200; +static constexpr UartBaudRate STAR_TRACKER_BAUD = UartBaudRate::RATE_921600; } diff --git a/fsfw b/fsfw index 85a6e4b1..6ce09e96 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 85a6e4b12977f24247ed3ca3011c6f8b611a144e +Subproject commit 6ce09e968d30997f8e3e82e16aef7ca19e19f5eb diff --git a/linux/devices/GPSHyperionLinuxController.cpp b/linux/devices/GPSHyperionLinuxController.cpp index d1ef7d1b..20860211 100644 --- a/linux/devices/GPSHyperionLinuxController.cpp +++ b/linux/devices/GPSHyperionLinuxController.cpp @@ -3,7 +3,6 @@ #include "OBSWConfig.h" #include "fsfw/datapool/PoolReadGuard.h" #include "fsfw/timemanager/Clock.h" - #include "linux/utility/utility.h" #include "mission/utility/compileTime.h" diff --git a/mission/devices/P60DockHandler.cpp b/mission/devices/P60DockHandler.cpp index d37673fc..508471d2 100644 --- a/mission/devices/P60DockHandler.cpp +++ b/mission/devices/P60DockHandler.cpp @@ -111,7 +111,7 @@ void P60DockHandler::parseHkTableReply(const uint8_t *packet) { dataOffset += 6; coreHk.bootCount = *(packet + dataOffset) << 24 | *(packet + dataOffset + 1) << 16 | *(packet + dataOffset + 2) << 8 | *(packet + dataOffset + 3); - if(firstHk) { + if (firstHk) { triggerEvent(P60_BOOT_COUNT, coreHk.bootCount.value); } dataOffset += 6; diff --git a/tmtc b/tmtc index 3a1c7c62..98783a09 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 3a1c7c62887eb377c498bd9cdac47b93f40c85ba +Subproject commit 98783a0981b2a23d8f4dbfa8706b8826b8194231 From 5e8262657f5b01173472475b0f195074517c6c6e Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 11 Apr 2022 14:57:45 +0200 Subject: [PATCH 49/65] fsfw update --- fsfw | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fsfw b/fsfw index 6ce09e96..28e93696 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 6ce09e968d30997f8e3e82e16aef7ca19e19f5eb +Subproject commit 28e93696dfe95fdeb8465a2f59a3e578fdf0f1cb From d96ff726357de2a8711b86d1547fd3f04fe8b9f1 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 11 Apr 2022 15:02:04 +0200 Subject: [PATCH 50/65] bump fsfw and tmtc deps --- fsfw | 2 +- tmtc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fsfw b/fsfw index 94ed5822..28e93696 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 94ed5822971575e9715c39c86ab4466c81718441 +Subproject commit 28e93696dfe95fdeb8465a2f59a3e578fdf0f1cb diff --git a/tmtc b/tmtc index 091cf2dd..98783a09 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 091cf2dd632c71a0fa8000312bb11e84f1a755db +Subproject commit 98783a0981b2a23d8f4dbfa8706b8826b8194231 From df38903fe958e4c58c2bcd91888b4df4ad8b8f2f Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 11 Apr 2022 17:16:25 +0200 Subject: [PATCH 51/65] some warning fixes for release build --- fsfw | 2 +- linux/boardtest/SpiTestClass.cpp | 2 +- linux/csp/CspComIF.cpp | 3 +- misc/eclipse/.cproject | 71 ++++++++++++-------------------- mission/devices/IMTQHandler.cpp | 19 +++++---- 5 files changed, 41 insertions(+), 56 deletions(-) diff --git a/fsfw b/fsfw index 28e93696..28166ee1 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 28e93696dfe95fdeb8465a2f59a3e578fdf0f1cb +Subproject commit 28166ee19ee0154dc1849ec0bbf1fef2cf71115d diff --git a/linux/boardtest/SpiTestClass.cpp b/linux/boardtest/SpiTestClass.cpp index ff721967..d9eb6b5a 100644 --- a/linux/boardtest/SpiTestClass.cpp +++ b/linux/boardtest/SpiTestClass.cpp @@ -408,7 +408,7 @@ void SpiTestClass::max1227RadSensorTest(int fd) { transfer(fd, gpioIds::CS_RAD_SENSOR); usleep(65); spiTransferStruct[0].len = 24; - std::memcpy(sendBuffer.data(), sendBuffer.data() + 1, 24); + std::memmove(sendBuffer.data(), sendBuffer.data() + 1, 24); transfer(fd, gpioIds::CS_RAD_SENSOR); int16_t tempRaw = ((recvBuffer[22] & 0x0f) << 8) | recvBuffer[23]; float temp = max1227::getTemperature(tempRaw); diff --git a/linux/csp/CspComIF.cpp b/linux/csp/CspComIF.cpp index fa372d4d..9f346405 100644 --- a/linux/csp/CspComIF.cpp +++ b/linux/csp/CspComIF.cpp @@ -141,11 +141,12 @@ ReturnValue_t CspComIF::cspTransfer(uint8_t cspAddress, uint8_t cspPort, const u int cmdLen, uint16_t querySize) { uint32_t timeout_ms = 1000; uint16_t bytesRead = 0; - int32_t expectedSize = (int32_t)querySize; + int32_t expectedSize = static_cast(querySize); vectorBufferIter iter = cspDeviceMap.find(cspAddress); if (iter == cspDeviceMap.end()) { sif::error << "CSP device with address " << cspAddress << " no found in" << " device map" << std::endl; + return RETURN_FAILED; } uint8_t* replyBuffer = iter->second.data(); diff --git a/misc/eclipse/.cproject b/misc/eclipse/.cproject index aa59f2da..6e4535c1 100644 --- a/misc/eclipse/.cproject +++ b/misc/eclipse/.cproject @@ -756,6 +756,7 @@ + @@ -818,8 +819,8 @@