v1.12.0 #269

Merged
muellerr merged 493 commits from develop into main 2022-07-04 11:19:05 +02:00
73 changed files with 2202 additions and 3212 deletions
Showing only changes of commit 1ce45acba3 - Show all commits

View File

@ -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<PDU1::SwitchChannels>(channel);
if (typedChannel == PDU1::SwitchChannels::ACS_A_SIDE) {
PDU1::Channels typedChannel = static_cast<PDU1::Channels>(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<PDU2::SwitchChannels>(channel);
if (typedChannel == PDU2::SwitchChannels::ACS_B_SIDE) {
PDU2::Channels typedChannel = static_cast<PDU2::Channels>(channel);
if (typedChannel == PDU2::Channels::ACS_B_SIDE) {
if (state) {
gpioComIF->pullHigh(gpioIds::GNSS_1_NRESET);
} else {

View File

@ -1,6 +1,7 @@
#include "CoreController.h"
#include <fsfw/events/EventManager.h>
#include <fsfw/ipc/QueueFactory.h>
#include "OBSWConfig.h"
#include "OBSWVersion.h"
@ -16,11 +17,13 @@
#include <fcntl.h>
#include <unistd.h>
#include <algorithm>
#include <filesystem>
#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;
@ -50,6 +53,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) {
@ -57,6 +61,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<GpsHyperion::FixMode>(event.getParameter2());
break;
}
}
}
performWatchdogControlOperation();
sdStateMachine();
performMountedSdCardOperations();
@ -79,8 +93,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 "
@ -91,7 +107,23 @@ ReturnValue_t CoreController::initialize() {
sdStateMachine();
triggerEvent(REBOOT_SW, CURRENT_CHIP, CURRENT_COPY);
return ExtendedControllerBase::initialize();
EventManagerIF *eventManager =
ObjectManager::instance()->get<EventManagerIF>(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) {
sif::warning << "CoreController::initialize: Registering as event listener failed" << std::endl;
}
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 RETURN_OK;
}
ReturnValue_t CoreController::initializeAfterTaskCreation() {
@ -639,8 +671,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)) {
@ -1198,24 +1229,27 @@ 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;
}
}
timeFileHandler();
}
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;
@ -1594,7 +1628,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) {
@ -1621,7 +1655,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
@ -1657,6 +1691,57 @@ 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(&currentTime);
if (result != HasReturnvaluesIF::RETURN_OK) {
return result;
}
std::ofstream timeFile(currMntPrefix + TIME_FILE);
timeFile << "UNIX SECONDS: " << currentTime.tv_sec << std::endl;
}
return RETURN_OK;
}
ReturnValue_t CoreController::initClockFromTimeFile() {
using namespace GpsHyperion;
using namespace std;
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") {
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;
}
#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(&currentTime);
}
return RETURN_OK;
}
void CoreController::readHkData() {
ReturnValue_t result = RETURN_OK;
result = hkSet.read(TIMEOUT_TYPE, MUTEX_TIMEOUT);
@ -1690,3 +1775,8 @@ 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();
}

View File

@ -10,6 +10,7 @@
#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;
@ -53,10 +54,12 @@ 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 +129,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 +155,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;
@ -173,6 +178,7 @@ class CoreController : public ExtendedControllerBase {
sd::SdState commandedState = sd::SdState::OFF;
} sdInfo;
RebootFile rebootFile = {};
std::string currMntPrefix;
bool doPerformMountedSdCardOps = true;
/**
@ -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_ */

View File

@ -169,7 +169,7 @@ void initmission::initTasks() {
#if OBSW_ADD_PLOC_SUPERVISOR == 1
PeriodicTaskIF* supvHelperTask = factory->createPeriodicTask(
"PLOC_SUPV_HELPER", 20, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.2, missedDeadlineFunc);
"PLOC_SUPV_HELPER", 10, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.3, missedDeadlineFunc);
result = supvHelperTask->addComponent(objects::PLOC_SUPERVISOR_HELPER);
if (result != HasReturnvaluesIF::RETURN_OK) {
initmission::printAddObjectError("PLOC_SUPV_HELPER", objects::PLOC_SUPERVISOR_HELPER);
@ -239,7 +239,9 @@ void initmission::initTasks() {
acsTask->startTask();
#endif
sysTask->startTask();
#if OBSW_ADD_PLOC_SUPERVISOR == 1
supvHelperTask->startTask();
#endif /* OBSW_ADD_PLOC_SUPERVISOR == 1 */
sif::info << "Tasks started.." << std::endl;
}

View File

@ -160,7 +160,9 @@ void ObjectFactory::produce(void* args) {
#if OBSW_ADD_MGT == 1
I2cCookie* imtqI2cCookie =
new I2cCookie(addresses::IMTQ, IMTQ::MAX_REPLY_SIZE, q7s::I2C_DEFAULT_DEV);
auto imtqHandler = new IMTQHandler(objects::IMTQ_HANDLER, objects::I2C_COM_IF, imtqI2cCookie);
auto imtqHandler = new IMTQHandler(objects::IMTQ_HANDLER, objects::I2C_COM_IF, imtqI2cCookie,
pcdu::Switches::PDU1_CH3_MGT_5V);
imtqHandler->setPowerSwitcher(pwrSwitcher);
static_cast<void>(imtqHandler);
#if OBSW_DEBUG_IMTQ == 1
imtqHandler->setStartUpImmediately();
@ -187,12 +189,14 @@ void ObjectFactory::produce(void* args) {
#if OBSW_ADD_STAR_TRACKER == 1
UartCookie* starTrackerCookie =
new UartCookie(objects::STAR_TRACKER, q7s::UART_STAR_TRACKER_DEV, UartModes::NON_CANONICAL,
uart::STAR_TRACKER_BAUD, startracker::MAX_FRAME_SIZE * 2 + 2);
new UartCookie(objects::STAR_TRACKER, q7s::UART_STAR_TRACKER_DEV, uart::STAR_TRACKER_BAUD,
startracker::MAX_FRAME_SIZE * 2 + 2, UartModes::NON_CANONICAL);
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);
auto starTracker =
new StarTrackerHandler(objects::STAR_TRACKER, objects::UART_COM_IF, starTrackerCookie,
strHelper, pcdu::PDU1_CH2_STAR_TRACKER_5V);
starTracker->setPowerSwitcher(pwrSwitcher);
#endif /* OBSW_ADD_STAR_TRACKER == 1 */
@ -600,7 +604,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() {
@ -620,18 +624,19 @@ 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);
}
void ObjectFactory::createSyrlinksComponents() {
void ObjectFactory::createSyrlinksComponents(PowerSwitchIF* pwrSwitcher) {
UartCookie* syrlinksUartCookie =
new UartCookie(objects::SYRLINKS_HK_HANDLER, q7s::UART_SYRLINKS_DEV, UartModes::NON_CANONICAL,
uart::SYRLINKS_BAUD, syrlinks::MAX_REPLY_SIZE);
new UartCookie(objects::SYRLINKS_HK_HANDLER, q7s::UART_SYRLINKS_DEV, uart::SYRLINKS_BAUD,
syrlinks::MAX_REPLY_SIZE, UartModes::NON_CANONICAL);
syrlinksUartCookie->setParityEven();
new SyrlinksHkHandler(objects::SYRLINKS_HK_HANDLER, objects::UART_COM_IF, syrlinksUartCookie,
pcduSwitches::PDU1_CH1_SYRLINKS_12V);
auto syrlinksHandler = new SyrlinksHkHandler(objects::SYRLINKS_HK_HANDLER, objects::UART_COM_IF,
syrlinksUartCookie, pcdu::PDU1_CH1_SYRLINKS_12V);
syrlinksHandler->setPowerSwitcher(pwrSwitcher);
}
void ObjectFactory::createPayloadComponents(LinuxLibgpioIF* gpioComIF) {
@ -645,8 +650,8 @@ void ObjectFactory::createPayloadComponents(LinuxLibgpioIF* gpioComIF) {
mpsocGpioCookie->addGpio(gpioIds::ENABLE_MPSOC_UART, gpioConfigMPSoC);
gpioComIF->addGpios(mpsocGpioCookie);
auto mpsocCookie =
new UartCookie(objects::PLOC_MPSOC_HANDLER, q7s::UART_PLOC_MPSOC_DEV,
UartModes::NON_CANONICAL, uart::PLOC_MPSOC_BAUD, mpsoc::MAX_REPLY_SIZE);
new UartCookie(objects::PLOC_MPSOC_HANDLER, q7s::UART_PLOC_MPSOC_DEV, uart::PLOC_MPSOC_BAUD,
mpsoc::MAX_REPLY_SIZE, UartModes::NON_CANONICAL);
mpsocCookie->setNoFixedSizeReply();
auto plocMpsocHelper = new PlocMPSoCHelper(objects::PLOC_MPSOC_HELPER);
new PlocMPSoCHandler(objects::PLOC_MPSOC_HANDLER, objects::UART_COM_IF, mpsocCookie,
@ -661,14 +666,14 @@ 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_SUPV_BAUD, supv::MAX_PACKET_SIZE * 20);
auto supervisorCookie =
new UartCookie(objects::PLOC_SUPERVISOR_HANDLER, q7s::UART_PLOC_SUPERVSIOR_DEV,
uart::PLOC_SUPV_BAUD, supv::MAX_PACKET_SIZE * 20, UartModes::NON_CANONICAL);
supervisorCookie->setNoFixedSizeReply();
auto supvHelper = new PlocSupvHelper(objects::PLOC_SUPERVISOR_HELPER);
new PlocSupervisorHandler(objects::PLOC_SUPERVISOR_HANDLER, objects::UART_COM_IF,
supervisorCookie, Gpio(gpioIds::ENABLE_SUPV_UART, gpioComIF),
pcduSwitches::PDU1_CH6_PLOC_12V, supvHelper);
pcdu::PDU1_CH6_PLOC_12V, supvHelper);
#endif /* OBSW_ADD_PLOC_SUPERVISOR == 1 */
static_cast<void>(consumer);
}
@ -925,8 +930,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<void>(plPcduHandler);

View File

@ -24,7 +24,7 @@ void createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComIF* uartComIF,
PowerSwitchIF* pwrSwitcher);
void createHeaterComponents();
void createSolarArrayDeploymentComponents();
void createSyrlinksComponents();
void createSyrlinksComponents(PowerSwitchIF* pwrSwitcher);
void createPayloadComponents(LinuxLibgpioIF* gpioComIF);
void createReactionWheelComponents(LinuxLibgpioIF* gpioComIF);
void createCcsdsComponents(LinuxLibgpioIF* gpioComIF);

View File

@ -6,24 +6,31 @@
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_SUPV_HELPER = 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,
P60_DOCK_HANDLER = 132,
PDU1_HANDLER = 133,
PDU2_HANDLER = 134,
ACU_HANDLER = 135,
PLOC_SUPV_HELPER = 136,
COMMON_SUBSYSTEM_ID_END
};
}

View File

@ -1,72 +1,6 @@
#ifndef FSFWCONFIG_DEVICES_POWERSWITCHERLIST_H_
#define FSFWCONFIG_DEVICES_POWERSWITCHERLIST_H_
#include "OBSWConfig.h"
#include <fsfw/power/definitions.h>
#include <array>
#include <cstdint>
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<uint8_t, NUMBER_OF_SWITCHES> 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_ */

2
fsfw

@ -1 +1 @@
Subproject commit ce17be63f4f3bb8947843e423685c622510ae09f
Subproject commit e949368b062e8703c35d2043ece8d7258cd2608b

View File

@ -77,116 +77,116 @@
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
11106;0x2b62;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
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
11505;0x2cf1;SUPV_HELPER_EXECUTING;LOW;Supervisor helper currently executing a command;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;SUPV_UPDATE_FAILED;LOW;update failed;linux\devices\ploc\PlocSupvHelper.h
11701;0x2db5;SUPV_UPDATE_SUCCESSFUL;LOW;update successful;linux\devices\ploc\PlocSupvHelper.h
11702;0x2db6;TERMINATED_UPDATE_PROCEDURE;LOW;Terminated update procedure by command;linux\devices\ploc\PlocSupvHelper.h
11703;0x2db7;SUPV_EVENT_BUFFER_REQUEST_SUCCESSFUL;LOW;Requesting event buffer was successful;linux\devices\ploc\PlocSupvHelper.h
11704;0x2db8;SUPV_EVENT_BUFFER_REQUEST_FAILED;LOW;Requesting event buffer failed;linux\devices\ploc\PlocSupvHelper.h
11705;0x2db9;SUPV_EVENT_BUFFER_REQUEST_TERMINATED;LOW;Terminated event buffer request by command P1: Number of packets read before process was terminated;linux\devices\ploc\PlocSupvHelper.h
11706;0x2dba;SUPV_SENDING_COMMAND_FAILED;LOW;;linux\devices\ploc\PlocSupvHelper.h
11707;0x2dbb;SUPV_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 supervisor helper;linux\devices\ploc\PlocSupvHelper.h
11708;0x2dbc;SUPV_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 supervisor helper;linux\devices\ploc\PlocSupvHelper.h
11709;0x2dbd;SUPV_MISSING_ACK;LOW;Did not receive acknowledgement report P1: Number of bytes missing P2: Internal state of MPSoC helper;linux\devices\ploc\PlocSupvHelper.h
11710;0x2dbe;SUPV_MISSING_EXE;LOW;Supervisor did not receive execution report P1: Number of bytes missing P2: Internal state of supervisor helper;linux\devices\ploc\PlocSupvHelper.h
11711;0x2dbf;SUPV_ACK_FAILURE_REPORT;LOW;Supervisor received acknowledgment failure report P1: Internal state of supervisor helper;linux\devices\ploc\PlocSupvHelper.h
11712;0x2dc0;SUPV_EXE_FAILURE_REPORT;LOW;Supervisor received execution failure report P1: Internal state of supervisor;linux\devices\ploc\PlocSupvHelper.h
11713;0x2dc1;SUPV_ACK_INVALID_APID;LOW;Supervisor expected acknowledgment report but received space packet with other apid P1: Apid of received space packet P2: Internal state of supervisor helper;linux\devices\ploc\PlocSupvHelper.h
11714;0x2dc2;SUPV_EXE_INVALID_APID;LOW;Supervisor helper expected execution report but received space packet with other apid P1: Apid of received space packet P2: Internal state of supervisor helper;linux\devices\ploc\PlocSupvHelper.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;MPSOC_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;MPSOC_MISSING_ACK;LOW;Did not receive acknowledgment report P1: Number of bytes missing P2: Internal state of MPSoC helper;linux\devices\ploc\PlocMPSoCHelper.h
12106;0x2f4a;MPSOC_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;MPSOC_ACK_FAILURE_REPORT;LOW;Received acknowledgment failure report P1: Internal state of MPSoC;linux\devices\ploc\PlocMPSoCHelper.h
12108;0x2f4c;MPSOC_EXE_FAILURE_REPORT;LOW;Received execution failure report P1: Internal state of MPSoC;linux\devices\ploc\PlocMPSoCHelper.h
12109;0x2f4d;MPSOC_ACK_INVALID_APID;LOW;Expected acknowledgment 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;MPSOC_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
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
13603;0x3523;REBOOT_HW;MEDIUM;;bsp_q7s\core\CoreController.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
12005;0x2ee5;SUPV_HELPER_EXECUTING;LOW;Supervisor helper currently executing a command;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
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;MPSOC_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;MPSOC_MISSING_ACK;LOW;Did not receive acknowledgment report P1: Number of bytes missing P2: Internal state of MPSoC helper;linux\devices\ploc\PlocMPSoCHelper.h
12606;0x313e;MPSOC_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;MPSOC_ACK_FAILURE_REPORT;LOW;Received acknowledgment failure report P1: Internal state of MPSoC;linux\devices\ploc\PlocMPSoCHelper.h
12608;0x3140;MPSOC_EXE_FAILURE_REPORT;LOW;Received execution failure report P1: Internal state of MPSoC;linux\devices\ploc\PlocMPSoCHelper.h
12609;0x3141;MPSOC_ACK_INVALID_APID;LOW;Expected acknowledgment 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;MPSOC_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
13200;0x3390;P60_BOOT_COUNT;INFO;P60 boot count is broadcasted once at SW startup. P1: Boot count;mission\devices\P60DockHandler.h
13201;0x3391;BATT_MODE;INFO;Battery mode is broadcasted at startup. P1: Mode;mission\devices\P60DockHandler.h
13202;0x3392;BATT_MODE_CHANGED;MEDIUM;Battery mode has changed. P1: Old mode. P2: New mode;mission\devices\P60DockHandler.h
13600;0x3520;SUPV_UPDATE_FAILED;LOW;update failed;linux\devices\ploc\PlocSupvHelper.h
13601;0x3521;SUPV_UPDATE_SUCCESSFUL;LOW;update successful;linux\devices\ploc\PlocSupvHelper.h
13602;0x3522;TERMINATED_UPDATE_PROCEDURE;LOW;Terminated update procedure by command;linux\devices\ploc\PlocSupvHelper.h
13603;0x3523;SUPV_EVENT_BUFFER_REQUEST_SUCCESSFUL;LOW;Requesting event buffer was successful;linux\devices\ploc\PlocSupvHelper.h
13604;0x3524;SUPV_EVENT_BUFFER_REQUEST_FAILED;LOW;Requesting event buffer failed;linux\devices\ploc\PlocSupvHelper.h
13605;0x3525;SUPV_EVENT_BUFFER_REQUEST_TERMINATED;LOW;Terminated event buffer request by command P1: Number of packets read before process was terminated;linux\devices\ploc\PlocSupvHelper.h
13606;0x3526;SUPV_SENDING_COMMAND_FAILED;LOW;;linux\devices\ploc\PlocSupvHelper.h
13607;0x3527;SUPV_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 supervisor helper;linux\devices\ploc\PlocSupvHelper.h
13608;0x3528;SUPV_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 supervisor helper;linux\devices\ploc\PlocSupvHelper.h
13609;0x3529;SUPV_MISSING_ACK;LOW;Did not receive acknowledgement report P1: Number of bytes missing P2: Internal state of MPSoC helper;linux\devices\ploc\PlocSupvHelper.h
13610;0x352a;SUPV_MISSING_EXE;LOW;Supervisor did not receive execution report P1: Number of bytes missing P2: Internal state of supervisor helper;linux\devices\ploc\PlocSupvHelper.h
13611;0x352b;SUPV_ACK_FAILURE_REPORT;LOW;Supervisor received acknowledgment failure report P1: Internal state of supervisor helper;linux\devices\ploc\PlocSupvHelper.h
13612;0x352c;SUPV_EXE_FAILURE_REPORT;LOW;Supervisor received execution failure report P1: Internal state of supervisor;linux\devices\ploc\PlocSupvHelper.h
13613;0x352d;SUPV_ACK_INVALID_APID;LOW;Supervisor expected acknowledgment report but received space packet with other apid P1: Apid of received space packet P2: Internal state of supervisor helper;linux\devices\ploc\PlocSupvHelper.h
13614;0x352e;SUPV_EXE_INVALID_APID;LOW;Supervisor helper expected execution report but received space packet with other apid P1: Apid of received space packet P2: Internal state of supervisor helper;linux\devices\ploc\PlocSupvHelper.h

1 2200 0x0898 STORE_SEND_WRITE_FAILED LOW fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h fsfw\src\fsfw\tmstorage\TmStoreBackendIF.h
77 8901 0x22c5 CLOCK_SET_FAILURE LOW fsfw/src/fsfw/pus/Service9TimeManagement.h fsfw\src\fsfw\pus\Service9TimeManagement.h
78 9700 0x25e4 TEST INFO fsfw/src/fsfw/pus/Service17Test.h fsfw\src\fsfw\pus\Service17Test.h
79 10600 0x2968 CHANGE_OF_SETUP_PARAMETER LOW fsfw/hal/src/fsfw_hal/devicehandlers/MgmLIS3MDLHandler.h fsfw\hal\src\fsfw_hal\devicehandlers\MgmLIS3MDLHandler.h
80 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 mission\devices\devicedefinitions\powerDefinitions.h
81 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 mission\devices\devicedefinitions\powerDefinitions.h
82 11302 0x2c26 SWITCHING_Q7S_DENIED MEDIUM mission/devices/devicedefinitions/powerDefinitions.h mission\devices\devicedefinitions\powerDefinitions.h
83 11303 11400 0x2c27 0x2c88 FDIR_REACTION_IGNORED GPIO_PULL_HIGH_FAILED MEDIUM LOW mission/devices/devicedefinitions/powerDefinitions.h mission\devices\HeaterHandler.h
84 11400 11401 0x2c88 0x2c89 GPIO_PULL_HIGH_FAILED GPIO_PULL_LOW_FAILED LOW mission/devices/HeaterHandler.h mission\devices\HeaterHandler.h
85 11401 11402 0x2c89 0x2c8a GPIO_PULL_LOW_FAILED SWITCH_ALREADY_ON LOW mission/devices/HeaterHandler.h mission\devices\HeaterHandler.h
86 11402 11403 0x2c8a 0x2c8b SWITCH_ALREADY_ON SWITCH_ALREADY_OFF LOW mission/devices/HeaterHandler.h mission\devices\HeaterHandler.h
87 11403 11404 0x2c8b 0x2c8c SWITCH_ALREADY_OFF MAIN_SWITCH_TIMEOUT LOW mission/devices/HeaterHandler.h mission\devices\HeaterHandler.h
88 11404 11500 0x2c8c 0x2cec MAIN_SWITCH_TIMEOUT MAIN_SWITCH_ON_TIMEOUT LOW mission/devices/HeaterHandler.h mission\devices\SolarArrayDeploymentHandler.h
89 11500 11501 0x2cec 0x2ced MAIN_SWITCH_ON_TIMEOUT MAIN_SWITCH_OFF_TIMEOUT LOW mission/devices/SolarArrayDeploymentHandler.h mission\devices\SolarArrayDeploymentHandler.h
90 11501 11502 0x2ced 0x2cee MAIN_SWITCH_OFF_TIMEOUT DEPLOYMENT_FAILED LOW HIGH mission/devices/SolarArrayDeploymentHandler.h mission\devices\SolarArrayDeploymentHandler.h
91 11502 11503 0x2cee 0x2cef DEPLOYMENT_FAILED DEPL_SA1_GPIO_SWTICH_ON_FAILED HIGH mission/devices/SolarArrayDeploymentHandler.h mission\devices\SolarArrayDeploymentHandler.h
92 11503 11504 0x2cef 0x2cf0 DEPL_SA1_GPIO_SWTICH_ON_FAILED DEPL_SA2_GPIO_SWTICH_ON_FAILED HIGH mission/devices/SolarArrayDeploymentHandler.h mission\devices\SolarArrayDeploymentHandler.h
93 11504 11601 0x2cf0 0x2d51 DEPL_SA2_GPIO_SWTICH_ON_FAILED MEMORY_READ_RPT_CRC_FAILURE HIGH LOW PLOC crc failure in telemetry packet mission/devices/SolarArrayDeploymentHandler.h linux\devices\ploc\PlocMPSoCHandler.h
94 11601 11602 0x2d51 0x2d52 MEMORY_READ_RPT_CRC_FAILURE ACK_FAILURE LOW PLOC crc failure in telemetry packet 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 linux\devices\ploc\PlocMPSoCHandler.h
95 11602 11603 0x2d52 0x2d53 ACK_FAILURE EXE_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 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 linux\devices\ploc\PlocMPSoCHandler.h
96 11603 11604 0x2d53 0x2d54 EXE_FAILURE MPSOC_HANDLER_CRC_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 PLOC reply has invalid crc linux/devices/ploc/PlocMPSoCHandler.h linux\devices\ploc\PlocMPSoCHandler.h
97 11604 11605 0x2d54 0x2d55 MPSOC_HANDLER_CRC_FAILURE MPSOC_HANDLER_SEQ_CNT_MISMATCH LOW PLOC reply has invalid crc 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 linux\devices\ploc\PlocMPSoCHandler.h
98 11605 11606 0x2d55 0x2d56 MPSOC_HANDLER_SEQ_CNT_MISMATCH MPSOC_SHUTDOWN_FAILED LOW HIGH Packet sequence count in received space packet does not match expected count P1: Expected sequence count P2: Received sequence count Supervisor fails to shutdown MPSoC. Requires to power off the PLOC and thus also to shutdown the supervisor. linux/devices/ploc/PlocMPSoCHandler.h linux\devices\ploc\PlocMPSoCHandler.h
99 11606 11701 0x2d56 0x2db5 MPSOC_SHUTDOWN_FAILED SELF_TEST_I2C_FAILURE HIGH LOW Supervisor fails to shutdown MPSoC. Requires to power off the PLOC and thus also to shutdown the supervisor. 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 linux/devices/ploc/PlocMPSoCHandler.h mission\devices\IMTQHandler.h
100 11701 11702 0x2db5 0x2db6 SELF_TEST_I2C_FAILURE SELF_TEST_SPI_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 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 mission\devices\IMTQHandler.h
101 11702 11703 0x2db6 0x2db7 SELF_TEST_SPI_FAILURE SELF_TEST_ADC_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 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 mission\devices\IMTQHandler.h
102 11703 11704 0x2db7 0x2db8 SELF_TEST_ADC_FAILURE SELF_TEST_PWM_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 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 mission\devices\IMTQHandler.h
103 11704 11705 0x2db8 0x2db9 SELF_TEST_PWM_FAILURE SELF_TEST_TC_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 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 mission\devices\IMTQHandler.h
104 11705 11706 0x2db9 0x2dba SELF_TEST_TC_FAILURE SELF_TEST_MTM_RANGE_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 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 mission\devices\IMTQHandler.h
105 11706 11707 0x2dba 0x2dbb SELF_TEST_MTM_RANGE_FAILURE SELF_TEST_COIL_CURRENT_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 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 mission\devices\IMTQHandler.h
106 11707 11708 0x2dbb 0x2dbc SELF_TEST_COIL_CURRENT_FAILURE INVALID_ERROR_BYTE 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 Received invalid error byte. This indicates an error of the communication link between IMTQ and OBC. mission/devices/IMTQHandler.h mission\devices\IMTQHandler.h
107 11708 11801 0x2dbc 0x2e19 INVALID_ERROR_BYTE ERROR_STATE LOW HIGH Received invalid error byte. This indicates an error of the communication link between IMTQ and OBC. Reaction wheel signals an error state mission/devices/IMTQHandler.h mission\devices\RwHandler.h
108 11801 11901 0x2e19 0x2e7d ERROR_STATE BOOTING_FIRMWARE_FAILED HIGH LOW Reaction wheel signals an error state Failed to boot firmware mission/devices/RwHandler.h linux\devices\startracker\StarTrackerHandler.h
109 11901 11902 0x2e7d 0x2e7e BOOTING_FIRMWARE_FAILED BOOTING_BOOTLOADER_FAILED LOW Failed to boot firmware Failed to boot star tracker into bootloader mode linux/devices/startracker/StarTrackerHandler.h linux\devices\startracker\StarTrackerHandler.h
110 11902 12001 0x2e7e 0x2ee1 BOOTING_BOOTLOADER_FAILED SUPV_MEMORY_READ_RPT_CRC_FAILURE LOW Failed to boot star tracker into bootloader mode PLOC supervisor crc failure in telemetry packet linux/devices/startracker/StarTrackerHandler.h linux\devices\ploc\PlocSupervisorHandler.h
111 12001 12002 0x2ee1 0x2ee2 SUPV_MEMORY_READ_RPT_CRC_FAILURE SUPV_ACK_FAILURE LOW PLOC supervisor crc failure in telemetry packet PLOC supervisor received acknowledgment failure report linux/devices/ploc/PlocSupervisorHandler.h linux\devices\ploc\PlocSupervisorHandler.h
112 12002 12003 0x2ee2 0x2ee3 SUPV_ACK_FAILURE SUPV_EXE_FAILURE LOW PLOC supervisor received acknowledgment failure report PLOC received execution failure report linux/devices/ploc/PlocSupervisorHandler.h linux\devices\ploc\PlocSupervisorHandler.h
113 12003 12004 0x2ee3 0x2ee4 SUPV_EXE_FAILURE SUPV_CRC_FAILURE_EVENT LOW PLOC received execution failure report PLOC supervisor reply has invalid crc linux/devices/ploc/PlocSupervisorHandler.h linux\devices\ploc\PlocSupervisorHandler.h
114 12004 12005 0x2ee4 0x2ee5 SUPV_CRC_FAILURE_EVENT SUPV_HELPER_EXECUTING LOW PLOC supervisor reply has invalid crc Supervisor helper currently executing a command linux/devices/ploc/PlocSupervisorHandler.h linux\devices\ploc\PlocSupervisorHandler.h
115 12100 0x2f44 SANITIZATION_FAILED LOW bsp_q7s/memory/SdCardManager.h bsp_q7s\memory\SdCardManager.h
116 12101 0x2f45 MOUNTED_SD_CARD INFO bsp_q7s/memory/SdCardManager.h bsp_q7s\memory\SdCardManager.h
117 12200 12300 0x2fa8 0x300c UPDATE_FILE_NOT_EXISTS 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/PlocUpdater.h linux\devices\ploc\PlocMemoryDumper.h
118 12201 12301 0x2fa9 0x300d ACTION_COMMANDING_FAILED MRAM_DUMP_FAILED LOW Failed to send command to supervisor handler P1: Return value of CommandActionHelper::commandAction P2: Action ID of command to send Received completion failure report form PLOC supervisor handler P1: MRAM start address of failing dump command linux/devices/ploc/PlocUpdater.h linux\devices\ploc\PlocMemoryDumper.h
119 12202 12302 0x2faa 0x300e UPDATE_AVAILABLE_FAILED MRAM_DUMP_FINISHED LOW Supervisor handler replied action message indicating a command execution failure of the update available command MRAM dump finished successfully linux/devices/ploc/PlocUpdater.h linux\devices\ploc\PlocMemoryDumper.h
120 12203 12401 0x2fab 0x3071 UPDATE_TRANSFER_FAILED INVALID_TC_FRAME LOW HIGH 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 linux\obc\PdecHandler.h
121 12204 12402 0x2fac 0x3072 UPDATE_VERIFY_FAILED INVALID_FAR LOW HIGH Supervisor failed to execute the update verify command. Read invalid FAR from PDEC after startup linux/devices/ploc/PlocUpdater.h linux\obc\PdecHandler.h
122 12205 12403 0x2fad 0x3073 UPDATE_FINISHED CARRIER_LOCK INFO MPSoC update successful completed Carrier lock detected linux/devices/ploc/PlocUpdater.h linux\obc\PdecHandler.h
123 12300 12404 0x300c 0x3074 SEND_MRAM_DUMP_FAILED BIT_LOCK_PDEC LOW INFO 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 Bit lock detected (data valid) linux/devices/ploc/PlocMemoryDumper.h linux\obc\PdecHandler.h
124 12301 12500 0x300d 0x30d4 MRAM_DUMP_FAILED IMAGE_UPLOAD_FAILED LOW Received completion failure report form PLOC supervisor handler P1: MRAM start address of failing dump command Image upload failed linux/devices/ploc/PlocMemoryDumper.h linux\devices\startracker\StrHelper.h
125 12302 12501 0x300e 0x30d5 MRAM_DUMP_FINISHED IMAGE_DOWNLOAD_FAILED LOW MRAM dump finished successfully Image download failed linux/devices/ploc/PlocMemoryDumper.h linux\devices\startracker\StrHelper.h
126 12401 12502 0x3071 0x30d6 INVALID_TC_FRAME IMAGE_UPLOAD_SUCCESSFUL HIGH LOW Uploading image to star tracker was successfulop linux/obc/PdecHandler.h linux\devices\startracker\StrHelper.h
127 12402 12503 0x3072 0x30d7 INVALID_FAR IMAGE_DOWNLOAD_SUCCESSFUL HIGH LOW Read invalid FAR from PDEC after startup Image download was successful linux/obc/PdecHandler.h linux\devices\startracker\StrHelper.h
128 12403 12504 0x3073 0x30d8 CARRIER_LOCK FLASH_WRITE_SUCCESSFUL INFO LOW Carrier lock detected Finished flash write procedure successfully linux/obc/PdecHandler.h linux\devices\startracker\StrHelper.h
129 12404 12505 0x3074 0x30d9 BIT_LOCK_PDEC FLASH_READ_SUCCESSFUL INFO LOW Bit lock detected (data valid) Finished flash read procedure successfully linux/obc/PdecHandler.h linux\devices\startracker\StrHelper.h
130 12500 12506 0x30d4 0x30da IMAGE_UPLOAD_FAILED FLASH_READ_FAILED LOW Image upload failed Flash read procedure failed linux/devices/startracker/StrHelper.h linux\devices\startracker\StrHelper.h
131 12501 12507 0x30d5 0x30db IMAGE_DOWNLOAD_FAILED FIRMWARE_UPDATE_SUCCESSFUL LOW Image download failed Firmware update was successful linux/devices/startracker/StrHelper.h linux\devices\startracker\StrHelper.h
132 12502 12508 0x30d6 0x30dc IMAGE_UPLOAD_SUCCESSFUL FIRMWARE_UPDATE_FAILED LOW Uploading image to star tracker was successfulop Firmware update failed linux/devices/startracker/StrHelper.h linux\devices\startracker\StrHelper.h
133 12503 12509 0x30d7 0x30dd IMAGE_DOWNLOAD_SUCCESSFUL STR_HELPER_READING_REPLY_FAILED LOW Image download was successful 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 linux\devices\startracker\StrHelper.h
134 12504 12510 0x30d8 0x30de FLASH_WRITE_SUCCESSFUL STR_HELPER_COM_ERROR LOW Finished flash write procedure successfully 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 linux\devices\startracker\StrHelper.h
135 12505 12511 0x30d9 0x30df FLASH_READ_SUCCESSFUL STR_HELPER_NO_REPLY LOW Finished flash read procedure successfully 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 linux\devices\startracker\StrHelper.h
136 12506 12512 0x30da 0x30e0 FLASH_READ_FAILED STR_HELPER_DEC_ERROR LOW Flash read procedure failed 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 linux\devices\startracker\StrHelper.h
137 12507 12513 0x30db 0x30e1 FIRMWARE_UPDATE_SUCCESSFUL POSITION_MISMATCH LOW Firmware update was successful Position mismatch P1: The expected position and thus the position for which the image upload/download failed linux/devices/startracker/StrHelper.h linux\devices\startracker\StrHelper.h
138 12508 12514 0x30dc 0x30e2 FIRMWARE_UPDATE_FAILED STR_HELPER_FILE_NOT_EXISTS LOW Firmware update failed Specified file does not exist P1: Internal state of str helper linux/devices/startracker/StrHelper.h linux\devices\startracker\StrHelper.h
139 12509 12515 0x30dd 0x30e3 STR_HELPER_READING_REPLY_FAILED STR_HELPER_SENDING_PACKET_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 linux\devices\startracker\StrHelper.h
140 12510 12516 0x30de 0x30e4 STR_HELPER_COM_ERROR STR_HELPER_REQUESTING_MSG_FAILED 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 linux\devices\startracker\StrHelper.h
141 12511 12600 0x30df 0x3138 STR_HELPER_NO_REPLY MPSOC_FLASH_WRITE_FAILED 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 Flash write fails linux/devices/startracker/StrHelper.h linux\devices\ploc\PlocMPSoCHelper.h
142 12512 12601 0x30e0 0x3139 STR_HELPER_DEC_ERROR MPSOC_FLASH_WRITE_SUCCESSFUL 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 Flash write successful linux/devices/startracker/StrHelper.h linux\devices\ploc\PlocMPSoCHelper.h
143 12513 12602 0x30e1 0x313a POSITION_MISMATCH MPSOC_SENDING_COMMAND_FAILED LOW Position mismatch P1: The expected position and thus the position for which the image upload/download failed linux/devices/startracker/StrHelper.h linux\devices\ploc\PlocMPSoCHelper.h
144 12514 12603 0x30e2 0x313b STR_HELPER_FILE_NOT_EXISTS MPSOC_HELPER_REQUESTING_REPLY_FAILED LOW Specified file does not exist P1: Internal state of str helper 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/startracker/StrHelper.h linux\devices\ploc\PlocMPSoCHelper.h
145 12515 12604 0x30e3 0x313c STR_HELPER_SENDING_PACKET_FAILED 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/startracker/StrHelper.h linux\devices\ploc\PlocMPSoCHelper.h
146 12516 12605 0x30e4 0x313d STR_HELPER_REQUESTING_MSG_FAILED MPSOC_MISSING_ACK LOW Did not receive acknowledgment report P1: Number of bytes missing P2: Internal state of MPSoC helper linux/devices/startracker/StrHelper.h linux\devices\ploc\PlocMPSoCHelper.h
147 12600 12606 0x3138 0x313e MPSOC_FLASH_WRITE_FAILED MPSOC_MISSING_EXE LOW Flash write fails Did not receive execution report P1: Number of bytes missing P2: Internal state of MPSoC helper linux/devices/ploc/PlocMPSoCHelper.h linux\devices\ploc\PlocMPSoCHelper.h
148 12601 12607 0x3139 0x313f MPSOC_FLASH_WRITE_SUCCESSFUL MPSOC_ACK_FAILURE_REPORT LOW Flash write successful Received acknowledgment failure report P1: Internal state of MPSoC linux/devices/ploc/PlocMPSoCHelper.h linux\devices\ploc\PlocMPSoCHelper.h
149 12602 12608 0x313a 0x3140 SENDING_COMMAND_FAILED MPSOC_EXE_FAILURE_REPORT LOW Received execution failure report P1: Internal state of MPSoC linux/devices/ploc/PlocMPSoCHelper.h linux\devices\ploc\PlocMPSoCHelper.h
150 12603 12609 0x313b 0x3141 MPSOC_HELPER_REQUESTING_REPLY_FAILED MPSOC_ACK_INVALID_APID LOW Request receive message of communication interface failed P1: Return value returned by the communication interface requestReceiveMessage function P2: Internal state of MPSoC helper Expected acknowledgment report but received space packet with other apid P1: Apid of received space packet P2: Internal state of MPSoC linux/devices/ploc/PlocMPSoCHelper.h linux\devices\ploc\PlocMPSoCHelper.h
151 12604 12610 0x313c 0x3142 MPSOC_HELPER_READING_REPLY_FAILED MPSOC_EXE_INVALID_APID LOW Reading receive message of communication interface failed P1: Return value returned by the communication interface readingReceivedMessage function P2: Internal state of MPSoC helper 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 linux\devices\ploc\PlocMPSoCHelper.h
152 12605 12611 0x313d 0x3143 MISSING_ACK MPSOC_HELPER_SEQ_CNT_MISMATCH LOW Did not receive acknowledgement report P1: Number of bytes missing P2: Internal state of MPSoC helper Received sequence count does not match expected sequence count P1: Expected sequence count P2: Received sequence count linux/devices/ploc/PlocMPSoCHelper.h linux\devices\ploc\PlocMPSoCHelper.h
153 12606 12700 0x313e 0x319c MISSING_EXE TRANSITION_BACK_TO_OFF LOW MEDIUM Did not receive execution report P1: Number of bytes missing P2: Internal state of MPSoC helper Could not transition properly and went back to ALL OFF linux/devices/ploc/PlocMPSoCHelper.h mission\devices\PayloadPcduHandler.h
154 12607 12701 0x313f 0x319d ACK_FAILURE_REPORT NEG_V_OUT_OF_BOUNDS LOW MEDIUM Received acknowledgement failure report P1: Internal state of MPSoC P1: 0 -> too low, 1 -> too high P2: Float value linux/devices/ploc/PlocMPSoCHelper.h mission\devices\PayloadPcduHandler.h
155 12608 12702 0x3140 0x319e EXE_FAILURE_REPORT U_DRO_OUT_OF_BOUNDS LOW MEDIUM Received execution failure report P1: Internal state of MPSoC P1: 0 -> too low, 1 -> too high P2: Float value linux/devices/ploc/PlocMPSoCHelper.h mission\devices\PayloadPcduHandler.h
156 12609 12703 0x3141 0x319f ACK_INVALID_APID I_DRO_OUT_OF_BOUNDS LOW MEDIUM Expected acknowledgement report but received space packet with other apid P1: Apid of received space packet P2: Internal state of MPSoC P1: 0 -> too low, 1 -> too high P2: Float value linux/devices/ploc/PlocMPSoCHelper.h mission\devices\PayloadPcduHandler.h
157 12610 12704 0x3142 0x31a0 EXE_INVALID_APID U_X8_OUT_OF_BOUNDS LOW MEDIUM Expected execution report but received space packet with other apid P1: Apid of received space packet P2: Internal state of MPSoC P1: 0 -> too low, 1 -> too high P2: Float value linux/devices/ploc/PlocMPSoCHelper.h mission\devices\PayloadPcduHandler.h
158 12611 12705 0x3143 0x31a1 MPSOC_HELPER_SEQ_CNT_MISMATCH I_X8_OUT_OF_BOUNDS LOW MEDIUM Received sequence count does not match expected sequence count P1: Expected sequence count P2: Received sequence count P1: 0 -> too low, 1 -> too high P2: Float value linux/devices/ploc/PlocMPSoCHelper.h mission\devices\PayloadPcduHandler.h
159 12700 12706 0x319c 0x31a2 TRANSITION_BACK_TO_OFF U_TX_OUT_OF_BOUNDS MEDIUM Could not transition properly and went back to ALL OFF P1: 0 -> too low, 1 -> too high P2: Float value mission/devices/PayloadPcduHandler.h mission\devices\PayloadPcduHandler.h
160 12701 12707 0x319d 0x31a3 NEG_V_OUT_OF_BOUNDS I_TX_OUT_OF_BOUNDS MEDIUM P1: 0 -> too low, 1 -> too high P2: Float value mission/devices/PayloadPcduHandler.h mission\devices\PayloadPcduHandler.h
161 12702 12708 0x319e 0x31a4 U_DRO_OUT_OF_BOUNDS U_MPA_OUT_OF_BOUNDS MEDIUM P1: 0 -> too low, 1 -> too high P2: Float value mission/devices/PayloadPcduHandler.h mission\devices\PayloadPcduHandler.h
162 12703 12709 0x319f 0x31a5 I_DRO_OUT_OF_BOUNDS I_MPA_OUT_OF_BOUNDS MEDIUM P1: 0 -> too low, 1 -> too high P2: Float value mission/devices/PayloadPcduHandler.h mission\devices\PayloadPcduHandler.h
163 12704 12710 0x31a0 0x31a6 U_X8_OUT_OF_BOUNDS U_HPA_OUT_OF_BOUNDS MEDIUM P1: 0 -> too low, 1 -> too high P2: Float value mission/devices/PayloadPcduHandler.h mission\devices\PayloadPcduHandler.h
164 12705 12711 0x31a1 0x31a7 I_X8_OUT_OF_BOUNDS I_HPA_OUT_OF_BOUNDS MEDIUM P1: 0 -> too low, 1 -> too high P2: Float value mission/devices/PayloadPcduHandler.h mission\devices\PayloadPcduHandler.h
165 12706 12800 0x31a2 0x3200 U_TX_OUT_OF_BOUNDS TRANSITION_OTHER_SIDE_FAILED MEDIUM HIGH P1: 0 -> too low, 1 -> too high P2: Float value mission/devices/PayloadPcduHandler.h mission\system\AcsBoardAssembly.h
166 12707 12801 0x31a3 0x3201 I_TX_OUT_OF_BOUNDS NOT_ENOUGH_DEVICES_DUAL_MODE MEDIUM HIGH P1: 0 -> too low, 1 -> too high P2: Float value mission/devices/PayloadPcduHandler.h mission\system\AcsBoardAssembly.h
167 12708 12802 0x31a4 0x3202 U_MPA_OUT_OF_BOUNDS POWER_STATE_MACHINE_TIMEOUT MEDIUM P1: 0 -> too low, 1 -> too high P2: Float value mission/devices/PayloadPcduHandler.h mission\system\AcsBoardAssembly.h
168 12709 12803 0x31a5 0x3203 I_MPA_OUT_OF_BOUNDS SIDE_SWITCH_TRANSITION_NOT_ALLOWED MEDIUM LOW P1: 0 -> too low, 1 -> too high P2: Float value 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/devices/PayloadPcduHandler.h mission\system\AcsBoardAssembly.h
169 12710 12900 0x31a6 0x3264 U_HPA_OUT_OF_BOUNDS TRANSITION_OTHER_SIDE_FAILED MEDIUM HIGH P1: 0 -> too low, 1 -> too high P2: Float value mission/devices/PayloadPcduHandler.h mission\system\SusAssembly.h
170 12711 12901 0x31a7 0x3265 I_HPA_OUT_OF_BOUNDS NOT_ENOUGH_DEVICES_DUAL_MODE MEDIUM HIGH P1: 0 -> too low, 1 -> too high P2: Float value mission/devices/PayloadPcduHandler.h mission\system\SusAssembly.h
171 12800 12902 0x3200 0x3266 TRANSITION_OTHER_SIDE_FAILED POWER_STATE_MACHINE_TIMEOUT HIGH MEDIUM mission/system/AcsBoardAssembly.h mission\system\SusAssembly.h
172 12801 12903 0x3201 0x3267 NOT_ENOUGH_DEVICES_DUAL_MODE SIDE_SWITCH_TRANSITION_NOT_ALLOWED HIGH 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 mission\system\SusAssembly.h
173 12802 13000 0x3202 0x32c8 POWER_STATE_MACHINE_TIMEOUT CHILDREN_LOST_MODE MEDIUM mission/system/AcsBoardAssembly.h mission\system\TcsBoardAssembly.h
174 12803 13100 0x3203 0x332c SIDE_SWITCH_TRANSITION_NOT_ALLOWED GPS_FIX_CHANGE LOW INFO 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 Fix has changed. P1: Old fix. P2: New fix 0: Not seen, 1: No Fix, 2: 2D-Fix, 3: 3D-Fix mission/system/AcsBoardAssembly.h mission\devices\devicedefinitions\GPSDefinitions.h
175 12900 13200 0x3264 0x3390 TRANSITION_OTHER_SIDE_FAILED P60_BOOT_COUNT HIGH INFO P60 boot count is broadcasted once at SW startup. P1: Boot count mission/system/SusAssembly.h mission\devices\P60DockHandler.h
176 12901 13201 0x3265 0x3391 NOT_ENOUGH_DEVICES_DUAL_MODE BATT_MODE HIGH INFO Battery mode is broadcasted at startup. P1: Mode mission/system/SusAssembly.h mission\devices\P60DockHandler.h
177 12902 13202 0x3266 0x3392 POWER_STATE_MACHINE_TIMEOUT BATT_MODE_CHANGED MEDIUM Battery mode has changed. P1: Old mode. P2: New mode mission/system/SusAssembly.h mission\devices\P60DockHandler.h
178 12903 13600 0x3267 0x3520 SIDE_SWITCH_TRANSITION_NOT_ALLOWED SUPV_UPDATE_FAILED 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 update failed mission/system/SusAssembly.h linux\devices\ploc\PlocSupvHelper.h
179 13000 13601 0x32c8 0x3521 CHILDREN_LOST_MODE SUPV_UPDATE_SUCCESSFUL MEDIUM LOW update successful mission/system/TcsBoardAssembly.h linux\devices\ploc\PlocSupvHelper.h
180 13100 13602 0x332c 0x3522 GPS_FIX_CHANGE TERMINATED_UPDATE_PROCEDURE INFO LOW Fix has changed. P1: Old fix. P2: New fix 0: Not seen, 1: No Fix, 2: 2D-Fix, 3: 3D-Fix Terminated update procedure by command mission/devices/devicedefinitions/GPSDefinitions.h linux\devices\ploc\PlocSupvHelper.h
181 13200 13603 0x3390 0x3523 P60_BOOT_COUNT SUPV_EVENT_BUFFER_REQUEST_SUCCESSFUL INFO LOW P60 boot count is broadcasted once at SW startup. P1: Boot count Requesting event buffer was successful mission/devices/P60DockHandler.h linux\devices\ploc\PlocSupvHelper.h
182 13201 13604 0x3391 0x3524 BATT_MODE SUPV_EVENT_BUFFER_REQUEST_FAILED INFO LOW Battery mode is broadcasted at startup. P1: Mode Requesting event buffer failed mission/devices/P60DockHandler.h linux\devices\ploc\PlocSupvHelper.h
183 13202 13605 0x3392 0x3525 BATT_MODE_CHANGED SUPV_EVENT_BUFFER_REQUEST_TERMINATED MEDIUM LOW Battery mode has changed. P1: Old mode. P2: New mode Terminated event buffer request by command P1: Number of packets read before process was terminated mission/devices/P60DockHandler.h linux\devices\ploc\PlocSupvHelper.h
184 13600 13606 0x3520 0x3526 ALLOC_FAILURE SUPV_SENDING_COMMAND_FAILED MEDIUM LOW bsp_q7s/core/CoreController.h linux\devices\ploc\PlocSupvHelper.h
185 13601 13607 0x3521 0x3527 REBOOT_SW SUPV_HELPER_REQUESTING_REPLY_FAILED MEDIUM LOW Software reboot occured. Can also be a systemd reboot. P1: Current Chip, P2: Current Copy Request receive message of communication interface failed P1: Return value returned by the communication interface requestReceiveMessage function P2: Internal state of supervisor helper bsp_q7s/core/CoreController.h linux\devices\ploc\PlocSupvHelper.h
186 13602 13608 0x3522 0x3528 REBOOT_MECHANISM_TRIGGERED SUPV_HELPER_READING_REPLY_FAILED MEDIUM LOW 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 Reading receive message of communication interface failed P1: Return value returned by the communication interface readingReceivedMessage function P2: Internal state of supervisor helper bsp_q7s/core/CoreController.h linux\devices\ploc\PlocSupvHelper.h
187 13603 13609 0x3523 0x3529 REBOOT_HW SUPV_MISSING_ACK MEDIUM LOW Did not receive acknowledgement report P1: Number of bytes missing P2: Internal state of MPSoC helper bsp_q7s/core/CoreController.h linux\devices\ploc\PlocSupvHelper.h
188 13610 0x352a SUPV_MISSING_EXE LOW Supervisor did not receive execution report P1: Number of bytes missing P2: Internal state of supervisor helper linux\devices\ploc\PlocSupvHelper.h
189 13611 0x352b SUPV_ACK_FAILURE_REPORT LOW Supervisor received acknowledgment failure report P1: Internal state of supervisor helper linux\devices\ploc\PlocSupvHelper.h
190 13612 0x352c SUPV_EXE_FAILURE_REPORT LOW Supervisor received execution failure report P1: Internal state of supervisor linux\devices\ploc\PlocSupvHelper.h
191 13613 0x352d SUPV_ACK_INVALID_APID LOW Supervisor expected acknowledgment report but received space packet with other apid P1: Apid of received space packet P2: Internal state of supervisor helper linux\devices\ploc\PlocSupvHelper.h
192 13614 0x352e SUPV_EXE_INVALID_APID LOW Supervisor helper expected execution report but received space packet with other apid P1: Apid of received space packet P2: Internal state of supervisor helper linux\devices\ploc\PlocSupvHelper.h

View File

@ -72,7 +72,7 @@ def parse_events(
LOGGER.info("EventParser: Parsing events: ")
# Small delay for clean printout
time.sleep(0.01)
event_list = generate_event_list()
event_list = generate_event_list()eive
if print_events:
PrettyPrinter.pprint(event_list)
# Delay for clean printout

View File

@ -1,7 +1,7 @@
/**
* @brief Auto-generated event translation file. Contains 192 translations.
* @details
* Generated on: 2022-04-14 15:49:05
* Generated on: 2022-04-16 17:47:08
*/
#include "translateEvents.h"
@ -121,21 +121,6 @@ const char *SUPV_CRC_FAILURE_EVENT_STRING = "SUPV_CRC_FAILURE_EVENT";
const char *SUPV_HELPER_EXECUTING_STRING = "SUPV_HELPER_EXECUTING";
const char *SANITIZATION_FAILED_STRING = "SANITIZATION_FAILED";
const char *MOUNTED_SD_CARD_STRING = "MOUNTED_SD_CARD";
const char *SUPV_UPDATE_FAILED_STRING = "SUPV_UPDATE_FAILED";
const char *SUPV_UPDATE_SUCCESSFUL_STRING = "SUPV_UPDATE_SUCCESSFUL";
const char *TERMINATED_UPDATE_PROCEDURE_STRING = "TERMINATED_UPDATE_PROCEDURE";
const char *SUPV_EVENT_BUFFER_REQUEST_SUCCESSFUL_STRING = "SUPV_EVENT_BUFFER_REQUEST_SUCCESSFUL";
const char *SUPV_EVENT_BUFFER_REQUEST_FAILED_STRING = "SUPV_EVENT_BUFFER_REQUEST_FAILED";
const char *SUPV_EVENT_BUFFER_REQUEST_TERMINATED_STRING = "SUPV_EVENT_BUFFER_REQUEST_TERMINATED";
const char *SUPV_SENDING_COMMAND_FAILED_STRING = "SUPV_SENDING_COMMAND_FAILED";
const char *SUPV_HELPER_REQUESTING_REPLY_FAILED_STRING = "SUPV_HELPER_REQUESTING_REPLY_FAILED";
const char *SUPV_HELPER_READING_REPLY_FAILED_STRING = "SUPV_HELPER_READING_REPLY_FAILED";
const char *SUPV_MISSING_ACK_STRING = "SUPV_MISSING_ACK";
const char *SUPV_MISSING_EXE_STRING = "SUPV_MISSING_EXE";
const char *SUPV_ACK_FAILURE_REPORT_STRING = "SUPV_ACK_FAILURE_REPORT";
const char *SUPV_EXE_FAILURE_REPORT_STRING = "SUPV_EXE_FAILURE_REPORT";
const char *SUPV_ACK_INVALID_APID_STRING = "SUPV_ACK_INVALID_APID";
const char *SUPV_EXE_INVALID_APID_STRING = "SUPV_EXE_INVALID_APID";
const char *SEND_MRAM_DUMP_FAILED_STRING = "SEND_MRAM_DUMP_FAILED";
const char *MRAM_DUMP_FAILED_STRING = "MRAM_DUMP_FAILED";
const char *MRAM_DUMP_FINISHED_STRING = "MRAM_DUMP_FINISHED";
@ -189,10 +174,25 @@ 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 *ALLOC_FAILURE_STRING = "ALLOC_FAILURE";
const char *REBOOT_SW_STRING = "REBOOT_SW";
const char *REBOOT_MECHANISM_TRIGGERED_STRING = "REBOOT_MECHANISM_TRIGGERED";
const char *REBOOT_HW_STRING = "REBOOT_HW";
const char *GPS_FIX_CHANGE_STRING = "GPS_FIX_CHANGE";
const char *P60_BOOT_COUNT_STRING = "P60_BOOT_COUNT";
const char *BATT_MODE_STRING = "BATT_MODE";
const char *BATT_MODE_CHANGED_STRING = "BATT_MODE_CHANGED";
const char *SUPV_UPDATE_FAILED_STRING = "SUPV_UPDATE_FAILED";
const char *SUPV_UPDATE_SUCCESSFUL_STRING = "SUPV_UPDATE_SUCCESSFUL";
const char *TERMINATED_UPDATE_PROCEDURE_STRING = "TERMINATED_UPDATE_PROCEDURE";
const char *SUPV_EVENT_BUFFER_REQUEST_SUCCESSFUL_STRING = "SUPV_EVENT_BUFFER_REQUEST_SUCCESSFUL";
const char *SUPV_EVENT_BUFFER_REQUEST_FAILED_STRING = "SUPV_EVENT_BUFFER_REQUEST_FAILED";
const char *SUPV_EVENT_BUFFER_REQUEST_TERMINATED_STRING = "SUPV_EVENT_BUFFER_REQUEST_TERMINATED";
const char *SUPV_SENDING_COMMAND_FAILED_STRING = "SUPV_SENDING_COMMAND_FAILED";
const char *SUPV_HELPER_REQUESTING_REPLY_FAILED_STRING = "SUPV_HELPER_REQUESTING_REPLY_FAILED";
const char *SUPV_HELPER_READING_REPLY_FAILED_STRING = "SUPV_HELPER_READING_REPLY_FAILED";
const char *SUPV_MISSING_ACK_STRING = "SUPV_MISSING_ACK";
const char *SUPV_MISSING_EXE_STRING = "SUPV_MISSING_EXE";
const char *SUPV_ACK_FAILURE_REPORT_STRING = "SUPV_ACK_FAILURE_REPORT";
const char *SUPV_EXE_FAILURE_REPORT_STRING = "SUPV_EXE_FAILURE_REPORT";
const char *SUPV_ACK_INVALID_APID_STRING = "SUPV_ACK_INVALID_APID";
const char *SUPV_EXE_INVALID_APID_STRING = "SUPV_EXE_INVALID_APID";
const char *translateEvents(Event event) {
switch ((event & 0xFFFF)) {
@ -354,224 +354,224 @@ 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 (11106):
return MPSOC_SHUTDOWN_FAILED_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 (11505):
return SUPV_HELPER_EXECUTING_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 SUPV_UPDATE_FAILED_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 SUPV_UPDATE_SUCCESSFUL_STRING;
return SELF_TEST_I2C_FAILURE_STRING;
case (11702):
return TERMINATED_UPDATE_PROCEDURE_STRING;
return SELF_TEST_SPI_FAILURE_STRING;
case (11703):
return SUPV_EVENT_BUFFER_REQUEST_SUCCESSFUL_STRING;
return SELF_TEST_ADC_FAILURE_STRING;
case (11704):
return SUPV_EVENT_BUFFER_REQUEST_FAILED_STRING;
return SELF_TEST_PWM_FAILURE_STRING;
case (11705):
return SUPV_EVENT_BUFFER_REQUEST_TERMINATED_STRING;
return SELF_TEST_TC_FAILURE_STRING;
case (11706):
return SUPV_SENDING_COMMAND_FAILED_STRING;
return SELF_TEST_MTM_RANGE_FAILURE_STRING;
case (11707):
return SUPV_HELPER_REQUESTING_REPLY_FAILED_STRING;
return SELF_TEST_COIL_CURRENT_FAILURE_STRING;
case (11708):
return SUPV_HELPER_READING_REPLY_FAILED_STRING;
case (11709):
return SUPV_MISSING_ACK_STRING;
case (11710):
return SUPV_MISSING_EXE_STRING;
case (11711):
return SUPV_ACK_FAILURE_REPORT_STRING;
case (11712):
return SUPV_EXE_FAILURE_REPORT_STRING;
case (11713):
return SUPV_ACK_INVALID_APID_STRING;
case (11714):
return SUPV_EXE_INVALID_APID_STRING;
case (11800):
return SEND_MRAM_DUMP_FAILED_STRING;
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;
return SUPV_CRC_FAILURE_EVENT_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_HELPER_EXECUTING_STRING;
case (12100):
return MPSOC_FLASH_WRITE_FAILED_STRING;
return SANITIZATION_FAILED_STRING;
case (12101):
return MPSOC_FLASH_WRITE_SUCCESSFUL_STRING;
case (12102):
return MPSOC_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 MPSOC_MISSING_ACK_STRING;
case (12106):
return MPSOC_MISSING_EXE_STRING;
case (12107):
return MPSOC_ACK_FAILURE_REPORT_STRING;
case (12108):
return MPSOC_EXE_FAILURE_REPORT_STRING;
case (12109):
return MPSOC_ACK_INVALID_APID_STRING;
case (12110):
return MPSOC_EXE_INVALID_APID_STRING;
case (12111):
return MPSOC_HELPER_SEQ_CNT_MISMATCH_STRING;
case (12200):
return TRANSITION_BACK_TO_OFF_STRING;
case (12201):
return NEG_V_OUT_OF_BOUNDS_STRING;
case (12202):
return U_DRO_OUT_OF_BOUNDS_STRING;
case (12203):
return I_DRO_OUT_OF_BOUNDS_STRING;
case (12204):
return U_X8_OUT_OF_BOUNDS_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 MOUNTED_SD_CARD_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 MPSOC_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 MPSOC_MISSING_ACK_STRING;
case (12606):
return MPSOC_MISSING_EXE_STRING;
case (12607):
return MPSOC_ACK_FAILURE_REPORT_STRING;
case (12608):
return MPSOC_EXE_FAILURE_REPORT_STRING;
case (12609):
return MPSOC_ACK_INVALID_APID_STRING;
case (12610):
return MPSOC_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 (13200):
return P60_BOOT_COUNT_STRING;
case (13201):
return BATT_MODE_STRING;
case (13202):
return BATT_MODE_CHANGED_STRING;
case (13600):
return ALLOC_FAILURE_STRING;
return SUPV_UPDATE_FAILED_STRING;
case (13601):
return REBOOT_SW_STRING;
return SUPV_UPDATE_SUCCESSFUL_STRING;
case (13602):
return REBOOT_MECHANISM_TRIGGERED_STRING;
return TERMINATED_UPDATE_PROCEDURE_STRING;
case (13603):
return REBOOT_HW_STRING;
return SUPV_EVENT_BUFFER_REQUEST_SUCCESSFUL_STRING;
case (13604):
return SUPV_EVENT_BUFFER_REQUEST_FAILED_STRING;
case (13605):
return SUPV_EVENT_BUFFER_REQUEST_TERMINATED_STRING;
case (13606):
return SUPV_SENDING_COMMAND_FAILED_STRING;
case (13607):
return SUPV_HELPER_REQUESTING_REPLY_FAILED_STRING;
case (13608):
return SUPV_HELPER_READING_REPLY_FAILED_STRING;
case (13609):
return SUPV_MISSING_ACK_STRING;
case (13610):
return SUPV_MISSING_EXE_STRING;
case (13611):
return SUPV_ACK_FAILURE_REPORT_STRING;
case (13612):
return SUPV_EXE_FAILURE_REPORT_STRING;
case (13613):
return SUPV_ACK_INVALID_APID_STRING;
case (13614):
return SUPV_EXE_INVALID_APID_STRING;
default:
return "UNKNOWN_EVENT";
}

View File

@ -2,7 +2,7 @@
* @brief Auto-generated object translation file.
* @details
* Contains 116 translations.
* Generated on: 2022-04-14 15:49:10
* Generated on: 2022-04-16 17:47:17
*/
#include "translateObjects.h"

View File

@ -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<void>(tcsBoardAss);
#endif // OBSW_ADD_RTD_DEVICES == 1
}

View File

@ -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);

View File

@ -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<int32_t>(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();

View File

@ -3,19 +3,24 @@
#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
#include <filesystem>
#include <fstream>
#endif
#include <cmath>
#include <ctime>
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() {}
@ -76,9 +81,7 @@ ReturnValue_t GPSHyperionLinuxController::initializeLocalDataPool(
localDataPoolMap.emplace(GpsHyperion::SATS_IN_USE, new PoolEntry<uint8_t>());
localDataPoolMap.emplace(GpsHyperion::SATS_IN_VIEW, new PoolEntry<uint8_t>());
localDataPoolMap.emplace(GpsHyperion::FIX_MODE, new PoolEntry<uint8_t>());
#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;
}
@ -124,8 +127,17 @@ void GPSHyperionLinuxController::readGpsDataFromGpsd() {
return;
}
bool validFix = false;
static_cast<void>(validFix);
// 0: Not seen, 1: No fix, 2: 2D-Fix, 3: 3D-Fix
gpsSet.fixMode.value = gps->fix.mode;
int newFixMode = gps->fix.mode;
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;
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
@ -172,6 +184,34 @@ 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 (timeInit and validFix) {
if (not utility::timeSanityCheck()) {
#if OBSW_VERBOSE_LEVEL >= 1
time_t timeRaw = time.tv_sec;
std::tm *timeTm = std::gmtime(&timeRaw);
sif::info << "Setting invalid system time from GPS data directly: "
<< 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);
}
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 some time..
// Clock::setClock(&time);
timeUpdateCd.resetTimer();
}
Clock::TimeOfDay_t timeOfDay = {};
Clock::convertTimevalToTimeOfDay(&time, &timeOfDay);
gpsSet.year = timeOfDay.year;
@ -192,6 +232,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

View File

@ -1,6 +1,7 @@
#ifndef MISSION_DEVICES_GPSHYPERIONHANDLER_H_
#define MISSION_DEVICES_GPSHYPERIONHANDLER_H_
#include "commonSubsystemIds.h"
#include "fsfw/FSFW.h"
#include "fsfw/controller/ExtendedControllerBase.h"
#include "fsfw/devicehandlers/DeviceHandlerBase.h"
@ -22,6 +23,7 @@
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();
@ -49,8 +51,11 @@ 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;
Countdown timeUpdateCd = Countdown(60);
void readGpsDataFromGpsd();
};

View File

@ -191,8 +191,8 @@ ReturnValue_t PlocSupvHelper::performUpdate() {
bytesWritten += dataLength;
#if OBSW_DEBUG_PLOC_SUPERVISOR == 1
progressPrinter.print(bytesWritten);
}
#endif /* OBSW_DEBUG_PLOC_SUPERVISOR == 1 */
}
result = handleCheckMemoryCommand();
if (result != RETURN_OK) {
return result;
@ -262,6 +262,7 @@ ReturnValue_t PlocSupvHelper::handlePacketTransmission(SpacePacket& packet) {
ReturnValue_t PlocSupvHelper::sendCommand(SpacePacket& packet) {
ReturnValue_t result = RETURN_OK;
rememberApid = packet.getAPID();
result = uartComIF->sendMessage(comCookie, packet.getWholeData(), packet.getFullSize());
if (result != RETURN_OK) {
sif::warning << "PlocSupvHelper::sendCommand: Failed to send command" << std::endl;
@ -276,6 +277,7 @@ ReturnValue_t PlocSupvHelper::handleAck() {
supv::TmPacket tmPacket;
result = handleTmReception(&tmPacket, supv::SIZE_ACK_REPORT);
if (result != RETURN_OK) {
triggerEvent(ACK_RECEPTION_FAILURE, result, static_cast<uint32_t>(rememberApid));
sif::warning << "PlocSupvHelper::handleAck: Error in reception of acknowledgment report"
<< std::endl;
return result;
@ -305,6 +307,7 @@ ReturnValue_t PlocSupvHelper::handleExe() {
supv::TmPacket tmPacket;
result = handleTmReception(&tmPacket, supv::SIZE_EXE_REPORT);
if (result != RETURN_OK) {
triggerEvent(EXE_RECEPTION_FAILURE, result, static_cast<uint32_t>(rememberApid));
sif::warning << "PlocSupvHelper::handleExe: Error in reception of execution report"
<< std::endl;
return result;

View File

@ -72,6 +72,14 @@ class PlocSupvHelper : public SystemObject, public ExecutableObjectIF, public Ha
//! P1: Apid of received space packet
//! P2: Internal state of supervisor helper
static const Event SUPV_EXE_INVALID_APID = MAKE_EVENT(14, severity::LOW);
//! [EXPORT] : [COMMENT] Failed to receive acknowledgment report
//! P1: Return value
//! P2: Apid of command for which the reception of the acknowledgment report failed
static const Event ACK_RECEPTION_FAILURE = MAKE_EVENT(15, severity::LOW);
//! [EXPORT] : [COMMENT] Failed to receive execution report
//! P1: Return value
//! P2: Apid of command for which the reception of the execution report failed
static const Event EXE_RECEPTION_FAILURE = MAKE_EVENT(16, severity::LOW);
PlocSupvHelper(object_id_t objectId);
virtual ~PlocSupvHelper();
@ -167,6 +175,9 @@ class PlocSupvHelper : public SystemObject, public ExecutableObjectIF, public Ha
bool timestamping = true;
// Remembers APID to know at which command a procedure failed
uint16_t rememberApid = 0;
ReturnValue_t performUpdate();
ReturnValue_t performEventBufferRequest();
ReturnValue_t handlePacketTransmission(SpacePacket& packet);

View File

@ -1,7 +1,7 @@
/**
* @brief Auto-generated event translation file. Contains 192 translations.
* @details
* Generated on: 2022-04-14 15:49:05
* Generated on: 2022-04-16 17:47:08
*/
#include "translateEvents.h"
@ -121,21 +121,6 @@ const char *SUPV_CRC_FAILURE_EVENT_STRING = "SUPV_CRC_FAILURE_EVENT";
const char *SUPV_HELPER_EXECUTING_STRING = "SUPV_HELPER_EXECUTING";
const char *SANITIZATION_FAILED_STRING = "SANITIZATION_FAILED";
const char *MOUNTED_SD_CARD_STRING = "MOUNTED_SD_CARD";
const char *SUPV_UPDATE_FAILED_STRING = "SUPV_UPDATE_FAILED";
const char *SUPV_UPDATE_SUCCESSFUL_STRING = "SUPV_UPDATE_SUCCESSFUL";
const char *TERMINATED_UPDATE_PROCEDURE_STRING = "TERMINATED_UPDATE_PROCEDURE";
const char *SUPV_EVENT_BUFFER_REQUEST_SUCCESSFUL_STRING = "SUPV_EVENT_BUFFER_REQUEST_SUCCESSFUL";
const char *SUPV_EVENT_BUFFER_REQUEST_FAILED_STRING = "SUPV_EVENT_BUFFER_REQUEST_FAILED";
const char *SUPV_EVENT_BUFFER_REQUEST_TERMINATED_STRING = "SUPV_EVENT_BUFFER_REQUEST_TERMINATED";
const char *SUPV_SENDING_COMMAND_FAILED_STRING = "SUPV_SENDING_COMMAND_FAILED";
const char *SUPV_HELPER_REQUESTING_REPLY_FAILED_STRING = "SUPV_HELPER_REQUESTING_REPLY_FAILED";
const char *SUPV_HELPER_READING_REPLY_FAILED_STRING = "SUPV_HELPER_READING_REPLY_FAILED";
const char *SUPV_MISSING_ACK_STRING = "SUPV_MISSING_ACK";
const char *SUPV_MISSING_EXE_STRING = "SUPV_MISSING_EXE";
const char *SUPV_ACK_FAILURE_REPORT_STRING = "SUPV_ACK_FAILURE_REPORT";
const char *SUPV_EXE_FAILURE_REPORT_STRING = "SUPV_EXE_FAILURE_REPORT";
const char *SUPV_ACK_INVALID_APID_STRING = "SUPV_ACK_INVALID_APID";
const char *SUPV_EXE_INVALID_APID_STRING = "SUPV_EXE_INVALID_APID";
const char *SEND_MRAM_DUMP_FAILED_STRING = "SEND_MRAM_DUMP_FAILED";
const char *MRAM_DUMP_FAILED_STRING = "MRAM_DUMP_FAILED";
const char *MRAM_DUMP_FINISHED_STRING = "MRAM_DUMP_FINISHED";
@ -189,10 +174,25 @@ 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 *ALLOC_FAILURE_STRING = "ALLOC_FAILURE";
const char *REBOOT_SW_STRING = "REBOOT_SW";
const char *REBOOT_MECHANISM_TRIGGERED_STRING = "REBOOT_MECHANISM_TRIGGERED";
const char *REBOOT_HW_STRING = "REBOOT_HW";
const char *GPS_FIX_CHANGE_STRING = "GPS_FIX_CHANGE";
const char *P60_BOOT_COUNT_STRING = "P60_BOOT_COUNT";
const char *BATT_MODE_STRING = "BATT_MODE";
const char *BATT_MODE_CHANGED_STRING = "BATT_MODE_CHANGED";
const char *SUPV_UPDATE_FAILED_STRING = "SUPV_UPDATE_FAILED";
const char *SUPV_UPDATE_SUCCESSFUL_STRING = "SUPV_UPDATE_SUCCESSFUL";
const char *TERMINATED_UPDATE_PROCEDURE_STRING = "TERMINATED_UPDATE_PROCEDURE";
const char *SUPV_EVENT_BUFFER_REQUEST_SUCCESSFUL_STRING = "SUPV_EVENT_BUFFER_REQUEST_SUCCESSFUL";
const char *SUPV_EVENT_BUFFER_REQUEST_FAILED_STRING = "SUPV_EVENT_BUFFER_REQUEST_FAILED";
const char *SUPV_EVENT_BUFFER_REQUEST_TERMINATED_STRING = "SUPV_EVENT_BUFFER_REQUEST_TERMINATED";
const char *SUPV_SENDING_COMMAND_FAILED_STRING = "SUPV_SENDING_COMMAND_FAILED";
const char *SUPV_HELPER_REQUESTING_REPLY_FAILED_STRING = "SUPV_HELPER_REQUESTING_REPLY_FAILED";
const char *SUPV_HELPER_READING_REPLY_FAILED_STRING = "SUPV_HELPER_READING_REPLY_FAILED";
const char *SUPV_MISSING_ACK_STRING = "SUPV_MISSING_ACK";
const char *SUPV_MISSING_EXE_STRING = "SUPV_MISSING_EXE";
const char *SUPV_ACK_FAILURE_REPORT_STRING = "SUPV_ACK_FAILURE_REPORT";
const char *SUPV_EXE_FAILURE_REPORT_STRING = "SUPV_EXE_FAILURE_REPORT";
const char *SUPV_ACK_INVALID_APID_STRING = "SUPV_ACK_INVALID_APID";
const char *SUPV_EXE_INVALID_APID_STRING = "SUPV_EXE_INVALID_APID";
const char *translateEvents(Event event) {
switch ((event & 0xFFFF)) {
@ -354,224 +354,224 @@ 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 (11106):
return MPSOC_SHUTDOWN_FAILED_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 (11505):
return SUPV_HELPER_EXECUTING_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 SUPV_UPDATE_FAILED_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 SUPV_UPDATE_SUCCESSFUL_STRING;
return SELF_TEST_I2C_FAILURE_STRING;
case (11702):
return TERMINATED_UPDATE_PROCEDURE_STRING;
return SELF_TEST_SPI_FAILURE_STRING;
case (11703):
return SUPV_EVENT_BUFFER_REQUEST_SUCCESSFUL_STRING;
return SELF_TEST_ADC_FAILURE_STRING;
case (11704):
return SUPV_EVENT_BUFFER_REQUEST_FAILED_STRING;
return SELF_TEST_PWM_FAILURE_STRING;
case (11705):
return SUPV_EVENT_BUFFER_REQUEST_TERMINATED_STRING;
return SELF_TEST_TC_FAILURE_STRING;
case (11706):
return SUPV_SENDING_COMMAND_FAILED_STRING;
return SELF_TEST_MTM_RANGE_FAILURE_STRING;
case (11707):
return SUPV_HELPER_REQUESTING_REPLY_FAILED_STRING;
return SELF_TEST_COIL_CURRENT_FAILURE_STRING;
case (11708):
return SUPV_HELPER_READING_REPLY_FAILED_STRING;
case (11709):
return SUPV_MISSING_ACK_STRING;
case (11710):
return SUPV_MISSING_EXE_STRING;
case (11711):
return SUPV_ACK_FAILURE_REPORT_STRING;
case (11712):
return SUPV_EXE_FAILURE_REPORT_STRING;
case (11713):
return SUPV_ACK_INVALID_APID_STRING;
case (11714):
return SUPV_EXE_INVALID_APID_STRING;
case (11800):
return SEND_MRAM_DUMP_FAILED_STRING;
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;
return SUPV_CRC_FAILURE_EVENT_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_HELPER_EXECUTING_STRING;
case (12100):
return MPSOC_FLASH_WRITE_FAILED_STRING;
return SANITIZATION_FAILED_STRING;
case (12101):
return MPSOC_FLASH_WRITE_SUCCESSFUL_STRING;
case (12102):
return MPSOC_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 MPSOC_MISSING_ACK_STRING;
case (12106):
return MPSOC_MISSING_EXE_STRING;
case (12107):
return MPSOC_ACK_FAILURE_REPORT_STRING;
case (12108):
return MPSOC_EXE_FAILURE_REPORT_STRING;
case (12109):
return MPSOC_ACK_INVALID_APID_STRING;
case (12110):
return MPSOC_EXE_INVALID_APID_STRING;
case (12111):
return MPSOC_HELPER_SEQ_CNT_MISMATCH_STRING;
case (12200):
return TRANSITION_BACK_TO_OFF_STRING;
case (12201):
return NEG_V_OUT_OF_BOUNDS_STRING;
case (12202):
return U_DRO_OUT_OF_BOUNDS_STRING;
case (12203):
return I_DRO_OUT_OF_BOUNDS_STRING;
case (12204):
return U_X8_OUT_OF_BOUNDS_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 MOUNTED_SD_CARD_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 MPSOC_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 MPSOC_MISSING_ACK_STRING;
case (12606):
return MPSOC_MISSING_EXE_STRING;
case (12607):
return MPSOC_ACK_FAILURE_REPORT_STRING;
case (12608):
return MPSOC_EXE_FAILURE_REPORT_STRING;
case (12609):
return MPSOC_ACK_INVALID_APID_STRING;
case (12610):
return MPSOC_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 (13200):
return P60_BOOT_COUNT_STRING;
case (13201):
return BATT_MODE_STRING;
case (13202):
return BATT_MODE_CHANGED_STRING;
case (13600):
return ALLOC_FAILURE_STRING;
return SUPV_UPDATE_FAILED_STRING;
case (13601):
return REBOOT_SW_STRING;
return SUPV_UPDATE_SUCCESSFUL_STRING;
case (13602):
return REBOOT_MECHANISM_TRIGGERED_STRING;
return TERMINATED_UPDATE_PROCEDURE_STRING;
case (13603):
return REBOOT_HW_STRING;
return SUPV_EVENT_BUFFER_REQUEST_SUCCESSFUL_STRING;
case (13604):
return SUPV_EVENT_BUFFER_REQUEST_FAILED_STRING;
case (13605):
return SUPV_EVENT_BUFFER_REQUEST_TERMINATED_STRING;
case (13606):
return SUPV_SENDING_COMMAND_FAILED_STRING;
case (13607):
return SUPV_HELPER_REQUESTING_REPLY_FAILED_STRING;
case (13608):
return SUPV_HELPER_READING_REPLY_FAILED_STRING;
case (13609):
return SUPV_MISSING_ACK_STRING;
case (13610):
return SUPV_MISSING_EXE_STRING;
case (13611):
return SUPV_ACK_FAILURE_REPORT_STRING;
case (13612):
return SUPV_EXE_FAILURE_REPORT_STRING;
case (13613):
return SUPV_ACK_INVALID_APID_STRING;
case (13614):
return SUPV_EXE_INVALID_APID_STRING;
default:
return "UNKNOWN_EVENT";
}

View File

@ -2,7 +2,7 @@
* @brief Auto-generated object translation file.
* @details
* Contains 116 translations.
* Generated on: 2022-04-14 15:49:10
* Generated on: 2022-04-16 17:47:17
*/
#include "translateObjects.h"

View File

@ -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);

View File

@ -1,3 +1,4 @@
#include "utility.h"
#include <cstring>
@ -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(&currentTime);
Clock::TimeOfDay_t currTimeOfDay = {};
Clock::convertTimevalToTimeOfDay(&currentTime, &currTimeOfDay);
if (currTimeOfDay.year == 2000) {
return false;
}
return true;
}

View File

@ -9,6 +9,8 @@ namespace utility {
void handleSystemError(int retcode, std::string function);
}
bool timeSanityCheck();
} // namespace utility
#endif /* LINUX_UTILITY_UTILITY_H_ */

View File

@ -756,6 +756,7 @@
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.2117915473.688890851.1707795689.1939781894" moduleId="org.eclipse.cdt.core.settings" name="eive-q7s-release">
<macros>
<stringMacro name="Q7S_SYSROOT" type="VALUE_TEXT" value="C:\Xilinx\cortexa9hf-neon-xiphos-linux-gnueabi"/>
<stringMacro name="Q7S_SYSROOT_UNIX" type="VALUE_TEXT" value="${HOME}/Xilinx/cortexa9hf-neon-xiphos-linux-gnueabi"/>
</macros>
<externalSettings/>
<extensions>
@ -818,8 +819,8 @@
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.lto.420747124" name="Link-time optimizer (-flto)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.lto"/>
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.nomoveloopinvariants.743473065" name="Disable loop invariant move (-fno-move-loop-invariants)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.nomoveloopinvariants"/>
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.other.1937642597" name="Other optimization flags" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.other"/>
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.toolchain.name.2006936773" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.toolchain.name" value="Custom" valueType="string"/>
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.toolchain.id.42890232" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.toolchain.id" value="2029746065" valueType="string"/>
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.toolchain.name.2006936773" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.toolchain.name" value="Linaro ARMv7 Linux GNU EABI HF" valueType="string"/>
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.toolchain.id.42890232" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.toolchain.id" value="4014586055" valueType="string"/>
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.warnings.syntaxonly.1649131445" name="Check syntax only (-fsyntax-only)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.warnings.syntaxonly"/>
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.warnings.pedantic.1978386125" name="Pedantic (-pedantic)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.warnings.pedantic"/>
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.warnings.pedanticerrors.1857256861" name="Pedantic warnings as errors (-pedantic-errors)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.warnings.pedanticerrors"/>
@ -859,12 +860,11 @@
</tool>
<tool id="ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.2002501811" name="GNU Arm Cross C Compiler" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler">
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.include.paths.1810457326" name="Include paths (-I)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.include.paths" useByScannerDiscovery="true" valueType="includePath">
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/eive_obsw}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${Q7S_SYSROOT_UNIX}/usr/include&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/eive-obsw/fsfw/inc}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/eive-obsw/linux/fsfwconfig}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/eive-obsw/fsfw/src}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/eive-obsw/fsfw/hal/src}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/eive-obsw}&quot;"/>
</option>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.defs.1774225921" name="Defined symbols (-D)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.defs" useByScannerDiscovery="true" valueType="definedSymbols">
<listOptionValue builtIn="false" value="LINUX=1"/>
@ -873,12 +873,11 @@
</tool>
<tool id="ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.compiler.281959373" name="GNU Arm Cross C++ Compiler" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.compiler">
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.compiler.include.paths.1282228801" name="Include paths (-I)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.compiler.include.paths" useByScannerDiscovery="true" valueType="includePath">
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/eive_obsw}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${Q7S_SYSROOT_UNIX}/usr/include&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/eive-obsw/fsfw/inc}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/eive-obsw/linux/fsfwconfig}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/eive-obsw/fsfw/src}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/eive-obsw/fsfw/hal/src}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/eive-obsw}&quot;"/>
</option>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.compiler.defs.41651526" name="Defined symbols (-D)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.compiler.defs" useByScannerDiscovery="true" valueType="definedSymbols">
<listOptionValue builtIn="false" value="LINUX=1"/>
@ -1533,9 +1532,18 @@
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.447898075;cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.447898075.;cdt.managedbuild.tool.gnu.cpp.compiler.base.1522927967;cdt.managedbuild.tool.gnu.cpp.compiler.input.305765911">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.2117915473.688890851.1707795689;cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.2117915473.688890851.1707795689.;ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.628631287;ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.input.216437361">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.2117915473;cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.2117915473.;cdt.managedbuild.tool.gnu.cpp.compiler.base.1405808772;cdt.managedbuild.tool.gnu.cpp.compiler.input.1960112549">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.2117915473;cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.2117915473.;cdt.managedbuild.tool.gnu.c.compiler.base.1946711528;cdt.managedbuild.tool.gnu.c.compiler.input.584209663">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.2117915473.688890851.190921171;cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.2117915473.688890851.190921171.;ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.compiler.2044466190;ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.compiler.input.1551006500">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.2117915473.688890851;cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.2117915473.688890851.;ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.2065184927;ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.input.920837857">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
@ -1551,42 +1559,6 @@
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.2117915473.688890851.1707795689.1775596945;cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.2117915473.688890851.1707795689.1775596945.;ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.1154394228;ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.input.1228307894">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.1043649249;cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.1043649249.;cdt.managedbuild.tool.gnu.cpp.compiler.mingw.base.539225324;cdt.managedbuild.tool.gnu.cpp.compiler.input.1848997248">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.2117915473.688890851.190921171;cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.2117915473.688890851.190921171.;ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.193772074;ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.input.2081570054">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443;cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.;cdt.managedbuild.tool.gnu.c.compiler.mingw.base.397223006;cdt.managedbuild.tool.gnu.c.compiler.input.1482659499">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.2117915473.775472168;cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.2117915473.775472168.;cdt.managedbuild.tool.gnu.cpp.compiler.base.1191599857;cdt.managedbuild.tool.gnu.cpp.compiler.input.1443212512">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.mingw.base.1031020513;cdt.managedbuild.toolchain.gnu.mingw.base.1031020513.519944638;cdt.managedbuild.tool.gnu.c.compiler.mingw.base.438317679;cdt.managedbuild.tool.gnu.c.compiler.input.336445831">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.2117915473.688890851.1707795689.1939781894;cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.2117915473.688890851.1707795689.1939781894.;ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.2002501811;ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.input.1316209993">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443;cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.;cdt.managedbuild.tool.gnu.cpp.compiler.mingw.base.646655988;cdt.managedbuild.tool.gnu.cpp.compiler.input.1437856797">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.2117915473.688890851.1707795689.1631077874;cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.2117915473.688890851.1707795689.1631077874.;ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.compiler.1992099127;ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.compiler.input.234631061">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.2117915473.688890851.1707795689;cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.2117915473.688890851.1707795689.;ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.628631287;ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.input.216437361">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.2117915473.688890851.1707795689.1631077874;cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.2117915473.688890851.1707795689.1631077874.;ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.715561087;ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.input.1004720080">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.2117915473;cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.2117915473.;cdt.managedbuild.tool.gnu.c.compiler.base.1946711528;cdt.managedbuild.tool.gnu.c.compiler.input.584209663">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.2117915473.688890851.190921171;cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.2117915473.688890851.190921171.;ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.compiler.2044466190;ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.compiler.input.1551006500">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.2117915473.688890851.1707795689;cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.2117915473.688890851.1707795689.;ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.compiler.1535302916;ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.compiler.input.96000231">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
@ -1599,16 +1571,25 @@
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.2117915473.688890851.1707795689.364559455;cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.2117915473.688890851.1707795689.364559455.;ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.1970346305;ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.input.2096585345">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.1043649249;cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.1043649249.;cdt.managedbuild.tool.gnu.cpp.compiler.mingw.base.539225324;cdt.managedbuild.tool.gnu.cpp.compiler.input.1848997248">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.447898075;cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.447898075.;cdt.managedbuild.tool.gnu.c.compiler.base.623389075;cdt.managedbuild.tool.gnu.c.compiler.input.1382191457">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.2117915473.688890851.1707795689.1631077874.1323243318;cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.2117915473.688890851.1707795689.1631077874.1323243318.;ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.compiler.1358447993;ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.compiler.input.1822075528">
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.2117915473.688890851.190921171;cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.2117915473.688890851.190921171.;ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.193772074;ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.input.2081570054">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.2117915473.775472168;cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.2117915473.775472168.;cdt.managedbuild.tool.gnu.c.compiler.base.1565023847;cdt.managedbuild.tool.gnu.c.compiler.input.1227677208">
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443;cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.;cdt.managedbuild.tool.gnu.c.compiler.mingw.base.397223006;cdt.managedbuild.tool.gnu.c.compiler.input.1482659499">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.2117915473.688890851.1707795689.1631077874.1323243318;cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.2117915473.688890851.1707795689.1631077874.1323243318.;ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.449221513;ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.input.1048106331">
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.mingw.base.1031020513;cdt.managedbuild.toolchain.gnu.mingw.base.1031020513.519944638;cdt.managedbuild.tool.gnu.c.compiler.mingw.base.438317679;cdt.managedbuild.tool.gnu.c.compiler.input.336445831">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.2117915473.688890851.1707795689.1939781894;cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.2117915473.688890851.1707795689.1939781894.;ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.2002501811;ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.input.1316209993">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443;cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.;cdt.managedbuild.tool.gnu.cpp.compiler.mingw.base.646655988;cdt.managedbuild.tool.gnu.cpp.compiler.input.1437856797">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.2117915473.688890851;cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.2117915473.688890851.;ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.compiler.1595165802;ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.compiler.input.1925043110">

View File

@ -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();
@ -194,82 +201,84 @@ 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<int16_t>({0}));
localDataPoolMap.emplace(P60System::ACU_CURRENT_IN_CHANNEL1, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::ACU_CURRENT_IN_CHANNEL2, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::ACU_CURRENT_IN_CHANNEL3, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::ACU_CURRENT_IN_CHANNEL4, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::ACU_CURRENT_IN_CHANNEL5, new PoolEntry<int16_t>({0}));
using namespace P60System;
localDataPoolMap.emplace(pool::ACU_CURRENT_IN_CHANNEL0, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(pool::ACU_CURRENT_IN_CHANNEL1, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(pool::ACU_CURRENT_IN_CHANNEL2, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(pool::ACU_CURRENT_IN_CHANNEL3, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(pool::ACU_CURRENT_IN_CHANNEL4, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(pool::ACU_CURRENT_IN_CHANNEL5, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::ACU_VOLTAGE_IN_CHANNEL0, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::ACU_VOLTAGE_IN_CHANNEL1, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::ACU_VOLTAGE_IN_CHANNEL2, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::ACU_VOLTAGE_IN_CHANNEL3, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::ACU_VOLTAGE_IN_CHANNEL4, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::ACU_VOLTAGE_IN_CHANNEL5, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(pool::ACU_VOLTAGE_IN_CHANNEL0, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(pool::ACU_VOLTAGE_IN_CHANNEL1, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(pool::ACU_VOLTAGE_IN_CHANNEL2, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(pool::ACU_VOLTAGE_IN_CHANNEL3, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(pool::ACU_VOLTAGE_IN_CHANNEL4, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(pool::ACU_VOLTAGE_IN_CHANNEL5, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::ACU_VCC, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::ACU_VBAT, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(pool::ACU_VCC, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(pool::ACU_VBAT, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::ACU_TEMPERATURE_1, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::ACU_TEMPERATURE_2, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::ACU_TEMPERATURE_3, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(pool::ACU_TEMPERATURE_1, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(pool::ACU_TEMPERATURE_2, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(pool::ACU_TEMPERATURE_3, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::ACU_MPPT_MODE, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(pool::ACU_MPPT_MODE, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::ACU_VBOOST_CHANNEL0, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::ACU_VBOOST_CHANNEL1, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::ACU_VBOOST_CHANNEL2, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::ACU_VBOOST_CHANNEL3, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::ACU_VBOOST_CHANNEL4, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::ACU_VBOOST_CHANNEL5, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(pool::ACU_VBOOST_CHANNEL0, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(pool::ACU_VBOOST_CHANNEL1, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(pool::ACU_VBOOST_CHANNEL2, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(pool::ACU_VBOOST_CHANNEL3, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(pool::ACU_VBOOST_CHANNEL4, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(pool::ACU_VBOOST_CHANNEL5, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::ACU_POWER_CHANNEL0, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::ACU_POWER_CHANNEL1, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::ACU_POWER_CHANNEL2, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::ACU_POWER_CHANNEL3, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::ACU_POWER_CHANNEL4, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::ACU_POWER_CHANNEL5, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(pool::ACU_POWER_CHANNEL0, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(pool::ACU_POWER_CHANNEL1, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(pool::ACU_POWER_CHANNEL2, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(pool::ACU_POWER_CHANNEL3, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(pool::ACU_POWER_CHANNEL4, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(pool::ACU_POWER_CHANNEL5, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::ACU_DAC_EN_0, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::ACU_DAC_EN_1, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::ACU_DAC_EN_2, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(pool::ACU_DAC_EN_0, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(pool::ACU_DAC_EN_1, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(pool::ACU_DAC_EN_2, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::ACU_DAC_RAW_0, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::ACU_DAC_RAW_1, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::ACU_DAC_RAW_2, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::ACU_DAC_RAW_3, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::ACU_DAC_RAW_4, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::ACU_DAC_RAW_5, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(pool::ACU_DAC_RAW_0, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(pool::ACU_DAC_RAW_1, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(pool::ACU_DAC_RAW_2, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(pool::ACU_DAC_RAW_3, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(pool::ACU_DAC_RAW_4, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(pool::ACU_DAC_RAW_5, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::ACU_BOOTCAUSE, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::ACU_BOOTCNT, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::ACU_UPTIME, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::ACU_RESET_CAUSE, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::ACU_MPPT_TIME, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::ACU_MPPT_PERIOD, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(pool::ACU_BOOTCAUSE, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(pool::ACU_BOOTCNT, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(pool::ACU_UPTIME, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(pool::ACU_RESET_CAUSE, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(pool::ACU_MPPT_TIME, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(pool::ACU_MPPT_PERIOD, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::ACU_DEVICE_0, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::ACU_DEVICE_1, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::ACU_DEVICE_2, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::ACU_DEVICE_3, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::ACU_DEVICE_4, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::ACU_DEVICE_5, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::ACU_DEVICE_6, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::ACU_DEVICE_7, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(pool::ACU_DEVICE_0, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(pool::ACU_DEVICE_1, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(pool::ACU_DEVICE_2, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(pool::ACU_DEVICE_3, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(pool::ACU_DEVICE_4, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(pool::ACU_DEVICE_5, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(pool::ACU_DEVICE_6, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(pool::ACU_DEVICE_7, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::ACU_DEVICE_0_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::ACU_DEVICE_1_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::ACU_DEVICE_2_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::ACU_DEVICE_3_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::ACU_DEVICE_4_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::ACU_DEVICE_5_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::ACU_DEVICE_6_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::ACU_DEVICE_7_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(pool::ACU_DEVICE_0_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(pool::ACU_DEVICE_1_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(pool::ACU_DEVICE_2_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(pool::ACU_DEVICE_3_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(pool::ACU_DEVICE_4_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(pool::ACU_DEVICE_5_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(pool::ACU_DEVICE_6_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(pool::ACU_DEVICE_7_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::ACU_WDT_CNT_GND, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::ACU_WDT_GND_LEFT, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(pool::ACU_WDT_CNT_GND, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(pool::ACU_WDT_GND_LEFT, new PoolEntry<uint32_t>({0}));
poolManager.subscribeForPeriodicPacket(acuHkTableDataset.getSid(), false, 30.0, false);
return HasReturnvaluesIF::RETURN_OK;
}

View File

@ -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;

View File

@ -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;
}

View File

@ -169,7 +169,7 @@ ReturnValue_t GPSHyperionHandler::initializeLocalDataPool(localpool::DataPool &l
localDataPoolMap.emplace(GpsHyperion::UNIX_SECONDS, new PoolEntry<uint32_t>());
localDataPoolMap.emplace(GpsHyperion::SATS_IN_USE, new PoolEntry<uint8_t>());
localDataPoolMap.emplace(GpsHyperion::FIX_MODE, new PoolEntry<uint8_t>());
poolManager.subscribeForPeriodicPacket(gpsSet.getSid(), true, 2.0, false);
poolManager.subscribeForPeriodicPacket(gpsSet.getSid(), false, 30.0, false);
return HasReturnvaluesIF::RETURN_OK;
}

View File

@ -1,26 +1,21 @@
#include "GomspaceDeviceHandler.h"
#include <common/config/commonObjects.h>
#include <fsfw/datapool/PoolReadGuard.h>
#include "devicedefinitions/GomSpacePackets.h"
#include "devicedefinitions/powerDefinitions.h"
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() {}
@ -362,6 +357,44 @@ ReturnValue_t GomspaceDeviceHandler::setParamCallback(SetParamMessageUnpacker& u
return HasReturnvaluesIF::RETURN_OK;
}
ReturnValue_t GomspaceDeviceHandler::initializePduPool(
localpool::DataPool& localDataPoolMap, LocalDataPoolManager& poolManager,
std::array<uint8_t, PDU::CHANNELS_LEN> initOutEnb) {
localDataPoolMap.emplace(P60System::pool::PDU_CURRENTS, new PoolEntry<int16_t>(9));
localDataPoolMap.emplace(P60System::pool::PDU_VOLTAGES, new PoolEntry<int16_t>(9));
localDataPoolMap.emplace(P60System::pool::PDU_VCC, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU_VBAT, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU_TEMPERATURE, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU_CONV_EN, new PoolEntry<uint8_t>(3));
localDataPoolMap.emplace(P60System::pool::PDU_OUT_ENABLE,
new PoolEntry<uint8_t>(initOutEnb.data(), initOutEnb.size()));
localDataPoolMap.emplace(P60System::pool::PDU_BOOTCAUSE, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU_BOOTCNT, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU_UPTIME, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU_RESETCAUSE, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU_BATT_MODE, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU_LATCHUPS, new PoolEntry<uint16_t>(9));
localDataPoolMap.emplace(P60System::pool::PDU_DEVICES, new PoolEntry<uint8_t>(8));
localDataPoolMap.emplace(P60System::pool::PDU_STATUSES, new PoolEntry<uint8_t>(8));
localDataPoolMap.emplace(P60System::pool::PDU_WDT_CNT_GND, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU_WDT_CNT_I2C, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU_WDT_CNT_CAN, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU_WDT_CNT_CSP1, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU_WDT_CNT_CSP2, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU_WDT_GND_LEFT, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU_WDT_I2C_LEFT, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU_WDT_CAN_LEFT, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU_WDT_CSP_LEFT1, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU_WDT_CSP_LEFT2, new PoolEntry<uint8_t>({0}));
return RETURN_OK;
}
ReturnValue_t GomspaceDeviceHandler::generateResetWatchdogCmd() {
WatchdogResetCommand watchdogResetCommand;
size_t cspPacketLen = 0;
@ -405,17 +438,116 @@ 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) {
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;
for (uint8_t idx = 0; idx < 3; idx++) {
auxHk.converterEnable[idx] = 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;
}

View File

@ -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.
@ -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<uint8_t, PDU::CHANNELS_LEN> initOutEnb);
private:
SetParamMessageUnpacker setParamCacher;
/**

View File

@ -363,6 +363,7 @@ ReturnValue_t GyroADIS1650XHandler::initializeLocalDataPool(localpool::DataPool
localDataPoolMap.emplace(ADIS1650X::FILTER_SETTINGS, new PoolEntry<uint8_t>());
localDataPoolMap.emplace(ADIS1650X::MSC_CTRL_REGISTER, new PoolEntry<uint16_t>());
localDataPoolMap.emplace(ADIS1650X::DEC_RATE_REGISTER, new PoolEntry<uint16_t>());
poolManager.subscribeForPeriodicPacket(primaryDataset.getSid(), false, 5.0, true);
return HasReturnvaluesIF::RETURN_OK;
}

View File

@ -7,8 +7,10 @@
#include "OBSWConfig.h"
IMTQHandler::IMTQHandler(object_id_t objectId, object_id_t comIF, CookieIF* comCookie)
IMTQHandler::IMTQHandler(object_id_t objectId, object_id_t comIF, CookieIF* comCookie,
power::Switch_t pwrSwitcher)
: DeviceHandlerBase(objectId, comIF, comCookie),
switcher(pwrSwitcher),
engHkDataset(this),
calMtmMeasurementSet(this),
rawMtmMeasurementSet(this),
@ -118,14 +120,17 @@ ReturnValue_t IMTQHandler::buildCommandFromCommand(DeviceCommandId_t deviceComma
case (IMTQ::START_ACTUATION_DIPOLE): {
/* IMTQ expects low byte first */
commandBuffer[0] = IMTQ::CC::START_ACTUATION_DIPOLE;
commandBuffer[1] = *(commandData + 1);
commandBuffer[2] = *(commandData);
commandBuffer[3] = *(commandData + 3);
commandBuffer[4] = *(commandData + 2);
commandBuffer[5] = *(commandData + 5);
commandBuffer[6] = *(commandData + 4);
commandBuffer[7] = *(commandData + 7);
commandBuffer[8] = *(commandData + 6);
if (commandData == nullptr) {
return DeviceHandlerIF::INVALID_COMMAND_PARAMETER;
}
commandBuffer[1] = commandData[1];
commandBuffer[2] = commandData[0];
commandBuffer[3] = commandData[3];
commandBuffer[4] = commandData[2];
commandBuffer[5] = commandData[5];
commandBuffer[6] = commandData[4];
commandBuffer[7] = commandData[7];
commandBuffer[8] = commandData[6];
rawPacket = commandBuffer;
rawPacketLen = 9;
return RETURN_OK;
@ -599,6 +604,8 @@ ReturnValue_t IMTQHandler::initializeLocalDataPool(localpool::DataPool& localDat
localDataPoolMap.emplace(IMTQ::FINA_NEG_Z_COIL_Y_TEMPERATURE, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(IMTQ::FINA_NEG_Z_COIL_Z_TEMPERATURE, new PoolEntry<uint16_t>({0}));
poolManager.subscribeForPeriodicPacket(engHkDataset.getSid(), false, 10.0, true);
poolManager.subscribeForPeriodicPacket(calMtmMeasurementSet.getSid(), false, 10.0, true);
return HasReturnvaluesIF::RETURN_OK;
}
@ -2173,3 +2180,12 @@ std::string IMTQHandler::makeStepString(const uint8_t step) {
}
return stepString;
}
ReturnValue_t IMTQHandler::getSwitches(const uint8_t** switches, uint8_t* numberOfSwitches) {
if (switcher != power::NO_SWITCH) {
*numberOfSwitches = 1;
*switches = &switcher;
return RETURN_OK;
}
return DeviceHandlerBase::NO_SWITCH;
}

View File

@ -12,7 +12,8 @@
*/
class IMTQHandler : public DeviceHandlerBase {
public:
IMTQHandler(object_id_t objectId, object_id_t comIF, CookieIF* comCookie);
IMTQHandler(object_id_t objectId, object_id_t comIF, CookieIF* comCookie,
power::Switch_t pwrSwitcher);
virtual ~IMTQHandler();
/**
@ -36,6 +37,7 @@ class IMTQHandler : public DeviceHandlerBase {
uint32_t getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) override;
ReturnValue_t initializeLocalDataPool(localpool::DataPool& localDataPoolMap,
LocalDataPoolManager& poolManager) override;
ReturnValue_t getSwitches(const uint8_t** switches, uint8_t* numberOfSwitches) override;
private:
static const uint8_t INTERFACE_ID = CLASS_ID::IMTQ_HANDLER;
@ -85,6 +87,8 @@ class IMTQHandler : public DeviceHandlerBase {
//! link between IMTQ and OBC.
static const Event INVALID_ERROR_BYTE = MAKE_EVENT(8, severity::LOW);
power::Switch_t switcher = power::NO_SWITCH;
IMTQ::EngHkDataset engHkDataset;
IMTQ::CalibratedMtmMeasurementSet calMtmMeasurementSet;
IMTQ::RawMtmMeasurementSet rawMtmMeasurementSet;

View File

@ -515,8 +515,7 @@ ReturnValue_t Max31865PT1000Handler::initializeLocalDataPool(localpool::DataPool
localDataPoolMap.emplace(Max31865Definitions::PoolIds::TEMPERATURE_C,
new PoolEntry<float>({0}, 1, true));
localDataPoolMap.emplace(Max31865Definitions::PoolIds::FAULT_BYTE, new PoolEntry<uint8_t>({0}));
// poolManager.subscribeForPeriodicPacket(sensorDatasetSid,
// false, 4.0, false);
poolManager.subscribeForPeriodicPacket(sensorDataset.getSid(), false, 30.0, false);
return HasReturnvaluesIF::RETURN_OK;
}

View File

@ -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();
@ -71,376 +71,202 @@ 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 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;
}
/**
* 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);
for (uint8_t idx = 0; idx < hk::CHNLS_LEN; idx++) {
coreHk.currents[idx] = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
dataOffset += 4;
}
for (uint8_t idx = 0; idx < hk::CHNLS_LEN; idx++) {
coreHk.voltages[idx] = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
dataOffset += 4;
}
for (uint8_t idx = 0; idx < hk::CHNLS_LEN; idx++) {
coreHk.outputEnables[idx] = *(packet + dataOffset);
dataOffset += 3;
}
coreHk.temperature1 = *(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);
coreHk.temperature2 = *(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;
auxHk.bootcause = *(packet + dataOffset) << 24 |
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;
p60dockHkTableDataset.temperature1 = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
dataOffset += 4;
p60dockHkTableDataset.temperature2 = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
dataOffset += 4;
p60dockHkTableDataset.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);
if (firstHk) {
triggerEvent(P60_BOOT_COUNT, coreHk.bootCount.value);
}
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);
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;
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;
p60dockHkTableDataset.latchupsAcuVcc = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
for (uint8_t idx = 0; idx < hk::CHNLS_LEN; idx++) {
auxHk.latchups[idx] = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
dataOffset += 4;
}
auxHk.dockVbatVoltageValue = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
dataOffset += 4;
p60dockHkTableDataset.latchupsAcuVcc = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
auxHk.dockVccCurrent = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
dataOffset += 4;
p60dockHkTableDataset.latchupsPdu1Vcc = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
coreHk.batteryCurrent = *(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);
coreHk.batteryVoltage = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
dataOffset += 4;
p60dockHkTableDataset.dockVbatVoltageValue =
*(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
auxHk.batteryTemperature1 = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
dataOffset += 4;
p60dockHkTableDataset.dockVccCurrent = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
dataOffset += 4;
p60dockHkTableDataset.batteryCurrent = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
dataOffset += 4;
p60dockHkTableDataset.batteryVoltage = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
auxHk.batteryTemperature2 = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
dataOffset += 4;
p60dockHkTableDataset.batteryTemperature1 =
*(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
dataOffset += 4;
p60dockHkTableDataset.batteryTemperature2 =
*(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
dataOffset += 4;
for (uint8_t idx = 0; idx < NUM_DEVS; idx++) {
auxHk.devicesType[idx] = *(packet + dataOffset);
dataOffset += 3;
}
for (uint8_t idx = 0; idx < NUM_DEVS; idx++) {
auxHk.devicesStatus[idx] = *(packet + dataOffset);
dataOffset += 3;
}
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);
auxHk.dearmStatus = *(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;
p60dockHkTableDataset.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.commit();
auxHk.ar6Depl = *(packet + dataOffset);
if (firstHk) {
firstHk = false;
}
coreHk.setValidity(true, true);
auxHk.setValidity(true, true);
}
ReturnValue_t P60DockHandler::initializeLocalDataPool(localpool::DataPool &localDataPoolMap,
LocalDataPoolManager &poolManager) {
localDataPoolMap.emplace(P60System::P60DOCK_CURRENT_ACU_VCC, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_CURRENT_PDU1_VCC, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_CURRENT_X3_IDLE_VCC, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_CURRENT_PDU2_VCC, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_CURRENT_ACU_VBAT, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_CURRENT_PDU1_VBAT, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_CURRENT_X3_IDLE_VBAT, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_CURRENT_PDU2_VBAT, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_CURRENT_STACK_VBAT, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_CURRENT_STACK_3V3, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_CURRENT_STACK_5V, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_CURRENT_GS3V3, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_CURRENT_GS5V, new PoolEntry<int16_t>({0}));
using namespace P60System;
localDataPoolMap.emplace(pool::P60_CURRENTS, &hkCurrents);
localDataPoolMap.emplace(P60System::P60DOCK_VOLTAGE_ACU_VCC, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_VOLTAGE_PDU1_VCC, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_VOLTAGE_X3_IDLE_VCC, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_VOLTAGE_PDU2_VCC, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_VOLTAGE_ACU_VBAT, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_VOLTAGE_PDU1_VBAT, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_VOLTAGE_X3_IDLE_VBAT, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_VOLTAGE_PDU2_VBAT, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_VOLTAGE_STACK_VBAT, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_VOLTAGE_STACK_3V3, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_VOLTAGE_STACK_5V, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_VOLTAGE_GS3V3, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_VOLTAGE_GS5V, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(pool::P60_VOLTAGES, &hkVoltages);
localDataPoolMap.emplace(P60System::P60DOCK_OUTPUTENABLE_ACU_VCC, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_OUTPUTENABLE_PDU1_VCC, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_OUTPUTENABLE_X3_IDLE_VCC,
new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_OUTPUTENABLE_PDU2_VCC, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_OUTPUTENABLE_ACU_VBAT, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_OUTPUTENABLE_PDU1_VBAT, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_OUTPUTENABLE_X3_IDLE_VBAT,
new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_OUTPUTENABLE_PDU2_VBAT, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_OUTPUTENABLE_STACK_VBAT, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_OUTPUTENABLE_STACK_3V3, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_OUTPUTENABLE_STACK_5V, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_OUTPUTENABLE_GS3V3, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_OUTPUTENABLE_GS5V, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(pool::P60_OUTPUT_ENABLE, &outputEnables);
localDataPoolMap.emplace(P60System::P60DOCK_TEMPERATURE_1, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_TEMPERATURE_2, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(pool::P60DOCK_TEMPERATURE_1, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(pool::P60DOCK_TEMPERATURE_2, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_BOOT_CAUSE, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_BOOT_CNT, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_UPTIME, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_RESETCAUSE, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_BATT_MODE, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_HEATER_ON, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_CONV_5V_ENABLE_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(pool::P60DOCK_BOOT_CAUSE, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(pool::P60DOCK_BOOT_CNT, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(pool::P60DOCK_UPTIME, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(pool::P60DOCK_RESETCAUSE, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(pool::P60DOCK_BATT_MODE, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(pool::P60DOCK_HEATER_ON, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(pool::P60DOCK_CONV_5V_ENABLE_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_LATCHUP_ACU_VCC, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_LATCHUP_PDU1_VCC, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_LATCHUP_X3_IDLE_VCC, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_LATCHUP_PDU2_VCC, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_LATCHUP_ACU_VBAT, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_LATCHUP_PDU1_VBAT, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_LATCHUP_X3_IDLE_VBAT, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_LATCHUP_PDU2_VBAT, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_LATCHUP_STACK_VBAT, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_LATCHUP_STACK_3V3, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_LATCHUP_STACK_5V, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_LATCHUP_GS3V3, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_LATCHUP_GS5V, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(pool::LATCHUPS, &latchups);
localDataPoolMap.emplace(P60System::P60DOCK_VBAT_VALUE, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_VCC_CURRENT_VALUE, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_BATTERY_CURRENT, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_BATTERY_VOLTAGE, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(pool::P60DOCK_DOCK_VBAT, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(pool::P60DOCK_DOCK_VCC_CURRENT, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(pool::P60DOCK_BATTERY_CURRENT, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(pool::P60DOCK_BATTERY_VOLTAGE, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_BATTERY_TEMPERATURE_1, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_BATTERY_TEMPERATURE_2, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(pool::P60DOCK_BATTERY_TEMPERATURE_1, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(pool::P60DOCK_BATTERY_TEMPERATURE_2, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_DEVICE_0, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_DEVICE_1, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_DEVICE_2, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_DEVICE_3, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_DEVICE_4, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_DEVICE_5, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_DEVICE_6, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_DEVICE_7, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(pool::DEVICES_TYPE, &devicesType);
localDataPoolMap.emplace(pool::DEVICES_STATUS, &devicesStatus);
localDataPoolMap.emplace(P60System::P60DOCK_DEVICE_0_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_DEVICE_1_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_DEVICE_2_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_DEVICE_3_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_DEVICE_4_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_DEVICE_5_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_DEVICE_6_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_DEVICE_7_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(pool::P60DOCK_DEARM_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_DEARM_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(pool::P60DOCK_WDT_CNT_GND, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(pool::P60DOCK_WDT_CNT_I2C, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(pool::P60DOCK_WDT_CNT_CAN, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(pool::P60DOCK_WDT_CNT_CSP_1, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(pool::P60DOCK_WDT_CNT_CSP_2, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_WDT_CNT_GND, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_WDT_CNT_I2C, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_WDT_CNT_CAN, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_WDT_CNT_CSP_1, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_WDT_CNT_CSP_2, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(pool::P60DOCK_WDT_GND_LEFT, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(pool::P60DOCK_WDT_I2C_LEFT, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(pool::P60DOCK_WDT_CAN_LEFT, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(pool::P60DOCK_WDT_CSP_LEFT_1, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(pool::P60DOCK_WDT_CSP_LEFT_2, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_WDT_GND_LEFT, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_WDT_I2C_LEFT, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_WDT_CAN_LEFT, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_WDT_CSP_LEFT_1, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_WDT_CSP_LEFT_2, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_BATT_CHARGE_CURRENT, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_BATT_DISCHARGE_CURRENT, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_ANT6_DEPL, new PoolEntry<int8_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_AR6_DEPL, new PoolEntry<int8_t>({0}));
localDataPoolMap.emplace(pool::P60DOCK_BATT_CHARGE_CURRENT, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(pool::P60DOCK_BATT_DISCHARGE_CURRENT, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(pool::P60DOCK_ANT6_DEPL, new PoolEntry<int8_t>({0}));
localDataPoolMap.emplace(pool::P60DOCK_AR6_DEPL, new PoolEntry<int8_t>({0}));
poolManager.subscribeForPeriodicPacket(coreHk.getSid(), false, 10.0, false);
poolManager.subscribeForPeriodicPacket(auxHk.getSid(), false, 30.0, false);
return HasReturnvaluesIF::RETURN_OK;
}
@ -448,16 +274,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) {
@ -474,84 +301,64 @@ 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<int>(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<int>(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;
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;
<< std::setw(4) << std::right << coreHk.batteryCurrent.value << ", " << std::setw(5)
<< coreHk.batteryVoltage.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(coreHk.outputEnables[idx]) << ", " << std::setw(4) << std::right
<< coreHk.currents[idx] << ", " << std::setw(5) << coreHk.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);
}
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;
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 << auxHk.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);
}

View File

@ -4,6 +4,7 @@
#include <mission/devices/devicedefinitions/GomspaceDefinitions.h>
#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,15 @@
*/
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, 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, 2, severity::MEDIUM);
P60DockHandler(object_id_t objectId, object_id_t comIF, CookieIF* comCookie);
virtual ~P60DockHandler();
@ -31,14 +41,24 @@ 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;
bool firstHk = true;
static constexpr uint8_t MAX_CHANNEL_STR_WIDTH = 16;
PoolEntry<int16_t> hkCurrents = PoolEntry<int16_t>(P60Dock::hk::CHNLS_LEN);
PoolEntry<uint16_t> hkVoltages = PoolEntry<uint16_t>(P60Dock::hk::CHNLS_LEN);
PoolEntry<uint8_t> outputEnables = PoolEntry<uint8_t>(P60Dock::hk::CHNLS_LEN);
PoolEntry<uint16_t> latchups = PoolEntry<uint16_t>(P60Dock::hk::CHNLS_LEN);
PoolEntry<uint8_t> devicesType = PoolEntry<uint8_t>(P60Dock::NUM_DEVS);
PoolEntry<uint8_t> devicesStatus = PoolEntry<uint8_t>(P60Dock::NUM_DEVS);
/**
* @brief Function extracts the hk table information from the received csp packet and stores
* the values in the p60dockHkTableDataset.

View File

@ -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<void*>(this));
commandQueue = QueueFactory::instance()->createMessageQueue(
@ -51,7 +52,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<uint32_t>(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;
@ -66,7 +68,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<uint32_t>(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;
@ -77,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];
}
}
}
@ -101,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, PDU2::HK_TABLE_DATA_SET_ID)) {
updateHkTableDataset(storeId, &pdu2HkTableDataset, &timeStampPdu2HkDataset);
if (sid == sid_t(objects::PDU2_HANDLER, static_cast<uint32_t>(P60System::SetIds::PDU_2_CORE))) {
updateHkTableDataset(storeId, &pdu2CoreHk, &timeStampPdu2HkDataset);
updatePdu2SwitchStates();
} else if (sid == sid_t(objects::PDU1_HANDLER, PDU1::HK_TABLE_DATA_SET_ID)) {
updateHkTableDataset(storeId, &pdu1HkTableDataset, &timeStampPdu1HkDataset);
} else if (sid ==
sid_t(objects::PDU1_HANDLER, static_cast<uint32_t>(P60System::SetIds::PDU_1_CORE))) {
updateHkTableDataset(storeId, &pdu1CoreHk, &timeStampPdu1HkDataset);
updatePdu1SwitchStates();
} else {
sif::error << "PCDUHandler::handleChangedDataset: Invalid sid" << std::endl;
@ -118,21 +126,19 @@ void PCDUHandler::updateHkTableDataset(store_address_t storeId, LocalPoolDataSet
HousekeepingSnapshot packetUpdate(reinterpret_cast<uint8_t*>(datasetTimeStamp),
sizeof(CCSDSTime::CDS_short), dataset);
const uint8_t* packet_ptr = NULL;
size_t size;
const uint8_t* packet_ptr = nullptr;
size_t size = 0;
result = IPCStore->getData(storeId, &packet_ptr, &size);
if (result != RETURN_OK) {
sif::error << "PCDUHandler::updateHkTableDataset: Failed to get data from IPCStore."
<< std::endl;
}
dataset->read();
result = packetUpdate.deSerialize(&packet_ptr, &size, SerializeIF::Endianness::MACHINE);
if (result != RETURN_OK) {
sif::error << "PCDUHandler::updateHkTableDataset: Failed to deserialize received packet "
"in hk table dataset"
<< std::endl;
}
dataset->commit();
result = IPCStore->deleteData(storeId);
if (result != RETURN_OK) {
sif::error << "PCDUHandler::updateHkTableDataset: Failed to delete data in IPCStore"
@ -141,29 +147,32 @@ 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);
if (rg0.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;
}
@ -174,27 +183,32 @@ void PCDUHandler::updatePdu2SwitchStates() {
}
void PCDUHandler::updatePdu1SwitchStates() {
using namespace pcduSwitches;
PoolReadGuard rg(&pdu1HkTableDataset);
using namespace pcdu;
using namespace PDU1;
PoolReadGuard rg0(&switcherSet);
GOMSPACE::Pdu pdu = GOMSPACE::Pdu::PDU1;
if (rg.getReadResult() == RETURN_OK) {
if (rg0.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;
}
@ -206,7 +220,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);
@ -214,94 +228,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<GomspaceDeviceHandler>(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<GomspaceDeviceHandler>(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<GomspaceDeviceHandler>(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<GomspaceDeviceHandler>(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<GomspaceDeviceHandler>(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<GomspaceDeviceHandler>(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<GomspaceDeviceHandler>(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<GomspaceDeviceHandler>(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<GomspaceDeviceHandler>(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<GomspaceDeviceHandler>(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<GomspaceDeviceHandler>(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<GomspaceDeviceHandler>(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<GomspaceDeviceHandler>(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<GomspaceDeviceHandler>(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<GomspaceDeviceHandler>(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<GomspaceDeviceHandler>(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<GomspaceDeviceHandler>(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<GomspaceDeviceHandler>(objects::PDU2_HANDLER);
break;
@ -353,7 +367,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;
}
@ -375,223 +389,10 @@ 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<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_CURRENT_OUT_PAYLOAD_PCDU_CH1,
new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_CURRENT_OUT_RW, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_CURRENT_OUT_TCS_BOARD_HEATER_IN,
new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_CURRENT_OUT_SUS_REDUNDANT, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_CURRENT_OUT_DEPLOYMENT_MECHANISM,
new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_CURRENT_OUT_PAYLOAD_PCDU_CH6,
new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_CURRENT_OUT_ACS_BOARD_SIDE_B,
new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_CURRENT_OUT_PAYLOAD_CAMERA, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_VOLTAGE_OUT_Q7S, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_VOLTAGE_OUT_PAYLOAD_PCDU_CH1,
new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_VOLTAGE_OUT_RW, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_VOLTAGE_OUT_TCS_BOARD_HEATER_IN,
new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_VOLTAGE_OUT_SUS_REDUNDANT, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_VOLTAGE_OUT_DEPLOYMENT_MECHANISM,
new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_VOLTAGE_OUT_PAYLOAD_PCDU_CH6,
new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_VOLTAGE_OUT_ACS_BOARD_SIDE_B,
new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_VOLTAGE_OUT_PAYLOAD_CAMERA, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_VCC, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_VBAT, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_TEMPERATURE, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_CONV_EN_1, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_CONV_EN_2, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_CONV_EN_3, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_OUT_EN_Q7S,
new PoolEntry<uint8_t>({INIT_SWITCH_STATES[Switches::PDU2_CH0_Q7S]}));
localDataPoolMap.emplace(
P60System::PDU2_OUT_EN_PAYLOAD_PCDU_CH1,
new PoolEntry<uint8_t>({INIT_SWITCH_STATES[Switches::PDU2_CH1_PL_PCDU_BATT_0_14V8]}));
localDataPoolMap.emplace(P60System::PDU2_OUT_EN_RW,
new PoolEntry<uint8_t>({INIT_SWITCH_STATES[Switches::PDU2_CH2_RW_5V]}));
#ifdef TE0720_1CFA
localDataPoolMap.emplace(P60System::PDU2_OUT_EN_TCS_BOARD_HEATER_IN, new PoolEntry<uint8_t>({1}));
#else
localDataPoolMap.emplace(
P60System::PDU2_OUT_EN_TCS_BOARD_HEATER_IN,
new PoolEntry<uint8_t>({INIT_SWITCH_STATES[Switches::PDU2_CH3_TCS_BOARD_HEATER_IN_8V]}));
#endif
localDataPoolMap.emplace(
P60System::PDU2_OUT_EN_SUS_REDUNDANT,
new PoolEntry<uint8_t>({INIT_SWITCH_STATES[Switches::PDU2_CH4_SUS_REDUNDANT_3V3]}));
localDataPoolMap.emplace(
P60System::PDU2_OUT_EN_DEPLOYMENT_MECHANISM,
new PoolEntry<uint8_t>({INIT_SWITCH_STATES[Switches::PDU2_CH5_DEPLOYMENT_MECHANISM_8V]}));
localDataPoolMap.emplace(
P60System::PDU2_OUT_EN_PAYLOAD_PCDU_CH6,
new PoolEntry<uint8_t>({INIT_SWITCH_STATES[Switches::PDU2_CH6_PL_PCDU_BATT_1_14V8]}));
localDataPoolMap.emplace(
P60System::PDU2_OUT_EN_ACS_BOARD_SIDE_B,
new PoolEntry<uint8_t>({INIT_SWITCH_STATES[Switches::PDU2_CH7_ACS_BOARD_SIDE_B_3V3]}));
localDataPoolMap.emplace(
P60System::PDU2_OUT_EN_PAYLOAD_CAMERA,
new PoolEntry<uint8_t>({INIT_SWITCH_STATES[Switches::PDU2_CH8_PAYLOAD_CAMERA]}));
localDataPoolMap.emplace(P60System::PDU2_BOOTCAUSE, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_BOOTCNT, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_UPTIME, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_RESETCAUSE, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_BATT_MODE, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_LATCHUP_Q7S, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_LATCHUP_PAYLOAD_PCDU_CH1, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_LATCHUP_RW, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_LATCHUP_TCS_BOARD_HEATER_IN,
new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_LATCHUP_TCS_BOARD_HEATER_IN,
new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_LATCHUP_SUS_REDUNDANT, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_LATCHUP_DEPLOYMENT_MECHANISM,
new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_LATCHUP_PAYLOAD_PCDU_CH6, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_LATCHUP_ACS_BOARD_SIDE_B, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_LATCHUP_PAYLOAD_CAMERA, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_DEVICE_0, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_DEVICE_1, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_DEVICE_2, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_DEVICE_3, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_DEVICE_4, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_DEVICE_5, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_DEVICE_6, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_DEVICE_7, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_DEVICE_0_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_DEVICE_1_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_DEVICE_2_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_DEVICE_3_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_DEVICE_4_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_DEVICE_5_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_DEVICE_6_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_DEVICE_7_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_WDT_CNT_GND, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_WDT_CNT_I2C, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_WDT_CNT_CAN, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_WDT_CNT_CSP1, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_WDT_CNT_CSP2, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_WDT_GND_LEFT, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_WDT_I2C_LEFT, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_WDT_CAN_LEFT, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_WDT_CSP_LEFT1, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_WDT_CSP_LEFT2, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_CURRENT_OUT_TCS_BOARD_3V3, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_CURRENT_OUT_SYRLINKS, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_CURRENT_OUT_STAR_TRACKER, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_CURRENT_OUT_MGT, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_CURRENT_OUT_SUS_NOMINAL, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_CURRENT_OUT_SOLAR_CELL_EXP, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_CURRENT_OUT_PLOC, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_CURRENT_OUT_ACS_BOARD_SIDE_A,
new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_CURRENT_OUT_CHANNEL8, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(
P60System::PDU1_VOLTAGE_OUT_TCS_BOARD_3V3,
new PoolEntry<int16_t>({INIT_SWITCH_STATES[Switches::PDU1_CH0_TCS_BOARD_3V3]}));
localDataPoolMap.emplace(
P60System::PDU1_VOLTAGE_OUT_SYRLINKS,
new PoolEntry<int16_t>({INIT_SWITCH_STATES[Switches::PDU1_CH1_SYRLINKS_12V]}));
localDataPoolMap.emplace(
P60System::PDU1_VOLTAGE_OUT_STAR_TRACKER,
new PoolEntry<int16_t>({INIT_SWITCH_STATES[Switches::PDU1_CH2_STAR_TRACKER_5V]}));
localDataPoolMap.emplace(P60System::PDU1_VOLTAGE_OUT_MGT,
new PoolEntry<int16_t>({INIT_SWITCH_STATES[Switches::PDU1_CH3_MGT_5V]}));
localDataPoolMap.emplace(
P60System::PDU1_VOLTAGE_OUT_SUS_NOMINAL,
new PoolEntry<int16_t>({INIT_SWITCH_STATES[Switches::PDU1_CH4_SUS_NOMINAL_3V3]}));
localDataPoolMap.emplace(
P60System::PDU1_VOLTAGE_OUT_SOLAR_CELL_EXP,
new PoolEntry<int16_t>({INIT_SWITCH_STATES[Switches::PDU1_CH5_SOLAR_CELL_EXP_5V]}));
localDataPoolMap.emplace(
P60System::PDU1_VOLTAGE_OUT_PLOC,
new PoolEntry<int16_t>({INIT_SWITCH_STATES[Switches::PDU1_CH6_PLOC_12V]}));
localDataPoolMap.emplace(
P60System::PDU1_VOLTAGE_OUT_ACS_BOARD_SIDE_A,
new PoolEntry<int16_t>({INIT_SWITCH_STATES[Switches::PDU1_CH7_ACS_A_SIDE_3V3]}));
localDataPoolMap.emplace(
P60System::PDU1_VOLTAGE_OUT_CHANNEL8,
new PoolEntry<int16_t>({INIT_SWITCH_STATES[Switches::PDU1_CH8_UNOCCUPIED]}));
localDataPoolMap.emplace(P60System::PDU1_VCC, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_VBAT, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_TEMPERATURE, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_CONV_EN_1, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_CONV_EN_2, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_CONV_EN_3, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_OUT_EN_TCS_BOARD_3V3, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_OUT_EN_SYRLINKS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_OUT_EN_STAR_TRACKER, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_OUT_EN_MGT, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_OUT_EN_SUS_NOMINAL, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_OUT_EN_SOLAR_CELL_EXP, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_OUT_EN_PLOC, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_OUT_EN_ACS_BOARD_SIDE_A, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_OUT_EN_CHANNEL8, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_BOOTCAUSE, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_BOOTCNT, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_UPTIME, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_RESETCAUSE, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_BATT_MODE, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_LATCHUP_TCS_BOARD_3V3, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_LATCHUP_SYRLINKS, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_LATCHUP_STAR_TRACKER, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_LATCHUP_MGT, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_LATCHUP_SUS_NOMINAL, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_LATCHUP_SOLAR_CELL_EXP, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_LATCHUP_PLOC, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_LATCHUP_ACS_BOARD_SIDE_A, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_LATCHUP_CHANNEL8, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_DEVICE_0, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_DEVICE_1, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_DEVICE_2, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_DEVICE_3, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_DEVICE_4, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_DEVICE_5, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_DEVICE_6, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_DEVICE_7, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_DEVICE_0_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_DEVICE_1_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_DEVICE_2_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_DEVICE_3_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_DEVICE_4_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_DEVICE_5_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_DEVICE_6_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_DEVICE_7_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_WDT_CNT_GND, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_WDT_CNT_I2C, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_WDT_CNT_CAN, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_WDT_CNT_CSP1, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_WDT_CNT_CSP2, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_WDT_GND_LEFT, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_WDT_I2C_LEFT, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_WDT_CAN_LEFT, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_WDT_CSP_LEFT1, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_WDT_CSP_LEFT2, new PoolEntry<uint8_t>({0}));
using namespace pcdu;
localDataPoolMap.emplace(PoolIds::PDU1_SWITCHES, &pdu1Switches);
localDataPoolMap.emplace(PoolIds::PDU2_SWITCHES, &pdu2Switches);
poolManager.subscribeForPeriodicPacket(switcherSet.getSid(), false, 5.0, true);
return HasReturnvaluesIF::RETURN_OK;
}
@ -611,17 +412,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.

View File

@ -2,6 +2,7 @@
#define MISSION_DEVICES_PCDUHANDLER_H_
#include <devices/powerSwitcherList.h>
#include <fsfw/datapool/PoolEntry.h>
#include <fsfw/datapoollocal/HasLocalDataPoolIF.h>
#include <fsfw/objectmanager/SystemObject.h>
#include <fsfw/power/PowerSwitchIF.h>
@ -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<uint8_t> pdu1Switches =
PoolEntry<uint8_t>(pcdu::INIT_SWITCHES_PDU1.data(), pcdu::INIT_SWITCHES_PDU1.size());
PoolEntry<uint8_t> pdu2Switches =
PoolEntry<uint8_t>(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_ */

View File

@ -3,13 +3,13 @@
#include <fsfw/datapool/PoolReadGuard.h>
#include <mission/devices/devicedefinitions/GomSpacePackets.h>
#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),
pdu1HkTableDataset(this) {}
PDU::MAX_HKTABLE_ADDRESS, PDU::HK_TABLE_REPLY_SIZE),
coreHk(this),
auxHk(this) {}
PDU1Handler::~PDU1Handler() {}
@ -20,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<unsigned int>(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<unsigned int>(pdu1HkTableDataset.csp1WatchdogPingsLeft.value)
<< std::endl;
sif::info << "PDU1 csp2 watchdog pings before reboot: "
<< static_cast<unsigned int>(pdu1HkTableDataset.csp2WatchdogPingsLeft.value)
<< std::endl;
pdu1HkTableDataset.commit();
#endif
handleDeviceTM(&coreHk, id, true);
}
void PDU1Handler::assignChannelHookFunction(GOMSPACE::ChannelSwitchHook hook, void *args) {
@ -124,305 +79,31 @@ 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::PDU1_CURRENT_OUT_TCS_BOARD_3V3, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_CURRENT_OUT_SYRLINKS, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_CURRENT_OUT_STAR_TRACKER, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_CURRENT_OUT_MGT, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_CURRENT_OUT_SUS_NOMINAL, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_CURRENT_OUT_SOLAR_CELL_EXP, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_CURRENT_OUT_PLOC, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_CURRENT_OUT_ACS_BOARD_SIDE_A,
new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_CURRENT_OUT_CHANNEL8, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_VOLTAGE_OUT_TCS_BOARD_3V3, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_VOLTAGE_OUT_SYRLINKS, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_VOLTAGE_OUT_STAR_TRACKER, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_VOLTAGE_OUT_MGT, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_VOLTAGE_OUT_SUS_NOMINAL, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_VOLTAGE_OUT_SOLAR_CELL_EXP, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_VOLTAGE_OUT_PLOC, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_VOLTAGE_OUT_ACS_BOARD_SIDE_A,
new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_VOLTAGE_OUT_CHANNEL8, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_VCC, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_VBAT, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_TEMPERATURE, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_CONV_EN_1, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_CONV_EN_2, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_CONV_EN_3, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_OUT_EN_TCS_BOARD_3V3, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_OUT_EN_SYRLINKS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_OUT_EN_STAR_TRACKER, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_OUT_EN_MGT, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_OUT_EN_SUS_NOMINAL, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_OUT_EN_SOLAR_CELL_EXP, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_OUT_EN_PLOC, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_OUT_EN_ACS_BOARD_SIDE_A, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_OUT_EN_CHANNEL8, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_BOOTCAUSE, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_BOOTCNT, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_UPTIME, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_RESETCAUSE, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_BATT_MODE, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_LATCHUP_TCS_BOARD_3V3, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_LATCHUP_SYRLINKS, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_LATCHUP_STAR_TRACKER, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_LATCHUP_MGT, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_LATCHUP_SUS_NOMINAL, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_LATCHUP_SOLAR_CELL_EXP, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_LATCHUP_PLOC, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_LATCHUP_ACS_BOARD_SIDE_A, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_LATCHUP_CHANNEL8, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_DEVICE_0, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_DEVICE_1, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_DEVICE_2, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_DEVICE_3, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_DEVICE_4, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_DEVICE_5, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_DEVICE_6, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_DEVICE_7, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_DEVICE_0_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_DEVICE_1_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_DEVICE_2_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_DEVICE_3_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_DEVICE_4_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_DEVICE_5_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_DEVICE_6_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_DEVICE_7_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_WDT_CNT_GND, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_WDT_CNT_I2C, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_WDT_CNT_CAN, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_WDT_CNT_CSP1, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_WDT_CNT_CSP2, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_WDT_GND_LEFT, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_WDT_I2C_LEFT, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_WDT_CAN_LEFT, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_WDT_CSP_LEFT1, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_WDT_CSP_LEFT2, new PoolEntry<uint8_t>({0}));
#if OBSW_ENABLE_PERIODIC_HK == 1
poolManager.subscribeForPeriodicPacket(pdu1HkTableDataset.getSid(), false, 0.4, true);
#endif
initializePduPool(localDataPoolMap, poolManager, pcdu::INIT_SWITCHES_PDU1);
poolManager.subscribeForPeriodicPacket(coreHk.getSid(), false, 10.0, true);
poolManager.subscribeForPeriodicPacket(auxHk.getSid(), false, 30.0, false);
return HasReturnvaluesIF::RETURN_OK;
}
LocalPoolDataSetBase *PDU1Handler::getDataSetHandle(sid_t sid) {
if (sid == coreHk.getSid()) {
return &coreHk;
} else if (sid == auxHk.getSid()) {
return &auxHk;
}
return nullptr;
}
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;
@ -431,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;
@ -450,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<int>(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<int>(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<unsigned int>(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<unsigned int>(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<unsigned int>(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<unsigned int>(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<unsigned int>(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<unsigned int>(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<unsigned int>(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);
}

View File

@ -36,14 +36,15 @@ 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:
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;

View File

@ -3,13 +3,13 @@
#include <fsfw/datapool/PoolReadGuard.h>
#include <mission/devices/devicedefinitions/GomSpacePackets.h>
#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),
pdu2HkTableDataset(this) {}
PDU::MAX_HKTABLE_ADDRESS, PDU::HK_TABLE_REPLY_SIZE),
coreHk(this),
auxHk(this) {}
PDU2Handler::~PDU2Handler() {}
@ -24,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,319 +32,24 @@ void PDU2Handler::assignChannelHookFunction(GOMSPACE::ChannelSwitchHook hook, vo
this->hookArgs = args;
}
LocalPoolDataSetBase *PDU2Handler::getDataSetHandle(sid_t sid) {
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) {
localDataPoolMap.emplace(P60System::PDU2_CURRENT_OUT_Q7S, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_CURRENT_OUT_PAYLOAD_PCDU_CH1,
new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_CURRENT_OUT_RW, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_CURRENT_OUT_TCS_BOARD_HEATER_IN,
new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_CURRENT_OUT_SUS_REDUNDANT, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_CURRENT_OUT_DEPLOYMENT_MECHANISM,
new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_CURRENT_OUT_PAYLOAD_PCDU_CH6,
new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_CURRENT_OUT_ACS_BOARD_SIDE_B,
new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_CURRENT_OUT_PAYLOAD_CAMERA, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_VOLTAGE_OUT_Q7S, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_VOLTAGE_OUT_PAYLOAD_PCDU_CH1,
new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_VOLTAGE_OUT_RW, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_VOLTAGE_OUT_TCS_BOARD_HEATER_IN,
new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_VOLTAGE_OUT_SUS_REDUNDANT, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_VOLTAGE_OUT_DEPLOYMENT_MECHANISM,
new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_VOLTAGE_OUT_PAYLOAD_PCDU_CH6,
new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_VOLTAGE_OUT_ACS_BOARD_SIDE_B,
new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_VOLTAGE_OUT_PAYLOAD_CAMERA, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_VCC, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_VBAT, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_TEMPERATURE, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_CONV_EN_1, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_CONV_EN_2, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_CONV_EN_3, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_OUT_EN_Q7S, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_OUT_EN_PAYLOAD_PCDU_CH1, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_OUT_EN_RW, new PoolEntry<uint8_t>({0}));
#ifdef TE0720_1CFA
localDataPoolMap.emplace(P60System::PDU2_OUT_EN_TCS_BOARD_HEATER_IN, new PoolEntry<uint8_t>({1}));
#else
localDataPoolMap.emplace(P60System::PDU2_OUT_EN_TCS_BOARD_HEATER_IN, new PoolEntry<uint8_t>({0}));
#endif
localDataPoolMap.emplace(P60System::PDU2_OUT_EN_SUS_REDUNDANT, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_OUT_EN_DEPLOYMENT_MECHANISM,
new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_OUT_EN_PAYLOAD_PCDU_CH6, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_OUT_EN_ACS_BOARD_SIDE_B, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_OUT_EN_PAYLOAD_CAMERA, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_BOOTCAUSE, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_BOOTCNT, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_UPTIME, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_RESETCAUSE, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_BATT_MODE, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_LATCHUP_Q7S, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_LATCHUP_PAYLOAD_PCDU_CH1, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_LATCHUP_RW, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_LATCHUP_TCS_BOARD_HEATER_IN,
new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_LATCHUP_SUS_REDUNDANT, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_LATCHUP_DEPLOYMENT_MECHANISM,
new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_LATCHUP_PAYLOAD_PCDU_CH6, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_LATCHUP_ACS_BOARD_SIDE_B, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_LATCHUP_PAYLOAD_CAMERA, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_DEVICE_0, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_DEVICE_1, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_DEVICE_2, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_DEVICE_3, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_DEVICE_4, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_DEVICE_5, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_DEVICE_6, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_DEVICE_7, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_DEVICE_0_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_DEVICE_1_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_DEVICE_2_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_DEVICE_3_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_DEVICE_4_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_DEVICE_5_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_DEVICE_6_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_DEVICE_7_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_WDT_CNT_GND, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_WDT_CNT_I2C, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_WDT_CNT_CAN, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_WDT_CNT_CSP1, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_WDT_CNT_CSP2, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_WDT_GND_LEFT, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_WDT_I2C_LEFT, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_WDT_CAN_LEFT, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_WDT_CSP_LEFT1, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_WDT_CSP_LEFT2, new PoolEntry<uint8_t>({0}));
#if OBSW_ENABLE_PERIODIC_HK == 1
poolManager.subscribeForPeriodicPacket(pdu2HkTableDataset.getSid(), false, 0.4, true);
#endif
initializePduPool(localDataPoolMap, poolManager, pcdu::INIT_SWITCHES_PDU2);
poolManager.subscribeForPeriodicPacket(coreHk.getSid(), false, 10.0, true);
poolManager.subscribeForPeriodicPacket(auxHk.getSid(), false, 30.0, false);
return HasReturnvaluesIF::RETURN_OK;
}
@ -374,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;
@ -383,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;
@ -402,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<int>(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<int>(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,

View File

@ -36,12 +36,14 @@ 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;
/** Dataset for the housekeeping table of the PDU2 */
PDU2::PDU2HkTableDataset pdu2HkTableDataset;
PDU2::Pdu2CoreHk coreHk;
PDU2::Pdu2AuxHk auxHk;
GOMSPACE::ChannelSwitchHook channelSwitchHook = nullptr;
void* hookArgs = nullptr;

View File

@ -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);
}
@ -66,7 +67,8 @@ 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) {
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"
<< "detected" << std::endl;
@ -82,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;
@ -106,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 == NormalSubmodes::DRO_ON) {
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 == NormalSubmodes::X8_ON) {
#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 == NormalSubmodes::TX_ON) {
#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 == NormalSubmodes::MPA_ON) {
#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 == NormalSubmodes::HPA_ON) {
#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;
@ -201,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);
@ -309,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;
}
@ -548,25 +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 == 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 & 0b1) != (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 & 0b11) != ((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 & 0b111) !=
((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 & 0b1111) !=
((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 & 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;

View File

@ -134,6 +134,7 @@ class PayloadPcduHandler : public DeviceHandlerBase {
SdCardMountedIF* sdcMan;
plpcdu::PlPcduParameter params;
bool quickTransitionAlreadyCalled = true;
uint8_t diffMask = 0;
PoolEntry<uint16_t> channelValues = PoolEntry<uint16_t>({0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0});
PoolEntry<float> processedValues =
@ -141,6 +142,8 @@ class PayloadPcduHandler : public DeviceHandlerBase {
PoolEntry<float> tempC = PoolEntry<float>({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;

View File

@ -203,6 +203,7 @@ ReturnValue_t RadiationSensorHandler::initializeLocalDataPool(localpool::DataPoo
localDataPoolMap.emplace(RAD_SENSOR::AIN5, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(RAD_SENSOR::AIN6, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(RAD_SENSOR::AIN7, new PoolEntry<uint16_t>({0}));
poolManager.subscribeForPeriodicPacket(dataset.getSid(), false, 20.0, false);
return HasReturnvaluesIF::RETURN_OK;
}

View File

@ -279,7 +279,9 @@ ReturnValue_t RwHandler::initializeLocalDataPool(localpool::DataPool& localDataP
localDataPoolMap.emplace(RwDefinitions::SPI_BYTES_READ, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(RwDefinitions::SPI_REG_OVERRUN_ERRORS, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(RwDefinitions::SPI_TOTAL_ERRORS, new PoolEntry<uint32_t>({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;
}

View File

@ -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_),

View File

@ -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();

View File

@ -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;
}

View File

@ -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<const char*>(packet + offset));
if (debug) {
sif::info << "SyrlinksHkHandler::parseRxStatusRegistersReply: Lcl config: "
<< static_cast<unsigned int>(lclConfig) << std::endl;
sif::info << "SyrlinksHkHandler::parseRxStatusRegistersReply: Lcl config: "
<< static_cast<unsigned int>(lclConfig) << std::endl;
}
}
@ -569,8 +570,8 @@ void SyrlinksHkHandler::parseTxStatusReply(const uint8_t* packet) {
txDataset.txStatus = convertHexStringToUint8(reinterpret_cast<const char*>(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<const char*>(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<const char*>(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
}
@ -626,6 +627,9 @@ ReturnValue_t SyrlinksHkHandler::initializeLocalDataPool(localpool::DataPool& lo
localDataPoolMap.emplace(syrlinks::TEMP_BASEBAND_BOARD, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(syrlinks::TEMP_POWER_AMPLIFIER, new PoolEntry<uint16_t>({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;
}

View File

@ -1,12 +1,13 @@
#ifndef MISSION_DEVICES_SYRLINKSHKHANDLER_H_
#define MISSION_DEVICES_SYRLINKSHKHANDLER_H_
#include <string.h>
#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 <string.h>
#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;

View File

@ -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<float>({0.0}));
localDataPoolMap.emplace(TMP1075::TEMPERATURE_C_TMP1075, new PoolEntry<float>({0.0}));
poolManager.subscribeForPeriodicPacket(dataset.getSid(), false, 30.0, false);
return HasReturnvaluesIF::RETURN_OK;
}

View File

@ -6,6 +6,13 @@
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;

File diff suppressed because it is too large Load Diff

View File

@ -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<sizeof(float)> {
public:
@ -29,7 +29,7 @@ class Tmp1075Dataset : public StaticLocalDataSet<sizeof(float)> {
Tmp1075Dataset(object_id_t objectId) : StaticLocalDataSet(sid_t(objectId, TMP1075_DATA_SET_ID)) {}
lp_var_t<float> temperatureCelcius = lp_var_t<float>(sid.objectId, TEMPERATURE_C_TMP1075_1, this);
lp_var_t<float> temperatureCelcius = lp_var_t<float>(sid.objectId, TEMPERATURE_C_TMP1075, this);
};
} // namespace TMP1075

View File

@ -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

View File

@ -4,6 +4,8 @@
#include <fsfw/power/PowerSwitchIF.h>
#include <fsfw/serviceinterface.h>
#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,

View File

@ -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;

View File

@ -1 +1,5 @@
#include "AcsSubsystem.h"
AcsSubsystem::AcsSubsystem(object_id_t setObjectId, object_id_t parent,
uint32_t maxNumberOfSequences, uint32_t maxNumberOfTables)
: Subsystem(setObjectId, parent, maxNumberOfSequences, maxNumberOfTables) {}

View File

@ -1,4 +1,14 @@
#ifndef MISSION_SYSTEM_ACSSUBSYSTEM_H_
#define MISSION_SYSTEM_ACSSUBSYSTEM_H_
#include <fsfw/subsystem/Subsystem.h>
class AcsSubsystem : public Subsystem {
public:
AcsSubsystem(object_id_t setObjectId, object_id_t parent, uint32_t maxNumberOfSequences,
uint32_t maxNumberOfTables);
private:
};
#endif /* MISSION_SYSTEM_ACSSUBSYSTEM_H_ */

View File

@ -1,9 +1,11 @@
target_sources(${LIB_EIVE_MISSION} PRIVATE
EiveSystem.cpp
AcsSubsystem.cpp
ComSubsystem.cpp
PayloadSubsystem.cpp
AcsBoardAssembly.cpp
SusAssembly.cpp
AcsSubsystem.cpp
EiveSystem.cpp
ComSubsystem.cpp
DualLanePowerStateMachine.cpp
PowerStateMachineBase.cpp
DualLaneAssemblyBase.cpp

View File

@ -1 +1,5 @@
#include "ComSubsystem.h"
ComSubsystem::ComSubsystem(object_id_t setObjectId, object_id_t parent,
uint32_t maxNumberOfSequences, uint32_t maxNumberOfTables)
: Subsystem(setObjectId, parent, maxNumberOfSequences, maxNumberOfTables) {}

View File

@ -1,4 +1,14 @@
#ifndef MISSION_SYSTEM_COMSUBSYSTEM_H_
#define MISSION_SYSTEM_COMSUBSYSTEM_H_
#include <fsfw/subsystem/Subsystem.h>
class ComSubsystem : public Subsystem {
public:
ComSubsystem(object_id_t setObjectId, object_id_t parent, uint32_t maxNumberOfSequences,
uint32_t maxNumberOfTables);
private:
};
#endif /* MISSION_SYSTEM_COMSUBSYSTEM_H_ */

View File

@ -2,10 +2,11 @@
#include <fsfw/ipc/QueueFactory.h>
#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),

View File

@ -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

View File

@ -1 +1,5 @@
#include "EiveSystem.h"
EiveSystem::EiveSystem(object_id_t setObjectId, object_id_t parent, uint32_t maxNumberOfSequences,
uint32_t maxNumberOfTables)
: Subsystem(setObjectId, parent, maxNumberOfSequences, maxNumberOfTables) {}

View File

@ -1,4 +1,14 @@
#ifndef MISSION_SYSTEM_EIVESYSTEM_H_
#define MISSION_SYSTEM_EIVESYSTEM_H_
#include <fsfw/subsystem/Subsystem.h>
class EiveSystem : public Subsystem {
public:
EiveSystem(object_id_t setObjectId, object_id_t parent, uint32_t maxNumberOfSequences,
uint32_t maxNumberOfTables);
private:
};
#endif /* MISSION_SYSTEM_EIVESYSTEM_H_ */

View File

@ -1 +1,5 @@
#include "PayloadSubsystem.h"
PayloadSubsystem::PayloadSubsystem(object_id_t setObjectId, object_id_t parent,
uint32_t maxNumberOfSequences, uint32_t maxNumberOfTables)
: Subsystem(setObjectId, parent, maxNumberOfSequences, maxNumberOfTables) {}

View File

@ -1,4 +1,14 @@
#ifndef MISSION_SYSTEM_PAYLOADSUBSYSTEM_H_
#define MISSION_SYSTEM_PAYLOADSUBSYSTEM_H_
#include <fsfw/subsystem/Subsystem.h>
class PayloadSubsystem : public Subsystem {
public:
PayloadSubsystem(object_id_t setObjectId, object_id_t parent, uint32_t maxNumberOfSequences,
uint32_t maxNumberOfTables);
private:
};
#endif /* MISSION_SYSTEM_PAYLOADSUBSYSTEM_H_ */

View File

@ -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<ModeListEntry, NUMBER_SUN_SENSORS> modeTable;
SusAssHelper helper;

View File

@ -0,0 +1,90 @@
/*
*
* 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