From b29a0cd0fb1c570b15ec2ef98c5ce77de6b320bf Mon Sep 17 00:00:00 2001 From: Jakob Meier Date: Thu, 31 Mar 2022 17:44:29 +0200 Subject: [PATCH 01/19] syrlinks temperature set and temperature protection --- bsp_q7s/core/ObjectFactory.cpp | 2 +- mission/devices/SyrlinksHkHandler.cpp | 383 ++++++++++-------- mission/devices/SyrlinksHkHandler.h | 23 +- .../devicedefinitions/SyrlinksDefinitions.h | 20 +- 4 files changed, 255 insertions(+), 173 deletions(-) diff --git a/bsp_q7s/core/ObjectFactory.cpp b/bsp_q7s/core/ObjectFactory.cpp index f9f582e8..f5904969 100644 --- a/bsp_q7s/core/ObjectFactory.cpp +++ b/bsp_q7s/core/ObjectFactory.cpp @@ -793,7 +793,7 @@ void ObjectFactory::createSolarArrayDeploymentComponents() { void ObjectFactory::createSyrlinksComponents() { UartCookie* syrlinksUartCookie = new UartCookie(objects::SYRLINKS_HK_HANDLER, q7s::UART_SYRLINKS_DEV, UartModes::NON_CANONICAL, - uart::SYRLINKS_BAUD, SYRLINKS::MAX_REPLY_SIZE); + uart::SYRLINKS_BAUD, syrlinks::MAX_REPLY_SIZE); syrlinksUartCookie->setParityEven(); new SyrlinksHkHandler(objects::SYRLINKS_HK_HANDLER, objects::UART_COM_IF, syrlinksUartCookie, diff --git a/mission/devices/SyrlinksHkHandler.cpp b/mission/devices/SyrlinksHkHandler.cpp index 017bd53c..4ee7ec5c 100644 --- a/mission/devices/SyrlinksHkHandler.cpp +++ b/mission/devices/SyrlinksHkHandler.cpp @@ -9,17 +9,27 @@ SyrlinksHkHandler::SyrlinksHkHandler(object_id_t objectId, object_id_t comIF, Co : DeviceHandlerBase(objectId, comIF, comCookie), rxDataset(this), txDataset(this), + temperatureSet(this), powerSwitch(powerSwitch) { if (comCookie == NULL) { - sif::error << "SyrlinksHkHandler: Invalid com cookie" << std::endl; + sif::warning << "SyrlinksHkHandler: Invalid com cookie" << std::endl; } } SyrlinksHkHandler::~SyrlinksHkHandler() {} void SyrlinksHkHandler::doStartUp() { - if (mode == _MODE_START_UP) { - setMode(MODE_ON); + switch (startupState) { + case StartupState::OFF: { + startupState = StartupState::ENABLE_TEMPERATURE_PROTECTION; + break; + } + case StartupState::DONE: { + setMode(_MODE_TO_ON); + break; + } + default: + break; } } @@ -27,41 +37,41 @@ void SyrlinksHkHandler::doShutDown() { setMode(_MODE_POWER_DOWN); } ReturnValue_t SyrlinksHkHandler::buildNormalDeviceCommand(DeviceCommandId_t* id) { switch (nextCommand) { - case (SYRLINKS::READ_RX_STATUS_REGISTERS): - *id = SYRLINKS::READ_RX_STATUS_REGISTERS; - nextCommand = SYRLINKS::READ_TX_STATUS; + case (syrlinks::READ_RX_STATUS_REGISTERS): + *id = syrlinks::READ_RX_STATUS_REGISTERS; + nextCommand = syrlinks::READ_TX_STATUS; break; - case (SYRLINKS::READ_TX_STATUS): - *id = SYRLINKS::READ_TX_STATUS; - nextCommand = SYRLINKS::READ_TX_WAVEFORM; + case (syrlinks::READ_TX_STATUS): + *id = syrlinks::READ_TX_STATUS; + nextCommand = syrlinks::READ_TX_WAVEFORM; break; - case (SYRLINKS::READ_TX_WAVEFORM): - *id = SYRLINKS::READ_TX_WAVEFORM; - nextCommand = SYRLINKS::READ_TX_AGC_VALUE_HIGH_BYTE; + case (syrlinks::READ_TX_WAVEFORM): + *id = syrlinks::READ_TX_WAVEFORM; + nextCommand = syrlinks::READ_TX_AGC_VALUE_HIGH_BYTE; break; - case (SYRLINKS::READ_TX_AGC_VALUE_HIGH_BYTE): - *id = SYRLINKS::READ_TX_AGC_VALUE_HIGH_BYTE; - nextCommand = SYRLINKS::READ_TX_AGC_VALUE_LOW_BYTE; + case (syrlinks::READ_TX_AGC_VALUE_HIGH_BYTE): + *id = syrlinks::READ_TX_AGC_VALUE_HIGH_BYTE; + nextCommand = syrlinks::READ_TX_AGC_VALUE_LOW_BYTE; break; - case (SYRLINKS::READ_TX_AGC_VALUE_LOW_BYTE): - *id = SYRLINKS::READ_TX_AGC_VALUE_LOW_BYTE; - nextCommand = SYRLINKS::TEMP_POWER_AMPLIFIER_HIGH_BYTE; + case (syrlinks::READ_TX_AGC_VALUE_LOW_BYTE): + *id = syrlinks::READ_TX_AGC_VALUE_LOW_BYTE; + nextCommand = syrlinks::TEMP_POWER_AMPLIFIER_HIGH_BYTE; break; - case (SYRLINKS::TEMP_POWER_AMPLIFIER_HIGH_BYTE): - *id = SYRLINKS::TEMP_POWER_AMPLIFIER_HIGH_BYTE; - nextCommand = SYRLINKS::TEMP_POWER_AMPLIFIER_LOW_BYTE; + case (syrlinks::TEMP_POWER_AMPLIFIER_HIGH_BYTE): + *id = syrlinks::TEMP_POWER_AMPLIFIER_HIGH_BYTE; + nextCommand = syrlinks::TEMP_POWER_AMPLIFIER_LOW_BYTE; break; - case (SYRLINKS::TEMP_POWER_AMPLIFIER_LOW_BYTE): - *id = SYRLINKS::TEMP_POWER_AMPLIFIER_LOW_BYTE; - nextCommand = SYRLINKS::TEMP_BASEBAND_BOARD_HIGH_BYTE; + case (syrlinks::TEMP_POWER_AMPLIFIER_LOW_BYTE): + *id = syrlinks::TEMP_POWER_AMPLIFIER_LOW_BYTE; + nextCommand = syrlinks::TEMP_BASEBAND_BOARD_HIGH_BYTE; break; - case (SYRLINKS::TEMP_BASEBAND_BOARD_HIGH_BYTE): - *id = SYRLINKS::TEMP_BASEBAND_BOARD_HIGH_BYTE; - nextCommand = SYRLINKS::TEMP_BASEBAND_BOARD_LOW_BYTE; + case (syrlinks::TEMP_BASEBAND_BOARD_HIGH_BYTE): + *id = syrlinks::TEMP_BASEBAND_BOARD_HIGH_BYTE; + nextCommand = syrlinks::TEMP_BASEBAND_BOARD_LOW_BYTE; break; - case (SYRLINKS::TEMP_BASEBAND_BOARD_LOW_BYTE): - *id = SYRLINKS::TEMP_BASEBAND_BOARD_LOW_BYTE; - nextCommand = SYRLINKS::READ_RX_STATUS_REGISTERS; + case (syrlinks::TEMP_BASEBAND_BOARD_LOW_BYTE): + *id = syrlinks::TEMP_BASEBAND_BOARD_LOW_BYTE; + nextCommand = syrlinks::READ_RX_STATUS_REGISTERS; break; default: sif::debug << "SyrlinksHkHandler::buildNormalDeviceCommand: rememberCommandId has invalid" @@ -72,111 +82,123 @@ ReturnValue_t SyrlinksHkHandler::buildNormalDeviceCommand(DeviceCommandId_t* id) } ReturnValue_t SyrlinksHkHandler::buildTransitionDeviceCommand(DeviceCommandId_t* id) { - return HasReturnvaluesIF::RETURN_OK; + switch (startupState) { + case StartupState::ENABLE_TEMPERATURE_PROTECTION: { + *id = syrlinks::WRITE_LCL_CONFIG; + return HasReturnvaluesIF::RETURN_OK; + } + default: + break; + } + return NOTHING_TO_SEND; } ReturnValue_t SyrlinksHkHandler::buildCommandFromCommand(DeviceCommandId_t deviceCommand, const uint8_t* commandData, size_t commandDataLen) { switch (deviceCommand) { - case (SYRLINKS::RESET_UNIT): { + case (syrlinks::RESET_UNIT): { resetCommand.copy(reinterpret_cast(commandBuffer), resetCommand.size(), 0); rawPacketLen = resetCommand.size(); rawPacket = commandBuffer; return RETURN_OK; } - case (SYRLINKS::SET_TX_MODE_STANDBY): { + case (syrlinks::SET_TX_MODE_STANDBY): { setTxModeStandby.copy(reinterpret_cast(commandBuffer), setTxModeStandby.size(), 0); rawPacketLen = setTxModeStandby.size(); rawPacket = commandBuffer; return RETURN_OK; } - case (SYRLINKS::SET_TX_MODE_MODULATION): { + case (syrlinks::SET_TX_MODE_MODULATION): { setTxModeModulation.copy(reinterpret_cast(commandBuffer), setTxModeModulation.size(), 0); rawPacketLen = setTxModeModulation.size(); rawPacket = commandBuffer; return RETURN_OK; } - case (SYRLINKS::SET_TX_MODE_CW): { + case (syrlinks::SET_TX_MODE_CW): { setTxModeCw.copy(reinterpret_cast(commandBuffer), setTxModeCw.size(), 0); rawPacketLen = setTxModeCw.size(); rawPacket = commandBuffer; return RETURN_OK; } - case (SYRLINKS::WRITE_LCL_CONFIG): { + case (syrlinks::WRITE_LCL_CONFIG): { writeLclConfig.copy(reinterpret_cast(commandBuffer), writeLclConfig.size(), 0); rawPacketLen = writeLclConfig.size(); rawPacket = commandBuffer; + rememberCommandId = syrlinks::WRITE_LCL_CONFIG; return RETURN_OK; } - case (SYRLINKS::READ_RX_STATUS_REGISTERS): { + case (syrlinks::READ_RX_STATUS_REGISTERS): { readRxStatusRegCommand.copy(reinterpret_cast(commandBuffer), readRxStatusRegCommand.size(), 0); rawPacketLen = readRxStatusRegCommand.size(); rawPacket = commandBuffer; return RETURN_OK; } - case (SYRLINKS::READ_LCL_CONFIG): { + case (syrlinks::READ_LCL_CONFIG): { readLclConfig.copy(reinterpret_cast(commandBuffer), readLclConfig.size(), 0); rawPacketLen = readLclConfig.size(); rawPacket = commandBuffer; - rememberCommandId = SYRLINKS::READ_LCL_CONFIG; + rememberCommandId = syrlinks::READ_LCL_CONFIG; return RETURN_OK; } - case (SYRLINKS::READ_TX_STATUS): { + case (syrlinks::READ_TX_STATUS): { readTxStatus.copy(reinterpret_cast(commandBuffer), readTxStatus.size(), 0); rawPacketLen = readTxStatus.size(); - rememberCommandId = SYRLINKS::READ_TX_STATUS; + rememberCommandId = syrlinks::READ_TX_STATUS; rawPacket = commandBuffer; return RETURN_OK; } - case (SYRLINKS::READ_TX_WAVEFORM): { + case (syrlinks::READ_TX_WAVEFORM): { readTxWaveform.copy(reinterpret_cast(commandBuffer), readTxWaveform.size(), 0); rawPacketLen = readTxWaveform.size(); - rememberCommandId = SYRLINKS::READ_TX_WAVEFORM; + rememberCommandId = syrlinks::READ_TX_WAVEFORM; rawPacket = commandBuffer; return RETURN_OK; } - case (SYRLINKS::READ_TX_AGC_VALUE_HIGH_BYTE): { - readTxAgcValueHighByte.copy(reinterpret_cast(commandBuffer), readTxAgcValueHighByte.size(), 0); + case (syrlinks::READ_TX_AGC_VALUE_HIGH_BYTE): { + readTxAgcValueHighByte.copy(reinterpret_cast(commandBuffer), + readTxAgcValueHighByte.size(), 0); rawPacketLen = readTxAgcValueHighByte.size(); - rememberCommandId = SYRLINKS::READ_TX_AGC_VALUE_HIGH_BYTE; + rememberCommandId = syrlinks::READ_TX_AGC_VALUE_HIGH_BYTE; rawPacket = commandBuffer; return RETURN_OK; } - case (SYRLINKS::READ_TX_AGC_VALUE_LOW_BYTE): { - readTxAgcValueLowByte.copy(reinterpret_cast(commandBuffer), readTxAgcValueLowByte.size(), 0); + case (syrlinks::READ_TX_AGC_VALUE_LOW_BYTE): { + readTxAgcValueLowByte.copy(reinterpret_cast(commandBuffer), + readTxAgcValueLowByte.size(), 0); rawPacketLen = readTxAgcValueLowByte.size(); - rememberCommandId = SYRLINKS::READ_TX_AGC_VALUE_LOW_BYTE; + rememberCommandId = syrlinks::READ_TX_AGC_VALUE_LOW_BYTE; rawPacket = commandBuffer; return RETURN_OK; } - case (SYRLINKS::TEMP_POWER_AMPLIFIER_HIGH_BYTE): - tempPowerAmpBoardHighByte.copy(reinterpret_cast(commandBuffer), tempPowerAmpBoardHighByte.size(), - 0); + case (syrlinks::TEMP_POWER_AMPLIFIER_HIGH_BYTE): + tempPowerAmpBoardHighByte.copy(reinterpret_cast(commandBuffer), + tempPowerAmpBoardHighByte.size(), 0); rawPacketLen = tempPowerAmpBoardHighByte.size(); - rememberCommandId = SYRLINKS::TEMP_POWER_AMPLIFIER_HIGH_BYTE; + rememberCommandId = syrlinks::TEMP_POWER_AMPLIFIER_HIGH_BYTE; rawPacket = commandBuffer; return RETURN_OK; - case (SYRLINKS::TEMP_POWER_AMPLIFIER_LOW_BYTE): - tempPowerAmpBoardLowByte.copy(reinterpret_cast(commandBuffer), tempPowerAmpBoardLowByte.size(), - 0); + case (syrlinks::TEMP_POWER_AMPLIFIER_LOW_BYTE): + tempPowerAmpBoardLowByte.copy(reinterpret_cast(commandBuffer), + tempPowerAmpBoardLowByte.size(), 0); rawPacketLen = tempPowerAmpBoardLowByte.size(); - rememberCommandId = SYRLINKS::TEMP_POWER_AMPLIFIER_LOW_BYTE; + rememberCommandId = syrlinks::TEMP_POWER_AMPLIFIER_LOW_BYTE; rawPacket = commandBuffer; return RETURN_OK; - case (SYRLINKS::TEMP_BASEBAND_BOARD_HIGH_BYTE): - tempBasebandBoardHighByte.copy(reinterpret_cast(commandBuffer), tempBasebandBoardHighByte.size(), - 0); + case (syrlinks::TEMP_BASEBAND_BOARD_HIGH_BYTE): + tempBasebandBoardHighByte.copy(reinterpret_cast(commandBuffer), + tempBasebandBoardHighByte.size(), 0); rawPacketLen = tempBasebandBoardHighByte.size(); - rememberCommandId = SYRLINKS::TEMP_BASEBAND_BOARD_HIGH_BYTE; + rememberCommandId = syrlinks::TEMP_BASEBAND_BOARD_HIGH_BYTE; rawPacket = commandBuffer; return RETURN_OK; - case (SYRLINKS::TEMP_BASEBAND_BOARD_LOW_BYTE): - tempBasebandBoardLowByte.copy(reinterpret_cast(commandBuffer), tempBasebandBoardLowByte.size(), 0); + case (syrlinks::TEMP_BASEBAND_BOARD_LOW_BYTE): + tempBasebandBoardLowByte.copy(reinterpret_cast(commandBuffer), + tempBasebandBoardLowByte.size(), 0); rawPacketLen = tempBasebandBoardLowByte.size(); - rememberCommandId = SYRLINKS::TEMP_BASEBAND_BOARD_LOW_BYTE; + rememberCommandId = syrlinks::TEMP_BASEBAND_BOARD_LOW_BYTE; rawPacket = commandBuffer; return RETURN_OK; default: @@ -186,36 +208,36 @@ ReturnValue_t SyrlinksHkHandler::buildCommandFromCommand(DeviceCommandId_t devic } void SyrlinksHkHandler::fillCommandAndReplyMap() { - this->insertInCommandAndReplyMap(SYRLINKS::RESET_UNIT, 1, nullptr, SYRLINKS::ACK_SIZE, false, - true, SYRLINKS::ACK_REPLY); - this->insertInCommandAndReplyMap(SYRLINKS::SET_TX_MODE_STANDBY, 1, nullptr, SYRLINKS::ACK_SIZE, - false, true, SYRLINKS::ACK_REPLY); - this->insertInCommandAndReplyMap(SYRLINKS::SET_TX_MODE_MODULATION, 1, nullptr, SYRLINKS::ACK_SIZE, - false, true, SYRLINKS::ACK_REPLY); - this->insertInCommandAndReplyMap(SYRLINKS::SET_TX_MODE_CW, 1, nullptr, SYRLINKS::ACK_SIZE, false, - true, SYRLINKS::ACK_REPLY); - this->insertInCommandAndReplyMap(SYRLINKS::WRITE_LCL_CONFIG, 1, nullptr, SYRLINKS::ACK_SIZE, - false, true, SYRLINKS::ACK_REPLY); - this->insertInCommandAndReplyMap(SYRLINKS::READ_LCL_CONFIG, 1, nullptr, - SYRLINKS::READ_ONE_REGISTER_REPLY_SIE); - this->insertInCommandAndReplyMap(SYRLINKS::READ_TX_STATUS, 1, &txDataset, - SYRLINKS::READ_ONE_REGISTER_REPLY_SIE); - this->insertInCommandAndReplyMap(SYRLINKS::READ_TX_WAVEFORM, 1, &txDataset, - SYRLINKS::READ_ONE_REGISTER_REPLY_SIE); - this->insertInCommandAndReplyMap(SYRLINKS::READ_TX_AGC_VALUE_HIGH_BYTE, 1, &txDataset, - SYRLINKS::READ_ONE_REGISTER_REPLY_SIE); - this->insertInCommandAndReplyMap(SYRLINKS::READ_TX_AGC_VALUE_LOW_BYTE, 1, &txDataset, - SYRLINKS::READ_ONE_REGISTER_REPLY_SIE); - this->insertInCommandAndReplyMap(SYRLINKS::TEMP_POWER_AMPLIFIER_HIGH_BYTE, 1, nullptr, - SYRLINKS::READ_ONE_REGISTER_REPLY_SIE); - this->insertInCommandAndReplyMap(SYRLINKS::TEMP_POWER_AMPLIFIER_LOW_BYTE, 1, nullptr, - SYRLINKS::READ_ONE_REGISTER_REPLY_SIE); - this->insertInCommandAndReplyMap(SYRLINKS::TEMP_BASEBAND_BOARD_HIGH_BYTE, 1, nullptr, - SYRLINKS::READ_ONE_REGISTER_REPLY_SIE); - this->insertInCommandAndReplyMap(SYRLINKS::TEMP_BASEBAND_BOARD_LOW_BYTE, 1, nullptr, - SYRLINKS::READ_ONE_REGISTER_REPLY_SIE); - this->insertInCommandAndReplyMap(SYRLINKS::READ_RX_STATUS_REGISTERS, 1, &rxDataset, - SYRLINKS::RX_STATUS_REGISTERS_REPLY_SIZE); + this->insertInCommandAndReplyMap(syrlinks::RESET_UNIT, 1, nullptr, syrlinks::ACK_SIZE, false, + true, syrlinks::ACK_REPLY); + this->insertInCommandAndReplyMap(syrlinks::SET_TX_MODE_STANDBY, 1, nullptr, syrlinks::ACK_SIZE, + false, true, syrlinks::ACK_REPLY); + this->insertInCommandAndReplyMap(syrlinks::SET_TX_MODE_MODULATION, 1, nullptr, syrlinks::ACK_SIZE, + false, true, syrlinks::ACK_REPLY); + this->insertInCommandAndReplyMap(syrlinks::SET_TX_MODE_CW, 1, nullptr, syrlinks::ACK_SIZE, false, + true, syrlinks::ACK_REPLY); + this->insertInCommandAndReplyMap(syrlinks::WRITE_LCL_CONFIG, 1, nullptr, syrlinks::ACK_SIZE, + false, true, syrlinks::ACK_REPLY); + this->insertInCommandAndReplyMap(syrlinks::READ_LCL_CONFIG, 1, nullptr, + syrlinks::READ_ONE_REGISTER_REPLY_SIE); + this->insertInCommandAndReplyMap(syrlinks::READ_TX_STATUS, 1, &txDataset, + syrlinks::READ_ONE_REGISTER_REPLY_SIE); + this->insertInCommandAndReplyMap(syrlinks::READ_TX_WAVEFORM, 1, &txDataset, + syrlinks::READ_ONE_REGISTER_REPLY_SIE); + this->insertInCommandAndReplyMap(syrlinks::READ_TX_AGC_VALUE_HIGH_BYTE, 1, &txDataset, + syrlinks::READ_ONE_REGISTER_REPLY_SIE); + this->insertInCommandAndReplyMap(syrlinks::READ_TX_AGC_VALUE_LOW_BYTE, 1, &txDataset, + syrlinks::READ_ONE_REGISTER_REPLY_SIE); + this->insertInCommandAndReplyMap(syrlinks::TEMP_POWER_AMPLIFIER_HIGH_BYTE, 1, nullptr, + syrlinks::READ_ONE_REGISTER_REPLY_SIE); + this->insertInCommandAndReplyMap(syrlinks::TEMP_POWER_AMPLIFIER_LOW_BYTE, 1, nullptr, + syrlinks::READ_ONE_REGISTER_REPLY_SIE); + this->insertInCommandAndReplyMap(syrlinks::TEMP_BASEBAND_BOARD_HIGH_BYTE, 1, nullptr, + syrlinks::READ_ONE_REGISTER_REPLY_SIE); + this->insertInCommandAndReplyMap(syrlinks::TEMP_BASEBAND_BOARD_LOW_BYTE, 1, nullptr, + syrlinks::READ_ONE_REGISTER_REPLY_SIE); + this->insertInCommandAndReplyMap(syrlinks::READ_RX_STATUS_REGISTERS, 1, &rxDataset, + syrlinks::RX_STATUS_REGISTERS_REPLY_SIZE); } ReturnValue_t SyrlinksHkHandler::scanForReply(const uint8_t* start, size_t remainingSize, @@ -223,25 +245,25 @@ ReturnValue_t SyrlinksHkHandler::scanForReply(const uint8_t* start, size_t remai ReturnValue_t result = RETURN_OK; if (*start != '<') { - sif::error << "SyrlinksHkHandler::scanForReply: Missing start frame character" << std::endl; + sif::warning << "SyrlinksHkHandler::scanForReply: Missing start frame character" << std::endl; return MISSING_START_FRAME_CHARACTER; } switch (*(start + 1)) { case ('A'): - *foundLen = SYRLINKS::ACK_SIZE; - *foundId = SYRLINKS::ACK_REPLY; + *foundLen = syrlinks::ACK_SIZE; + *foundId = syrlinks::ACK_REPLY; break; case ('E'): - *foundLen = SYRLINKS::RX_STATUS_REGISTERS_REPLY_SIZE; - *foundId = SYRLINKS::READ_RX_STATUS_REGISTERS; + *foundLen = syrlinks::RX_STATUS_REGISTERS_REPLY_SIZE; + *foundId = syrlinks::READ_RX_STATUS_REGISTERS; break; case ('R'): *foundId = rememberCommandId; - *foundLen = SYRLINKS::READ_ONE_REGISTER_REPLY_SIE; + *foundLen = syrlinks::READ_ONE_REGISTER_REPLY_SIE; break; default: - sif::error << "SyrlinksHkHandler::scanForReply: Unknown reply identifier" << std::endl; + sif::warning << "SyrlinksHkHandler::scanForReply: Unknown reply identifier" << std::endl; result = IGNORE_REPLY_DATA; break; } @@ -262,124 +284,142 @@ ReturnValue_t SyrlinksHkHandler::interpretDeviceReply(DeviceCommandId_t id, cons ReturnValue_t result; switch (id) { - case (SYRLINKS::ACK_REPLY): - result = verifyReply(packet, SYRLINKS::ACK_SIZE); + case (syrlinks::ACK_REPLY): { + result = verifyReply(packet, syrlinks::ACK_SIZE); if (result != RETURN_OK) { - sif::error << "SyrlinksHkHandler::interpretDeviceReply: Acknowledgment reply has " + sif::warning << "SyrlinksHkHandler::interpretDeviceReply: Acknowledgment reply has " "invalid crc" << std::endl; return CRC_FAILURE; } - result = - parseReplyStatus(reinterpret_cast(packet + SYRLINKS::MESSAGE_HEADER_SIZE)); + result = handleAckReply(packet); if (result != RETURN_OK) { return result; } break; - case (SYRLINKS::READ_RX_STATUS_REGISTERS): - result = verifyReply(packet, SYRLINKS::RX_STATUS_REGISTERS_REPLY_SIZE); + } + case (syrlinks::READ_RX_STATUS_REGISTERS): { + result = verifyReply(packet, syrlinks::RX_STATUS_REGISTERS_REPLY_SIZE); if (result != RETURN_OK) { - sif::error << "SyrlinksHkHandler::interpretDeviceReply: Read rx status registers reply " + sif::warning << "SyrlinksHkHandler::interpretDeviceReply: Read rx status registers reply " << "has invalid crc" << std::endl; return CRC_FAILURE; } parseRxStatusRegistersReply(packet); break; - case (SYRLINKS::READ_LCL_CONFIG): - result = verifyReply(packet, SYRLINKS::READ_ONE_REGISTER_REPLY_SIE); + } + case (syrlinks::READ_LCL_CONFIG): { + result = verifyReply(packet, syrlinks::READ_ONE_REGISTER_REPLY_SIE); if (result != RETURN_OK) { - sif::error << "SyrlinksHkHandler::interpretDeviceReply: Read config lcl reply " + sif::warning << "SyrlinksHkHandler::interpretDeviceReply: Read config lcl reply " << "has invalid crc" << std::endl; return CRC_FAILURE; } parseLclConfigReply(packet); break; - case (SYRLINKS::READ_TX_STATUS): - result = verifyReply(packet, SYRLINKS::READ_ONE_REGISTER_REPLY_SIE); + } + case (syrlinks::READ_TX_STATUS): { + result = verifyReply(packet, syrlinks::READ_ONE_REGISTER_REPLY_SIE); if (result != RETURN_OK) { - sif::error << "SyrlinksHkHandler::interpretDeviceReply: Read tx status reply " + sif::warning << "SyrlinksHkHandler::interpretDeviceReply: Read tx status reply " << "has invalid crc" << std::endl; return CRC_FAILURE; } parseTxStatusReply(packet); break; - case (SYRLINKS::READ_TX_WAVEFORM): - result = verifyReply(packet, SYRLINKS::READ_ONE_REGISTER_REPLY_SIE); + } + case (syrlinks::READ_TX_WAVEFORM): { + result = verifyReply(packet, syrlinks::READ_ONE_REGISTER_REPLY_SIE); if (result != RETURN_OK) { - sif::error << "SyrlinksHkHandler::interpretDeviceReply: Read tx waveform reply " + sif::warning << "SyrlinksHkHandler::interpretDeviceReply: Read tx waveform reply " << "has invalid crc" << std::endl; return CRC_FAILURE; } parseTxWaveformReply(packet); break; - case (SYRLINKS::READ_TX_AGC_VALUE_HIGH_BYTE): - result = verifyReply(packet, SYRLINKS::READ_ONE_REGISTER_REPLY_SIE); + } + case (syrlinks::READ_TX_AGC_VALUE_HIGH_BYTE): { + result = verifyReply(packet, syrlinks::READ_ONE_REGISTER_REPLY_SIE); if (result != RETURN_OK) { - sif::error << "SyrlinksHkHandler::interpretDeviceReply: Read tx AGC high byte reply " + sif::warning << "SyrlinksHkHandler::interpretDeviceReply: Read tx AGC high byte reply " << "has invalid crc" << std::endl; return CRC_FAILURE; } parseAgcHighByte(packet); break; - case (SYRLINKS::READ_TX_AGC_VALUE_LOW_BYTE): - result = verifyReply(packet, SYRLINKS::READ_ONE_REGISTER_REPLY_SIE); + } + case (syrlinks::READ_TX_AGC_VALUE_LOW_BYTE): { + result = verifyReply(packet, syrlinks::READ_ONE_REGISTER_REPLY_SIE); if (result != RETURN_OK) { - sif::error << "SyrlinksHkHandler::interpretDeviceReply: Read tx AGC low byte reply " + sif::warning << "SyrlinksHkHandler::interpretDeviceReply: Read tx AGC low byte reply " << "has invalid crc" << std::endl; return CRC_FAILURE; } parseAgcLowByte(packet); break; - case (SYRLINKS::TEMP_BASEBAND_BOARD_HIGH_BYTE): - result = verifyReply(packet, SYRLINKS::READ_ONE_REGISTER_REPLY_SIE); + } + case (syrlinks::TEMP_BASEBAND_BOARD_HIGH_BYTE): { + result = verifyReply(packet, syrlinks::READ_ONE_REGISTER_REPLY_SIE); if (result != RETURN_OK) { - sif::error << "SyrlinksHkHandler::interpretDeviceReply: Read temperature baseband board " + sif::warning << "SyrlinksHkHandler::interpretDeviceReply: Read temperature baseband board " << "high byte reply has invalid crc" << std::endl; return CRC_FAILURE; } rawTempBasebandBoard = convertHexStringToUint8(reinterpret_cast( - packet + SYRLINKS::MESSAGE_HEADER_SIZE)) + packet + syrlinks::MESSAGE_HEADER_SIZE)) << 8; break; - case (SYRLINKS::TEMP_BASEBAND_BOARD_LOW_BYTE): - result = verifyReply(packet, SYRLINKS::READ_ONE_REGISTER_REPLY_SIE); + } + case (syrlinks::TEMP_BASEBAND_BOARD_LOW_BYTE): { + result = verifyReply(packet, syrlinks::READ_ONE_REGISTER_REPLY_SIE); if (result != RETURN_OK) { - sif::error << "SyrlinksHkHandler::interpretDeviceReply: Read temperature baseband board" + sif::warning << "SyrlinksHkHandler::interpretDeviceReply: Read temperature baseband board" " low byte reply has invalid crc" << std::endl; return CRC_FAILURE; } rawTempBasebandBoard |= convertHexStringToUint8( - reinterpret_cast(packet + SYRLINKS::MESSAGE_HEADER_SIZE)); + reinterpret_cast(packet + syrlinks::MESSAGE_HEADER_SIZE)); tempBasebandBoard = calcTempVal(rawTempBasebandBoard); - sif::info << "Syrlinks temperature baseband board: " << tempBasebandBoard << " °C" - << std::endl; + temperatureSet.temperatureBasebandBoard = tempBasebandBoard; + PoolReadGuard rg(&temperatureSet); + if (debug) { + sif::info << "Syrlinks temperature baseband board: " << tempBasebandBoard << " °C" + << std::endl; + } break; - case (SYRLINKS::TEMP_POWER_AMPLIFIER_HIGH_BYTE): - result = verifyReply(packet, SYRLINKS::READ_ONE_REGISTER_REPLY_SIE); + } + case (syrlinks::TEMP_POWER_AMPLIFIER_HIGH_BYTE): { + result = verifyReply(packet, syrlinks::READ_ONE_REGISTER_REPLY_SIE); if (result != RETURN_OK) { - sif::error << "SyrlinksHkHandler::interpretDeviceReply: Read temperature power amplifier " + sif::warning << "SyrlinksHkHandler::interpretDeviceReply: Read temperature power amplifier " << "board high byte reply has invalid crc" << std::endl; return CRC_FAILURE; } rawTempPowerAmplifier = 0; rawTempPowerAmplifier = convertHexStringToUint8(reinterpret_cast( - packet + SYRLINKS::MESSAGE_HEADER_SIZE)) - << 8; + packet + syrlinks::MESSAGE_HEADER_SIZE)) + << 8; break; - case (SYRLINKS::TEMP_POWER_AMPLIFIER_LOW_BYTE): - result = verifyReply(packet, SYRLINKS::READ_ONE_REGISTER_REPLY_SIE); + } + case (syrlinks::TEMP_POWER_AMPLIFIER_LOW_BYTE): { + result = verifyReply(packet, syrlinks::READ_ONE_REGISTER_REPLY_SIE); if (result != RETURN_OK) { - sif::error << "SyrlinksHkHandler::interpretDeviceReply: Read temperature power amplifier" + sif::warning << "SyrlinksHkHandler::interpretDeviceReply: Read temperature power amplifier" << " board low byte reply has invalid crc" << std::endl; return CRC_FAILURE; } rawTempPowerAmplifier |= convertHexStringToUint8( - reinterpret_cast(packet + SYRLINKS::MESSAGE_HEADER_SIZE)); + reinterpret_cast(packet + syrlinks::MESSAGE_HEADER_SIZE)); tempPowerAmplifier = calcTempVal(rawTempPowerAmplifier); - sif::info << "Syrlinks temperature power amplifier board: " << tempPowerAmplifier << " °C" - << std::endl; + PoolReadGuard rg(&temperatureSet); + temperatureSet.temperaturePowerAmplifier = tempPowerAmplifier; + if (debug) { + sif::info << "Syrlinks temperature power amplifier board: " << tempPowerAmplifier + << " °C" << std::endl; + } break; + } default: { sif::debug << "SyrlinksHkHandler::interpretDeviceReply: Unknown device reply id" << std::endl; return DeviceHandlerIF::UNKNOWN_DEVICE_REPLY; @@ -394,8 +434,10 @@ LocalPoolDataSetBase* SyrlinksHkHandler::getDataSetHandle(sid_t sid) { return &rxDataset; } else if (sid == txDataset.getSid()) { return &txDataset; + } else if (sid == temperatureSet.getSid()) { + return &temperatureSet; } else { - sif::error << "SyrlinksHkHandler::getDataSetHandle: Invalid sid" << std::endl; + sif::warning << "SyrlinksHkHandler::getDataSetHandle: Invalid sid" << std::endl; return nullptr; } } @@ -479,11 +521,11 @@ ReturnValue_t SyrlinksHkHandler::verifyReply(const uint8_t* packet, uint8_t size int result = 0; /* Calculate crc from received packet */ uint16_t crc = - CRC::crc16ccitt(packet, size - SYRLINKS::SIZE_CRC_AND_TERMINATION, CRC_INITIAL_VALUE); + CRC::crc16ccitt(packet, size - syrlinks::SIZE_CRC_AND_TERMINATION, CRC_INITIAL_VALUE); std::string recalculatedCrc = convertUint16ToHexString(crc); const char* startOfCrc = - reinterpret_cast(packet + size - SYRLINKS::SIZE_CRC_AND_TERMINATION); + reinterpret_cast(packet + size - syrlinks::SIZE_CRC_AND_TERMINATION); const char* endOfCrc = reinterpret_cast(packet + size - 1); std::string replyCrc(startOfCrc, endOfCrc); @@ -497,7 +539,7 @@ ReturnValue_t SyrlinksHkHandler::verifyReply(const uint8_t* packet, uint8_t size void SyrlinksHkHandler::parseRxStatusRegistersReply(const uint8_t* packet) { PoolReadGuard readHelper(&rxDataset); - uint16_t offset = SYRLINKS::MESSAGE_HEADER_SIZE; + uint16_t offset = syrlinks::MESSAGE_HEADER_SIZE; rxDataset.rxStatus = convertHexStringToUint8(reinterpret_cast(packet + offset)); offset += 2; rxDataset.rxSensitivity = @@ -531,7 +573,7 @@ void SyrlinksHkHandler::parseRxStatusRegistersReply(const uint8_t* packet) { } void SyrlinksHkHandler::parseLclConfigReply(const uint8_t* packet) { - uint16_t offset = SYRLINKS::MESSAGE_HEADER_SIZE; + uint16_t offset = syrlinks::MESSAGE_HEADER_SIZE; uint8_t lclConfig = convertHexStringToUint8(reinterpret_cast(packet + offset)); sif::info << "SyrlinksHkHandler::parseRxStatusRegistersReply: Lcl config: " << static_cast(lclConfig) << std::endl; @@ -539,7 +581,7 @@ void SyrlinksHkHandler::parseLclConfigReply(const uint8_t* packet) { void SyrlinksHkHandler::parseTxStatusReply(const uint8_t* packet) { PoolReadGuard readHelper(&txDataset); - uint16_t offset = SYRLINKS::MESSAGE_HEADER_SIZE; + uint16_t offset = syrlinks::MESSAGE_HEADER_SIZE; txDataset.txStatus = convertHexStringToUint8(reinterpret_cast(packet + offset)); #if OBSW_VERBOSE_LEVEL >= 1 && OBSW_DEBUG_SYRLINKS == 1 sif::info << "Syrlinks TX Status: 0x" << std::hex << (unsigned int)txDataset.txStatus.value @@ -549,7 +591,7 @@ void SyrlinksHkHandler::parseTxStatusReply(const uint8_t* packet) { void SyrlinksHkHandler::parseTxWaveformReply(const uint8_t* packet) { PoolReadGuard readHelper(&txDataset); - uint16_t offset = SYRLINKS::MESSAGE_HEADER_SIZE; + uint16_t offset = syrlinks::MESSAGE_HEADER_SIZE; txDataset.txWaveform = convertHexStringToUint8(reinterpret_cast(packet + offset)); #if OBSW_VERBOSE_LEVEL >= 1 && OBSW_DEBUG_SYRLINKS == 1 sif::info << "Syrlinks TX Waveform: 0x" << std::hex << (unsigned int)txDataset.txWaveform.value @@ -559,7 +601,7 @@ void SyrlinksHkHandler::parseTxWaveformReply(const uint8_t* packet) { void SyrlinksHkHandler::parseAgcLowByte(const uint8_t* packet) { PoolReadGuard readHelper(&txDataset); - uint16_t offset = SYRLINKS::MESSAGE_HEADER_SIZE; + uint16_t offset = syrlinks::MESSAGE_HEADER_SIZE; txDataset.txAgcValue = agcValueHighByte << 8 | convertHexStringToUint8(reinterpret_cast(packet + offset)); #if OBSW_VERBOSE_LEVEL >= 1 && OBSW_DEBUG_SYRLINKS == 1 @@ -569,7 +611,7 @@ void SyrlinksHkHandler::parseAgcLowByte(const uint8_t* packet) { void SyrlinksHkHandler::parseAgcHighByte(const uint8_t* packet) { PoolReadGuard readHelper(&txDataset); - uint16_t offset = SYRLINKS::MESSAGE_HEADER_SIZE; + uint16_t offset = syrlinks::MESSAGE_HEADER_SIZE; agcValueHighByte = convertHexStringToUint8(reinterpret_cast(packet + offset)); } @@ -579,18 +621,18 @@ uint32_t SyrlinksHkHandler::getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) ReturnValue_t SyrlinksHkHandler::initializeLocalDataPool(localpool::DataPool& localDataPoolMap, LocalDataPoolManager& poolManager) { - localDataPoolMap.emplace(SYRLINKS::RX_STATUS, new PoolEntry({0})); - localDataPoolMap.emplace(SYRLINKS::RX_SENSITIVITY, new PoolEntry({0})); - localDataPoolMap.emplace(SYRLINKS::RX_FREQUENCY_SHIFT, new PoolEntry({0})); - localDataPoolMap.emplace(SYRLINKS::RX_IQ_POWER, new PoolEntry({0})); - localDataPoolMap.emplace(SYRLINKS::RX_AGC_VALUE, new PoolEntry({0})); - localDataPoolMap.emplace(SYRLINKS::RX_DEMOD_EB, new PoolEntry({0})); - localDataPoolMap.emplace(SYRLINKS::RX_DEMOD_N0, new PoolEntry({0})); - localDataPoolMap.emplace(SYRLINKS::RX_DATA_RATE, new PoolEntry({0})); + localDataPoolMap.emplace(syrlinks::RX_STATUS, new PoolEntry({0})); + localDataPoolMap.emplace(syrlinks::RX_SENSITIVITY, new PoolEntry({0})); + localDataPoolMap.emplace(syrlinks::RX_FREQUENCY_SHIFT, new PoolEntry({0})); + localDataPoolMap.emplace(syrlinks::RX_IQ_POWER, new PoolEntry({0})); + localDataPoolMap.emplace(syrlinks::RX_AGC_VALUE, new PoolEntry({0})); + localDataPoolMap.emplace(syrlinks::RX_DEMOD_EB, new PoolEntry({0})); + localDataPoolMap.emplace(syrlinks::RX_DEMOD_N0, new PoolEntry({0})); + localDataPoolMap.emplace(syrlinks::RX_DATA_RATE, new PoolEntry({0})); - localDataPoolMap.emplace(SYRLINKS::TX_STATUS, new PoolEntry({0})); - localDataPoolMap.emplace(SYRLINKS::TX_WAVEFORM, new PoolEntry({0})); - localDataPoolMap.emplace(SYRLINKS::TX_AGC_VALUE, new PoolEntry({0})); + localDataPoolMap.emplace(syrlinks::TX_STATUS, new PoolEntry({0})); + localDataPoolMap.emplace(syrlinks::TX_WAVEFORM, new PoolEntry({0})); + localDataPoolMap.emplace(syrlinks::TX_AGC_VALUE, new PoolEntry({0})); return HasReturnvaluesIF::RETURN_OK; } @@ -598,3 +640,14 @@ ReturnValue_t SyrlinksHkHandler::initializeLocalDataPool(localpool::DataPool& lo void SyrlinksHkHandler::setModeNormal() { mode = MODE_NORMAL; } float SyrlinksHkHandler::calcTempVal(uint16_t raw) { return 0.126984 * raw - 67.87; } + +ReturnValue_t SyrlinksHkHandler::handleAckReply(const uint8_t* packet) { + ReturnValue_t result = + parseReplyStatus(reinterpret_cast(packet + syrlinks::MESSAGE_HEADER_SIZE)); + if (rememberCommandId == syrlinks::WRITE_LCL_CONFIG and result != RETURN_OK) { + startupState = StartupState::OFF; + } else if (rememberCommandId == syrlinks::WRITE_LCL_CONFIG and result == RETURN_OK) { + startupState = StartupState::DONE; + } + return result; +} diff --git a/mission/devices/SyrlinksHkHandler.h b/mission/devices/SyrlinksHkHandler.h index 9b9e05c2..b330f151 100644 --- a/mission/devices/SyrlinksHkHandler.h +++ b/mission/devices/SyrlinksHkHandler.h @@ -80,10 +80,11 @@ class SyrlinksHkHandler : public DeviceHandlerBase { * In some cases it is not possible to extract from the received reply the information about * the associated command. This variable is thus used to remember the command id. */ - DeviceCommandId_t rememberCommandId = SYRLINKS::NONE; + DeviceCommandId_t rememberCommandId = syrlinks::NONE; - SYRLINKS::RxDataset rxDataset; - SYRLINKS::TxDataset txDataset; + syrlinks::RxDataset rxDataset; + syrlinks::TxDataset txDataset; + syrlinks::TemperatureSet temperatureSet; const power::Switch_t powerSwitch = power::NO_SWITCH; @@ -93,13 +94,23 @@ class SyrlinksHkHandler : public DeviceHandlerBase { float tempPowerAmplifier = 0; float tempBasebandBoard = 0; - uint8_t commandBuffer[SYRLINKS::MAX_COMMAND_SIZE]; + uint8_t commandBuffer[syrlinks::MAX_COMMAND_SIZE]; + + enum class StartupState { + OFF, + ENABLE_TEMPERATURE_PROTECTION, + DONE + }; + + StartupState startupState = StartupState::OFF; + + bool debug = false; /** * This object is used to store the id of the next command to execute. This controls the * read out of multiple registers which can not be fetched with one single command. */ - DeviceCommandId_t nextCommand = SYRLINKS::READ_RX_STATUS_REGISTERS; + DeviceCommandId_t nextCommand = syrlinks::READ_RX_STATUS_REGISTERS; /** * @brief This function converts an uint16_t into its hexadecimal string representation. @@ -192,6 +203,8 @@ class SyrlinksHkHandler : public DeviceHandlerBase { * @brief Calculates temperature in degree celcius form raw value */ float calcTempVal(uint16_t); + + ReturnValue_t handleAckReply(const uint8_t* packet); }; #endif /* MISSION_DEVICES_SYRLINKSHKHANDLER_H_ */ diff --git a/mission/devices/devicedefinitions/SyrlinksDefinitions.h b/mission/devices/devicedefinitions/SyrlinksDefinitions.h index affebff7..e8973621 100644 --- a/mission/devices/devicedefinitions/SyrlinksDefinitions.h +++ b/mission/devices/devicedefinitions/SyrlinksDefinitions.h @@ -1,7 +1,7 @@ #ifndef MISSION_DEVICES_DEVICEDEFINITIONS_SYRLINKSDEFINITIONS_H_ #define MISSION_DEVICES_DEVICEDEFINITIONS_SYRLINKSDEFINITIONS_H_ -namespace SYRLINKS { +namespace syrlinks { static const DeviceCommandId_t NONE = 0; static const DeviceCommandId_t RESET_UNIT = 1; @@ -36,6 +36,7 @@ static const uint8_t READ_ONE_REGISTER_REPLY_SIE = 13; static const uint8_t RX_DATASET_ID = 0x1; static const uint8_t TX_DATASET_ID = 0x2; +static const uint8_t TEMPERATURE_SET_ID = 0x3; static const size_t MAX_REPLY_SIZE = RX_STATUS_REGISTERS_REPLY_SIZE; static const size_t MAX_COMMAND_SIZE = 15; @@ -44,6 +45,7 @@ static const size_t CRC_FIELD_SIZE = 4; static const uint8_t RX_DATASET_SIZE = 8; static const uint8_t TX_DATASET_SIZE = 3; +static const uint8_t TEMPERATURE_SET_SIZE = 3; enum SyrlinksPoolIds : lp_id_t { RX_STATUS, @@ -60,6 +62,8 @@ enum SyrlinksPoolIds : lp_id_t { TX_WAVEFORM, TX_PCM_INDEX, TX_AGC_VALUE, + TEMP_POWER_AMPLIFIER, + TEMP_BASEBAND_BOARD }; class RxDataset : public StaticLocalDataSet { @@ -89,6 +93,18 @@ class TxDataset : public StaticLocalDataSet { lp_var_t txAgcValue = lp_var_t(sid.objectId, TX_AGC_VALUE, this); }; -} // namespace SYRLINKS +class TemperatureSet : public StaticLocalDataSet { + public: + TemperatureSet(HasLocalDataPoolIF* owner) : StaticLocalDataSet(owner, TEMPERATURE_SET_ID) {} + + TemperatureSet(object_id_t objectId) : StaticLocalDataSet(sid_t(objectId, TEMPERATURE_SET_ID)) {} + + lp_var_t temperaturePowerAmplifier = + lp_var_t(sid.objectId, TEMP_POWER_AMPLIFIER, this); + lp_var_t temperatureBasebandBoard = + lp_var_t(sid.objectId, TEMP_BASEBAND_BOARD, this); +}; + +} // namespace syrlinks #endif /* MISSION_DEVICES_DEVICEDEFINITIONS_SYRLINKSDEFINITIONS_H_ */ From ca1e8f3dc1fffca3802732fea7131dd68b3ea302 Mon Sep 17 00:00:00 2001 From: Jakob Meier Date: Fri, 1 Apr 2022 09:20:35 +0200 Subject: [PATCH 02/19] syrlinks fault flag --- bsp_q7s/boardconfig/busConf.h | 1 + mission/devices/SyrlinksFaultFlagMonitoring.cpp | 16 ++++++++++++++++ mission/devices/SyrlinksFaultFlagMonitoring.h | 17 +++++++++++++++++ mission/devices/SyrlinksHkHandler.cpp | 9 +++++++-- mission/devices/SyrlinksHkHandler.h | 7 ++++++- 5 files changed, 47 insertions(+), 3 deletions(-) create mode 100644 mission/devices/SyrlinksFaultFlagMonitoring.cpp create mode 100644 mission/devices/SyrlinksFaultFlagMonitoring.h diff --git a/bsp_q7s/boardconfig/busConf.h b/bsp_q7s/boardconfig/busConf.h index 5c52693c..bc6efd7a 100644 --- a/bsp_q7s/boardconfig/busConf.h +++ b/bsp_q7s/boardconfig/busConf.h @@ -84,6 +84,7 @@ static constexpr char RS485_EN_TX_DATA[] = "tx_data_enable_ltc2872"; static constexpr char RS485_EN_RX_CLOCK[] = "rx_clock_enable_ltc2872"; static constexpr char RS485_EN_RX_DATA[] = "rx_data_enable_ltc2872"; static constexpr char PDEC_RESET[] = "pdec_reset"; +static constexpr char SYRLINKS_FAULT[] = "syrlinks_fault"; static constexpr char PL_PCDU_ENABLE_VBAT0[] = "enable_plpcdu_vbat0"; static constexpr char PL_PCDU_ENABLE_VBAT1[] = "enable_plpcdu_vbat1"; diff --git a/mission/devices/SyrlinksFaultFlagMonitoring.cpp b/mission/devices/SyrlinksFaultFlagMonitoring.cpp new file mode 100644 index 00000000..f999a47c --- /dev/null +++ b/mission/devices/SyrlinksFaultFlagMonitoring.cpp @@ -0,0 +1,16 @@ +/* + * SyrlinksFaultFlagMonitoring.cpp + * + * Created on: 01.04.2022 + * Author: jakob + */ + +#include "SyrlinksFaultFlagMonitoring.h" + +SyrlinksFaultFlagMonitoring::SyrlinksFaultFlagMonitoring() { + // TODO Auto-generated constructor stub +} + +SyrlinksFaultFlagMonitoring::~SyrlinksFaultFlagMonitoring() { + // TODO Auto-generated destructor stub +} diff --git a/mission/devices/SyrlinksFaultFlagMonitoring.h b/mission/devices/SyrlinksFaultFlagMonitoring.h new file mode 100644 index 00000000..09869c44 --- /dev/null +++ b/mission/devices/SyrlinksFaultFlagMonitoring.h @@ -0,0 +1,17 @@ +/* + * SyrlinksFaultFlagMonitoring.h + * + * Created on: 01.04.2022 + * Author: jakob + */ + +#ifndef MISSION_DEVICES_SYRLINKSFAULTFLAGMONITORING_H_ +#define MISSION_DEVICES_SYRLINKSFAULTFLAGMONITORING_H_ + +class SyrlinksFaultFlagMonitoring : public ExecutableObjectIF { + public: + SyrlinksFaultFlagMonitoring(); + virtual ~SyrlinksFaultFlagMonitoring(); +}; + +#endif /* MISSION_DEVICES_SYRLINKSFAULTFLAGMONITORING_H_ */ diff --git a/mission/devices/SyrlinksHkHandler.cpp b/mission/devices/SyrlinksHkHandler.cpp index 4ee7ec5c..e8680a74 100644 --- a/mission/devices/SyrlinksHkHandler.cpp +++ b/mission/devices/SyrlinksHkHandler.cpp @@ -5,12 +5,13 @@ #include "OBSWConfig.h" SyrlinksHkHandler::SyrlinksHkHandler(object_id_t objectId, object_id_t comIF, CookieIF* comCookie, - power::Switch_t powerSwitch) + power::Switch_t powerSwitch, Gpio fault) : DeviceHandlerBase(objectId, comIF, comCookie), rxDataset(this), txDataset(this), temperatureSet(this), - powerSwitch(powerSwitch) { + powerSwitch(powerSwitch), + fault(fault){ if (comCookie == NULL) { sif::warning << "SyrlinksHkHandler: Invalid com cookie" << std::endl; } @@ -442,6 +443,10 @@ LocalPoolDataSetBase* SyrlinksHkHandler::getDataSetHandle(sid_t sid) { } } +void SyrlinksHkHandler::performOperationHook() { + +} + std::string SyrlinksHkHandler::convertUint16ToHexString(uint16_t intValue) { std::stringstream stream; stream << std::setfill('0') << std::setw(4) << std::hex << std::uppercase << intValue; diff --git a/mission/devices/SyrlinksHkHandler.h b/mission/devices/SyrlinksHkHandler.h index b330f151..9b8ac2c9 100644 --- a/mission/devices/SyrlinksHkHandler.h +++ b/mission/devices/SyrlinksHkHandler.h @@ -4,6 +4,8 @@ #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 /** @@ -17,7 +19,7 @@ class SyrlinksHkHandler : public DeviceHandlerBase { public: SyrlinksHkHandler(object_id_t objectId, object_id_t comIF, CookieIF* comCookie, - power::Switch_t powerSwitch); + power::Switch_t powerSwitch, Gpio fault); virtual ~SyrlinksHkHandler(); /** @@ -42,6 +44,7 @@ class SyrlinksHkHandler : public DeviceHandlerBase { ReturnValue_t initializeLocalDataPool(localpool::DataPool& localDataPoolMap, LocalDataPoolManager& poolManager) override; LocalPoolDataSetBase* getDataSetHandle(sid_t sid) override; + void performOperationHook(); private: static const uint8_t INTERFACE_ID = CLASS_ID::SYRLINKS_HANDLER; @@ -88,6 +91,8 @@ class SyrlinksHkHandler : public DeviceHandlerBase { const power::Switch_t powerSwitch = power::NO_SWITCH; + Gpio fault; + uint8_t agcValueHighByte = 0; uint16_t rawTempPowerAmplifier = 0; uint16_t rawTempBasebandBoard = 0; From 07c242282d933c7f78dd7bc65bf086f07737cdc7 Mon Sep 17 00:00:00 2001 From: Jakob Meier Date: Fri, 1 Apr 2022 14:15:42 +0200 Subject: [PATCH 03/19] syrlinks test --- linux/obc/AxiPtmeConfig.h | 5 +- mission/devices/SyrlinksHkHandler.cpp | 61 ++++++++++++++----- mission/devices/SyrlinksHkHandler.h | 10 +-- .../devicedefinitions/SyrlinksDefinitions.h | 4 ++ mission/tmtc/CCSDSHandler.h | 4 +- tmtc | 2 +- 6 files changed, 62 insertions(+), 24 deletions(-) diff --git a/linux/obc/AxiPtmeConfig.h b/linux/obc/AxiPtmeConfig.h index c86bb429..9a048308 100644 --- a/linux/obc/AxiPtmeConfig.h +++ b/linux/obc/AxiPtmeConfig.h @@ -37,6 +37,8 @@ class AxiPtmeConfig : public SystemObject { * The default implementation of the PTME generates a clock where the high level is * only one bit clock period long. This might be too short to match the setup and hold * times of the S-and transceiver. + * Default: Enables TX clock manipulator + * */ ReturnValue_t enableTxclockManipulator(); ReturnValue_t disableTxclockManipulator(); @@ -47,6 +49,7 @@ class AxiPtmeConfig : public SystemObject { * Enable inversion will update data on falling edge (not the configuration required by the * syrlinks) * Disable clock inversion. Data updated on rising edge. + * Default: Inversion is disabled */ ReturnValue_t enableTxclockInversion(); ReturnValue_t disableTxclockInversion(); @@ -54,7 +57,7 @@ class AxiPtmeConfig : public SystemObject { private: // Address of register storing the bitrate configuration parameter static const uint32_t CADU_BITRATE_REG = 0x0; - // Address to register storing common configuration parameters + // Address of register storing common configuration parameters static const uint32_t COMMON_CONFIG_REG = 0x4; static const uint32_t ADRESS_DIVIDER = 4; diff --git a/mission/devices/SyrlinksHkHandler.cpp b/mission/devices/SyrlinksHkHandler.cpp index e8680a74..31549af5 100644 --- a/mission/devices/SyrlinksHkHandler.cpp +++ b/mission/devices/SyrlinksHkHandler.cpp @@ -5,13 +5,12 @@ #include "OBSWConfig.h" SyrlinksHkHandler::SyrlinksHkHandler(object_id_t objectId, object_id_t comIF, CookieIF* comCookie, - power::Switch_t powerSwitch, Gpio fault) + power::Switch_t powerSwitch) : DeviceHandlerBase(objectId, comIF, comCookie), rxDataset(this), txDataset(this), temperatureSet(this), - powerSwitch(powerSwitch), - fault(fault){ + powerSwitch(powerSwitch) { if (comCookie == NULL) { sif::warning << "SyrlinksHkHandler: Invalid com cookie" << std::endl; } @@ -20,18 +19,19 @@ SyrlinksHkHandler::SyrlinksHkHandler(object_id_t objectId, object_id_t comIF, Co SyrlinksHkHandler::~SyrlinksHkHandler() {} void SyrlinksHkHandler::doStartUp() { - switch (startupState) { - case StartupState::OFF: { - startupState = StartupState::ENABLE_TEMPERATURE_PROTECTION; - break; - } - case StartupState::DONE: { - setMode(_MODE_TO_ON); - break; - } - default: - break; - } +// switch (startupState) { +// case StartupState::OFF: { +// startupState = StartupState::ENABLE_TEMPERATURE_PROTECTION; +// break; +// } +// case StartupState::DONE: { +// setMode(_MODE_TO_ON); +// break; +// } +// default: +// break; +// } + setMode(_MODE_TO_ON); } void SyrlinksHkHandler::doShutDown() { setMode(_MODE_POWER_DOWN); } @@ -202,6 +202,27 @@ ReturnValue_t SyrlinksHkHandler::buildCommandFromCommand(DeviceCommandId_t devic rememberCommandId = syrlinks::TEMP_BASEBAND_BOARD_LOW_BYTE; rawPacket = commandBuffer; return RETURN_OK; + case (syrlinks::SET_WAVEFORM_OQPSK): + setWaveformOQPSK.copy(reinterpret_cast(commandBuffer), + setWaveformOQPSK.size(), 0); + rawPacketLen = setWaveformOQPSK.size(); + rememberCommandId = syrlinks::SET_WAVEFORM_OQPSK; + rawPacket = commandBuffer; + return RETURN_OK; + case (syrlinks::SET_WAVEFORM_BPSK): + setWaveformBPSK.copy(reinterpret_cast(commandBuffer), + setWaveformBPSK.size(), 0); + rawPacketLen = setWaveformBPSK.size(); + rememberCommandId = syrlinks::SET_WAVEFORM_BPSK; + rawPacket = commandBuffer; + return RETURN_OK; + case (syrlinks::SET_SECOND_CONFIG): + setSecondConfiguration.copy(reinterpret_cast(commandBuffer), + setSecondConfiguration.size(), 0); + rawPacketLen = setSecondConfiguration.size(); + rememberCommandId = syrlinks::SET_SECOND_CONFIG; + rawPacket = commandBuffer; + return RETURN_OK; default: return DeviceHandlerIF::COMMAND_NOT_IMPLEMENTED; } @@ -219,6 +240,12 @@ 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::SET_WAVEFORM_OQPSK, 1, nullptr, syrlinks::ACK_SIZE, + false, true, syrlinks::ACK_REPLY); + this->insertInCommandAndReplyMap(syrlinks::SET_WAVEFORM_BPSK, 1, nullptr, syrlinks::ACK_SIZE, + false, true, syrlinks::ACK_REPLY); + this->insertInCommandAndReplyMap(syrlinks::SET_SECOND_CONFIG, 1, nullptr, syrlinks::ACK_SIZE, + false, true, syrlinks::ACK_REPLY); this->insertInCommandAndReplyMap(syrlinks::READ_LCL_CONFIG, 1, nullptr, syrlinks::READ_ONE_REGISTER_REPLY_SIE); this->insertInCommandAndReplyMap(syrlinks::READ_TX_STATUS, 1, &txDataset, @@ -622,7 +649,7 @@ void SyrlinksHkHandler::parseAgcHighByte(const uint8_t* packet) { void SyrlinksHkHandler::setNormalDatapoolEntriesInvalid() {} -uint32_t SyrlinksHkHandler::getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) { return 500; } +uint32_t SyrlinksHkHandler::getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) { return 5000; } ReturnValue_t SyrlinksHkHandler::initializeLocalDataPool(localpool::DataPool& localDataPoolMap, LocalDataPoolManager& poolManager) { @@ -638,6 +665,8 @@ ReturnValue_t SyrlinksHkHandler::initializeLocalDataPool(localpool::DataPool& lo localDataPoolMap.emplace(syrlinks::TX_STATUS, new PoolEntry({0})); localDataPoolMap.emplace(syrlinks::TX_WAVEFORM, new PoolEntry({0})); localDataPoolMap.emplace(syrlinks::TX_AGC_VALUE, new PoolEntry({0})); + localDataPoolMap.emplace(syrlinks::TEMP_BASEBAND_BOARD, new PoolEntry({0})); + localDataPoolMap.emplace(syrlinks::TEMP_POWER_AMPLIFIER, new PoolEntry({0})); return HasReturnvaluesIF::RETURN_OK; } diff --git a/mission/devices/SyrlinksHkHandler.h b/mission/devices/SyrlinksHkHandler.h index 9b8ac2c9..739db450 100644 --- a/mission/devices/SyrlinksHkHandler.h +++ b/mission/devices/SyrlinksHkHandler.h @@ -19,7 +19,7 @@ class SyrlinksHkHandler : public DeviceHandlerBase { public: SyrlinksHkHandler(object_id_t objectId, object_id_t comIF, CookieIF* comCookie, - power::Switch_t powerSwitch, Gpio fault); + power::Switch_t powerSwitch); virtual ~SyrlinksHkHandler(); /** @@ -67,8 +67,12 @@ class SyrlinksHkHandler : public DeviceHandlerBase { std::string setTxModeStandby = ""; /** W - write, 04 - 4 bytes in data field, 01 - value, 40 register to write value */ std::string setTxModeModulation = ""; +// std::string setSecondConfiguration = ""; + std::string setSecondConfiguration = ""; std::string setTxModeCw = ""; std::string writeLclConfig = ""; + std::string setWaveformOQPSK = ""; + std::string setWaveformBPSK = ""; std::string readTxStatus = ""; std::string readTxWaveform = ""; std::string readTxAgcValueHighByte = ""; @@ -91,8 +95,6 @@ class SyrlinksHkHandler : public DeviceHandlerBase { const power::Switch_t powerSwitch = power::NO_SWITCH; - Gpio fault; - uint8_t agcValueHighByte = 0; uint16_t rawTempPowerAmplifier = 0; uint16_t rawTempBasebandBoard = 0; @@ -109,7 +111,7 @@ class SyrlinksHkHandler : public DeviceHandlerBase { StartupState startupState = StartupState::OFF; - bool debug = false; + bool debug = true; /** * This object is used to store the id of the next command to execute. This controls the diff --git a/mission/devices/devicedefinitions/SyrlinksDefinitions.h b/mission/devices/devicedefinitions/SyrlinksDefinitions.h index e8973621..bf964063 100644 --- a/mission/devices/devicedefinitions/SyrlinksDefinitions.h +++ b/mission/devices/devicedefinitions/SyrlinksDefinitions.h @@ -24,6 +24,10 @@ static const DeviceCommandId_t TEMP_POWER_AMPLIFIER_HIGH_BYTE = 13; static const DeviceCommandId_t TEMP_POWER_AMPLIFIER_LOW_BYTE = 14; static const DeviceCommandId_t TEMP_BASEBAND_BOARD_HIGH_BYTE = 15; static const DeviceCommandId_t TEMP_BASEBAND_BOARD_LOW_BYTE = 16; +static const DeviceCommandId_t SET_WAVEFORM_OQPSK = 17; +static const DeviceCommandId_t SET_WAVEFORM_BPSK = 18; +static const DeviceCommandId_t SET_SECOND_CONFIG = 19; +static const DeviceCommandId_t ENABLE_DEBUG = 20; /** Size of a simple transmission success response */ static const uint8_t ACK_SIZE = 12; diff --git a/mission/tmtc/CCSDSHandler.h b/mission/tmtc/CCSDSHandler.h index a916361b..1c4fde09 100644 --- a/mission/tmtc/CCSDSHandler.h +++ b/mission/tmtc/CCSDSHandler.h @@ -91,9 +91,9 @@ class CCSDSHandler : public SystemObject, static const ActionId_t ARBITRARY_RATE = 4; static const ActionId_t ENABLE_TX_CLK_MANIPULATOR = 5; static const ActionId_t DISABLE_TX_CLK_MANIPULATOR = 6; - // Will update data with respect to tx clock signal of cadu bitsream on rising edge + // Will update data with respect to tx clock signal of cadu bitstream on rising edge static const ActionId_t UPDATE_ON_RISING_EDGE = 7; - // Will update data with respect to tx clock signal of cadu bitsream on falling edge + // Will update data with respect to tx clock signal of cadu bitstream on falling edge static const ActionId_t UPDATE_ON_FALLING_EDGE = 8; // Syrlinks supports two bitrates (200 kbps and 1000 kbps) diff --git a/tmtc b/tmtc index 5ac8912d..811aedce 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 5ac8912dd2b47f01f66093187f15a9f9824ffd66 +Subproject commit 811aedce9762daa87e268b8832f23b0d28f8a714 From ec880d4232dc2e55bfe062234f67f7a4bfdcba65 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 4 Apr 2022 13:40:45 +0200 Subject: [PATCH 04/19] apply auto-formatter --- bsp_q7s/core/ObjectFactory.cpp | 6 +- .../PlocSupervisorDefinitions.h | 2 +- linux/devices/ploc/PlocMPSoCHandler.cpp | 131 +++++++++--------- linux/devices/ploc/PlocSupervisorHandler.cpp | 21 ++- linux/devices/ploc/PlocUpdater.cpp | 23 ++- .../devices/startracker/StarTrackerHandler.h | 2 +- mission/devices/RadiationSensorHandler.cpp | 24 ++-- mission/devices/SyrlinksHkHandler.cpp | 31 +++-- mission/devices/SyrlinksHkHandler.h | 3 +- mission/system/AcsBoardAssembly.cpp | 30 ++-- 10 files changed, 133 insertions(+), 140 deletions(-) diff --git a/bsp_q7s/core/ObjectFactory.cpp b/bsp_q7s/core/ObjectFactory.cpp index 123ef60e..2d28a095 100644 --- a/bsp_q7s/core/ObjectFactory.cpp +++ b/bsp_q7s/core/ObjectFactory.cpp @@ -662,9 +662,9 @@ void ObjectFactory::createPayloadComponents(LinuxLibgpioIF* gpioComIF) { auto supvGpioCookie = new GpioCookie; supvGpioCookie->addGpio(gpioIds::ENABLE_SUPV_UART, gpioConfigSupv); gpioComIF->addGpios(supvGpioCookie); - auto supervisorCookie = new UartCookie( - objects::PLOC_SUPERVISOR_HANDLER, q7s::UART_PLOC_SUPERVSIOR_DEV, UartModes::NON_CANONICAL, - uart::PLOC_SUPERVISOR_BAUD, supv::MAX_PACKET_SIZE * 20); + auto supervisorCookie = new UartCookie(objects::PLOC_SUPERVISOR_HANDLER, + q7s::UART_PLOC_SUPERVSIOR_DEV, UartModes::NON_CANONICAL, + uart::PLOC_SUPERVISOR_BAUD, supv::MAX_PACKET_SIZE * 20); supervisorCookie->setNoFixedSizeReply(); new PlocSupervisorHandler(objects::PLOC_SUPERVISOR_HANDLER, objects::UART_COM_IF, supervisorCookie, Gpio(gpioIds::ENABLE_SUPV_UART, gpioComIF), diff --git a/linux/devices/devicedefinitions/PlocSupervisorDefinitions.h b/linux/devices/devicedefinitions/PlocSupervisorDefinitions.h index 96e72f86..58166e98 100644 --- a/linux/devices/devicedefinitions/PlocSupervisorDefinitions.h +++ b/linux/devices/devicedefinitions/PlocSupervisorDefinitions.h @@ -1541,6 +1541,6 @@ class LatchupStatusReport : public StaticLocalDataSet { lp_var_t isSet = lp_var_t(sid.objectId, PoolIds::LATCHUP_RPT_TIME_IS_SET, this); }; -} // namespace PLOC_SPV +} // namespace supv #endif /* MISSION_DEVICES_DEVICEDEFINITIONS_PLOCSVPDEFINITIONS_H_ */ diff --git a/linux/devices/ploc/PlocMPSoCHandler.cpp b/linux/devices/ploc/PlocMPSoCHandler.cpp index d6777afd..13fa9ed7 100644 --- a/linux/devices/ploc/PlocMPSoCHandler.cpp +++ b/linux/devices/ploc/PlocMPSoCHandler.cpp @@ -1,9 +1,9 @@ #include "PlocMPSoCHandler.h" -#include "linux/devices/devicedefinitions/PlocSupervisorDefinitions.h" #include "OBSWConfig.h" #include "fsfw/datapool/PoolReadGuard.h" #include "fsfw/globalfunctions/CRC.h" +#include "linux/devices/devicedefinitions/PlocSupervisorDefinitions.h" PlocMPSoCHandler::PlocMPSoCHandler(object_id_t objectId, object_id_t uartComIFid, CookieIF* comCookie, PlocMPSoCHelper* plocMPSoCHelper, @@ -87,8 +87,8 @@ void PlocMPSoCHandler::performOperationHook() { } } CommandMessage message; - for (ReturnValue_t result = commandActionHelperQueue->receiveMessage(&message); result == RETURN_OK; - result = commandActionHelperQueue->receiveMessage(&message)) { + for (ReturnValue_t result = commandActionHelperQueue->receiveMessage(&message); + result == RETURN_OK; result = commandActionHelperQueue->receiveMessage(&message)) { result = commandActionHelper.handleReply(&message); if (result == RETURN_OK) { continue; @@ -133,31 +133,31 @@ ReturnValue_t PlocMPSoCHandler::executeAction(ActionId_t actionId, MessageQueueI } void PlocMPSoCHandler::doStartUp() { - switch(powerState) { - case PowerState::OFF: + switch (powerState) { + case PowerState::OFF: commandActionHelper.commandAction(supervisorHandler, supv::START_MPSOC); powerState = PowerState::BOOTING; break; - case PowerState::ON: + case PowerState::ON: setMode(_MODE_TO_ON); uartIsolatorSwitch.pullHigh(); break; - default: + default: break; } } void PlocMPSoCHandler::doShutDown() { - switch(powerState) { - case PowerState::ON: + switch (powerState) { + case PowerState::ON: uartIsolatorSwitch.pullLow(); commandActionHelper.commandAction(supervisorHandler, supv::SHUTDOWN_MPSOC); powerState = PowerState::SHUTDOWN; break; - case PowerState::OFF: + case PowerState::OFF: setMode(_MODE_POWER_DOWN); break; - default: + default: break; } } @@ -703,64 +703,57 @@ size_t PlocMPSoCHandler::getNextReplyLength(DeviceCommandId_t commandId) { return replyLen; } -MessageQueueIF* PlocMPSoCHandler::getCommandQueuePtr() { - return commandActionHelperQueue; -} +MessageQueueIF* PlocMPSoCHandler::getCommandQueuePtr() { return commandActionHelperQueue; } -void PlocMPSoCHandler::stepSuccessfulReceived(ActionId_t actionId, uint8_t step) { - return; -} +void PlocMPSoCHandler::stepSuccessfulReceived(ActionId_t actionId, uint8_t step) { return; } void PlocMPSoCHandler::stepFailedReceived(ActionId_t actionId, uint8_t step, - ReturnValue_t returnCode) { - switch (actionId) { - case supv::START_MPSOC: - sif::warning << "PlocMPSoCHandler::stepFailedReceived: Failed to start MPSoC" - << std::endl; - powerState = PowerState::OFF; - break; - case supv::SHUTDOWN_MPSOC: - triggerEvent(MPSOC_SHUTDOWN_FAILED); - sif::warning << "PlocMPSoCHandler::stepFailedReceived: Failed to shutdown MPSoC" - << std::endl; - // TODO: Setting state to on or off here? - powerState = PowerState::ON; - break; - default: - sif::debug - << "PlocMPSoCHandler::stepFailedReceived: Received unexpected action reply" - << std::endl; - break; - } + ReturnValue_t returnCode) { + switch (actionId) { + case supv::START_MPSOC: + sif::warning << "PlocMPSoCHandler::stepFailedReceived: Failed to start MPSoC" << std::endl; + powerState = PowerState::OFF; + break; + case supv::SHUTDOWN_MPSOC: + triggerEvent(MPSOC_SHUTDOWN_FAILED); + sif::warning << "PlocMPSoCHandler::stepFailedReceived: Failed to shutdown MPSoC" << std::endl; + // TODO: Setting state to on or off here? + powerState = PowerState::ON; + break; + default: + sif::debug << "PlocMPSoCHandler::stepFailedReceived: Received unexpected action reply" + << std::endl; + break; + } } void PlocMPSoCHandler::dataReceived(ActionId_t actionId, const uint8_t* data, uint32_t size) { - return; + return; } void PlocMPSoCHandler::completionSuccessfulReceived(ActionId_t actionId) { - if (actionId != supv::EXE_REPORT) { - sif::debug << "PlocMPSoCHandler::completionSuccessfulReceived: Did not expect this action " - << "ID" << std::endl; - return; - } - switch(powerState) { + if (actionId != supv::EXE_REPORT) { + sif::debug << "PlocMPSoCHandler::completionSuccessfulReceived: Did not expect this action " + << "ID" << std::endl; + return; + } + switch (powerState) { case PowerState::BOOTING: { - powerState = PowerState::ON; - break; + powerState = PowerState::ON; + break; } case PowerState::SHUTDOWN: { - powerState = PowerState::OFF; - break; + powerState = PowerState::OFF; + break; } default: { break; } - } + } } void PlocMPSoCHandler::completionFailedReceived(ActionId_t actionId, ReturnValue_t returnCode) { - handleActionCommandFailure(actionId); + handleActionCommandFailure(actionId); } void PlocMPSoCHandler::handleDeviceTM(const uint8_t* data, size_t dataSize, @@ -862,27 +855,27 @@ void PlocMPSoCHandler::handleActionCommandFailure(ActionId_t actionId) { switch (actionId) { case supv::ACK_REPORT: case supv::EXE_REPORT: - break; + break; default: - sif::debug << "PlocMPSoCHandler::handleActionCommandFailure: Did not expect this action ID " - << std::endl; - return; + sif::debug << "PlocMPSoCHandler::handleActionCommandFailure: Did not expect this action ID " + << std::endl; + return; } - switch(powerState) { - case PowerState::BOOTING: { - sif::warning << "PlocMPSoCHandler::handleActionCommandFailure: Failed to boot MPSoC" - << std::endl; - powerState = PowerState::OFF; - break; - } - case PowerState::SHUTDOWN: { - sif::warning << "PlocMPSoCHandler::handleActionCommandFailure: Failed to shutdown MPSoC" - << std::endl; - powerState = PowerState::ON; - break; - } - default: - break; + switch (powerState) { + case PowerState::BOOTING: { + sif::warning << "PlocMPSoCHandler::handleActionCommandFailure: Failed to boot MPSoC" + << std::endl; + powerState = PowerState::OFF; + break; + } + case PowerState::SHUTDOWN: { + sif::warning << "PlocMPSoCHandler::handleActionCommandFailure: Failed to shutdown MPSoC" + << std::endl; + powerState = PowerState::ON; + break; + } + default: + break; } return; } diff --git a/linux/devices/ploc/PlocSupervisorHandler.cpp b/linux/devices/ploc/PlocSupervisorHandler.cpp index 078475c9..5065c7dd 100644 --- a/linux/devices/ploc/PlocSupervisorHandler.cpp +++ b/linux/devices/ploc/PlocSupervisorHandler.cpp @@ -384,7 +384,7 @@ ReturnValue_t PlocSupervisorHandler::scanForReply(const uint8_t* start, size_t r ReturnValue_t PlocSupervisorHandler::getSwitches(const uint8_t** switches, uint8_t* numberOfSwitches) { if (powerSwitch == power::NO_SWITCH) { - return DeviceHandlerBase::NO_SWITCH; + return DeviceHandlerBase::NO_SWITCH; } *numberOfSwitches = 1; *switches = &powerSwitch; @@ -489,8 +489,8 @@ ReturnValue_t PlocSupervisorHandler::enableReplyInReplyMap(DeviceCommandMap::ite switch (command->first) { case supv::GET_HK_REPORT: { enabledReplies = 3; - result = DeviceHandlerBase::enableReplyInReplyMap(command, enabledReplies, true, - supv::HK_REPORT); + result = + DeviceHandlerBase::enableReplyInReplyMap(command, enabledReplies, true, supv::HK_REPORT); if (result != RETURN_OK) { sif::debug << "PlocSupervisorHandler::enableReplyInReplyMap: Reply with id " << supv::HK_REPORT << " not in replyMap" << std::endl; @@ -589,15 +589,15 @@ ReturnValue_t PlocSupervisorHandler::enableReplyInReplyMap(DeviceCommandMap::ite result = DeviceHandlerBase::enableReplyInReplyMap(command, enabledReplies, true, supv::ACK_REPORT); if (result != RETURN_OK) { - sif::debug << "PlocSupervisorHandler::enableReplyInReplyMap: Reply with id " - << supv::ACK_REPORT << " not in replyMap" << std::endl; + sif::debug << "PlocSupervisorHandler::enableReplyInReplyMap: Reply with id " << supv::ACK_REPORT + << " not in replyMap" << std::endl; } result = DeviceHandlerBase::enableReplyInReplyMap(command, enabledReplies, true, supv::EXE_REPORT); if (result != RETURN_OK) { - sif::debug << "PlocSupervisorHandler::enableReplyInReplyMap: Reply with id " - << supv::EXE_REPORT << " not in replyMap" << std::endl; + sif::debug << "PlocSupervisorHandler::enableReplyInReplyMap: Reply with id " << supv::EXE_REPORT + << " not in replyMap" << std::endl; } return RETURN_OK; @@ -1013,7 +1013,7 @@ void PlocSupervisorHandler::prepareEmptyCmd(uint16_t apid) { void PlocSupervisorHandler::prepareSelBootImageCmd(const uint8_t* commandData) { supv::MPSoCBootSelect packet(*commandData, *(commandData + 1), *(commandData + 2), - *(commandData + 3)); + *(commandData + 3)); packetToOutBuffer(packet.getWholeData(), packet.getFullSize()); } @@ -1459,9 +1459,8 @@ ReturnValue_t PlocSupervisorHandler::handleMramDumpFile(DeviceCommandId_t id) { return MRAM_FILE_NOT_EXISTS; } std::ofstream file(activeMramFile, std::ios_base::app | std::ios_base::out); - file.write( - reinterpret_cast(spacePacketBuffer + supv::SPACE_PACKET_HEADER_LENGTH), - packetLen - 1); + file.write(reinterpret_cast(spacePacketBuffer + supv::SPACE_PACKET_HEADER_LENGTH), + packetLen - 1); file.close(); return RETURN_OK; } diff --git a/linux/devices/ploc/PlocUpdater.cpp b/linux/devices/ploc/PlocUpdater.cpp index 220b1e00..37a553da 100644 --- a/linux/devices/ploc/PlocUpdater.cpp +++ b/linux/devices/ploc/PlocUpdater.cpp @@ -262,12 +262,11 @@ void PlocUpdater::commandUpdateAvailable() { calcImageCrc(); supv::UpdateInfo packet(supv::APID_UPDATE_AVAILABLE, static_cast(image), - static_cast(partition), imageSize, imageCrc, - numOfUpdatePackets); + static_cast(partition), imageSize, imageCrc, numOfUpdatePackets); - result = commandActionHelper.commandAction(objects::PLOC_SUPERVISOR_HANDLER, - supv::UPDATE_AVAILABLE, packet.getWholeData(), - packet.getFullSize()); + result = + commandActionHelper.commandAction(objects::PLOC_SUPERVISOR_HANDLER, supv::UPDATE_AVAILABLE, + packet.getWholeData(), packet.getFullSize()); if (result != RETURN_OK) { sif::warning << "PlocUpdater::commandUpdateAvailable: Failed to send update available" << " packet to supervisor handler" << std::endl; @@ -311,9 +310,9 @@ void PlocUpdater::commandUpdatePacket() { } packet.makeCrc(); - result = commandActionHelper.commandAction(objects::PLOC_SUPERVISOR_HANDLER, - supv::UPDATE_IMAGE_DATA, packet.getWholeData(), - packet.getFullSize()); + result = + commandActionHelper.commandAction(objects::PLOC_SUPERVISOR_HANDLER, supv::UPDATE_IMAGE_DATA, + packet.getWholeData(), packet.getFullSize()); if (result != RETURN_OK) { sif::warning << "PlocUpdater::commandUpdateAvailable: Failed to send update" @@ -335,12 +334,10 @@ void PlocUpdater::commandUpdateVerify() { ReturnValue_t result = RETURN_OK; supv::UpdateInfo packet(supv::APID_UPDATE_VERIFY, static_cast(image), - static_cast(partition), imageSize, imageCrc, - numOfUpdatePackets); + static_cast(partition), imageSize, imageCrc, numOfUpdatePackets); - result = - commandActionHelper.commandAction(objects::PLOC_SUPERVISOR_HANDLER, supv::UPDATE_VERIFY, - packet.getWholeData(), packet.getFullSize()); + result = commandActionHelper.commandAction(objects::PLOC_SUPERVISOR_HANDLER, supv::UPDATE_VERIFY, + packet.getWholeData(), packet.getFullSize()); if (result != RETURN_OK) { sif::warning << "PlocUpdater::commandUpdateAvailable: Failed to send update available" << " packet to supervisor handler" << std::endl; diff --git a/linux/devices/startracker/StarTrackerHandler.h b/linux/devices/startracker/StarTrackerHandler.h index 2667db31..90a30966 100644 --- a/linux/devices/startracker/StarTrackerHandler.h +++ b/linux/devices/startracker/StarTrackerHandler.h @@ -7,12 +7,12 @@ #include "ArcsecJsonParamBase.h" #include "OBSWConfig.h" #include "StrHelper.h" +#include "devices/powerSwitcherList.h" #include "fsfw/devicehandlers/DeviceHandlerBase.h" #include "fsfw/src/fsfw/serialize/SerializeAdapter.h" #include "fsfw/timemanager/Countdown.h" #include "linux/devices/devicedefinitions/StarTrackerDefinitions.h" #include "thirdparty/arcsec_star_tracker/common/SLIP.h" -#include "devices/powerSwitcherList.h" /** * @brief This is the device handler for the star tracker from arcsec. diff --git a/mission/devices/RadiationSensorHandler.cpp b/mission/devices/RadiationSensorHandler.cpp index 179444ca..e91d8427 100644 --- a/mission/devices/RadiationSensorHandler.cpp +++ b/mission/devices/RadiationSensorHandler.cpp @@ -92,15 +92,15 @@ ReturnValue_t RadiationSensorHandler::buildCommandFromCommand(DeviceCommandId_t return RETURN_OK; } case RAD_SENSOR::ENABLE_DEBUG_OUTPUT: { - printPeriodicData = true; - rawPacketLen = 0; - return RETURN_OK; - } - case RAD_SENSOR::DISABLE_DEBUG_OUTPUT: { - rawPacketLen = 0; - printPeriodicData = false; - return RETURN_OK; - } + printPeriodicData = true; + rawPacketLen = 0; + return RETURN_OK; + } + case RAD_SENSOR::DISABLE_DEBUG_OUTPUT: { + rawPacketLen = 0; + printPeriodicData = false; + return RETURN_OK; + } default: return DeviceHandlerIF::COMMAND_NOT_IMPLEMENTED; } @@ -123,7 +123,7 @@ ReturnValue_t RadiationSensorHandler::scanForReply(const uint8_t *start, size_t switch (*foundId) { case RAD_SENSOR::START_CONVERSION: case RAD_SENSOR::WRITE_SETUP: - *foundLen = remainingSize; + *foundLen = remainingSize; return IGNORE_REPLY_DATA; case RAD_SENSOR::READ_CONVERSIONS: { ReturnValue_t result = gpioIF->pullLow(gpioIds::ENABLE_RADFET); @@ -138,8 +138,8 @@ ReturnValue_t RadiationSensorHandler::scanForReply(const uint8_t *start, size_t } case RAD_SENSOR::ENABLE_DEBUG_OUTPUT: case RAD_SENSOR::DISABLE_DEBUG_OUTPUT: - sif::info << "RadiationSensorHandler::scanForReply: " << remainingSize << std::endl; - break; + sif::info << "RadiationSensorHandler::scanForReply: " << remainingSize << std::endl; + break; default: break; } diff --git a/mission/devices/SyrlinksHkHandler.cpp b/mission/devices/SyrlinksHkHandler.cpp index 017bd53c..53a8af23 100644 --- a/mission/devices/SyrlinksHkHandler.cpp +++ b/mission/devices/SyrlinksHkHandler.cpp @@ -139,42 +139,45 @@ ReturnValue_t SyrlinksHkHandler::buildCommandFromCommand(DeviceCommandId_t devic return RETURN_OK; } case (SYRLINKS::READ_TX_AGC_VALUE_HIGH_BYTE): { - readTxAgcValueHighByte.copy(reinterpret_cast(commandBuffer), readTxAgcValueHighByte.size(), 0); + readTxAgcValueHighByte.copy(reinterpret_cast(commandBuffer), + readTxAgcValueHighByte.size(), 0); rawPacketLen = readTxAgcValueHighByte.size(); rememberCommandId = SYRLINKS::READ_TX_AGC_VALUE_HIGH_BYTE; rawPacket = commandBuffer; return RETURN_OK; } case (SYRLINKS::READ_TX_AGC_VALUE_LOW_BYTE): { - readTxAgcValueLowByte.copy(reinterpret_cast(commandBuffer), readTxAgcValueLowByte.size(), 0); + readTxAgcValueLowByte.copy(reinterpret_cast(commandBuffer), + readTxAgcValueLowByte.size(), 0); rawPacketLen = readTxAgcValueLowByte.size(); rememberCommandId = SYRLINKS::READ_TX_AGC_VALUE_LOW_BYTE; rawPacket = commandBuffer; return RETURN_OK; } case (SYRLINKS::TEMP_POWER_AMPLIFIER_HIGH_BYTE): - tempPowerAmpBoardHighByte.copy(reinterpret_cast(commandBuffer), tempPowerAmpBoardHighByte.size(), - 0); + tempPowerAmpBoardHighByte.copy(reinterpret_cast(commandBuffer), + tempPowerAmpBoardHighByte.size(), 0); rawPacketLen = tempPowerAmpBoardHighByte.size(); rememberCommandId = SYRLINKS::TEMP_POWER_AMPLIFIER_HIGH_BYTE; rawPacket = commandBuffer; return RETURN_OK; case (SYRLINKS::TEMP_POWER_AMPLIFIER_LOW_BYTE): - tempPowerAmpBoardLowByte.copy(reinterpret_cast(commandBuffer), tempPowerAmpBoardLowByte.size(), - 0); + tempPowerAmpBoardLowByte.copy(reinterpret_cast(commandBuffer), + tempPowerAmpBoardLowByte.size(), 0); rawPacketLen = tempPowerAmpBoardLowByte.size(); rememberCommandId = SYRLINKS::TEMP_POWER_AMPLIFIER_LOW_BYTE; rawPacket = commandBuffer; return RETURN_OK; case (SYRLINKS::TEMP_BASEBAND_BOARD_HIGH_BYTE): - tempBasebandBoardHighByte.copy(reinterpret_cast(commandBuffer), tempBasebandBoardHighByte.size(), - 0); + tempBasebandBoardHighByte.copy(reinterpret_cast(commandBuffer), + tempBasebandBoardHighByte.size(), 0); rawPacketLen = tempBasebandBoardHighByte.size(); rememberCommandId = SYRLINKS::TEMP_BASEBAND_BOARD_HIGH_BYTE; rawPacket = commandBuffer; return RETURN_OK; case (SYRLINKS::TEMP_BASEBAND_BOARD_LOW_BYTE): - tempBasebandBoardLowByte.copy(reinterpret_cast(commandBuffer), tempBasebandBoardLowByte.size(), 0); + tempBasebandBoardLowByte.copy(reinterpret_cast(commandBuffer), + tempBasebandBoardLowByte.size(), 0); rawPacketLen = tempBasebandBoardLowByte.size(); rememberCommandId = SYRLINKS::TEMP_BASEBAND_BOARD_LOW_BYTE; rawPacket = commandBuffer; @@ -352,8 +355,8 @@ ReturnValue_t SyrlinksHkHandler::interpretDeviceReply(DeviceCommandId_t id, cons rawTempBasebandBoard |= convertHexStringToUint8( reinterpret_cast(packet + SYRLINKS::MESSAGE_HEADER_SIZE)); tempBasebandBoard = calcTempVal(rawTempBasebandBoard); - sif::info << "Syrlinks temperature baseband board: " << tempBasebandBoard << " °C" - << std::endl; + sif::info << "Syrlinks temperature baseband board: " << tempBasebandBoard << " °C" + << std::endl; break; case (SYRLINKS::TEMP_POWER_AMPLIFIER_HIGH_BYTE): result = verifyReply(packet, SYRLINKS::READ_ONE_REGISTER_REPLY_SIE); @@ -364,8 +367,8 @@ ReturnValue_t SyrlinksHkHandler::interpretDeviceReply(DeviceCommandId_t id, cons } rawTempPowerAmplifier = 0; rawTempPowerAmplifier = convertHexStringToUint8(reinterpret_cast( - packet + SYRLINKS::MESSAGE_HEADER_SIZE)) - << 8; + packet + SYRLINKS::MESSAGE_HEADER_SIZE)) + << 8; break; case (SYRLINKS::TEMP_POWER_AMPLIFIER_LOW_BYTE): result = verifyReply(packet, SYRLINKS::READ_ONE_REGISTER_REPLY_SIE); @@ -378,7 +381,7 @@ ReturnValue_t SyrlinksHkHandler::interpretDeviceReply(DeviceCommandId_t id, cons reinterpret_cast(packet + SYRLINKS::MESSAGE_HEADER_SIZE)); tempPowerAmplifier = calcTempVal(rawTempPowerAmplifier); sif::info << "Syrlinks temperature power amplifier board: " << tempPowerAmplifier << " °C" - << std::endl; + << std::endl; break; default: { sif::debug << "SyrlinksHkHandler::interpretDeviceReply: Unknown device reply id" << std::endl; diff --git a/mission/devices/SyrlinksHkHandler.h b/mission/devices/SyrlinksHkHandler.h index 9b9e05c2..a8cb7b8c 100644 --- a/mission/devices/SyrlinksHkHandler.h +++ b/mission/devices/SyrlinksHkHandler.h @@ -1,10 +1,11 @@ #ifndef MISSION_DEVICES_SYRLINKSHKHANDLER_H_ #define MISSION_DEVICES_SYRLINKSHKHANDLER_H_ +#include + #include "devices/powerSwitcherList.h" #include "fsfw/devicehandlers/DeviceHandlerBase.h" #include "mission/devices/devicedefinitions/SyrlinksDefinitions.h" -#include /** * @brief This is the device handler for the syrlinks transceiver. It handles the command diff --git a/mission/system/AcsBoardAssembly.cpp b/mission/system/AcsBoardAssembly.cpp index e319f32b..0d65d20e 100644 --- a/mission/system/AcsBoardAssembly.cpp +++ b/mission/system/AcsBoardAssembly.cpp @@ -143,13 +143,13 @@ ReturnValue_t AcsBoardAssembly::handleNormalOrOnModeCmd(Mode_t mode, Submode_t s cmdSeq(helper.mgm1Rm3100IdSideA, helper.mgm1SideAMode, ModeTableIdx::MGM_1_A); if (gpsUsable) { gpioHandler(gpioIds::GNSS_0_NRESET, true, - "AcsBoardAssembly::handleNormalOrOnModeCmd: Could not pull nReset pin" - "of GNSS 0 high (used GNSS)"); + "AcsBoardAssembly::handleNormalOrOnModeCmd: Could not pull nReset pin" + "of GNSS 0 high (used GNSS)"); gpioHandler(gpioIds::GNSS_1_NRESET, false, - "AcsBoardAssembly::handleNormalOrOnModeCmd: Could not pull nReset pin" - "of GNSS 1 low (unused GNSS)"); + "AcsBoardAssembly::handleNormalOrOnModeCmd: Could not pull nReset pin" + "of GNSS 1 low (unused GNSS)"); gpioHandler(gpioIds::GNSS_SELECT, false, - "AcsBoardAssembly::handleNormalOrOnModeCmd: Could not pull GNSS select low"); + "AcsBoardAssembly::handleNormalOrOnModeCmd: Could not pull GNSS select low"); } break; } @@ -168,13 +168,13 @@ ReturnValue_t AcsBoardAssembly::handleNormalOrOnModeCmd(Mode_t mode, Submode_t s cmdSeq(helper.mgm3Rm3100IdSideB, helper.mgm3SideBMode, ModeTableIdx::MGM_3_B); if (gpsUsable) { gpioHandler(gpioIds::GNSS_0_NRESET, false, - "AcsBoardAssembly::handleNormalOrOnModeCmd: Could not pull nReset pin" - "of GNSS 0 low (unused GNSS)"); + "AcsBoardAssembly::handleNormalOrOnModeCmd: Could not pull nReset pin" + "of GNSS 0 low (unused GNSS)"); gpioHandler(gpioIds::GNSS_1_NRESET, true, - "AcsBoardAssembly::handleNormalOrOnModeCmd: Could not pull nReset pin" - "of GNSS 1 high (used GNSS)"); + "AcsBoardAssembly::handleNormalOrOnModeCmd: Could not pull nReset pin" + "of GNSS 1 high (used GNSS)"); gpioHandler(gpioIds::GNSS_SELECT, true, - "AcsBoardAssembly::handleNormalOrOnModeCmd: Could not pull GNSS select high"); + "AcsBoardAssembly::handleNormalOrOnModeCmd: Could not pull GNSS select high"); } break; } @@ -191,11 +191,11 @@ ReturnValue_t AcsBoardAssembly::handleNormalOrOnModeCmd(Mode_t mode, Submode_t s ReturnValue_t status = RETURN_OK; if (gpsUsable) { gpioHandler(gpioIds::GNSS_0_NRESET, true, - "AcsBoardAssembly::handleNormalOrOnModeCmd: Could not pull nReset pin" - "of GNSS 0 high (used GNSS)"); + "AcsBoardAssembly::handleNormalOrOnModeCmd: Could not pull nReset pin" + "of GNSS 0 high (used GNSS)"); gpioHandler(gpioIds::GNSS_1_NRESET, true, - "AcsBoardAssembly::handleNormalOrOnModeCmd: Could not pull nReset pin" - "of GNSS 1 high (used GNSS)"); + "AcsBoardAssembly::handleNormalOrOnModeCmd: Could not pull nReset pin" + "of GNSS 1 high (used GNSS)"); if (defaultSubmode == Submodes::A_SIDE) { status = gpioIF->pullLow(gpioIds::GNSS_SELECT); } else { @@ -245,7 +245,7 @@ void AcsBoardAssembly::selectGpsInDualMode(duallane::Submodes side) { void AcsBoardAssembly::gpioHandler(gpioId_t gpio, bool high, std::string error) { ReturnValue_t result = RETURN_OK; - if(high) { + if (high) { result = gpioIF->pullHigh(gpio); } else { result = gpioIF->pullLow(gpio); From d2f54f033f977a63ba1e358373cf8320d0203b68 Mon Sep 17 00:00:00 2001 From: Jakob Meier Date: Mon, 4 Apr 2022 14:58:35 +0200 Subject: [PATCH 05/19] syrlinks --- bsp_hosted/acsDummies/GpsDummy.cpp | 7 + bsp_hosted/acsDummies/GpsDummy.h | 13 + bsp_q7s/core/obsw.cpp | 4 - mission/controller/AcsController.cpp | 48 ++++ mission/controller/AcsController.h | 18 ++ .../devices/SyrlinksFaultFlagMonitoring.cpp | 9 - mission/devices/SyrlinksFaultFlagMonitoring.h | 7 - mission/devices/SyrlinksHkHandler.cpp | 225 +++++++----------- mission/devices/SyrlinksHkHandler.h | 9 +- .../devicedefinitions/SyrlinksDefinitions.h | 7 +- 10 files changed, 185 insertions(+), 162 deletions(-) create mode 100644 bsp_hosted/acsDummies/GpsDummy.cpp create mode 100644 bsp_hosted/acsDummies/GpsDummy.h create mode 100644 mission/controller/AcsController.cpp create mode 100644 mission/controller/AcsController.h diff --git a/bsp_hosted/acsDummies/GpsDummy.cpp b/bsp_hosted/acsDummies/GpsDummy.cpp new file mode 100644 index 00000000..b4331798 --- /dev/null +++ b/bsp_hosted/acsDummies/GpsDummy.cpp @@ -0,0 +1,7 @@ +#include "GpsDummy.h" + +GpsDummy::GpsDummy() { +} + +GpsDummy::~GpsDummy() { +} diff --git a/bsp_hosted/acsDummies/GpsDummy.h b/bsp_hosted/acsDummies/GpsDummy.h new file mode 100644 index 00000000..f25bf1f2 --- /dev/null +++ b/bsp_hosted/acsDummies/GpsDummy.h @@ -0,0 +1,13 @@ +#ifndef BSP_HOSTED_ACSDUMMIES_GPSDUMMY_H_ +#define BSP_HOSTED_ACSDUMMIES_GPSDUMMY_H_ + +/** + * @brief Dummy class to simulate sending of GPS data to ACS controller. + */ +class GpsDummy : public ExtendedControllerBase { + public: + GpsDummy(); + virtual ~GpsDummy(); +}; + +#endif /* BSP_HOSTED_ACSDUMMIES_GPSDUMMY_H_ */ diff --git a/bsp_q7s/core/obsw.cpp b/bsp_q7s/core/obsw.cpp index aede1698..27d1484e 100644 --- a/bsp_q7s/core/obsw.cpp +++ b/bsp_q7s/core/obsw.cpp @@ -15,11 +15,7 @@ static int OBSW_ALREADY_RUNNING = -2; int obsw::obsw() { using namespace fsfw; std::cout << "-- EIVE OBSW --" << std::endl; -#ifdef TE0720_1CFA std::cout << "-- Compiled for Linux (Xiphos Q7S) --" << std::endl; -#else - std::cout << "-- Compiled for Linux (TE0720) --" << std::endl; -#endif std::cout << "-- OBSW v" << SW_VERSION << "." << SW_SUBVERSION << "." << SW_REVISION << ", FSFW v" << FSFW_VERSION << "--" << std::endl; std::cout << "-- " << __DATE__ << " " << __TIME__ << " --" << std::endl; diff --git a/mission/controller/AcsController.cpp b/mission/controller/AcsController.cpp new file mode 100644 index 00000000..28f7032b --- /dev/null +++ b/mission/controller/AcsController.cpp @@ -0,0 +1,48 @@ +#include "AcsController.h" + +AcsController::AcsController() { +} + +AcsController::~AcsController() { +} + +ReturnValue_t AcsController::initialize() { + + ControllerBase::initialize(); +} + +ReturnValue_t AcsController::handleCommandMessage(CommandMessage * message) { + ReturnValue_t result = actionHelper.handleActionMessage(message); + if (result == HasReturnvaluesIF::RETURN_OK) { + return HasReturnvaluesIF::RETURN_OK; + } + return result; +} + +void AcsController::performControlOperation() { + if (mode != MODE_OFF) { + monitoring.monitor(&acsParameters); + switch (submode) { + case SUBMODE_SAFE: + performSafe(SAFE_CONTROLLER); + break; + case SUBMODE_IDLE: + performPointing(IDLE_CONTROLLER); + break; + case SUBMODE_NADIR: + performPointing(NADIR_CONTROLLER); + break; + case SUBMODE_TARGET: + performPointing(TARGET_CONTROLLER); + break; + case SUBMODE_INERTIAL: + performPointing(INERTIAL_CONTROLLER); + break; + case SUBMODE_ROTATION: + performPointing(ROTATION_CONTROLLER); + break; + default: + break; + } + } +} diff --git a/mission/controller/AcsController.h b/mission/controller/AcsController.h new file mode 100644 index 00000000..20f19c15 --- /dev/null +++ b/mission/controller/AcsController.h @@ -0,0 +1,18 @@ +#ifndef MISSION_CONTROLLER_ACSCONTROLLER_H_ +#define MISSION_CONTROLLER_ACSCONTROLLER_H_ + +#include "fsfw/controller/ControllerBase.h" + +class AcsController : public ControllerBase { + public: + AcsController(); + virtual ~AcsController(); + + ReturnValue_t initialize() override; + + protected: + ReturnValue_t handleCommandMessage(CommandMessage *message); + void performControlOperation(); +}; + +#endif /* MISSION_CONTROLLER_ACSCONTROLLER_H_ */ diff --git a/mission/devices/SyrlinksFaultFlagMonitoring.cpp b/mission/devices/SyrlinksFaultFlagMonitoring.cpp index f999a47c..79b752d7 100644 --- a/mission/devices/SyrlinksFaultFlagMonitoring.cpp +++ b/mission/devices/SyrlinksFaultFlagMonitoring.cpp @@ -1,16 +1,7 @@ -/* - * SyrlinksFaultFlagMonitoring.cpp - * - * Created on: 01.04.2022 - * Author: jakob - */ - #include "SyrlinksFaultFlagMonitoring.h" SyrlinksFaultFlagMonitoring::SyrlinksFaultFlagMonitoring() { - // TODO Auto-generated constructor stub } SyrlinksFaultFlagMonitoring::~SyrlinksFaultFlagMonitoring() { - // TODO Auto-generated destructor stub } diff --git a/mission/devices/SyrlinksFaultFlagMonitoring.h b/mission/devices/SyrlinksFaultFlagMonitoring.h index 09869c44..7959ca55 100644 --- a/mission/devices/SyrlinksFaultFlagMonitoring.h +++ b/mission/devices/SyrlinksFaultFlagMonitoring.h @@ -1,10 +1,3 @@ -/* - * SyrlinksFaultFlagMonitoring.h - * - * Created on: 01.04.2022 - * Author: jakob - */ - #ifndef MISSION_DEVICES_SYRLINKSFAULTFLAGMONITORING_H_ #define MISSION_DEVICES_SYRLINKSFAULTFLAGMONITORING_H_ diff --git a/mission/devices/SyrlinksHkHandler.cpp b/mission/devices/SyrlinksHkHandler.cpp index 31549af5..c64ac747 100644 --- a/mission/devices/SyrlinksHkHandler.cpp +++ b/mission/devices/SyrlinksHkHandler.cpp @@ -19,19 +19,18 @@ SyrlinksHkHandler::SyrlinksHkHandler(object_id_t objectId, object_id_t comIF, Co SyrlinksHkHandler::~SyrlinksHkHandler() {} void SyrlinksHkHandler::doStartUp() { -// switch (startupState) { -// case StartupState::OFF: { -// startupState = StartupState::ENABLE_TEMPERATURE_PROTECTION; -// break; -// } -// case StartupState::DONE: { -// setMode(_MODE_TO_ON); -// break; -// } -// default: -// break; -// } - setMode(_MODE_TO_ON); + switch (startupState) { + case StartupState::OFF: { + startupState = StartupState::ENABLE_TEMPERATURE_PROTECTION; + break; + } + case StartupState::DONE: { + setMode(_MODE_TO_ON); + break; + } + default: + break; + } } void SyrlinksHkHandler::doShutDown() { setMode(_MODE_POWER_DOWN); } @@ -99,130 +98,81 @@ ReturnValue_t SyrlinksHkHandler::buildCommandFromCommand(DeviceCommandId_t devic size_t commandDataLen) { switch (deviceCommand) { case (syrlinks::RESET_UNIT): { - resetCommand.copy(reinterpret_cast(commandBuffer), resetCommand.size(), 0); - rawPacketLen = resetCommand.size(); - rawPacket = commandBuffer; + prepareCommand(resetCommand, deviceCommand); return RETURN_OK; } case (syrlinks::SET_TX_MODE_STANDBY): { - setTxModeStandby.copy(reinterpret_cast(commandBuffer), setTxModeStandby.size(), 0); - rawPacketLen = setTxModeStandby.size(); - rawPacket = commandBuffer; + prepareCommand(setTxModeStandby, deviceCommand); return RETURN_OK; } case (syrlinks::SET_TX_MODE_MODULATION): { - setTxModeModulation.copy(reinterpret_cast(commandBuffer), setTxModeModulation.size(), - 0); - rawPacketLen = setTxModeModulation.size(); - rawPacket = commandBuffer; + prepareCommand(setTxModeModulation, deviceCommand); return RETURN_OK; } case (syrlinks::SET_TX_MODE_CW): { - setTxModeCw.copy(reinterpret_cast(commandBuffer), setTxModeCw.size(), 0); - rawPacketLen = setTxModeCw.size(); - rawPacket = commandBuffer; + prepareCommand(setTxModeCw, deviceCommand); return RETURN_OK; } case (syrlinks::WRITE_LCL_CONFIG): { - writeLclConfig.copy(reinterpret_cast(commandBuffer), writeLclConfig.size(), 0); - rawPacketLen = writeLclConfig.size(); - rawPacket = commandBuffer; - rememberCommandId = syrlinks::WRITE_LCL_CONFIG; + prepareCommand(writeLclConfig, deviceCommand); return RETURN_OK; } case (syrlinks::READ_RX_STATUS_REGISTERS): { - readRxStatusRegCommand.copy(reinterpret_cast(commandBuffer), - readRxStatusRegCommand.size(), 0); - rawPacketLen = readRxStatusRegCommand.size(); - rawPacket = commandBuffer; + prepareCommand(readRxStatusRegCommand, deviceCommand); return RETURN_OK; } case (syrlinks::READ_LCL_CONFIG): { - readLclConfig.copy(reinterpret_cast(commandBuffer), readLclConfig.size(), 0); - rawPacketLen = readLclConfig.size(); - rawPacket = commandBuffer; - rememberCommandId = syrlinks::READ_LCL_CONFIG; + prepareCommand(readLclConfig, deviceCommand); return RETURN_OK; } case (syrlinks::READ_TX_STATUS): { - readTxStatus.copy(reinterpret_cast(commandBuffer), readTxStatus.size(), 0); - rawPacketLen = readTxStatus.size(); - rememberCommandId = syrlinks::READ_TX_STATUS; - rawPacket = commandBuffer; + prepareCommand(readTxStatus, deviceCommand); return RETURN_OK; } case (syrlinks::READ_TX_WAVEFORM): { - readTxWaveform.copy(reinterpret_cast(commandBuffer), readTxWaveform.size(), 0); - rawPacketLen = readTxWaveform.size(); - rememberCommandId = syrlinks::READ_TX_WAVEFORM; - rawPacket = commandBuffer; + prepareCommand(readTxWaveform, deviceCommand); return RETURN_OK; } case (syrlinks::READ_TX_AGC_VALUE_HIGH_BYTE): { - readTxAgcValueHighByte.copy(reinterpret_cast(commandBuffer), - readTxAgcValueHighByte.size(), 0); - rawPacketLen = readTxAgcValueHighByte.size(); - rememberCommandId = syrlinks::READ_TX_AGC_VALUE_HIGH_BYTE; - rawPacket = commandBuffer; + prepareCommand(readTxAgcValueHighByte, deviceCommand); return RETURN_OK; } case (syrlinks::READ_TX_AGC_VALUE_LOW_BYTE): { - readTxAgcValueLowByte.copy(reinterpret_cast(commandBuffer), - readTxAgcValueLowByte.size(), 0); - rawPacketLen = readTxAgcValueLowByte.size(); - rememberCommandId = syrlinks::READ_TX_AGC_VALUE_LOW_BYTE; - rawPacket = commandBuffer; + prepareCommand(readTxAgcValueLowByte, deviceCommand); return RETURN_OK; } - case (syrlinks::TEMP_POWER_AMPLIFIER_HIGH_BYTE): - tempPowerAmpBoardHighByte.copy(reinterpret_cast(commandBuffer), - tempPowerAmpBoardHighByte.size(), 0); - rawPacketLen = tempPowerAmpBoardHighByte.size(); - rememberCommandId = syrlinks::TEMP_POWER_AMPLIFIER_HIGH_BYTE; - rawPacket = commandBuffer; + case (syrlinks::TEMP_POWER_AMPLIFIER_HIGH_BYTE): { + prepareCommand(tempPowerAmpBoardHighByte, deviceCommand); return RETURN_OK; - case (syrlinks::TEMP_POWER_AMPLIFIER_LOW_BYTE): - tempPowerAmpBoardLowByte.copy(reinterpret_cast(commandBuffer), - tempPowerAmpBoardLowByte.size(), 0); - rawPacketLen = tempPowerAmpBoardLowByte.size(); - rememberCommandId = syrlinks::TEMP_POWER_AMPLIFIER_LOW_BYTE; - rawPacket = commandBuffer; + } + case (syrlinks::TEMP_POWER_AMPLIFIER_LOW_BYTE): { + prepareCommand(tempPowerAmpBoardLowByte, deviceCommand); return RETURN_OK; - case (syrlinks::TEMP_BASEBAND_BOARD_HIGH_BYTE): - tempBasebandBoardHighByte.copy(reinterpret_cast(commandBuffer), - tempBasebandBoardHighByte.size(), 0); - rawPacketLen = tempBasebandBoardHighByte.size(); - rememberCommandId = syrlinks::TEMP_BASEBAND_BOARD_HIGH_BYTE; - rawPacket = commandBuffer; + } + case (syrlinks::TEMP_BASEBAND_BOARD_HIGH_BYTE): { + prepareCommand(tempBasebandBoardHighByte, deviceCommand); return RETURN_OK; - case (syrlinks::TEMP_BASEBAND_BOARD_LOW_BYTE): - tempBasebandBoardLowByte.copy(reinterpret_cast(commandBuffer), - tempBasebandBoardLowByte.size(), 0); - rawPacketLen = tempBasebandBoardLowByte.size(); - rememberCommandId = syrlinks::TEMP_BASEBAND_BOARD_LOW_BYTE; - rawPacket = commandBuffer; + } + case (syrlinks::TEMP_BASEBAND_BOARD_LOW_BYTE): { + prepareCommand(tempBasebandBoardLowByte, deviceCommand); return RETURN_OK; - case (syrlinks::SET_WAVEFORM_OQPSK): - setWaveformOQPSK.copy(reinterpret_cast(commandBuffer), - setWaveformOQPSK.size(), 0); - rawPacketLen = setWaveformOQPSK.size(); - rememberCommandId = syrlinks::SET_WAVEFORM_OQPSK; - rawPacket = commandBuffer; + } + case (syrlinks::CONFIG_BPSK): { + prepareCommand(configBPSK, deviceCommand); return RETURN_OK; - case (syrlinks::SET_WAVEFORM_BPSK): - setWaveformBPSK.copy(reinterpret_cast(commandBuffer), - setWaveformBPSK.size(), 0); - rawPacketLen = setWaveformBPSK.size(); - rememberCommandId = syrlinks::SET_WAVEFORM_BPSK; - rawPacket = commandBuffer; + } + case (syrlinks::CONFIG_OQPSK): { + prepareCommand(configOQPSK, deviceCommand); return RETURN_OK; - case (syrlinks::SET_SECOND_CONFIG): - setSecondConfiguration.copy(reinterpret_cast(commandBuffer), - setSecondConfiguration.size(), 0); - rawPacketLen = setSecondConfiguration.size(); - rememberCommandId = syrlinks::SET_SECOND_CONFIG; - rawPacket = commandBuffer; + } + case (syrlinks::ENABLE_DEBUG): { + debug = true; return RETURN_OK; + } + case (syrlinks::DISABLE_DEBUG): { + debug = false; + return RETURN_OK; + } default: return DeviceHandlerIF::COMMAND_NOT_IMPLEMENTED; } @@ -240,12 +190,12 @@ 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::SET_WAVEFORM_OQPSK, 1, nullptr, syrlinks::ACK_SIZE, + this->insertInCommandAndReplyMap(syrlinks::CONFIG_BPSK, 1, nullptr, syrlinks::ACK_SIZE, false, true, syrlinks::ACK_REPLY); - this->insertInCommandAndReplyMap(syrlinks::SET_WAVEFORM_BPSK, 1, nullptr, syrlinks::ACK_SIZE, - false, true, syrlinks::ACK_REPLY); - this->insertInCommandAndReplyMap(syrlinks::SET_SECOND_CONFIG, 1, nullptr, syrlinks::ACK_SIZE, + 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, syrlinks::READ_ONE_REGISTER_REPLY_SIE); this->insertInCommandAndReplyMap(syrlinks::READ_TX_STATUS, 1, &txDataset, @@ -316,8 +266,8 @@ ReturnValue_t SyrlinksHkHandler::interpretDeviceReply(DeviceCommandId_t id, cons result = verifyReply(packet, syrlinks::ACK_SIZE); if (result != RETURN_OK) { sif::warning << "SyrlinksHkHandler::interpretDeviceReply: Acknowledgment reply has " - "invalid crc" - << std::endl; + "invalid crc" + << std::endl; return CRC_FAILURE; } result = handleAckReply(packet); @@ -330,7 +280,7 @@ ReturnValue_t SyrlinksHkHandler::interpretDeviceReply(DeviceCommandId_t id, cons result = verifyReply(packet, syrlinks::RX_STATUS_REGISTERS_REPLY_SIZE); if (result != RETURN_OK) { sif::warning << "SyrlinksHkHandler::interpretDeviceReply: Read rx status registers reply " - << "has invalid crc" << std::endl; + << "has invalid crc" << std::endl; return CRC_FAILURE; } parseRxStatusRegistersReply(packet); @@ -340,7 +290,7 @@ ReturnValue_t SyrlinksHkHandler::interpretDeviceReply(DeviceCommandId_t id, cons result = verifyReply(packet, syrlinks::READ_ONE_REGISTER_REPLY_SIE); if (result != RETURN_OK) { sif::warning << "SyrlinksHkHandler::interpretDeviceReply: Read config lcl reply " - << "has invalid crc" << std::endl; + << "has invalid crc" << std::endl; return CRC_FAILURE; } parseLclConfigReply(packet); @@ -350,7 +300,7 @@ ReturnValue_t SyrlinksHkHandler::interpretDeviceReply(DeviceCommandId_t id, cons result = verifyReply(packet, syrlinks::READ_ONE_REGISTER_REPLY_SIE); if (result != RETURN_OK) { sif::warning << "SyrlinksHkHandler::interpretDeviceReply: Read tx status reply " - << "has invalid crc" << std::endl; + << "has invalid crc" << std::endl; return CRC_FAILURE; } parseTxStatusReply(packet); @@ -360,7 +310,7 @@ ReturnValue_t SyrlinksHkHandler::interpretDeviceReply(DeviceCommandId_t id, cons result = verifyReply(packet, syrlinks::READ_ONE_REGISTER_REPLY_SIE); if (result != RETURN_OK) { sif::warning << "SyrlinksHkHandler::interpretDeviceReply: Read tx waveform reply " - << "has invalid crc" << std::endl; + << "has invalid crc" << std::endl; return CRC_FAILURE; } parseTxWaveformReply(packet); @@ -370,7 +320,7 @@ ReturnValue_t SyrlinksHkHandler::interpretDeviceReply(DeviceCommandId_t id, cons result = verifyReply(packet, syrlinks::READ_ONE_REGISTER_REPLY_SIE); if (result != RETURN_OK) { sif::warning << "SyrlinksHkHandler::interpretDeviceReply: Read tx AGC high byte reply " - << "has invalid crc" << std::endl; + << "has invalid crc" << std::endl; return CRC_FAILURE; } parseAgcHighByte(packet); @@ -380,7 +330,7 @@ ReturnValue_t SyrlinksHkHandler::interpretDeviceReply(DeviceCommandId_t id, cons result = verifyReply(packet, syrlinks::READ_ONE_REGISTER_REPLY_SIE); if (result != RETURN_OK) { sif::warning << "SyrlinksHkHandler::interpretDeviceReply: Read tx AGC low byte reply " - << "has invalid crc" << std::endl; + << "has invalid crc" << std::endl; return CRC_FAILURE; } parseAgcLowByte(packet); @@ -390,7 +340,7 @@ ReturnValue_t SyrlinksHkHandler::interpretDeviceReply(DeviceCommandId_t id, cons result = verifyReply(packet, syrlinks::READ_ONE_REGISTER_REPLY_SIE); if (result != RETURN_OK) { sif::warning << "SyrlinksHkHandler::interpretDeviceReply: Read temperature baseband board " - << "high byte reply has invalid crc" << std::endl; + << "high byte reply has invalid crc" << std::endl; return CRC_FAILURE; } rawTempBasebandBoard = convertHexStringToUint8(reinterpret_cast( @@ -402,8 +352,8 @@ ReturnValue_t SyrlinksHkHandler::interpretDeviceReply(DeviceCommandId_t id, cons result = verifyReply(packet, syrlinks::READ_ONE_REGISTER_REPLY_SIE); if (result != RETURN_OK) { sif::warning << "SyrlinksHkHandler::interpretDeviceReply: Read temperature baseband board" - " low byte reply has invalid crc" - << std::endl; + " low byte reply has invalid crc" + << std::endl; return CRC_FAILURE; } rawTempBasebandBoard |= convertHexStringToUint8( @@ -412,8 +362,8 @@ ReturnValue_t SyrlinksHkHandler::interpretDeviceReply(DeviceCommandId_t id, cons temperatureSet.temperatureBasebandBoard = tempBasebandBoard; PoolReadGuard rg(&temperatureSet); if (debug) { - sif::info << "Syrlinks temperature baseband board: " << tempBasebandBoard << " °C" - << std::endl; + sif::info << "Syrlinks temperature baseband board: " << tempBasebandBoard << " °C" + << std::endl; } break; } @@ -421,7 +371,7 @@ ReturnValue_t SyrlinksHkHandler::interpretDeviceReply(DeviceCommandId_t id, cons result = verifyReply(packet, syrlinks::READ_ONE_REGISTER_REPLY_SIE); if (result != RETURN_OK) { sif::warning << "SyrlinksHkHandler::interpretDeviceReply: Read temperature power amplifier " - << "board high byte reply has invalid crc" << std::endl; + << "board high byte reply has invalid crc" << std::endl; return CRC_FAILURE; } rawTempPowerAmplifier = 0; @@ -434,7 +384,7 @@ ReturnValue_t SyrlinksHkHandler::interpretDeviceReply(DeviceCommandId_t id, cons result = verifyReply(packet, syrlinks::READ_ONE_REGISTER_REPLY_SIE); if (result != RETURN_OK) { sif::warning << "SyrlinksHkHandler::interpretDeviceReply: Read temperature power amplifier" - << " board low byte reply has invalid crc" << std::endl; + << " board low byte reply has invalid crc" << std::endl; return CRC_FAILURE; } rawTempPowerAmplifier |= convertHexStringToUint8( @@ -443,8 +393,8 @@ ReturnValue_t SyrlinksHkHandler::interpretDeviceReply(DeviceCommandId_t id, cons PoolReadGuard rg(&temperatureSet); temperatureSet.temperaturePowerAmplifier = tempPowerAmplifier; if (debug) { - sif::info << "Syrlinks temperature power amplifier board: " << tempPowerAmplifier - << " °C" << std::endl; + sif::info << "Syrlinks temperature power amplifier board: " << tempPowerAmplifier << " °C" + << std::endl; } break; } @@ -470,10 +420,6 @@ LocalPoolDataSetBase* SyrlinksHkHandler::getDataSetHandle(sid_t sid) { } } -void SyrlinksHkHandler::performOperationHook() { - -} - std::string SyrlinksHkHandler::convertUint16ToHexString(uint16_t intValue) { std::stringstream stream; stream << std::setfill('0') << std::setw(4) << std::hex << std::uppercase << intValue; @@ -592,15 +538,17 @@ void SyrlinksHkHandler::parseRxStatusRegistersReply(const uint8_t* packet) { rxDataset.rxDataRate = convertHexStringToUint8(reinterpret_cast(packet + offset)); #if OBSW_VERBOSE_LEVEL >= 1 && OBSW_DEBUG_SYRLINKS == 1 - 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; + 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; + } #endif } @@ -615,7 +563,7 @@ void SyrlinksHkHandler::parseTxStatusReply(const uint8_t* packet) { PoolReadGuard readHelper(&txDataset); uint16_t offset = syrlinks::MESSAGE_HEADER_SIZE; txDataset.txStatus = convertHexStringToUint8(reinterpret_cast(packet + offset)); -#if OBSW_VERBOSE_LEVEL >= 1 && OBSW_DEBUG_SYRLINKS == 1 +#if OBSW_DEBUG_SYRLINKS == 1 sif::info << "Syrlinks TX Status: 0x" << std::hex << (unsigned int)txDataset.txStatus.value << std::endl; #endif @@ -625,7 +573,7 @@ void SyrlinksHkHandler::parseTxWaveformReply(const uint8_t* packet) { PoolReadGuard readHelper(&txDataset); uint16_t offset = syrlinks::MESSAGE_HEADER_SIZE; txDataset.txWaveform = convertHexStringToUint8(reinterpret_cast(packet + offset)); -#if OBSW_VERBOSE_LEVEL >= 1 && OBSW_DEBUG_SYRLINKS == 1 +#if OBSW_DEBUG_SYRLINKS == 1 sif::info << "Syrlinks TX Waveform: 0x" << std::hex << (unsigned int)txDataset.txWaveform.value << std::endl; #endif @@ -636,7 +584,7 @@ void SyrlinksHkHandler::parseAgcLowByte(const uint8_t* packet) { uint16_t offset = syrlinks::MESSAGE_HEADER_SIZE; txDataset.txAgcValue = agcValueHighByte << 8 | convertHexStringToUint8(reinterpret_cast(packet + offset)); -#if OBSW_VERBOSE_LEVEL >= 1 && OBSW_DEBUG_SYRLINKS == 1 +#if OBSW_DEBUG_SYRLINKS == 1 sif::info << "Syrlinks TX AGC Value: " << txDataset.txAgcValue << std::endl; #endif } @@ -685,3 +633,10 @@ ReturnValue_t SyrlinksHkHandler::handleAckReply(const uint8_t* packet) { } return result; } + +void SyrlinksHkHandler::prepareCommand(std::string command, DeviceCommandId_t commandId) { + command.copy(reinterpret_cast(commandBuffer), readTxWaveform.size(), 0); + rawPacketLen = command.size(); + rememberCommandId = commandId; + rawPacket = commandBuffer; +} diff --git a/mission/devices/SyrlinksHkHandler.h b/mission/devices/SyrlinksHkHandler.h index 739db450..7eab1b01 100644 --- a/mission/devices/SyrlinksHkHandler.h +++ b/mission/devices/SyrlinksHkHandler.h @@ -44,7 +44,6 @@ class SyrlinksHkHandler : public DeviceHandlerBase { ReturnValue_t initializeLocalDataPool(localpool::DataPool& localDataPoolMap, LocalDataPoolManager& poolManager) override; LocalPoolDataSetBase* getDataSetHandle(sid_t sid) override; - void performOperationHook(); private: static const uint8_t INTERFACE_ID = CLASS_ID::SYRLINKS_HANDLER; @@ -67,8 +66,8 @@ class SyrlinksHkHandler : public DeviceHandlerBase { std::string setTxModeStandby = ""; /** W - write, 04 - 4 bytes in data field, 01 - value, 40 register to write value */ std::string setTxModeModulation = ""; -// std::string setSecondConfiguration = ""; - std::string setSecondConfiguration = ""; + std::string configBPSK = ""; + std::string configOQPSK = ""; std::string setTxModeCw = ""; std::string writeLclConfig = ""; std::string setWaveformOQPSK = ""; @@ -111,7 +110,7 @@ class SyrlinksHkHandler : public DeviceHandlerBase { StartupState startupState = StartupState::OFF; - bool debug = true; + bool debug = false; /** * This object is used to store the id of the next command to execute. This controls the @@ -212,6 +211,8 @@ class SyrlinksHkHandler : public DeviceHandlerBase { float calcTempVal(uint16_t); ReturnValue_t handleAckReply(const uint8_t* packet); + + void prepareCommand(std::string command, DeviceCommandId_t commandId); }; #endif /* MISSION_DEVICES_SYRLINKSHKHANDLER_H_ */ diff --git a/mission/devices/devicedefinitions/SyrlinksDefinitions.h b/mission/devices/devicedefinitions/SyrlinksDefinitions.h index bf964063..a816dc29 100644 --- a/mission/devices/devicedefinitions/SyrlinksDefinitions.h +++ b/mission/devices/devicedefinitions/SyrlinksDefinitions.h @@ -24,10 +24,11 @@ static const DeviceCommandId_t TEMP_POWER_AMPLIFIER_HIGH_BYTE = 13; static const DeviceCommandId_t TEMP_POWER_AMPLIFIER_LOW_BYTE = 14; static const DeviceCommandId_t TEMP_BASEBAND_BOARD_HIGH_BYTE = 15; static const DeviceCommandId_t TEMP_BASEBAND_BOARD_LOW_BYTE = 16; -static const DeviceCommandId_t SET_WAVEFORM_OQPSK = 17; -static const DeviceCommandId_t SET_WAVEFORM_BPSK = 18; -static const DeviceCommandId_t SET_SECOND_CONFIG = 19; +static const DeviceCommandId_t CONFIG_OQPSK = 17; +// After startup syrlinks always in BSPK configuration +static const DeviceCommandId_t CONFIG_BPSK = 18; static const DeviceCommandId_t ENABLE_DEBUG = 20; +static const DeviceCommandId_t DISABLE_DEBUG = 21; /** Size of a simple transmission success response */ static const uint8_t ACK_SIZE = 12; From a30e57142a6480b14ee38cdeca9681fb2acdd667 Mon Sep 17 00:00:00 2001 From: Jakob Meier Date: Mon, 4 Apr 2022 15:05:56 +0200 Subject: [PATCH 06/19] tmtc update --- tmtc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tmtc b/tmtc index 811aedce..592f3754 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 811aedce9762daa87e268b8832f23b0d28f8a714 +Subproject commit 592f37544f252466f702502ffb0140840ab75d8c From 65ce25ec7abf792d59b83bf85be1c34a46334aa2 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 4 Apr 2022 17:16:52 +0200 Subject: [PATCH 07/19] improved P60 HK handling --- bsp_q7s/core/ObjectFactory.cpp | 6 +- fsfw | 2 +- .../PlocSupervisorDefinitions.h | 2 +- linux/devices/ploc/PlocMPSoCHandler.cpp | 131 ++- linux/devices/ploc/PlocSupervisorHandler.cpp | 21 +- linux/devices/ploc/PlocUpdater.cpp | 23 +- .../devices/startracker/StarTrackerHandler.h | 2 +- mission/devices/ACUHandler.cpp | 127 +-- mission/devices/P60DockHandler.cpp | 408 +++------- mission/devices/P60DockHandler.h | 7 + mission/devices/PCDUHandler.cpp | 309 ++++---- mission/devices/PDU1Handler.cpp | 162 ++-- mission/devices/PDU2Handler.cpp | 160 ++-- mission/devices/RadiationSensorHandler.cpp | 24 +- mission/devices/SyrlinksHkHandler.cpp | 31 +- mission/devices/SyrlinksHkHandler.h | 3 +- .../devicedefinitions/GomspaceDefinitions.h | 749 ++++++++---------- mission/system/AcsBoardAssembly.cpp | 30 +- tmtc | 2 +- 19 files changed, 928 insertions(+), 1271 deletions(-) diff --git a/bsp_q7s/core/ObjectFactory.cpp b/bsp_q7s/core/ObjectFactory.cpp index 123ef60e..2d28a095 100644 --- a/bsp_q7s/core/ObjectFactory.cpp +++ b/bsp_q7s/core/ObjectFactory.cpp @@ -662,9 +662,9 @@ void ObjectFactory::createPayloadComponents(LinuxLibgpioIF* gpioComIF) { auto supvGpioCookie = new GpioCookie; supvGpioCookie->addGpio(gpioIds::ENABLE_SUPV_UART, gpioConfigSupv); gpioComIF->addGpios(supvGpioCookie); - auto supervisorCookie = new UartCookie( - objects::PLOC_SUPERVISOR_HANDLER, q7s::UART_PLOC_SUPERVSIOR_DEV, UartModes::NON_CANONICAL, - uart::PLOC_SUPERVISOR_BAUD, supv::MAX_PACKET_SIZE * 20); + auto supervisorCookie = new UartCookie(objects::PLOC_SUPERVISOR_HANDLER, + q7s::UART_PLOC_SUPERVSIOR_DEV, UartModes::NON_CANONICAL, + uart::PLOC_SUPERVISOR_BAUD, supv::MAX_PACKET_SIZE * 20); supervisorCookie->setNoFixedSizeReply(); new PlocSupervisorHandler(objects::PLOC_SUPERVISOR_HANDLER, objects::UART_COM_IF, supervisorCookie, Gpio(gpioIds::ENABLE_SUPV_UART, gpioComIF), diff --git a/fsfw b/fsfw index ce2f7c4f..e4c6a69f 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit ce2f7c4fdf97d92466c921135b9cec770ba7fd20 +Subproject commit e4c6a69f776cd8056985ce56ba6528bd842a1ea8 diff --git a/linux/devices/devicedefinitions/PlocSupervisorDefinitions.h b/linux/devices/devicedefinitions/PlocSupervisorDefinitions.h index 96e72f86..58166e98 100644 --- a/linux/devices/devicedefinitions/PlocSupervisorDefinitions.h +++ b/linux/devices/devicedefinitions/PlocSupervisorDefinitions.h @@ -1541,6 +1541,6 @@ class LatchupStatusReport : public StaticLocalDataSet { lp_var_t isSet = lp_var_t(sid.objectId, PoolIds::LATCHUP_RPT_TIME_IS_SET, this); }; -} // namespace PLOC_SPV +} // namespace supv #endif /* MISSION_DEVICES_DEVICEDEFINITIONS_PLOCSVPDEFINITIONS_H_ */ diff --git a/linux/devices/ploc/PlocMPSoCHandler.cpp b/linux/devices/ploc/PlocMPSoCHandler.cpp index d6777afd..13fa9ed7 100644 --- a/linux/devices/ploc/PlocMPSoCHandler.cpp +++ b/linux/devices/ploc/PlocMPSoCHandler.cpp @@ -1,9 +1,9 @@ #include "PlocMPSoCHandler.h" -#include "linux/devices/devicedefinitions/PlocSupervisorDefinitions.h" #include "OBSWConfig.h" #include "fsfw/datapool/PoolReadGuard.h" #include "fsfw/globalfunctions/CRC.h" +#include "linux/devices/devicedefinitions/PlocSupervisorDefinitions.h" PlocMPSoCHandler::PlocMPSoCHandler(object_id_t objectId, object_id_t uartComIFid, CookieIF* comCookie, PlocMPSoCHelper* plocMPSoCHelper, @@ -87,8 +87,8 @@ void PlocMPSoCHandler::performOperationHook() { } } CommandMessage message; - for (ReturnValue_t result = commandActionHelperQueue->receiveMessage(&message); result == RETURN_OK; - result = commandActionHelperQueue->receiveMessage(&message)) { + for (ReturnValue_t result = commandActionHelperQueue->receiveMessage(&message); + result == RETURN_OK; result = commandActionHelperQueue->receiveMessage(&message)) { result = commandActionHelper.handleReply(&message); if (result == RETURN_OK) { continue; @@ -133,31 +133,31 @@ ReturnValue_t PlocMPSoCHandler::executeAction(ActionId_t actionId, MessageQueueI } void PlocMPSoCHandler::doStartUp() { - switch(powerState) { - case PowerState::OFF: + switch (powerState) { + case PowerState::OFF: commandActionHelper.commandAction(supervisorHandler, supv::START_MPSOC); powerState = PowerState::BOOTING; break; - case PowerState::ON: + case PowerState::ON: setMode(_MODE_TO_ON); uartIsolatorSwitch.pullHigh(); break; - default: + default: break; } } void PlocMPSoCHandler::doShutDown() { - switch(powerState) { - case PowerState::ON: + switch (powerState) { + case PowerState::ON: uartIsolatorSwitch.pullLow(); commandActionHelper.commandAction(supervisorHandler, supv::SHUTDOWN_MPSOC); powerState = PowerState::SHUTDOWN; break; - case PowerState::OFF: + case PowerState::OFF: setMode(_MODE_POWER_DOWN); break; - default: + default: break; } } @@ -703,64 +703,57 @@ size_t PlocMPSoCHandler::getNextReplyLength(DeviceCommandId_t commandId) { return replyLen; } -MessageQueueIF* PlocMPSoCHandler::getCommandQueuePtr() { - return commandActionHelperQueue; -} +MessageQueueIF* PlocMPSoCHandler::getCommandQueuePtr() { return commandActionHelperQueue; } -void PlocMPSoCHandler::stepSuccessfulReceived(ActionId_t actionId, uint8_t step) { - return; -} +void PlocMPSoCHandler::stepSuccessfulReceived(ActionId_t actionId, uint8_t step) { return; } void PlocMPSoCHandler::stepFailedReceived(ActionId_t actionId, uint8_t step, - ReturnValue_t returnCode) { - switch (actionId) { - case supv::START_MPSOC: - sif::warning << "PlocMPSoCHandler::stepFailedReceived: Failed to start MPSoC" - << std::endl; - powerState = PowerState::OFF; - break; - case supv::SHUTDOWN_MPSOC: - triggerEvent(MPSOC_SHUTDOWN_FAILED); - sif::warning << "PlocMPSoCHandler::stepFailedReceived: Failed to shutdown MPSoC" - << std::endl; - // TODO: Setting state to on or off here? - powerState = PowerState::ON; - break; - default: - sif::debug - << "PlocMPSoCHandler::stepFailedReceived: Received unexpected action reply" - << std::endl; - break; - } + ReturnValue_t returnCode) { + switch (actionId) { + case supv::START_MPSOC: + sif::warning << "PlocMPSoCHandler::stepFailedReceived: Failed to start MPSoC" << std::endl; + powerState = PowerState::OFF; + break; + case supv::SHUTDOWN_MPSOC: + triggerEvent(MPSOC_SHUTDOWN_FAILED); + sif::warning << "PlocMPSoCHandler::stepFailedReceived: Failed to shutdown MPSoC" << std::endl; + // TODO: Setting state to on or off here? + powerState = PowerState::ON; + break; + default: + sif::debug << "PlocMPSoCHandler::stepFailedReceived: Received unexpected action reply" + << std::endl; + break; + } } void PlocMPSoCHandler::dataReceived(ActionId_t actionId, const uint8_t* data, uint32_t size) { - return; + return; } void PlocMPSoCHandler::completionSuccessfulReceived(ActionId_t actionId) { - if (actionId != supv::EXE_REPORT) { - sif::debug << "PlocMPSoCHandler::completionSuccessfulReceived: Did not expect this action " - << "ID" << std::endl; - return; - } - switch(powerState) { + if (actionId != supv::EXE_REPORT) { + sif::debug << "PlocMPSoCHandler::completionSuccessfulReceived: Did not expect this action " + << "ID" << std::endl; + return; + } + switch (powerState) { case PowerState::BOOTING: { - powerState = PowerState::ON; - break; + powerState = PowerState::ON; + break; } case PowerState::SHUTDOWN: { - powerState = PowerState::OFF; - break; + powerState = PowerState::OFF; + break; } default: { break; } - } + } } void PlocMPSoCHandler::completionFailedReceived(ActionId_t actionId, ReturnValue_t returnCode) { - handleActionCommandFailure(actionId); + handleActionCommandFailure(actionId); } void PlocMPSoCHandler::handleDeviceTM(const uint8_t* data, size_t dataSize, @@ -862,27 +855,27 @@ void PlocMPSoCHandler::handleActionCommandFailure(ActionId_t actionId) { switch (actionId) { case supv::ACK_REPORT: case supv::EXE_REPORT: - break; + break; default: - sif::debug << "PlocMPSoCHandler::handleActionCommandFailure: Did not expect this action ID " - << std::endl; - return; + sif::debug << "PlocMPSoCHandler::handleActionCommandFailure: Did not expect this action ID " + << std::endl; + return; } - switch(powerState) { - case PowerState::BOOTING: { - sif::warning << "PlocMPSoCHandler::handleActionCommandFailure: Failed to boot MPSoC" - << std::endl; - powerState = PowerState::OFF; - break; - } - case PowerState::SHUTDOWN: { - sif::warning << "PlocMPSoCHandler::handleActionCommandFailure: Failed to shutdown MPSoC" - << std::endl; - powerState = PowerState::ON; - break; - } - default: - break; + switch (powerState) { + case PowerState::BOOTING: { + sif::warning << "PlocMPSoCHandler::handleActionCommandFailure: Failed to boot MPSoC" + << std::endl; + powerState = PowerState::OFF; + break; + } + case PowerState::SHUTDOWN: { + sif::warning << "PlocMPSoCHandler::handleActionCommandFailure: Failed to shutdown MPSoC" + << std::endl; + powerState = PowerState::ON; + break; + } + default: + break; } return; } diff --git a/linux/devices/ploc/PlocSupervisorHandler.cpp b/linux/devices/ploc/PlocSupervisorHandler.cpp index 078475c9..5065c7dd 100644 --- a/linux/devices/ploc/PlocSupervisorHandler.cpp +++ b/linux/devices/ploc/PlocSupervisorHandler.cpp @@ -384,7 +384,7 @@ ReturnValue_t PlocSupervisorHandler::scanForReply(const uint8_t* start, size_t r ReturnValue_t PlocSupervisorHandler::getSwitches(const uint8_t** switches, uint8_t* numberOfSwitches) { if (powerSwitch == power::NO_SWITCH) { - return DeviceHandlerBase::NO_SWITCH; + return DeviceHandlerBase::NO_SWITCH; } *numberOfSwitches = 1; *switches = &powerSwitch; @@ -489,8 +489,8 @@ ReturnValue_t PlocSupervisorHandler::enableReplyInReplyMap(DeviceCommandMap::ite switch (command->first) { case supv::GET_HK_REPORT: { enabledReplies = 3; - result = DeviceHandlerBase::enableReplyInReplyMap(command, enabledReplies, true, - supv::HK_REPORT); + result = + DeviceHandlerBase::enableReplyInReplyMap(command, enabledReplies, true, supv::HK_REPORT); if (result != RETURN_OK) { sif::debug << "PlocSupervisorHandler::enableReplyInReplyMap: Reply with id " << supv::HK_REPORT << " not in replyMap" << std::endl; @@ -589,15 +589,15 @@ ReturnValue_t PlocSupervisorHandler::enableReplyInReplyMap(DeviceCommandMap::ite result = DeviceHandlerBase::enableReplyInReplyMap(command, enabledReplies, true, supv::ACK_REPORT); if (result != RETURN_OK) { - sif::debug << "PlocSupervisorHandler::enableReplyInReplyMap: Reply with id " - << supv::ACK_REPORT << " not in replyMap" << std::endl; + sif::debug << "PlocSupervisorHandler::enableReplyInReplyMap: Reply with id " << supv::ACK_REPORT + << " not in replyMap" << std::endl; } result = DeviceHandlerBase::enableReplyInReplyMap(command, enabledReplies, true, supv::EXE_REPORT); if (result != RETURN_OK) { - sif::debug << "PlocSupervisorHandler::enableReplyInReplyMap: Reply with id " - << supv::EXE_REPORT << " not in replyMap" << std::endl; + sif::debug << "PlocSupervisorHandler::enableReplyInReplyMap: Reply with id " << supv::EXE_REPORT + << " not in replyMap" << std::endl; } return RETURN_OK; @@ -1013,7 +1013,7 @@ void PlocSupervisorHandler::prepareEmptyCmd(uint16_t apid) { void PlocSupervisorHandler::prepareSelBootImageCmd(const uint8_t* commandData) { supv::MPSoCBootSelect packet(*commandData, *(commandData + 1), *(commandData + 2), - *(commandData + 3)); + *(commandData + 3)); packetToOutBuffer(packet.getWholeData(), packet.getFullSize()); } @@ -1459,9 +1459,8 @@ ReturnValue_t PlocSupervisorHandler::handleMramDumpFile(DeviceCommandId_t id) { return MRAM_FILE_NOT_EXISTS; } std::ofstream file(activeMramFile, std::ios_base::app | std::ios_base::out); - file.write( - reinterpret_cast(spacePacketBuffer + supv::SPACE_PACKET_HEADER_LENGTH), - packetLen - 1); + file.write(reinterpret_cast(spacePacketBuffer + supv::SPACE_PACKET_HEADER_LENGTH), + packetLen - 1); file.close(); return RETURN_OK; } diff --git a/linux/devices/ploc/PlocUpdater.cpp b/linux/devices/ploc/PlocUpdater.cpp index 220b1e00..37a553da 100644 --- a/linux/devices/ploc/PlocUpdater.cpp +++ b/linux/devices/ploc/PlocUpdater.cpp @@ -262,12 +262,11 @@ void PlocUpdater::commandUpdateAvailable() { calcImageCrc(); supv::UpdateInfo packet(supv::APID_UPDATE_AVAILABLE, static_cast(image), - static_cast(partition), imageSize, imageCrc, - numOfUpdatePackets); + static_cast(partition), imageSize, imageCrc, numOfUpdatePackets); - result = commandActionHelper.commandAction(objects::PLOC_SUPERVISOR_HANDLER, - supv::UPDATE_AVAILABLE, packet.getWholeData(), - packet.getFullSize()); + result = + commandActionHelper.commandAction(objects::PLOC_SUPERVISOR_HANDLER, supv::UPDATE_AVAILABLE, + packet.getWholeData(), packet.getFullSize()); if (result != RETURN_OK) { sif::warning << "PlocUpdater::commandUpdateAvailable: Failed to send update available" << " packet to supervisor handler" << std::endl; @@ -311,9 +310,9 @@ void PlocUpdater::commandUpdatePacket() { } packet.makeCrc(); - result = commandActionHelper.commandAction(objects::PLOC_SUPERVISOR_HANDLER, - supv::UPDATE_IMAGE_DATA, packet.getWholeData(), - packet.getFullSize()); + result = + commandActionHelper.commandAction(objects::PLOC_SUPERVISOR_HANDLER, supv::UPDATE_IMAGE_DATA, + packet.getWholeData(), packet.getFullSize()); if (result != RETURN_OK) { sif::warning << "PlocUpdater::commandUpdateAvailable: Failed to send update" @@ -335,12 +334,10 @@ void PlocUpdater::commandUpdateVerify() { ReturnValue_t result = RETURN_OK; supv::UpdateInfo packet(supv::APID_UPDATE_VERIFY, static_cast(image), - static_cast(partition), imageSize, imageCrc, - numOfUpdatePackets); + static_cast(partition), imageSize, imageCrc, numOfUpdatePackets); - result = - commandActionHelper.commandAction(objects::PLOC_SUPERVISOR_HANDLER, supv::UPDATE_VERIFY, - packet.getWholeData(), packet.getFullSize()); + result = commandActionHelper.commandAction(objects::PLOC_SUPERVISOR_HANDLER, supv::UPDATE_VERIFY, + packet.getWholeData(), packet.getFullSize()); if (result != RETURN_OK) { sif::warning << "PlocUpdater::commandUpdateAvailable: Failed to send update available" << " packet to supervisor handler" << std::endl; diff --git a/linux/devices/startracker/StarTrackerHandler.h b/linux/devices/startracker/StarTrackerHandler.h index 2667db31..90a30966 100644 --- a/linux/devices/startracker/StarTrackerHandler.h +++ b/linux/devices/startracker/StarTrackerHandler.h @@ -7,12 +7,12 @@ #include "ArcsecJsonParamBase.h" #include "OBSWConfig.h" #include "StrHelper.h" +#include "devices/powerSwitcherList.h" #include "fsfw/devicehandlers/DeviceHandlerBase.h" #include "fsfw/src/fsfw/serialize/SerializeAdapter.h" #include "fsfw/timemanager/Countdown.h" #include "linux/devices/devicedefinitions/StarTrackerDefinitions.h" #include "thirdparty/arcsec_star_tracker/common/SLIP.h" -#include "devices/powerSwitcherList.h" /** * @brief This is the device handler for the star tracker from arcsec. diff --git a/mission/devices/ACUHandler.cpp b/mission/devices/ACUHandler.cpp index b7a54088..7c6e048c 100644 --- a/mission/devices/ACUHandler.cpp +++ b/mission/devices/ACUHandler.cpp @@ -194,81 +194,82 @@ void ACUHandler::parseHkTableReply(const uint8_t *packet) { ReturnValue_t ACUHandler::initializeLocalDataPool(localpool::DataPool &localDataPoolMap, LocalDataPoolManager &poolManager) { - localDataPoolMap.emplace(P60System::ACU_CURRENT_IN_CHANNEL0, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::ACU_CURRENT_IN_CHANNEL1, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::ACU_CURRENT_IN_CHANNEL2, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::ACU_CURRENT_IN_CHANNEL3, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::ACU_CURRENT_IN_CHANNEL4, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::ACU_CURRENT_IN_CHANNEL5, new PoolEntry({0})); + using namespace P60System; + localDataPoolMap.emplace(pool::ACU_CURRENT_IN_CHANNEL0, new PoolEntry({0})); + localDataPoolMap.emplace(pool::ACU_CURRENT_IN_CHANNEL1, new PoolEntry({0})); + localDataPoolMap.emplace(pool::ACU_CURRENT_IN_CHANNEL2, new PoolEntry({0})); + localDataPoolMap.emplace(pool::ACU_CURRENT_IN_CHANNEL3, new PoolEntry({0})); + localDataPoolMap.emplace(pool::ACU_CURRENT_IN_CHANNEL4, new PoolEntry({0})); + localDataPoolMap.emplace(pool::ACU_CURRENT_IN_CHANNEL5, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::ACU_VOLTAGE_IN_CHANNEL0, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::ACU_VOLTAGE_IN_CHANNEL1, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::ACU_VOLTAGE_IN_CHANNEL2, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::ACU_VOLTAGE_IN_CHANNEL3, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::ACU_VOLTAGE_IN_CHANNEL4, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::ACU_VOLTAGE_IN_CHANNEL5, new PoolEntry({0})); + localDataPoolMap.emplace(pool::ACU_VOLTAGE_IN_CHANNEL0, new PoolEntry({0})); + localDataPoolMap.emplace(pool::ACU_VOLTAGE_IN_CHANNEL1, new PoolEntry({0})); + localDataPoolMap.emplace(pool::ACU_VOLTAGE_IN_CHANNEL2, new PoolEntry({0})); + localDataPoolMap.emplace(pool::ACU_VOLTAGE_IN_CHANNEL3, new PoolEntry({0})); + localDataPoolMap.emplace(pool::ACU_VOLTAGE_IN_CHANNEL4, new PoolEntry({0})); + localDataPoolMap.emplace(pool::ACU_VOLTAGE_IN_CHANNEL5, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::ACU_VCC, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::ACU_VBAT, new PoolEntry({0})); + localDataPoolMap.emplace(pool::ACU_VCC, new PoolEntry({0})); + localDataPoolMap.emplace(pool::ACU_VBAT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::ACU_TEMPERATURE_1, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::ACU_TEMPERATURE_2, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::ACU_TEMPERATURE_3, new PoolEntry({0})); + localDataPoolMap.emplace(pool::ACU_TEMPERATURE_1, new PoolEntry({0})); + localDataPoolMap.emplace(pool::ACU_TEMPERATURE_2, new PoolEntry({0})); + localDataPoolMap.emplace(pool::ACU_TEMPERATURE_3, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::ACU_MPPT_MODE, new PoolEntry({0})); + localDataPoolMap.emplace(pool::ACU_MPPT_MODE, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::ACU_VBOOST_CHANNEL0, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::ACU_VBOOST_CHANNEL1, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::ACU_VBOOST_CHANNEL2, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::ACU_VBOOST_CHANNEL3, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::ACU_VBOOST_CHANNEL4, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::ACU_VBOOST_CHANNEL5, new PoolEntry({0})); + localDataPoolMap.emplace(pool::ACU_VBOOST_CHANNEL0, new PoolEntry({0})); + localDataPoolMap.emplace(pool::ACU_VBOOST_CHANNEL1, new PoolEntry({0})); + localDataPoolMap.emplace(pool::ACU_VBOOST_CHANNEL2, new PoolEntry({0})); + localDataPoolMap.emplace(pool::ACU_VBOOST_CHANNEL3, new PoolEntry({0})); + localDataPoolMap.emplace(pool::ACU_VBOOST_CHANNEL4, new PoolEntry({0})); + localDataPoolMap.emplace(pool::ACU_VBOOST_CHANNEL5, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::ACU_POWER_CHANNEL0, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::ACU_POWER_CHANNEL1, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::ACU_POWER_CHANNEL2, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::ACU_POWER_CHANNEL3, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::ACU_POWER_CHANNEL4, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::ACU_POWER_CHANNEL5, new PoolEntry({0})); + localDataPoolMap.emplace(pool::ACU_POWER_CHANNEL0, new PoolEntry({0})); + localDataPoolMap.emplace(pool::ACU_POWER_CHANNEL1, new PoolEntry({0})); + localDataPoolMap.emplace(pool::ACU_POWER_CHANNEL2, new PoolEntry({0})); + localDataPoolMap.emplace(pool::ACU_POWER_CHANNEL3, new PoolEntry({0})); + localDataPoolMap.emplace(pool::ACU_POWER_CHANNEL4, new PoolEntry({0})); + localDataPoolMap.emplace(pool::ACU_POWER_CHANNEL5, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::ACU_DAC_EN_0, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::ACU_DAC_EN_1, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::ACU_DAC_EN_2, new PoolEntry({0})); + localDataPoolMap.emplace(pool::ACU_DAC_EN_0, new PoolEntry({0})); + localDataPoolMap.emplace(pool::ACU_DAC_EN_1, new PoolEntry({0})); + localDataPoolMap.emplace(pool::ACU_DAC_EN_2, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::ACU_DAC_RAW_0, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::ACU_DAC_RAW_1, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::ACU_DAC_RAW_2, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::ACU_DAC_RAW_3, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::ACU_DAC_RAW_4, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::ACU_DAC_RAW_5, new PoolEntry({0})); + localDataPoolMap.emplace(pool::ACU_DAC_RAW_0, new PoolEntry({0})); + localDataPoolMap.emplace(pool::ACU_DAC_RAW_1, new PoolEntry({0})); + localDataPoolMap.emplace(pool::ACU_DAC_RAW_2, new PoolEntry({0})); + localDataPoolMap.emplace(pool::ACU_DAC_RAW_3, new PoolEntry({0})); + localDataPoolMap.emplace(pool::ACU_DAC_RAW_4, new PoolEntry({0})); + localDataPoolMap.emplace(pool::ACU_DAC_RAW_5, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::ACU_BOOTCAUSE, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::ACU_BOOTCNT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::ACU_UPTIME, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::ACU_RESET_CAUSE, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::ACU_MPPT_TIME, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::ACU_MPPT_PERIOD, new PoolEntry({0})); + localDataPoolMap.emplace(pool::ACU_BOOTCAUSE, new PoolEntry({0})); + localDataPoolMap.emplace(pool::ACU_BOOTCNT, new PoolEntry({0})); + localDataPoolMap.emplace(pool::ACU_UPTIME, new PoolEntry({0})); + localDataPoolMap.emplace(pool::ACU_RESET_CAUSE, new PoolEntry({0})); + localDataPoolMap.emplace(pool::ACU_MPPT_TIME, new PoolEntry({0})); + localDataPoolMap.emplace(pool::ACU_MPPT_PERIOD, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::ACU_DEVICE_0, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::ACU_DEVICE_1, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::ACU_DEVICE_2, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::ACU_DEVICE_3, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::ACU_DEVICE_4, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::ACU_DEVICE_5, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::ACU_DEVICE_6, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::ACU_DEVICE_7, new PoolEntry({0})); + localDataPoolMap.emplace(pool::ACU_DEVICE_0, new PoolEntry({0})); + localDataPoolMap.emplace(pool::ACU_DEVICE_1, new PoolEntry({0})); + localDataPoolMap.emplace(pool::ACU_DEVICE_2, new PoolEntry({0})); + localDataPoolMap.emplace(pool::ACU_DEVICE_3, new PoolEntry({0})); + localDataPoolMap.emplace(pool::ACU_DEVICE_4, new PoolEntry({0})); + localDataPoolMap.emplace(pool::ACU_DEVICE_5, new PoolEntry({0})); + localDataPoolMap.emplace(pool::ACU_DEVICE_6, new PoolEntry({0})); + localDataPoolMap.emplace(pool::ACU_DEVICE_7, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::ACU_DEVICE_0_STATUS, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::ACU_DEVICE_1_STATUS, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::ACU_DEVICE_2_STATUS, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::ACU_DEVICE_3_STATUS, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::ACU_DEVICE_4_STATUS, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::ACU_DEVICE_5_STATUS, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::ACU_DEVICE_6_STATUS, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::ACU_DEVICE_7_STATUS, new PoolEntry({0})); + localDataPoolMap.emplace(pool::ACU_DEVICE_0_STATUS, new PoolEntry({0})); + localDataPoolMap.emplace(pool::ACU_DEVICE_1_STATUS, new PoolEntry({0})); + localDataPoolMap.emplace(pool::ACU_DEVICE_2_STATUS, new PoolEntry({0})); + localDataPoolMap.emplace(pool::ACU_DEVICE_3_STATUS, new PoolEntry({0})); + localDataPoolMap.emplace(pool::ACU_DEVICE_4_STATUS, new PoolEntry({0})); + localDataPoolMap.emplace(pool::ACU_DEVICE_5_STATUS, new PoolEntry({0})); + localDataPoolMap.emplace(pool::ACU_DEVICE_6_STATUS, new PoolEntry({0})); + localDataPoolMap.emplace(pool::ACU_DEVICE_7_STATUS, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::ACU_WDT_CNT_GND, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::ACU_WDT_GND_LEFT, new PoolEntry({0})); + localDataPoolMap.emplace(pool::ACU_WDT_CNT_GND, new PoolEntry({0})); + localDataPoolMap.emplace(pool::ACU_WDT_GND_LEFT, new PoolEntry({0})); return HasReturnvaluesIF::RETURN_OK; } diff --git a/mission/devices/P60DockHandler.cpp b/mission/devices/P60DockHandler.cpp index b506a92b..5ad4ffee 100644 --- a/mission/devices/P60DockHandler.cpp +++ b/mission/devices/P60DockHandler.cpp @@ -71,95 +71,29 @@ void P60DockHandler::letChildHandleHkReply(DeviceCommandId_t id, const uint8_t * } void P60DockHandler::parseHkTableReply(const uint8_t *packet) { + using namespace P60Dock; uint16_t dataOffset = 0; - p60dockHkTableDataset.read(); + PoolReadGuard pg(&p60dockHkTableDataset); + if (pg.getReadResult() != HasReturnvaluesIF::RETURN_OK) { + return; + } /** * Fist 10 bytes contain the gomspace header. Each variable is preceded by the 16-bit table * address. */ dataOffset += 12; - p60dockHkTableDataset.currentAcuVcc = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - p60dockHkTableDataset.currentPdu1Vcc = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - p60dockHkTableDataset.currentX3IdleVcc = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - p60dockHkTableDataset.currentPdu2Vcc = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - p60dockHkTableDataset.currentAcuVbat = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - p60dockHkTableDataset.currentPdu1Vbat = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - p60dockHkTableDataset.currentX3IdleVbat = - *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - p60dockHkTableDataset.currentPdu2Vbat = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - p60dockHkTableDataset.currentStackVbat = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - p60dockHkTableDataset.currentStack3V3 = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - p60dockHkTableDataset.currentStack5V = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - p60dockHkTableDataset.currentGS3V3 = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - p60dockHkTableDataset.currentGS5V = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - - p60dockHkTableDataset.voltageAcuVcc = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - p60dockHkTableDataset.voltageAcuVcc = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - p60dockHkTableDataset.voltagePdu1Vcc = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - p60dockHkTableDataset.voltageX3IdleVcc = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - p60dockHkTableDataset.voltagePdu2Vcc = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - p60dockHkTableDataset.voltageAcuVbat = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - p60dockHkTableDataset.voltagePdu1Vbat = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - p60dockHkTableDataset.voltageX3IdleVbat = - *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - p60dockHkTableDataset.voltagePdu2Vbat = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - p60dockHkTableDataset.voltageStackVbat = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - p60dockHkTableDataset.voltageStack3V3 = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - p60dockHkTableDataset.voltageStack5V = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - p60dockHkTableDataset.voltageGS3V3 = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - - p60dockHkTableDataset.outputEnableStateAcuVcc = *(packet + dataOffset); - dataOffset += 3; - p60dockHkTableDataset.outputEnableStatePdu1Vcc = *(packet + dataOffset); - dataOffset += 3; - p60dockHkTableDataset.outputEnableStateX3IdleVcc = *(packet + dataOffset); - dataOffset += 3; - p60dockHkTableDataset.outputEnableStatePdu2Vcc = *(packet + dataOffset); - dataOffset += 3; - p60dockHkTableDataset.outputEnableStateAcuVbat = *(packet + dataOffset); - dataOffset += 3; - p60dockHkTableDataset.outputEnableStatePdu1Vbat = *(packet + dataOffset); - dataOffset += 3; - p60dockHkTableDataset.outputEnableStateX3IdleVbat = *(packet + dataOffset); - dataOffset += 3; - p60dockHkTableDataset.outputEnableStatePdu2Vbat = *(packet + dataOffset); - dataOffset += 3; - p60dockHkTableDataset.outputEnableStateStackVbat = *(packet + dataOffset); - dataOffset += 3; - p60dockHkTableDataset.outputEnableStateStack3V3 = *(packet + dataOffset); - dataOffset += 3; - p60dockHkTableDataset.outputEnableStateStack5V = *(packet + dataOffset); - dataOffset += 3; - p60dockHkTableDataset.outputEnableStateGS3V3 = *(packet + dataOffset); - dataOffset += 3; - p60dockHkTableDataset.outputEnableStateGS5V = *(packet + dataOffset); - dataOffset += 3; + for (uint8_t idx = 0; idx < hk::CHNLS_LEN; idx++) { + p60dockHkTableDataset.currents[idx] = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); + dataOffset += 4; + } + for (uint8_t idx = 0; idx < hk::CHNLS_LEN; idx++) { + p60dockHkTableDataset.voltages[idx] = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); + dataOffset += 4; + } + for (uint8_t idx = 0; idx < hk::CHNLS_LEN; idx++) { + p60dockHkTableDataset.outputEnables[idx] = *(packet + dataOffset); + dataOffset += 3; + } p60dockHkTableDataset.temperature1 = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); dataOffset += 4; @@ -187,35 +121,10 @@ void P60DockHandler::parseHkTableReply(const uint8_t *packet) { p60dockHkTableDataset.converter5VStatus = *(packet + dataOffset); dataOffset += 3; - p60dockHkTableDataset.latchupsAcuVcc = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - p60dockHkTableDataset.latchupsAcuVcc = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - p60dockHkTableDataset.latchupsPdu1Vcc = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - p60dockHkTableDataset.latchupsX3IdleVcc = - *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - p60dockHkTableDataset.latchupsPdu2Vcc = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - p60dockHkTableDataset.latchupsAcuVbat = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - p60dockHkTableDataset.latchupsPdu1Vbat = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - p60dockHkTableDataset.latchupsX3IdleVbat = - *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - p60dockHkTableDataset.latchupsPdu2Vbat = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - p60dockHkTableDataset.latchupsStackVbat = - *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - p60dockHkTableDataset.latchupsStack3V3 = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - p60dockHkTableDataset.latchupsStack5V = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; - p60dockHkTableDataset.latchupsGS3V3 = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); - dataOffset += 4; + for (uint8_t idx = 0; idx < hk::CHNLS_LEN; idx++) { + p60dockHkTableDataset.latchups[idx] = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); + dataOffset += 4; + } p60dockHkTableDataset.dockVbatVoltageValue = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); @@ -234,39 +143,14 @@ void P60DockHandler::parseHkTableReply(const uint8_t *packet) { *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); dataOffset += 4; - p60dockHkTableDataset.device0 = *(packet + dataOffset); - dataOffset += 3; - p60dockHkTableDataset.device1 = *(packet + dataOffset); - dataOffset += 3; - p60dockHkTableDataset.device2 = *(packet + dataOffset); - dataOffset += 3; - p60dockHkTableDataset.device3 = *(packet + dataOffset); - dataOffset += 3; - p60dockHkTableDataset.device4 = *(packet + dataOffset); - dataOffset += 3; - p60dockHkTableDataset.device5 = *(packet + dataOffset); - dataOffset += 3; - p60dockHkTableDataset.device6 = *(packet + dataOffset); - dataOffset += 3; - p60dockHkTableDataset.device7 = *(packet + dataOffset); - dataOffset += 3; - - p60dockHkTableDataset.device0Status = *(packet + dataOffset); - dataOffset += 3; - p60dockHkTableDataset.device1Status = *(packet + dataOffset); - dataOffset += 3; - p60dockHkTableDataset.device2Status = *(packet + dataOffset); - dataOffset += 3; - p60dockHkTableDataset.device3Status = *(packet + dataOffset); - dataOffset += 3; - p60dockHkTableDataset.device4Status = *(packet + dataOffset); - dataOffset += 3; - p60dockHkTableDataset.device5Status = *(packet + dataOffset); - dataOffset += 3; - p60dockHkTableDataset.device6Status = *(packet + dataOffset); - dataOffset += 3; - p60dockHkTableDataset.device7Status = *(packet + dataOffset); - dataOffset += 3; + for (uint8_t idx = 0; idx < NUM_DEVS; idx++) { + p60dockHkTableDataset.devicesType[idx] = *(packet + dataOffset); + dataOffset += 3; + } + for (uint8_t idx = 0; idx < NUM_DEVS; idx++) { + p60dockHkTableDataset.devicesStatus[idx] = *(packet + dataOffset); + dataOffset += 3; + } p60dockHkTableDataset.dearmStatus = *(packet + dataOffset); dataOffset += 3; @@ -320,126 +204,60 @@ void P60DockHandler::parseHkTableReply(const uint8_t *packet) { p60dockHkTableDataset.ant6Depl = *(packet + dataOffset); dataOffset += 3; p60dockHkTableDataset.ar6Depl = *(packet + dataOffset); - - p60dockHkTableDataset.commit(); } ReturnValue_t P60DockHandler::initializeLocalDataPool(localpool::DataPool &localDataPoolMap, LocalDataPoolManager &poolManager) { - localDataPoolMap.emplace(P60System::P60DOCK_CURRENT_ACU_VCC, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_CURRENT_PDU1_VCC, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_CURRENT_X3_IDLE_VCC, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_CURRENT_PDU2_VCC, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_CURRENT_ACU_VBAT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_CURRENT_PDU1_VBAT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_CURRENT_X3_IDLE_VBAT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_CURRENT_PDU2_VBAT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_CURRENT_STACK_VBAT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_CURRENT_STACK_3V3, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_CURRENT_STACK_5V, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_CURRENT_GS3V3, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_CURRENT_GS5V, new PoolEntry({0})); + using namespace P60System; + localDataPoolMap.emplace(pool::CURRENTS, &hkCurrents); - localDataPoolMap.emplace(P60System::P60DOCK_VOLTAGE_ACU_VCC, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_VOLTAGE_PDU1_VCC, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_VOLTAGE_X3_IDLE_VCC, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_VOLTAGE_PDU2_VCC, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_VOLTAGE_ACU_VBAT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_VOLTAGE_PDU1_VBAT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_VOLTAGE_X3_IDLE_VBAT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_VOLTAGE_PDU2_VBAT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_VOLTAGE_STACK_VBAT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_VOLTAGE_STACK_3V3, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_VOLTAGE_STACK_5V, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_VOLTAGE_GS3V3, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_VOLTAGE_GS5V, new PoolEntry({0})); + localDataPoolMap.emplace(pool::VOLTAGES, &hkVoltages); - localDataPoolMap.emplace(P60System::P60DOCK_OUTPUTENABLE_ACU_VCC, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_OUTPUTENABLE_PDU1_VCC, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_OUTPUTENABLE_X3_IDLE_VCC, - new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_OUTPUTENABLE_PDU2_VCC, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_OUTPUTENABLE_ACU_VBAT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_OUTPUTENABLE_PDU1_VBAT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_OUTPUTENABLE_X3_IDLE_VBAT, - new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_OUTPUTENABLE_PDU2_VBAT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_OUTPUTENABLE_STACK_VBAT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_OUTPUTENABLE_STACK_3V3, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_OUTPUTENABLE_STACK_5V, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_OUTPUTENABLE_GS3V3, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_OUTPUTENABLE_GS5V, new PoolEntry({0})); + localDataPoolMap.emplace(pool::OUTPUT_ENABLE, &outputEnables); - localDataPoolMap.emplace(P60System::P60DOCK_TEMPERATURE_1, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_TEMPERATURE_2, new PoolEntry({0})); + localDataPoolMap.emplace(pool::P60DOCK_TEMPERATURE_1, new PoolEntry({0})); + localDataPoolMap.emplace(pool::P60DOCK_TEMPERATURE_2, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_BOOT_CAUSE, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_BOOT_CNT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_UPTIME, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_RESETCAUSE, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_BATT_MODE, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_HEATER_ON, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_CONV_5V_ENABLE_STATUS, new PoolEntry({0})); + localDataPoolMap.emplace(pool::P60DOCK_BOOT_CAUSE, new PoolEntry({0})); + localDataPoolMap.emplace(pool::P60DOCK_BOOT_CNT, new PoolEntry({0})); + localDataPoolMap.emplace(pool::P60DOCK_UPTIME, new PoolEntry({0})); + localDataPoolMap.emplace(pool::P60DOCK_RESETCAUSE, new PoolEntry({0})); + localDataPoolMap.emplace(pool::P60DOCK_BATT_MODE, new PoolEntry({0})); + localDataPoolMap.emplace(pool::P60DOCK_HEATER_ON, new PoolEntry({0})); + localDataPoolMap.emplace(pool::P60DOCK_CONV_5V_ENABLE_STATUS, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_LATCHUP_ACU_VCC, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_LATCHUP_PDU1_VCC, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_LATCHUP_X3_IDLE_VCC, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_LATCHUP_PDU2_VCC, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_LATCHUP_ACU_VBAT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_LATCHUP_PDU1_VBAT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_LATCHUP_X3_IDLE_VBAT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_LATCHUP_PDU2_VBAT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_LATCHUP_STACK_VBAT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_LATCHUP_STACK_3V3, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_LATCHUP_STACK_5V, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_LATCHUP_GS3V3, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_LATCHUP_GS5V, new PoolEntry({0})); + localDataPoolMap.emplace(pool::LATCHUPS, &latchups); - localDataPoolMap.emplace(P60System::P60DOCK_VBAT_VALUE, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_VCC_CURRENT_VALUE, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_BATTERY_CURRENT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_BATTERY_VOLTAGE, new PoolEntry({0})); + localDataPoolMap.emplace(pool::P60DOCK_DOCK_VBAT, new PoolEntry({0})); + localDataPoolMap.emplace(pool::P60DOCK_DOCK_VCC_CURRENT, new PoolEntry({0})); + localDataPoolMap.emplace(pool::P60DOCK_BATTERY_CURRENT, new PoolEntry({0})); + localDataPoolMap.emplace(pool::P60DOCK_BATTERY_VOLTAGE, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_BATTERY_TEMPERATURE_1, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_BATTERY_TEMPERATURE_2, new PoolEntry({0})); + localDataPoolMap.emplace(pool::P60DOCK_BATTERY_TEMPERATURE_1, new PoolEntry({0})); + localDataPoolMap.emplace(pool::P60DOCK_BATTERY_TEMPERATURE_2, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_DEVICE_0, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_DEVICE_1, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_DEVICE_2, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_DEVICE_3, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_DEVICE_4, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_DEVICE_5, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_DEVICE_6, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_DEVICE_7, new PoolEntry({0})); + localDataPoolMap.emplace(pool::DEVICES_TYPE, &devicesType); + localDataPoolMap.emplace(pool::DEVICES_STATUS, &devicesStatus); - localDataPoolMap.emplace(P60System::P60DOCK_DEVICE_0_STATUS, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_DEVICE_1_STATUS, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_DEVICE_2_STATUS, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_DEVICE_3_STATUS, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_DEVICE_4_STATUS, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_DEVICE_5_STATUS, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_DEVICE_6_STATUS, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_DEVICE_7_STATUS, new PoolEntry({0})); + localDataPoolMap.emplace(pool::P60DOCK_DEARM_STATUS, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_DEARM_STATUS, new PoolEntry({0})); + localDataPoolMap.emplace(pool::P60DOCK_WDT_CNT_GND, new PoolEntry({0})); + localDataPoolMap.emplace(pool::P60DOCK_WDT_CNT_I2C, new PoolEntry({0})); + localDataPoolMap.emplace(pool::P60DOCK_WDT_CNT_CAN, new PoolEntry({0})); + localDataPoolMap.emplace(pool::P60DOCK_WDT_CNT_CSP_1, new PoolEntry({0})); + localDataPoolMap.emplace(pool::P60DOCK_WDT_CNT_CSP_2, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_WDT_CNT_GND, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_WDT_CNT_I2C, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_WDT_CNT_CAN, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_WDT_CNT_CSP_1, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_WDT_CNT_CSP_2, new PoolEntry({0})); + localDataPoolMap.emplace(pool::P60DOCK_WDT_GND_LEFT, new PoolEntry({0})); + localDataPoolMap.emplace(pool::P60DOCK_WDT_I2C_LEFT, new PoolEntry({0})); + localDataPoolMap.emplace(pool::P60DOCK_WDT_CAN_LEFT, new PoolEntry({0})); + localDataPoolMap.emplace(pool::P60DOCK_WDT_CSP_LEFT_1, new PoolEntry({0})); + localDataPoolMap.emplace(pool::P60DOCK_WDT_CSP_LEFT_2, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_WDT_GND_LEFT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_WDT_I2C_LEFT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_WDT_CAN_LEFT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_WDT_CSP_LEFT_1, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_WDT_CSP_LEFT_2, new PoolEntry({0})); + localDataPoolMap.emplace(pool::P60DOCK_BATT_CHARGE_CURRENT, new PoolEntry({0})); + localDataPoolMap.emplace(pool::P60DOCK_BATT_DISCHARGE_CURRENT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_BATT_CHARGE_CURRENT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_BATT_DISCHARGE_CURRENT, new PoolEntry({0})); - - localDataPoolMap.emplace(P60System::P60DOCK_ANT6_DEPL, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::P60DOCK_AR6_DEPL, new PoolEntry({0})); + localDataPoolMap.emplace(pool::P60DOCK_ANT6_DEPL, new PoolEntry({0})); + localDataPoolMap.emplace(pool::P60DOCK_AR6_DEPL, new PoolEntry({0})); return HasReturnvaluesIF::RETURN_OK; } @@ -474,6 +292,7 @@ ReturnValue_t P60DockHandler::printStatus(DeviceCommandId_t cmd) { } void P60DockHandler::printHkTableSwitchIV() { + using namespace P60Dock; sif::info << "P60 Dock Info:" << std::endl; sif::info << "Boot Cause: " << p60dockHkTableDataset.bootcause << " | Boot Count: " << std::setw(4) << std::right << p60dockHkTableDataset.bootCount @@ -488,70 +307,43 @@ void P60DockHandler::printHkTableSwitchIV() { sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "BATT" << std::dec << "| -, " << std::setw(4) << std::right << p60dockHkTableDataset.batteryCurrent.value << ", " << std::setw(5) << p60dockHkTableDataset.batteryVoltage.value << std::endl; - sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "ACU VCC" << std::dec << "| " - << unsigned(p60dockHkTableDataset.outputEnableStateAcuVcc.value) << ", " << std::setw(4) - << std::right << p60dockHkTableDataset.currentAcuVcc.value << ", " << std::setw(5) - << p60dockHkTableDataset.voltageAcuVcc.value << std::endl; - sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "ACU VBAT" << std::dec << "| " - << unsigned(p60dockHkTableDataset.outputEnableStateAcuVbat.value) << ", " - << std::setw(4) << std::right << p60dockHkTableDataset.currentAcuVbat.value << ", " - << std::setw(5) << p60dockHkTableDataset.voltageAcuVbat.value << std::endl; - sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "PDU1 VCC" << std::dec << "| " - << unsigned(p60dockHkTableDataset.outputEnableStatePdu1Vcc.value) << ", " - << std::setw(4) << std::right << p60dockHkTableDataset.currentPdu1Vcc.value << ", " - << std::setw(5) << p60dockHkTableDataset.voltagePdu1Vcc.value << std::endl; - sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "PDU1 VBAT" << std::dec << "| " - << unsigned(p60dockHkTableDataset.outputEnableStatePdu1Vbat.value) << ", " - << std::setw(4) << std::right << p60dockHkTableDataset.currentPdu1Vbat.value << ", " - << std::setw(5) << p60dockHkTableDataset.voltagePdu1Vbat.value << std::endl; + auto genericPrintoutHandler = [&](std::string name, uint8_t idx) { + sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << name << std::dec << "| " + << unsigned(p60dockHkTableDataset.outputEnables[idx]) << ", " << std::setw(4) + << std::right << p60dockHkTableDataset.currents[idx] << ", " << std::setw(5) + << p60dockHkTableDataset.voltages[idx] << std::endl; + }; - sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "PDU2 VCC" << std::dec << "| " - << unsigned(p60dockHkTableDataset.outputEnableStatePdu2Vcc.value) << ", " - << std::setw(4) << std::right << p60dockHkTableDataset.currentPdu2Vcc.value << ", " - << std::setw(5) << p60dockHkTableDataset.voltagePdu2Vcc.value << std::endl; - sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "PDU2 VBAT" << std::dec << "| " - << unsigned(p60dockHkTableDataset.outputEnableStatePdu2Vbat.value) << ", " - << std::setw(4) << std::right << p60dockHkTableDataset.currentPdu2Vbat.value << ", " - << std::setw(5) << p60dockHkTableDataset.voltagePdu2Vbat.value << std::endl; - sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "Stack VBAT" << std::dec << "| " - << unsigned(p60dockHkTableDataset.outputEnableStateStackVbat.value) << ", " - << std::setw(4) << std::right << p60dockHkTableDataset.currentStackVbat.value << ", " - << std::setw(5) << p60dockHkTableDataset.voltageStackVbat.value << std::endl; - sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "Stack 3V3" << std::dec << "| " - << unsigned(p60dockHkTableDataset.outputEnableStateStack3V3.value) << ", " - << std::setw(4) << std::right << p60dockHkTableDataset.currentStack3V3.value << ", " - << std::setw(5) << p60dockHkTableDataset.voltageStack3V3.value << std::endl; - sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "Stack 5V" << std::dec << "| " - << unsigned(p60dockHkTableDataset.outputEnableStateStack5V.value) << ", " - << std::setw(4) << std::right << p60dockHkTableDataset.currentStack5V.value << ", " - << std::setw(5) << p60dockHkTableDataset.voltageStack5V.value << std::endl; + genericPrintoutHandler("ACU VCC", hk::ACU_VCC); + genericPrintoutHandler("ACU VBAT", hk::ACU_VBAT); + genericPrintoutHandler("PDU1 VCC", hk::PDU1_VCC); + genericPrintoutHandler("PDU1 VBAT", hk::PDU1_VBAT); + genericPrintoutHandler("PDU2 VCC", hk::PDU2_VCC); + genericPrintoutHandler("PDU2 VBAT", hk::PDU2_VBAT); + genericPrintoutHandler("Stack VBAT", hk::STACK_VBAT); + genericPrintoutHandler("Stack 3V3", hk::STACK_3V3); + genericPrintoutHandler("Stack 5V", hk::STACK_5V); } void P60DockHandler::printHkTableLatchups() { + using namespace P60Dock; sif::info << "P60 Latchup Information" << std::endl; - sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "ACU VCC" << std::dec << "| " - << std::setw(4) << std::right << p60dockHkTableDataset.latchupsAcuVcc << std::endl; - sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "ACU VBAT" << std::dec << "| " - << std::setw(4) << std::right << p60dockHkTableDataset.latchupsAcuVbat << std::endl; - sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "PDU1 VCC" << std::dec << "| " - << std::setw(4) << std::right << p60dockHkTableDataset.latchupsPdu1Vcc << std::endl; - sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "PDU1 VBAT" << std::dec << "| " - << std::setw(4) << std::right << p60dockHkTableDataset.latchupsPdu1Vbat << std::endl; - sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "PDU2 VCC" << std::dec << "| " - << std::setw(4) << std::right << p60dockHkTableDataset.latchupsPdu2Vcc << std::endl; - sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "PDU2 VBAT" << std::dec << "| " - << std::setw(4) << std::right << p60dockHkTableDataset.latchupsPdu2Vbat << std::endl; - sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "Stack 3V3" << std::dec << "| " - << std::setw(4) << std::right << p60dockHkTableDataset.latchupsStack3V3 << std::endl; - sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "Stack 5V" << std::dec << "| " - << std::setw(4) << std::right << p60dockHkTableDataset.latchupsStack5V << std::endl; - sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "GS 3V3" << std::dec << "| " - << std::setw(4) << std::right << p60dockHkTableDataset.latchupsGS3V3 << std::endl; - sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "GS 5V" << std::dec << "| " - << std::setw(4) << std::right << p60dockHkTableDataset.latchupsGS5V << std::endl; - sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "X3 VBAT" << std::dec << "| " - << std::setw(4) << std::right << p60dockHkTableDataset.latchupsX3IdleVbat << std::endl; - sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "X3 VCC" << std::dec << "| " - << std::setw(4) << std::right << p60dockHkTableDataset.latchupsX3IdleVcc << std::endl; + auto genericPrintoutHandler = [&](std::string name, uint8_t idx) { + sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << name << std::dec << "| " + << std::setw(4) << std::right << p60dockHkTableDataset.latchups[idx] << std::endl; + }; + genericPrintoutHandler("ACU VCC", hk::ACU_VCC); + genericPrintoutHandler("ACU VBAT", hk::ACU_VBAT); + genericPrintoutHandler("PDU1 VCC", hk::PDU1_VCC); + genericPrintoutHandler("PDU1 VBAT", hk::PDU1_VBAT); + genericPrintoutHandler("PDU2 VCC", hk::PDU2_VCC); + genericPrintoutHandler("PDU2 VBAT", hk::PDU2_VBAT); + genericPrintoutHandler("STACK VBAT", hk::STACK_VBAT); + genericPrintoutHandler("STACK 3V3", hk::STACK_3V3); + genericPrintoutHandler("STACK 5V", hk::STACK_5V); + genericPrintoutHandler("GS 3V3", hk::GS3V3); + genericPrintoutHandler("GS 5V", hk::GS5V); + genericPrintoutHandler("X3 VBAT", hk::X3_IDLE_VBAT); + genericPrintoutHandler("X3 VCC", hk::X3_IDLE_VCC); } diff --git a/mission/devices/P60DockHandler.h b/mission/devices/P60DockHandler.h index 38ca391a..b86f37bb 100644 --- a/mission/devices/P60DockHandler.h +++ b/mission/devices/P60DockHandler.h @@ -39,6 +39,13 @@ class P60DockHandler : public GomspaceDeviceHandler { P60Dock::HkTableDataset p60dockHkTableDataset; static constexpr uint8_t MAX_CHANNEL_STR_WIDTH = 16; + PoolEntry hkCurrents = PoolEntry(P60Dock::hk::CHNLS_LEN); + PoolEntry hkVoltages = PoolEntry(P60Dock::hk::CHNLS_LEN); + PoolEntry outputEnables = PoolEntry(P60Dock::hk::CHNLS_LEN); + PoolEntry latchups = PoolEntry(P60Dock::hk::CHNLS_LEN); + + PoolEntry devicesType = PoolEntry(P60Dock::NUM_DEVS); + PoolEntry devicesStatus = PoolEntry(P60Dock::NUM_DEVS); /** * @brief Function extracts the hk table information from the received csp packet and stores * the values in the p60dockHkTableDataset. diff --git a/mission/devices/PCDUHandler.cpp b/mission/devices/PCDUHandler.cpp index 837d4f37..44b9181a 100644 --- a/mission/devices/PCDUHandler.cpp +++ b/mission/devices/PCDUHandler.cpp @@ -376,221 +376,210 @@ object_id_t PCDUHandler::getObjectId() const { return SystemObject::getObjectId( ReturnValue_t PCDUHandler::initializeLocalDataPool(localpool::DataPool& localDataPoolMap, LocalDataPoolManager& poolManager) { using namespace pcduSwitches; - localDataPoolMap.emplace(P60System::PDU2_CURRENT_OUT_Q7S, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_CURRENT_OUT_PAYLOAD_PCDU_CH1, + using namespace P60System; + localDataPoolMap.emplace(pool::PDU2_CURRENT_OUT_Q7S, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_CURRENT_OUT_PAYLOAD_PCDU_CH1, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_CURRENT_OUT_RW, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_CURRENT_OUT_TCS_BOARD_HEATER_IN, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_CURRENT_OUT_SUS_REDUNDANT, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_CURRENT_OUT_DEPLOYMENT_MECHANISM, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_CURRENT_OUT_RW, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_CURRENT_OUT_TCS_BOARD_HEATER_IN, - new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_CURRENT_OUT_SUS_REDUNDANT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_CURRENT_OUT_DEPLOYMENT_MECHANISM, - new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_CURRENT_OUT_PAYLOAD_PCDU_CH6, - new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_CURRENT_OUT_ACS_BOARD_SIDE_B, - new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_CURRENT_OUT_PAYLOAD_CAMERA, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_CURRENT_OUT_PAYLOAD_PCDU_CH6, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_CURRENT_OUT_ACS_BOARD_SIDE_B, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_CURRENT_OUT_PAYLOAD_CAMERA, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_VOLTAGE_OUT_Q7S, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_VOLTAGE_OUT_PAYLOAD_PCDU_CH1, + localDataPoolMap.emplace(pool::PDU2_VOLTAGE_OUT_Q7S, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_VOLTAGE_OUT_PAYLOAD_PCDU_CH1, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_VOLTAGE_OUT_RW, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_VOLTAGE_OUT_TCS_BOARD_HEATER_IN, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_VOLTAGE_OUT_SUS_REDUNDANT, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_VOLTAGE_OUT_DEPLOYMENT_MECHANISM, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_VOLTAGE_OUT_RW, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_VOLTAGE_OUT_TCS_BOARD_HEATER_IN, - new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_VOLTAGE_OUT_SUS_REDUNDANT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_VOLTAGE_OUT_DEPLOYMENT_MECHANISM, - new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_VOLTAGE_OUT_PAYLOAD_PCDU_CH6, - new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_VOLTAGE_OUT_ACS_BOARD_SIDE_B, - new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_VOLTAGE_OUT_PAYLOAD_CAMERA, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_VOLTAGE_OUT_PAYLOAD_PCDU_CH6, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_VOLTAGE_OUT_ACS_BOARD_SIDE_B, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_VOLTAGE_OUT_PAYLOAD_CAMERA, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_VCC, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_VBAT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_TEMPERATURE, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_CONV_EN_1, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_CONV_EN_2, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_CONV_EN_3, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_VCC, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_VBAT, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_TEMPERATURE, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_CONV_EN_1, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_CONV_EN_2, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_CONV_EN_3, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_OUT_EN_Q7S, + localDataPoolMap.emplace(pool::PDU2_OUT_EN_Q7S, new PoolEntry({INIT_SWITCH_STATES[Switches::PDU2_CH0_Q7S]})); localDataPoolMap.emplace( - P60System::PDU2_OUT_EN_PAYLOAD_PCDU_CH1, + pool::PDU2_OUT_EN_PAYLOAD_PCDU_CH1, new PoolEntry({INIT_SWITCH_STATES[Switches::PDU2_CH1_PL_PCDU_BATT_0_14V8]})); - localDataPoolMap.emplace(P60System::PDU2_OUT_EN_RW, + localDataPoolMap.emplace(pool::PDU2_OUT_EN_RW, new PoolEntry({INIT_SWITCH_STATES[Switches::PDU2_CH2_RW_5V]})); #ifdef TE0720_1CFA - localDataPoolMap.emplace(P60System::PDU2_OUT_EN_TCS_BOARD_HEATER_IN, new PoolEntry({1})); + localDataPoolMap.emplace(pool::PDU2_OUT_EN_TCS_BOARD_HEATER_IN, new PoolEntry({1})); #else localDataPoolMap.emplace( - P60System::PDU2_OUT_EN_TCS_BOARD_HEATER_IN, + pool::PDU2_OUT_EN_TCS_BOARD_HEATER_IN, new PoolEntry({INIT_SWITCH_STATES[Switches::PDU2_CH3_TCS_BOARD_HEATER_IN_8V]})); #endif localDataPoolMap.emplace( - P60System::PDU2_OUT_EN_SUS_REDUNDANT, + pool::PDU2_OUT_EN_SUS_REDUNDANT, new PoolEntry({INIT_SWITCH_STATES[Switches::PDU2_CH4_SUS_REDUNDANT_3V3]})); localDataPoolMap.emplace( - P60System::PDU2_OUT_EN_DEPLOYMENT_MECHANISM, + pool::PDU2_OUT_EN_DEPLOYMENT_MECHANISM, new PoolEntry({INIT_SWITCH_STATES[Switches::PDU2_CH5_DEPLOYMENT_MECHANISM_8V]})); localDataPoolMap.emplace( - P60System::PDU2_OUT_EN_PAYLOAD_PCDU_CH6, + pool::PDU2_OUT_EN_PAYLOAD_PCDU_CH6, new PoolEntry({INIT_SWITCH_STATES[Switches::PDU2_CH6_PL_PCDU_BATT_1_14V8]})); localDataPoolMap.emplace( - P60System::PDU2_OUT_EN_ACS_BOARD_SIDE_B, + pool::PDU2_OUT_EN_ACS_BOARD_SIDE_B, new PoolEntry({INIT_SWITCH_STATES[Switches::PDU2_CH7_ACS_BOARD_SIDE_B_3V3]})); localDataPoolMap.emplace( - P60System::PDU2_OUT_EN_PAYLOAD_CAMERA, + pool::PDU2_OUT_EN_PAYLOAD_CAMERA, new PoolEntry({INIT_SWITCH_STATES[Switches::PDU2_CH8_PAYLOAD_CAMERA]})); - localDataPoolMap.emplace(P60System::PDU2_BOOTCAUSE, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_BOOTCNT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_UPTIME, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_RESETCAUSE, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_BATT_MODE, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_BOOTCAUSE, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_BOOTCNT, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_UPTIME, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_RESETCAUSE, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_BATT_MODE, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_LATCHUP_Q7S, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_LATCHUP_PAYLOAD_PCDU_CH1, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_LATCHUP_RW, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_LATCHUP_TCS_BOARD_HEATER_IN, - new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_LATCHUP_TCS_BOARD_HEATER_IN, - new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_LATCHUP_SUS_REDUNDANT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_LATCHUP_DEPLOYMENT_MECHANISM, - new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_LATCHUP_PAYLOAD_PCDU_CH6, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_LATCHUP_ACS_BOARD_SIDE_B, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_LATCHUP_PAYLOAD_CAMERA, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_LATCHUP_Q7S, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_LATCHUP_PAYLOAD_PCDU_CH1, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_LATCHUP_RW, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_LATCHUP_TCS_BOARD_HEATER_IN, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_LATCHUP_TCS_BOARD_HEATER_IN, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_LATCHUP_SUS_REDUNDANT, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_LATCHUP_DEPLOYMENT_MECHANISM, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_LATCHUP_PAYLOAD_PCDU_CH6, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_LATCHUP_ACS_BOARD_SIDE_B, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_LATCHUP_PAYLOAD_CAMERA, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_DEVICE_0, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_DEVICE_1, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_DEVICE_2, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_DEVICE_3, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_DEVICE_4, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_DEVICE_5, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_DEVICE_6, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_DEVICE_7, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_DEVICE_0, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_DEVICE_1, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_DEVICE_2, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_DEVICE_3, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_DEVICE_4, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_DEVICE_5, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_DEVICE_6, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_DEVICE_7, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_DEVICE_0_STATUS, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_DEVICE_1_STATUS, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_DEVICE_2_STATUS, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_DEVICE_3_STATUS, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_DEVICE_4_STATUS, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_DEVICE_5_STATUS, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_DEVICE_6_STATUS, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_DEVICE_7_STATUS, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_DEVICE_0_STATUS, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_DEVICE_1_STATUS, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_DEVICE_2_STATUS, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_DEVICE_3_STATUS, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_DEVICE_4_STATUS, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_DEVICE_5_STATUS, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_DEVICE_6_STATUS, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_DEVICE_7_STATUS, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_WDT_CNT_GND, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_WDT_CNT_I2C, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_WDT_CNT_CAN, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_WDT_CNT_CSP1, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_WDT_CNT_CSP2, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_WDT_GND_LEFT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_WDT_I2C_LEFT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_WDT_CAN_LEFT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_WDT_CSP_LEFT1, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_WDT_CSP_LEFT2, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_WDT_CNT_GND, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_WDT_CNT_I2C, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_WDT_CNT_CAN, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_WDT_CNT_CSP1, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_WDT_CNT_CSP2, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_WDT_GND_LEFT, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_WDT_I2C_LEFT, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_WDT_CAN_LEFT, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_WDT_CSP_LEFT1, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_WDT_CSP_LEFT2, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_CURRENT_OUT_TCS_BOARD_3V3, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_CURRENT_OUT_SYRLINKS, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_CURRENT_OUT_STAR_TRACKER, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_CURRENT_OUT_MGT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_CURRENT_OUT_SUS_NOMINAL, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_CURRENT_OUT_SOLAR_CELL_EXP, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_CURRENT_OUT_PLOC, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_CURRENT_OUT_ACS_BOARD_SIDE_A, - new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_CURRENT_OUT_CHANNEL8, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU1_CURRENT_OUT_TCS_BOARD_3V3, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU1_CURRENT_OUT_SYRLINKS, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU1_CURRENT_OUT_STAR_TRACKER, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU1_CURRENT_OUT_MGT, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU1_CURRENT_OUT_SUS_NOMINAL, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU1_CURRENT_OUT_SOLAR_CELL_EXP, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU1_CURRENT_OUT_PLOC, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU1_CURRENT_OUT_ACS_BOARD_SIDE_A, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU1_CURRENT_OUT_CHANNEL8, new PoolEntry({0})); localDataPoolMap.emplace( - P60System::PDU1_VOLTAGE_OUT_TCS_BOARD_3V3, + pool::PDU1_VOLTAGE_OUT_TCS_BOARD_3V3, new PoolEntry({INIT_SWITCH_STATES[Switches::PDU1_CH0_TCS_BOARD_3V3]})); localDataPoolMap.emplace( - P60System::PDU1_VOLTAGE_OUT_SYRLINKS, + pool::PDU1_VOLTAGE_OUT_SYRLINKS, new PoolEntry({INIT_SWITCH_STATES[Switches::PDU1_CH1_SYRLINKS_12V]})); localDataPoolMap.emplace( - P60System::PDU1_VOLTAGE_OUT_STAR_TRACKER, + pool::PDU1_VOLTAGE_OUT_STAR_TRACKER, new PoolEntry({INIT_SWITCH_STATES[Switches::PDU1_CH2_STAR_TRACKER_5V]})); - localDataPoolMap.emplace(P60System::PDU1_VOLTAGE_OUT_MGT, + localDataPoolMap.emplace(pool::PDU1_VOLTAGE_OUT_MGT, new PoolEntry({INIT_SWITCH_STATES[Switches::PDU1_CH3_MGT_5V]})); localDataPoolMap.emplace( - P60System::PDU1_VOLTAGE_OUT_SUS_NOMINAL, + pool::PDU1_VOLTAGE_OUT_SUS_NOMINAL, new PoolEntry({INIT_SWITCH_STATES[Switches::PDU1_CH4_SUS_NOMINAL_3V3]})); localDataPoolMap.emplace( - P60System::PDU1_VOLTAGE_OUT_SOLAR_CELL_EXP, + pool::PDU1_VOLTAGE_OUT_SOLAR_CELL_EXP, new PoolEntry({INIT_SWITCH_STATES[Switches::PDU1_CH5_SOLAR_CELL_EXP_5V]})); localDataPoolMap.emplace( - P60System::PDU1_VOLTAGE_OUT_PLOC, + pool::PDU1_VOLTAGE_OUT_PLOC, new PoolEntry({INIT_SWITCH_STATES[Switches::PDU1_CH6_PLOC_12V]})); localDataPoolMap.emplace( - P60System::PDU1_VOLTAGE_OUT_ACS_BOARD_SIDE_A, + pool::PDU1_VOLTAGE_OUT_ACS_BOARD_SIDE_A, new PoolEntry({INIT_SWITCH_STATES[Switches::PDU1_CH7_ACS_A_SIDE_3V3]})); localDataPoolMap.emplace( - P60System::PDU1_VOLTAGE_OUT_CHANNEL8, + pool::PDU1_VOLTAGE_OUT_CHANNEL8, new PoolEntry({INIT_SWITCH_STATES[Switches::PDU1_CH8_UNOCCUPIED]})); - localDataPoolMap.emplace(P60System::PDU1_VCC, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_VBAT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_TEMPERATURE, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_CONV_EN_1, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_CONV_EN_2, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_CONV_EN_3, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU1_VCC, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU1_VBAT, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU1_TEMPERATURE, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU1_CONV_EN_1, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU1_CONV_EN_2, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU1_CONV_EN_3, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_OUT_EN_TCS_BOARD_3V3, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_OUT_EN_SYRLINKS, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_OUT_EN_STAR_TRACKER, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_OUT_EN_MGT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_OUT_EN_SUS_NOMINAL, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_OUT_EN_SOLAR_CELL_EXP, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_OUT_EN_PLOC, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_OUT_EN_ACS_BOARD_SIDE_A, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_OUT_EN_CHANNEL8, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU1_OUT_EN_TCS_BOARD_3V3, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU1_OUT_EN_SYRLINKS, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU1_OUT_EN_STAR_TRACKER, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU1_OUT_EN_MGT, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU1_OUT_EN_SUS_NOMINAL, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU1_OUT_EN_SOLAR_CELL_EXP, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU1_OUT_EN_PLOC, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU1_OUT_EN_ACS_BOARD_SIDE_A, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU1_OUT_EN_CHANNEL8, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_BOOTCAUSE, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_BOOTCNT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_UPTIME, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_RESETCAUSE, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_BATT_MODE, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU1_BOOTCAUSE, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU1_BOOTCNT, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU1_UPTIME, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU1_RESETCAUSE, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU1_BATT_MODE, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_LATCHUP_TCS_BOARD_3V3, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_LATCHUP_SYRLINKS, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_LATCHUP_STAR_TRACKER, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_LATCHUP_MGT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_LATCHUP_SUS_NOMINAL, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_LATCHUP_SOLAR_CELL_EXP, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_LATCHUP_PLOC, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_LATCHUP_ACS_BOARD_SIDE_A, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_LATCHUP_CHANNEL8, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU1_LATCHUP_TCS_BOARD_3V3, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU1_LATCHUP_SYRLINKS, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU1_LATCHUP_STAR_TRACKER, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU1_LATCHUP_MGT, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU1_LATCHUP_SUS_NOMINAL, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU1_LATCHUP_SOLAR_CELL_EXP, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU1_LATCHUP_PLOC, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU1_LATCHUP_ACS_BOARD_SIDE_A, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU1_LATCHUP_CHANNEL8, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_DEVICE_0, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_DEVICE_1, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_DEVICE_2, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_DEVICE_3, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_DEVICE_4, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_DEVICE_5, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_DEVICE_6, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_DEVICE_7, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU1_DEVICE_0, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU1_DEVICE_1, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU1_DEVICE_2, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU1_DEVICE_3, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU1_DEVICE_4, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU1_DEVICE_5, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU1_DEVICE_6, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU1_DEVICE_7, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_DEVICE_0_STATUS, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_DEVICE_1_STATUS, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_DEVICE_2_STATUS, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_DEVICE_3_STATUS, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_DEVICE_4_STATUS, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_DEVICE_5_STATUS, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_DEVICE_6_STATUS, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_DEVICE_7_STATUS, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU1_DEVICE_0_STATUS, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU1_DEVICE_1_STATUS, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU1_DEVICE_2_STATUS, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU1_DEVICE_3_STATUS, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU1_DEVICE_4_STATUS, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU1_DEVICE_5_STATUS, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU1_DEVICE_6_STATUS, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU1_DEVICE_7_STATUS, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_WDT_CNT_GND, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_WDT_CNT_I2C, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_WDT_CNT_CAN, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_WDT_CNT_CSP1, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_WDT_CNT_CSP2, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_WDT_GND_LEFT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_WDT_I2C_LEFT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_WDT_CAN_LEFT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_WDT_CSP_LEFT1, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_WDT_CSP_LEFT2, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU1_WDT_CNT_GND, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU1_WDT_CNT_I2C, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU1_WDT_CNT_CAN, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU1_WDT_CNT_CSP1, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU1_WDT_CNT_CSP2, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU1_WDT_GND_LEFT, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU1_WDT_I2C_LEFT, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU1_WDT_CAN_LEFT, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU1_WDT_CSP_LEFT1, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU1_WDT_CSP_LEFT2, new PoolEntry({0})); return HasReturnvaluesIF::RETURN_OK; } diff --git a/mission/devices/PDU1Handler.cpp b/mission/devices/PDU1Handler.cpp index 38256cf9..264fd098 100644 --- a/mission/devices/PDU1Handler.cpp +++ b/mission/devices/PDU1Handler.cpp @@ -329,89 +329,103 @@ void PDU1Handler::parseHkTableReply(const uint8_t *packet) { ReturnValue_t PDU1Handler::initializeLocalDataPool(localpool::DataPool &localDataPoolMap, LocalDataPoolManager &poolManager) { - localDataPoolMap.emplace(P60System::PDU1_CURRENT_OUT_TCS_BOARD_3V3, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_CURRENT_OUT_SYRLINKS, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_CURRENT_OUT_STAR_TRACKER, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_CURRENT_OUT_MGT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_CURRENT_OUT_SUS_NOMINAL, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_CURRENT_OUT_SOLAR_CELL_EXP, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_CURRENT_OUT_PLOC, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_CURRENT_OUT_ACS_BOARD_SIDE_A, + localDataPoolMap.emplace(P60System::pool::PDU1_CURRENT_OUT_TCS_BOARD_3V3, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_CURRENT_OUT_CHANNEL8, new PoolEntry({0})); - - localDataPoolMap.emplace(P60System::PDU1_VOLTAGE_OUT_TCS_BOARD_3V3, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_VOLTAGE_OUT_SYRLINKS, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_VOLTAGE_OUT_STAR_TRACKER, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_VOLTAGE_OUT_MGT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_VOLTAGE_OUT_SUS_NOMINAL, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_VOLTAGE_OUT_SOLAR_CELL_EXP, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_VOLTAGE_OUT_PLOC, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_VOLTAGE_OUT_ACS_BOARD_SIDE_A, + localDataPoolMap.emplace(P60System::pool::PDU1_CURRENT_OUT_SYRLINKS, new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_CURRENT_OUT_STAR_TRACKER, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_VOLTAGE_OUT_CHANNEL8, new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_CURRENT_OUT_MGT, new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_CURRENT_OUT_SUS_NOMINAL, + new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_CURRENT_OUT_SOLAR_CELL_EXP, + new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_CURRENT_OUT_PLOC, new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_CURRENT_OUT_ACS_BOARD_SIDE_A, + new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_CURRENT_OUT_CHANNEL8, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_VCC, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_VBAT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_TEMPERATURE, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_CONV_EN_1, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_CONV_EN_2, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_CONV_EN_3, new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_VOLTAGE_OUT_TCS_BOARD_3V3, + new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_VOLTAGE_OUT_SYRLINKS, new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_VOLTAGE_OUT_STAR_TRACKER, + new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_VOLTAGE_OUT_MGT, new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_VOLTAGE_OUT_SUS_NOMINAL, + new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_VOLTAGE_OUT_SOLAR_CELL_EXP, + new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_VOLTAGE_OUT_PLOC, new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_VOLTAGE_OUT_ACS_BOARD_SIDE_A, + new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_VOLTAGE_OUT_CHANNEL8, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_OUT_EN_TCS_BOARD_3V3, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_OUT_EN_SYRLINKS, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_OUT_EN_STAR_TRACKER, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_OUT_EN_MGT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_OUT_EN_SUS_NOMINAL, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_OUT_EN_SOLAR_CELL_EXP, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_OUT_EN_PLOC, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_OUT_EN_ACS_BOARD_SIDE_A, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_OUT_EN_CHANNEL8, new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_VCC, new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_VBAT, new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_TEMPERATURE, new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_CONV_EN_1, new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_CONV_EN_2, new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_CONV_EN_3, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_BOOTCAUSE, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_BOOTCNT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_UPTIME, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_RESETCAUSE, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_BATT_MODE, new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_OUT_EN_TCS_BOARD_3V3, new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_OUT_EN_SYRLINKS, new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_OUT_EN_STAR_TRACKER, new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_OUT_EN_MGT, new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_OUT_EN_SUS_NOMINAL, new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_OUT_EN_SOLAR_CELL_EXP, + new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_OUT_EN_PLOC, new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_OUT_EN_ACS_BOARD_SIDE_A, + new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_OUT_EN_CHANNEL8, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_LATCHUP_TCS_BOARD_3V3, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_LATCHUP_SYRLINKS, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_LATCHUP_STAR_TRACKER, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_LATCHUP_MGT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_LATCHUP_SUS_NOMINAL, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_LATCHUP_SOLAR_CELL_EXP, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_LATCHUP_PLOC, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_LATCHUP_ACS_BOARD_SIDE_A, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_LATCHUP_CHANNEL8, new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_BOOTCAUSE, new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_BOOTCNT, new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_UPTIME, new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_RESETCAUSE, new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_BATT_MODE, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_DEVICE_0, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_DEVICE_1, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_DEVICE_2, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_DEVICE_3, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_DEVICE_4, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_DEVICE_5, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_DEVICE_6, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_DEVICE_7, new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_LATCHUP_TCS_BOARD_3V3, + new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_LATCHUP_SYRLINKS, new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_LATCHUP_STAR_TRACKER, + new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_LATCHUP_MGT, new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_LATCHUP_SUS_NOMINAL, new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_LATCHUP_SOLAR_CELL_EXP, + new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_LATCHUP_PLOC, new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_LATCHUP_ACS_BOARD_SIDE_A, + new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_LATCHUP_CHANNEL8, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_DEVICE_0_STATUS, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_DEVICE_1_STATUS, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_DEVICE_2_STATUS, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_DEVICE_3_STATUS, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_DEVICE_4_STATUS, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_DEVICE_5_STATUS, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_DEVICE_6_STATUS, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_DEVICE_7_STATUS, new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_DEVICE_0, new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_DEVICE_1, new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_DEVICE_2, new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_DEVICE_3, new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_DEVICE_4, new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_DEVICE_5, new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_DEVICE_6, new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_DEVICE_7, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_WDT_CNT_GND, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_WDT_CNT_I2C, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_WDT_CNT_CAN, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_WDT_CNT_CSP1, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_WDT_CNT_CSP2, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_WDT_GND_LEFT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_WDT_I2C_LEFT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_WDT_CAN_LEFT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_WDT_CSP_LEFT1, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU1_WDT_CSP_LEFT2, new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_DEVICE_0_STATUS, new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_DEVICE_1_STATUS, new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_DEVICE_2_STATUS, new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_DEVICE_3_STATUS, new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_DEVICE_4_STATUS, new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_DEVICE_5_STATUS, new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_DEVICE_6_STATUS, new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_DEVICE_7_STATUS, new PoolEntry({0})); + + localDataPoolMap.emplace(P60System::pool::PDU1_WDT_CNT_GND, new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_WDT_CNT_I2C, new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_WDT_CNT_CAN, new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_WDT_CNT_CSP1, new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_WDT_CNT_CSP2, new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_WDT_GND_LEFT, new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_WDT_I2C_LEFT, new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_WDT_CAN_LEFT, new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_WDT_CSP_LEFT1, new PoolEntry({0})); + localDataPoolMap.emplace(P60System::pool::PDU1_WDT_CSP_LEFT2, new PoolEntry({0})); #if OBSW_ENABLE_PERIODIC_HK == 1 poolManager.subscribeForPeriodicPacket(pdu1HkTableDataset.getSid(), false, 0.4, true); #endif diff --git a/mission/devices/PDU2Handler.cpp b/mission/devices/PDU2Handler.cpp index 512d8745..48e7f90e 100644 --- a/mission/devices/PDU2Handler.cpp +++ b/mission/devices/PDU2Handler.cpp @@ -266,104 +266,94 @@ void PDU2Handler::parseHkTableReply(const uint8_t *packet) { ReturnValue_t PDU2Handler::initializeLocalDataPool(localpool::DataPool &localDataPoolMap, LocalDataPoolManager &poolManager) { - localDataPoolMap.emplace(P60System::PDU2_CURRENT_OUT_Q7S, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_CURRENT_OUT_PAYLOAD_PCDU_CH1, + using namespace P60System; + localDataPoolMap.emplace(pool::PDU2_CURRENT_OUT_Q7S, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_CURRENT_OUT_PAYLOAD_PCDU_CH1, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_CURRENT_OUT_RW, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_CURRENT_OUT_TCS_BOARD_HEATER_IN, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_CURRENT_OUT_SUS_REDUNDANT, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_CURRENT_OUT_DEPLOYMENT_MECHANISM, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_CURRENT_OUT_RW, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_CURRENT_OUT_TCS_BOARD_HEATER_IN, - new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_CURRENT_OUT_SUS_REDUNDANT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_CURRENT_OUT_DEPLOYMENT_MECHANISM, - new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_CURRENT_OUT_PAYLOAD_PCDU_CH6, - new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_CURRENT_OUT_ACS_BOARD_SIDE_B, - new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_CURRENT_OUT_PAYLOAD_CAMERA, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_CURRENT_OUT_PAYLOAD_PCDU_CH6, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_CURRENT_OUT_ACS_BOARD_SIDE_B, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_CURRENT_OUT_PAYLOAD_CAMERA, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_VOLTAGE_OUT_Q7S, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_VOLTAGE_OUT_PAYLOAD_PCDU_CH1, + localDataPoolMap.emplace(pool::PDU2_VOLTAGE_OUT_Q7S, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_VOLTAGE_OUT_PAYLOAD_PCDU_CH1, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_VOLTAGE_OUT_RW, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_VOLTAGE_OUT_TCS_BOARD_HEATER_IN, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_VOLTAGE_OUT_SUS_REDUNDANT, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_VOLTAGE_OUT_DEPLOYMENT_MECHANISM, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_VOLTAGE_OUT_RW, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_VOLTAGE_OUT_TCS_BOARD_HEATER_IN, - new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_VOLTAGE_OUT_SUS_REDUNDANT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_VOLTAGE_OUT_DEPLOYMENT_MECHANISM, - new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_VOLTAGE_OUT_PAYLOAD_PCDU_CH6, - new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_VOLTAGE_OUT_ACS_BOARD_SIDE_B, - new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_VOLTAGE_OUT_PAYLOAD_CAMERA, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_VOLTAGE_OUT_PAYLOAD_PCDU_CH6, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_VOLTAGE_OUT_ACS_BOARD_SIDE_B, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_VOLTAGE_OUT_PAYLOAD_CAMERA, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_VCC, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_VBAT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_TEMPERATURE, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_CONV_EN_1, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_CONV_EN_2, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_CONV_EN_3, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_VCC, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_VBAT, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_TEMPERATURE, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_CONV_EN_1, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_CONV_EN_2, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_CONV_EN_3, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_OUT_EN_Q7S, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_OUT_EN_PAYLOAD_PCDU_CH1, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_OUT_EN_RW, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_OUT_EN_Q7S, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_OUT_EN_PAYLOAD_PCDU_CH1, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_OUT_EN_RW, new PoolEntry({0})); #ifdef TE0720_1CFA - localDataPoolMap.emplace(P60System::PDU2_OUT_EN_TCS_BOARD_HEATER_IN, new PoolEntry({1})); + localDataPoolMap.emplace(pool::PDU2_OUT_EN_TCS_BOARD_HEATER_IN, new PoolEntry({1})); #else - localDataPoolMap.emplace(P60System::PDU2_OUT_EN_TCS_BOARD_HEATER_IN, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_OUT_EN_TCS_BOARD_HEATER_IN, new PoolEntry({0})); #endif - localDataPoolMap.emplace(P60System::PDU2_OUT_EN_SUS_REDUNDANT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_OUT_EN_DEPLOYMENT_MECHANISM, - new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_OUT_EN_PAYLOAD_PCDU_CH6, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_OUT_EN_ACS_BOARD_SIDE_B, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_OUT_EN_PAYLOAD_CAMERA, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_OUT_EN_SUS_REDUNDANT, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_OUT_EN_DEPLOYMENT_MECHANISM, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_OUT_EN_PAYLOAD_PCDU_CH6, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_OUT_EN_ACS_BOARD_SIDE_B, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_OUT_EN_PAYLOAD_CAMERA, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_BOOTCAUSE, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_BOOTCNT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_UPTIME, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_RESETCAUSE, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_BATT_MODE, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_BOOTCAUSE, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_BOOTCNT, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_UPTIME, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_RESETCAUSE, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_BATT_MODE, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_LATCHUP_Q7S, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_LATCHUP_PAYLOAD_PCDU_CH1, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_LATCHUP_RW, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_LATCHUP_TCS_BOARD_HEATER_IN, - new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_LATCHUP_SUS_REDUNDANT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_LATCHUP_DEPLOYMENT_MECHANISM, - new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_LATCHUP_PAYLOAD_PCDU_CH6, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_LATCHUP_ACS_BOARD_SIDE_B, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_LATCHUP_PAYLOAD_CAMERA, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_LATCHUP_Q7S, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_LATCHUP_PAYLOAD_PCDU_CH1, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_LATCHUP_RW, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_LATCHUP_TCS_BOARD_HEATER_IN, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_LATCHUP_SUS_REDUNDANT, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_LATCHUP_DEPLOYMENT_MECHANISM, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_LATCHUP_PAYLOAD_PCDU_CH6, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_LATCHUP_ACS_BOARD_SIDE_B, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_LATCHUP_PAYLOAD_CAMERA, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_DEVICE_0, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_DEVICE_1, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_DEVICE_2, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_DEVICE_3, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_DEVICE_4, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_DEVICE_5, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_DEVICE_6, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_DEVICE_7, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_DEVICE_0, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_DEVICE_1, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_DEVICE_2, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_DEVICE_3, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_DEVICE_4, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_DEVICE_5, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_DEVICE_6, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_DEVICE_7, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_DEVICE_0_STATUS, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_DEVICE_1_STATUS, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_DEVICE_2_STATUS, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_DEVICE_3_STATUS, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_DEVICE_4_STATUS, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_DEVICE_5_STATUS, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_DEVICE_6_STATUS, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_DEVICE_7_STATUS, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_DEVICE_0_STATUS, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_DEVICE_1_STATUS, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_DEVICE_2_STATUS, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_DEVICE_3_STATUS, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_DEVICE_4_STATUS, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_DEVICE_5_STATUS, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_DEVICE_6_STATUS, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_DEVICE_7_STATUS, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_WDT_CNT_GND, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_WDT_CNT_I2C, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_WDT_CNT_CAN, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_WDT_CNT_CSP1, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_WDT_CNT_CSP2, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_WDT_GND_LEFT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_WDT_I2C_LEFT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_WDT_CAN_LEFT, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_WDT_CSP_LEFT1, new PoolEntry({0})); - localDataPoolMap.emplace(P60System::PDU2_WDT_CSP_LEFT2, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_WDT_CNT_GND, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_WDT_CNT_I2C, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_WDT_CNT_CAN, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_WDT_CNT_CSP1, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_WDT_CNT_CSP2, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_WDT_GND_LEFT, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_WDT_I2C_LEFT, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_WDT_CAN_LEFT, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_WDT_CSP_LEFT1, new PoolEntry({0})); + localDataPoolMap.emplace(pool::PDU2_WDT_CSP_LEFT2, new PoolEntry({0})); #if OBSW_ENABLE_PERIODIC_HK == 1 poolManager.subscribeForPeriodicPacket(pdu2HkTableDataset.getSid(), false, 0.4, true); #endif diff --git a/mission/devices/RadiationSensorHandler.cpp b/mission/devices/RadiationSensorHandler.cpp index 179444ca..e91d8427 100644 --- a/mission/devices/RadiationSensorHandler.cpp +++ b/mission/devices/RadiationSensorHandler.cpp @@ -92,15 +92,15 @@ ReturnValue_t RadiationSensorHandler::buildCommandFromCommand(DeviceCommandId_t return RETURN_OK; } case RAD_SENSOR::ENABLE_DEBUG_OUTPUT: { - printPeriodicData = true; - rawPacketLen = 0; - return RETURN_OK; - } - case RAD_SENSOR::DISABLE_DEBUG_OUTPUT: { - rawPacketLen = 0; - printPeriodicData = false; - return RETURN_OK; - } + printPeriodicData = true; + rawPacketLen = 0; + return RETURN_OK; + } + case RAD_SENSOR::DISABLE_DEBUG_OUTPUT: { + rawPacketLen = 0; + printPeriodicData = false; + return RETURN_OK; + } default: return DeviceHandlerIF::COMMAND_NOT_IMPLEMENTED; } @@ -123,7 +123,7 @@ ReturnValue_t RadiationSensorHandler::scanForReply(const uint8_t *start, size_t switch (*foundId) { case RAD_SENSOR::START_CONVERSION: case RAD_SENSOR::WRITE_SETUP: - *foundLen = remainingSize; + *foundLen = remainingSize; return IGNORE_REPLY_DATA; case RAD_SENSOR::READ_CONVERSIONS: { ReturnValue_t result = gpioIF->pullLow(gpioIds::ENABLE_RADFET); @@ -138,8 +138,8 @@ ReturnValue_t RadiationSensorHandler::scanForReply(const uint8_t *start, size_t } case RAD_SENSOR::ENABLE_DEBUG_OUTPUT: case RAD_SENSOR::DISABLE_DEBUG_OUTPUT: - sif::info << "RadiationSensorHandler::scanForReply: " << remainingSize << std::endl; - break; + sif::info << "RadiationSensorHandler::scanForReply: " << remainingSize << std::endl; + break; default: break; } diff --git a/mission/devices/SyrlinksHkHandler.cpp b/mission/devices/SyrlinksHkHandler.cpp index 017bd53c..53a8af23 100644 --- a/mission/devices/SyrlinksHkHandler.cpp +++ b/mission/devices/SyrlinksHkHandler.cpp @@ -139,42 +139,45 @@ ReturnValue_t SyrlinksHkHandler::buildCommandFromCommand(DeviceCommandId_t devic return RETURN_OK; } case (SYRLINKS::READ_TX_AGC_VALUE_HIGH_BYTE): { - readTxAgcValueHighByte.copy(reinterpret_cast(commandBuffer), readTxAgcValueHighByte.size(), 0); + readTxAgcValueHighByte.copy(reinterpret_cast(commandBuffer), + readTxAgcValueHighByte.size(), 0); rawPacketLen = readTxAgcValueHighByte.size(); rememberCommandId = SYRLINKS::READ_TX_AGC_VALUE_HIGH_BYTE; rawPacket = commandBuffer; return RETURN_OK; } case (SYRLINKS::READ_TX_AGC_VALUE_LOW_BYTE): { - readTxAgcValueLowByte.copy(reinterpret_cast(commandBuffer), readTxAgcValueLowByte.size(), 0); + readTxAgcValueLowByte.copy(reinterpret_cast(commandBuffer), + readTxAgcValueLowByte.size(), 0); rawPacketLen = readTxAgcValueLowByte.size(); rememberCommandId = SYRLINKS::READ_TX_AGC_VALUE_LOW_BYTE; rawPacket = commandBuffer; return RETURN_OK; } case (SYRLINKS::TEMP_POWER_AMPLIFIER_HIGH_BYTE): - tempPowerAmpBoardHighByte.copy(reinterpret_cast(commandBuffer), tempPowerAmpBoardHighByte.size(), - 0); + tempPowerAmpBoardHighByte.copy(reinterpret_cast(commandBuffer), + tempPowerAmpBoardHighByte.size(), 0); rawPacketLen = tempPowerAmpBoardHighByte.size(); rememberCommandId = SYRLINKS::TEMP_POWER_AMPLIFIER_HIGH_BYTE; rawPacket = commandBuffer; return RETURN_OK; case (SYRLINKS::TEMP_POWER_AMPLIFIER_LOW_BYTE): - tempPowerAmpBoardLowByte.copy(reinterpret_cast(commandBuffer), tempPowerAmpBoardLowByte.size(), - 0); + tempPowerAmpBoardLowByte.copy(reinterpret_cast(commandBuffer), + tempPowerAmpBoardLowByte.size(), 0); rawPacketLen = tempPowerAmpBoardLowByte.size(); rememberCommandId = SYRLINKS::TEMP_POWER_AMPLIFIER_LOW_BYTE; rawPacket = commandBuffer; return RETURN_OK; case (SYRLINKS::TEMP_BASEBAND_BOARD_HIGH_BYTE): - tempBasebandBoardHighByte.copy(reinterpret_cast(commandBuffer), tempBasebandBoardHighByte.size(), - 0); + tempBasebandBoardHighByte.copy(reinterpret_cast(commandBuffer), + tempBasebandBoardHighByte.size(), 0); rawPacketLen = tempBasebandBoardHighByte.size(); rememberCommandId = SYRLINKS::TEMP_BASEBAND_BOARD_HIGH_BYTE; rawPacket = commandBuffer; return RETURN_OK; case (SYRLINKS::TEMP_BASEBAND_BOARD_LOW_BYTE): - tempBasebandBoardLowByte.copy(reinterpret_cast(commandBuffer), tempBasebandBoardLowByte.size(), 0); + tempBasebandBoardLowByte.copy(reinterpret_cast(commandBuffer), + tempBasebandBoardLowByte.size(), 0); rawPacketLen = tempBasebandBoardLowByte.size(); rememberCommandId = SYRLINKS::TEMP_BASEBAND_BOARD_LOW_BYTE; rawPacket = commandBuffer; @@ -352,8 +355,8 @@ ReturnValue_t SyrlinksHkHandler::interpretDeviceReply(DeviceCommandId_t id, cons rawTempBasebandBoard |= convertHexStringToUint8( reinterpret_cast(packet + SYRLINKS::MESSAGE_HEADER_SIZE)); tempBasebandBoard = calcTempVal(rawTempBasebandBoard); - sif::info << "Syrlinks temperature baseband board: " << tempBasebandBoard << " °C" - << std::endl; + sif::info << "Syrlinks temperature baseband board: " << tempBasebandBoard << " °C" + << std::endl; break; case (SYRLINKS::TEMP_POWER_AMPLIFIER_HIGH_BYTE): result = verifyReply(packet, SYRLINKS::READ_ONE_REGISTER_REPLY_SIE); @@ -364,8 +367,8 @@ ReturnValue_t SyrlinksHkHandler::interpretDeviceReply(DeviceCommandId_t id, cons } rawTempPowerAmplifier = 0; rawTempPowerAmplifier = convertHexStringToUint8(reinterpret_cast( - packet + SYRLINKS::MESSAGE_HEADER_SIZE)) - << 8; + packet + SYRLINKS::MESSAGE_HEADER_SIZE)) + << 8; break; case (SYRLINKS::TEMP_POWER_AMPLIFIER_LOW_BYTE): result = verifyReply(packet, SYRLINKS::READ_ONE_REGISTER_REPLY_SIE); @@ -378,7 +381,7 @@ ReturnValue_t SyrlinksHkHandler::interpretDeviceReply(DeviceCommandId_t id, cons reinterpret_cast(packet + SYRLINKS::MESSAGE_HEADER_SIZE)); tempPowerAmplifier = calcTempVal(rawTempPowerAmplifier); sif::info << "Syrlinks temperature power amplifier board: " << tempPowerAmplifier << " °C" - << std::endl; + << std::endl; break; default: { sif::debug << "SyrlinksHkHandler::interpretDeviceReply: Unknown device reply id" << std::endl; diff --git a/mission/devices/SyrlinksHkHandler.h b/mission/devices/SyrlinksHkHandler.h index 9b9e05c2..a8cb7b8c 100644 --- a/mission/devices/SyrlinksHkHandler.h +++ b/mission/devices/SyrlinksHkHandler.h @@ -1,10 +1,11 @@ #ifndef MISSION_DEVICES_SYRLINKSHKHANDLER_H_ #define MISSION_DEVICES_SYRLINKSHKHANDLER_H_ +#include + #include "devices/powerSwitcherList.h" #include "fsfw/devicehandlers/DeviceHandlerBase.h" #include "mission/devices/devicedefinitions/SyrlinksDefinitions.h" -#include /** * @brief This is the device handler for the syrlinks transceiver. It handles the command diff --git a/mission/devices/devicedefinitions/GomspaceDefinitions.h b/mission/devices/devicedefinitions/GomspaceDefinitions.h index d06c7eef..3a66ca69 100644 --- a/mission/devices/devicedefinitions/GomspaceDefinitions.h +++ b/mission/devices/devicedefinitions/GomspaceDefinitions.h @@ -42,46 +42,13 @@ static const DeviceCommandId_t PRINT_LATCHUPS = 33; } // namespace GOMSPACE namespace P60System { -enum P60SytemPoolIds : lp_id_t { - P60DOCK_CURRENT_ACU_VCC, - P60DOCK_CURRENT_PDU1_VCC, - P60DOCK_CURRENT_X3_IDLE_VCC, - P60DOCK_CURRENT_PDU2_VCC, - P60DOCK_CURRENT_ACU_VBAT, - P60DOCK_CURRENT_PDU1_VBAT, - P60DOCK_CURRENT_X3_IDLE_VBAT, - P60DOCK_CURRENT_PDU2_VBAT, - P60DOCK_CURRENT_STACK_VBAT, - P60DOCK_CURRENT_STACK_3V3, - P60DOCK_CURRENT_STACK_5V, - P60DOCK_CURRENT_GS3V3, - P60DOCK_CURRENT_GS5V, - P60DOCK_VOLTAGE_ACU_VCC, - P60DOCK_VOLTAGE_PDU1_VCC, - P60DOCK_VOLTAGE_X3_IDLE_VCC, - P60DOCK_VOLTAGE_PDU2_VCC, - P60DOCK_VOLTAGE_ACU_VBAT, - P60DOCK_VOLTAGE_PDU1_VBAT, - P60DOCK_VOLTAGE_X3_IDLE_VBAT, - P60DOCK_VOLTAGE_PDU2_VBAT, - P60DOCK_VOLTAGE_STACK_VBAT, - P60DOCK_VOLTAGE_STACK_3V3, - P60DOCK_VOLTAGE_STACK_5V, - P60DOCK_VOLTAGE_GS3V3, - P60DOCK_VOLTAGE_GS5V, - P60DOCK_OUTPUTENABLE_ACU_VCC, - P60DOCK_OUTPUTENABLE_PDU1_VCC, - P60DOCK_OUTPUTENABLE_X3_IDLE_VCC, - P60DOCK_OUTPUTENABLE_PDU2_VCC, - P60DOCK_OUTPUTENABLE_ACU_VBAT, - P60DOCK_OUTPUTENABLE_PDU1_VBAT, - P60DOCK_OUTPUTENABLE_X3_IDLE_VBAT, - P60DOCK_OUTPUTENABLE_PDU2_VBAT, - P60DOCK_OUTPUTENABLE_STACK_VBAT, - P60DOCK_OUTPUTENABLE_STACK_3V3, - P60DOCK_OUTPUTENABLE_STACK_5V, - P60DOCK_OUTPUTENABLE_GS3V3, - P60DOCK_OUTPUTENABLE_GS5V, + +namespace pool { + +enum Ids : lp_id_t { + CURRENTS, + VOLTAGES, + OUTPUT_ENABLE, P60DOCK_TEMPERATURE_1, P60DOCK_TEMPERATURE_2, P60DOCK_BOOT_CAUSE, @@ -91,41 +58,16 @@ enum P60SytemPoolIds : lp_id_t { P60DOCK_BATT_MODE, P60DOCK_HEATER_ON, P60DOCK_CONV_5V_ENABLE_STATUS, - P60DOCK_LATCHUP_ACU_VCC, - P60DOCK_LATCHUP_PDU1_VCC, - P60DOCK_LATCHUP_X3_IDLE_VCC, - P60DOCK_LATCHUP_PDU2_VCC, - P60DOCK_LATCHUP_ACU_VBAT, - P60DOCK_LATCHUP_PDU1_VBAT, - P60DOCK_LATCHUP_X3_IDLE_VBAT, - P60DOCK_LATCHUP_PDU2_VBAT, - P60DOCK_LATCHUP_STACK_VBAT, - P60DOCK_LATCHUP_STACK_3V3, - P60DOCK_LATCHUP_STACK_5V, - P60DOCK_LATCHUP_GS3V3, - P60DOCK_LATCHUP_GS5V, - P60DOCK_VBAT_VALUE, - P60DOCK_VCC_CURRENT_VALUE, + LATCHUPS, + P60DOCK_DOCK_VBAT, + P60DOCK_DOCK_VCC_CURRENT, + // Difference between charge and discharge P60DOCK_BATTERY_CURRENT, P60DOCK_BATTERY_VOLTAGE, P60DOCK_BATTERY_TEMPERATURE_1, P60DOCK_BATTERY_TEMPERATURE_2, - P60DOCK_DEVICE_0, - P60DOCK_DEVICE_1, - P60DOCK_DEVICE_2, - P60DOCK_DEVICE_3, - P60DOCK_DEVICE_4, - P60DOCK_DEVICE_5, - P60DOCK_DEVICE_6, - P60DOCK_DEVICE_7, - P60DOCK_DEVICE_0_STATUS, - P60DOCK_DEVICE_1_STATUS, - P60DOCK_DEVICE_2_STATUS, - P60DOCK_DEVICE_3_STATUS, - P60DOCK_DEVICE_4_STATUS, - P60DOCK_DEVICE_5_STATUS, - P60DOCK_DEVICE_6_STATUS, - P60DOCK_DEVICE_7_STATUS, + DEVICES_TYPE, + DEVICES_STATUS, P60DOCK_DEVICE_TYPE_GROUP, P60DOCK_DEVICE_STATUS_GROUP, P60DOCK_DEARM_STATUS, @@ -359,9 +301,33 @@ enum P60SytemPoolIds : lp_id_t { ACU_WDT_GND_LEFT }; } +} // namespace P60System namespace P60Dock { +static constexpr uint8_t NUM_DEVS = 8; + +namespace hk { + +enum Index : uint8_t { + ACU_VCC = 0, + PDU1_VCC = 1, + X3_IDLE_VCC = 2, + PDU2_VCC = 3, + ACU_VBAT = 4, + PDU1_VBAT = 5, + X3_IDLE_VBAT = 6, + PDU2_VBAT = 7, + STACK_VBAT = 8, + STACK_3V3 = 9, + STACK_5V = 10, + GS3V3 = 11, + GS5V = 12, + CHNLS_LEN = 13 +}; + +} + enum SwitchChannels : uint8_t { ACU = 0, PDU1 = 1, @@ -408,207 +374,99 @@ class HkTableDataset : public StaticLocalDataSet { : StaticLocalDataSet(sid_t(objectId, HK_TABLE_DATA_SET_ID)) {} /** Measured output currents */ - lp_var_t currentAcuVcc = - lp_var_t(sid.objectId, P60System::P60DOCK_CURRENT_ACU_VCC, this); - lp_var_t currentPdu1Vcc = - lp_var_t(sid.objectId, P60System::P60DOCK_CURRENT_PDU1_VCC, this); - lp_var_t currentX3IdleVcc = - lp_var_t(sid.objectId, P60System::P60DOCK_CURRENT_X3_IDLE_VCC, this); - lp_var_t currentPdu2Vcc = - lp_var_t(sid.objectId, P60System::P60DOCK_CURRENT_PDU2_VCC, this); - lp_var_t currentAcuVbat = - lp_var_t(sid.objectId, P60System::P60DOCK_CURRENT_ACU_VBAT, this); - lp_var_t currentPdu1Vbat = - lp_var_t(sid.objectId, P60System::P60DOCK_CURRENT_PDU1_VBAT, this); - lp_var_t currentX3IdleVbat = - lp_var_t(sid.objectId, P60System::P60DOCK_CURRENT_X3_IDLE_VBAT, this); - lp_var_t currentPdu2Vbat = - lp_var_t(sid.objectId, P60System::P60DOCK_CURRENT_PDU2_VBAT, this); - lp_var_t currentStackVbat = - lp_var_t(sid.objectId, P60System::P60DOCK_CURRENT_STACK_VBAT, this); - lp_var_t currentStack3V3 = - lp_var_t(sid.objectId, P60System::P60DOCK_CURRENT_STACK_3V3, this); - lp_var_t currentStack5V = - lp_var_t(sid.objectId, P60System::P60DOCK_CURRENT_STACK_5V, this); - lp_var_t currentGS3V3 = - lp_var_t(sid.objectId, P60System::P60DOCK_CURRENT_GS3V3, this); - lp_var_t currentGS5V = - lp_var_t(sid.objectId, P60System::P60DOCK_CURRENT_GS5V, this); + lp_vec_t currents = + lp_vec_t(sid.objectId, P60System::pool::CURRENTS, + this); /** Measured output voltages */ - lp_var_t voltageAcuVcc = - lp_var_t(sid.objectId, P60System::P60DOCK_VOLTAGE_ACU_VCC, this); - lp_var_t voltagePdu1Vcc = - lp_var_t(sid.objectId, P60System::P60DOCK_VOLTAGE_PDU1_VCC, this); - lp_var_t voltageX3IdleVcc = - lp_var_t(sid.objectId, P60System::P60DOCK_VOLTAGE_X3_IDLE_VCC, this); - lp_var_t voltagePdu2Vcc = - lp_var_t(sid.objectId, P60System::P60DOCK_VOLTAGE_PDU2_VCC, this); - lp_var_t voltageAcuVbat = - lp_var_t(sid.objectId, P60System::P60DOCK_VOLTAGE_ACU_VBAT, this); - lp_var_t voltagePdu1Vbat = - lp_var_t(sid.objectId, P60System::P60DOCK_VOLTAGE_PDU1_VBAT, this); - lp_var_t voltageX3IdleVbat = - lp_var_t(sid.objectId, P60System::P60DOCK_VOLTAGE_X3_IDLE_VBAT, this); - lp_var_t voltagePdu2Vbat = - lp_var_t(sid.objectId, P60System::P60DOCK_VOLTAGE_PDU2_VBAT, this); - lp_var_t voltageStackVbat = - lp_var_t(sid.objectId, P60System::P60DOCK_VOLTAGE_STACK_VBAT, this); - lp_var_t voltageStack3V3 = - lp_var_t(sid.objectId, P60System::P60DOCK_VOLTAGE_STACK_3V3, this); - lp_var_t voltageStack5V = - lp_var_t(sid.objectId, P60System::P60DOCK_VOLTAGE_STACK_5V, this); - lp_var_t voltageGS3V3 = - lp_var_t(sid.objectId, P60System::P60DOCK_VOLTAGE_GS3V3, this); - lp_var_t voltageGS5V = - lp_var_t(sid.objectId, P60System::P60DOCK_VOLTAGE_GS5V, this); + lp_vec_t voltages = + lp_vec_t(sid.objectId, P60System::pool::VOLTAGES, + this); /** Output enable states */ - lp_var_t outputEnableStateAcuVcc = - lp_var_t(sid.objectId, P60System::P60DOCK_OUTPUTENABLE_ACU_VCC, this); - lp_var_t outputEnableStatePdu1Vcc = - lp_var_t(sid.objectId, P60System::P60DOCK_OUTPUTENABLE_PDU1_VCC, this); - lp_var_t outputEnableStateX3IdleVcc = - lp_var_t(sid.objectId, P60System::P60DOCK_OUTPUTENABLE_X3_IDLE_VCC, this); - lp_var_t outputEnableStatePdu2Vcc = - lp_var_t(sid.objectId, P60System::P60DOCK_OUTPUTENABLE_PDU2_VCC, this); - lp_var_t outputEnableStateAcuVbat = - lp_var_t(sid.objectId, P60System::P60DOCK_OUTPUTENABLE_ACU_VBAT, this); - lp_var_t outputEnableStatePdu1Vbat = - lp_var_t(sid.objectId, P60System::P60DOCK_OUTPUTENABLE_PDU1_VBAT, this); - lp_var_t outputEnableStateX3IdleVbat = - lp_var_t(sid.objectId, P60System::P60DOCK_OUTPUTENABLE_X3_IDLE_VBAT, this); - lp_var_t outputEnableStatePdu2Vbat = - lp_var_t(sid.objectId, P60System::P60DOCK_OUTPUTENABLE_PDU2_VBAT, this); - lp_var_t outputEnableStateStackVbat = - lp_var_t(sid.objectId, P60System::P60DOCK_OUTPUTENABLE_STACK_VBAT, this); - lp_var_t outputEnableStateStack3V3 = - lp_var_t(sid.objectId, P60System::P60DOCK_OUTPUTENABLE_STACK_3V3, this); - lp_var_t outputEnableStateStack5V = - lp_var_t(sid.objectId, P60System::P60DOCK_OUTPUTENABLE_STACK_5V, this); - lp_var_t outputEnableStateGS3V3 = - lp_var_t(sid.objectId, P60System::P60DOCK_OUTPUTENABLE_GS3V3, this); - lp_var_t outputEnableStateGS5V = - lp_var_t(sid.objectId, P60System::P60DOCK_OUTPUTENABLE_GS5V, this); + lp_vec_t outputEnables = + lp_vec_t(sid.objectId, P60System::pool::OUTPUT_ENABLE, + this); lp_var_t temperature1 = - lp_var_t(sid.objectId, P60System::P60DOCK_TEMPERATURE_1, this); + lp_var_t(sid.objectId, P60System::pool::P60DOCK_TEMPERATURE_1, this); lp_var_t temperature2 = - lp_var_t(sid.objectId, P60System::P60DOCK_TEMPERATURE_2, this); + lp_var_t(sid.objectId, P60System::pool::P60DOCK_TEMPERATURE_2, this); lp_var_t bootcause = - lp_var_t(sid.objectId, P60System::P60DOCK_BOOT_CAUSE, this); + lp_var_t(sid.objectId, P60System::pool::P60DOCK_BOOT_CAUSE, this); lp_var_t bootCount = - lp_var_t(sid.objectId, P60System::P60DOCK_BOOT_CNT, this); - lp_var_t uptime = lp_var_t(sid.objectId, P60System::P60DOCK_UPTIME, this); + lp_var_t(sid.objectId, P60System::pool::P60DOCK_BOOT_CNT, this); + lp_var_t uptime = + lp_var_t(sid.objectId, P60System::pool::P60DOCK_UPTIME, this); lp_var_t resetcause = - lp_var_t(sid.objectId, P60System::P60DOCK_RESETCAUSE, this); - lp_var_t battMode = lp_var_t(sid.objectId, P60System::P60DOCK_BATT_MODE, this); + lp_var_t(sid.objectId, P60System::pool::P60DOCK_RESETCAUSE, this); + lp_var_t battMode = + lp_var_t(sid.objectId, P60System::pool::P60DOCK_BATT_MODE, this); /** Battery heater control only possible on BP4 packs */ - lp_var_t heaterOn = lp_var_t(sid.objectId, P60System::P60DOCK_HEATER_ON, this); + lp_var_t heaterOn = + lp_var_t(sid.objectId, P60System::pool::P60DOCK_HEATER_ON, this); lp_var_t converter5VStatus = - lp_var_t(sid.objectId, P60System::P60DOCK_CONV_5V_ENABLE_STATUS, this); + lp_var_t(sid.objectId, P60System::pool::P60DOCK_CONV_5V_ENABLE_STATUS, this); /** Number of detected latchups on each output channel */ - lp_var_t latchupsAcuVcc = - lp_var_t(sid.objectId, P60System::P60DOCK_LATCHUP_ACU_VCC, this); - lp_var_t latchupsPdu1Vcc = - lp_var_t(sid.objectId, P60System::P60DOCK_LATCHUP_PDU1_VCC, this); - lp_var_t latchupsX3IdleVcc = - lp_var_t(sid.objectId, P60System::P60DOCK_LATCHUP_X3_IDLE_VCC, this); - lp_var_t latchupsPdu2Vcc = - lp_var_t(sid.objectId, P60System::P60DOCK_LATCHUP_PDU2_VCC, this); - lp_var_t latchupsAcuVbat = - lp_var_t(sid.objectId, P60System::P60DOCK_LATCHUP_ACU_VBAT, this); - lp_var_t latchupsPdu1Vbat = - lp_var_t(sid.objectId, P60System::P60DOCK_LATCHUP_PDU1_VBAT, this); - lp_var_t latchupsX3IdleVbat = - lp_var_t(sid.objectId, P60System::P60DOCK_LATCHUP_X3_IDLE_VBAT, this); - lp_var_t latchupsPdu2Vbat = - lp_var_t(sid.objectId, P60System::P60DOCK_LATCHUP_PDU2_VBAT, this); - lp_var_t latchupsStackVbat = - lp_var_t(sid.objectId, P60System::P60DOCK_LATCHUP_STACK_VBAT, this); - lp_var_t latchupsStack3V3 = - lp_var_t(sid.objectId, P60System::P60DOCK_LATCHUP_STACK_3V3, this); - lp_var_t latchupsStack5V = - lp_var_t(sid.objectId, P60System::P60DOCK_LATCHUP_STACK_5V, this); - lp_var_t latchupsGS3V3 = - lp_var_t(sid.objectId, P60System::P60DOCK_LATCHUP_GS3V3, this); - lp_var_t latchupsGS5V = - lp_var_t(sid.objectId, P60System::P60DOCK_LATCHUP_GS5V, this); + lp_vec_t latchups = + lp_vec_t(sid.objectId, P60System::pool::LATCHUPS, + this); lp_var_t dockVbatVoltageValue = - lp_var_t(sid.objectId, P60System::P60DOCK_VBAT_VALUE, this); + lp_var_t(sid.objectId, P60System::pool::P60DOCK_DOCK_VBAT, this); lp_var_t dockVccCurrent = - lp_var_t(sid.objectId, P60System::P60DOCK_VCC_CURRENT_VALUE, this); + lp_var_t(sid.objectId, P60System::pool::P60DOCK_DOCK_VCC_CURRENT, this); // Difference between charge and discharge current lp_var_t batteryCurrent = - lp_var_t(sid.objectId, P60System::P60DOCK_BATTERY_CURRENT, this); + lp_var_t(sid.objectId, P60System::pool::P60DOCK_BATTERY_CURRENT, this); lp_var_t batteryVoltage = - lp_var_t(sid.objectId, P60System::P60DOCK_BATTERY_VOLTAGE, this); + lp_var_t(sid.objectId, P60System::pool::P60DOCK_BATTERY_VOLTAGE, this); lp_var_t batteryTemperature1 = - lp_var_t(sid.objectId, P60System::P60DOCK_BATTERY_TEMPERATURE_1, this); + lp_var_t(sid.objectId, P60System::pool::P60DOCK_BATTERY_TEMPERATURE_1, this); lp_var_t batteryTemperature2 = - lp_var_t(sid.objectId, P60System::P60DOCK_BATTERY_TEMPERATURE_2, this); + lp_var_t(sid.objectId, P60System::pool::P60DOCK_BATTERY_TEMPERATURE_2, this); - lp_var_t device0 = lp_var_t(sid.objectId, P60System::P60DOCK_DEVICE_0, this); - lp_var_t device1 = lp_var_t(sid.objectId, P60System::P60DOCK_DEVICE_1, this); - lp_var_t device2 = lp_var_t(sid.objectId, P60System::P60DOCK_DEVICE_2, this); - lp_var_t device3 = lp_var_t(sid.objectId, P60System::P60DOCK_DEVICE_3, this); - lp_var_t device4 = lp_var_t(sid.objectId, P60System::P60DOCK_DEVICE_4, this); - lp_var_t device5 = lp_var_t(sid.objectId, P60System::P60DOCK_DEVICE_5, this); - lp_var_t device6 = lp_var_t(sid.objectId, P60System::P60DOCK_DEVICE_6, this); - lp_var_t device7 = lp_var_t(sid.objectId, P60System::P60DOCK_DEVICE_7, this); - - lp_var_t device0Status = - lp_var_t(sid.objectId, P60System::P60DOCK_DEVICE_0_STATUS, this); - lp_var_t device1Status = - lp_var_t(sid.objectId, P60System::P60DOCK_DEVICE_1_STATUS, this); - lp_var_t device2Status = - lp_var_t(sid.objectId, P60System::P60DOCK_DEVICE_2_STATUS, this); - lp_var_t device3Status = - lp_var_t(sid.objectId, P60System::P60DOCK_DEVICE_3_STATUS, this); - lp_var_t device4Status = - lp_var_t(sid.objectId, P60System::P60DOCK_DEVICE_4_STATUS, this); - lp_var_t device5Status = - lp_var_t(sid.objectId, P60System::P60DOCK_DEVICE_5_STATUS, this); - lp_var_t device6Status = - lp_var_t(sid.objectId, P60System::P60DOCK_DEVICE_6_STATUS, this); - lp_var_t device7Status = - lp_var_t(sid.objectId, P60System::P60DOCK_DEVICE_7_STATUS, this); + lp_vec_t devicesType = + lp_vec_t(sid.objectId, P60System::pool::DEVICES_TYPE, this); + lp_vec_t devicesStatus = + lp_vec_t(sid.objectId, P60System::pool::DEVICES_STATUS, this); lp_var_t dearmStatus = - lp_var_t(sid.objectId, P60System::P60DOCK_DEARM_STATUS, this); + lp_var_t(sid.objectId, P60System::pool::P60DOCK_DEARM_STATUS, this); /** Number of reboots due to gnd, i2c, csp watchdog timeout */ lp_var_t wdtCntGnd = - lp_var_t(sid.objectId, P60System::P60DOCK_WDT_CNT_GND, this); + lp_var_t(sid.objectId, P60System::pool::P60DOCK_WDT_CNT_GND, this); lp_var_t wdtCntI2c = - lp_var_t(sid.objectId, P60System::P60DOCK_WDT_CNT_I2C, this); + lp_var_t(sid.objectId, P60System::pool::P60DOCK_WDT_CNT_I2C, this); lp_var_t wdtCntCan = - lp_var_t(sid.objectId, P60System::P60DOCK_WDT_CNT_CAN, this); + lp_var_t(sid.objectId, P60System::pool::P60DOCK_WDT_CNT_CAN, this); lp_var_t wdtCntCsp1 = - lp_var_t(sid.objectId, P60System::P60DOCK_WDT_CNT_CSP_1, this); + lp_var_t(sid.objectId, P60System::pool::P60DOCK_WDT_CNT_CSP_1, this); lp_var_t wdtCntCsp2 = - lp_var_t(sid.objectId, P60System::P60DOCK_WDT_CNT_CSP_2, this); + lp_var_t(sid.objectId, P60System::pool::P60DOCK_WDT_CNT_CSP_2, this); lp_var_t wdtGndLeft = - lp_var_t(sid.objectId, P60System::P60DOCK_WDT_GND_LEFT, this); + lp_var_t(sid.objectId, P60System::pool::P60DOCK_WDT_GND_LEFT, this); lp_var_t wdtI2cLeft = - lp_var_t(sid.objectId, P60System::P60DOCK_WDT_I2C_LEFT, this); + lp_var_t(sid.objectId, P60System::pool::P60DOCK_WDT_I2C_LEFT, this); lp_var_t wdtCanLeft = - lp_var_t(sid.objectId, P60System::P60DOCK_WDT_CAN_LEFT, this); + lp_var_t(sid.objectId, P60System::pool::P60DOCK_WDT_CAN_LEFT, this); lp_var_t wdtCspLeft1 = - lp_var_t(sid.objectId, P60System::P60DOCK_WDT_CSP_LEFT_1, this); + lp_var_t(sid.objectId, P60System::pool::P60DOCK_WDT_CSP_LEFT_1, this); lp_var_t wdtCspLeft2 = - lp_var_t(sid.objectId, P60System::P60DOCK_WDT_CSP_LEFT_2, this); + lp_var_t(sid.objectId, P60System::pool::P60DOCK_WDT_CSP_LEFT_2, this); lp_var_t batteryChargeCurrent = - lp_var_t(sid.objectId, P60System::P60DOCK_BATT_CHARGE_CURRENT, this); + lp_var_t(sid.objectId, P60System::pool::P60DOCK_BATT_CHARGE_CURRENT, this); lp_var_t batteryDischargeCurrent = - lp_var_t(sid.objectId, P60System::P60DOCK_BATT_DISCHARGE_CURRENT, this); - lp_var_t ant6Depl = lp_var_t(sid.objectId, P60System::P60DOCK_ANT6_DEPL, this); - lp_var_t ar6Depl = lp_var_t(sid.objectId, P60System::P60DOCK_AR6_DEPL, this); + lp_var_t(sid.objectId, P60System::pool::P60DOCK_BATT_DISCHARGE_CURRENT, this); + lp_var_t ant6Depl = + lp_var_t(sid.objectId, P60System::pool::P60DOCK_ANT6_DEPL, this); + lp_var_t ar6Depl = + lp_var_t(sid.objectId, P60System::pool::P60DOCK_AR6_DEPL, this); }; } // namespace P60Dock @@ -666,163 +524,166 @@ class PDU1HkTableDataset : public StaticLocalDataSet { /** Measured output currents */ lp_var_t currentOutTCSBoard3V3 = - lp_var_t(sid.objectId, P60System::PDU1_CURRENT_OUT_TCS_BOARD_3V3, this); + lp_var_t(sid.objectId, P60System::pool::PDU1_CURRENT_OUT_TCS_BOARD_3V3, this); lp_var_t currentOutSyrlinks = - lp_var_t(sid.objectId, P60System::PDU1_CURRENT_OUT_SYRLINKS, this); + lp_var_t(sid.objectId, P60System::pool::PDU1_CURRENT_OUT_SYRLINKS, this); lp_var_t currentOutStarTracker = - lp_var_t(sid.objectId, P60System::PDU1_CURRENT_OUT_STAR_TRACKER, this); + lp_var_t(sid.objectId, P60System::pool::PDU1_CURRENT_OUT_STAR_TRACKER, this); lp_var_t currentOutMGT = - lp_var_t(sid.objectId, P60System::PDU1_CURRENT_OUT_MGT, this); + lp_var_t(sid.objectId, P60System::pool::PDU1_CURRENT_OUT_MGT, this); lp_var_t currentOutSUSNominal = - lp_var_t(sid.objectId, P60System::PDU1_CURRENT_OUT_SUS_NOMINAL, this); + lp_var_t(sid.objectId, P60System::pool::PDU1_CURRENT_OUT_SUS_NOMINAL, this); lp_var_t currentOutSolarCellExp = - lp_var_t(sid.objectId, P60System::PDU1_CURRENT_OUT_SOLAR_CELL_EXP, this); + lp_var_t(sid.objectId, P60System::pool::PDU1_CURRENT_OUT_SOLAR_CELL_EXP, this); lp_var_t currentOutPLOC = - lp_var_t(sid.objectId, P60System::PDU1_CURRENT_OUT_PLOC, this); + lp_var_t(sid.objectId, P60System::pool::PDU1_CURRENT_OUT_PLOC, this); lp_var_t currentOutACSBoardSideA = - lp_var_t(sid.objectId, P60System::PDU1_CURRENT_OUT_ACS_BOARD_SIDE_A, this); + lp_var_t(sid.objectId, P60System::pool::PDU1_CURRENT_OUT_ACS_BOARD_SIDE_A, this); lp_var_t currentOutChannel8 = - lp_var_t(sid.objectId, P60System::PDU1_CURRENT_OUT_CHANNEL8, this); + lp_var_t(sid.objectId, P60System::pool::PDU1_CURRENT_OUT_CHANNEL8, this); /** Measured voltage of output channels */ lp_var_t voltageOutTCSBoard3V3 = - lp_var_t(sid.objectId, P60System::PDU1_VOLTAGE_OUT_TCS_BOARD_3V3, this); + lp_var_t(sid.objectId, P60System::pool::PDU1_VOLTAGE_OUT_TCS_BOARD_3V3, this); lp_var_t voltageOutSyrlinks = - lp_var_t(sid.objectId, P60System::PDU1_VOLTAGE_OUT_SYRLINKS, this); + lp_var_t(sid.objectId, P60System::pool::PDU1_VOLTAGE_OUT_SYRLINKS, this); lp_var_t voltageOutStarTracker = - lp_var_t(sid.objectId, P60System::PDU1_VOLTAGE_OUT_STAR_TRACKER, this); + lp_var_t(sid.objectId, P60System::pool::PDU1_VOLTAGE_OUT_STAR_TRACKER, this); lp_var_t voltageOutMGT = - lp_var_t(sid.objectId, P60System::PDU1_VOLTAGE_OUT_MGT, this); + lp_var_t(sid.objectId, P60System::pool::PDU1_VOLTAGE_OUT_MGT, this); lp_var_t voltageOutSUSNominal = - lp_var_t(sid.objectId, P60System::PDU1_VOLTAGE_OUT_SUS_NOMINAL, this); + lp_var_t(sid.objectId, P60System::pool::PDU1_VOLTAGE_OUT_SUS_NOMINAL, this); lp_var_t voltageOutSolarCellExp = - lp_var_t(sid.objectId, P60System::PDU1_VOLTAGE_OUT_SOLAR_CELL_EXP, this); + lp_var_t(sid.objectId, P60System::pool::PDU1_VOLTAGE_OUT_SOLAR_CELL_EXP, this); lp_var_t voltageOutPLOC = - lp_var_t(sid.objectId, P60System::PDU1_VOLTAGE_OUT_PLOC, this); + lp_var_t(sid.objectId, P60System::pool::PDU1_VOLTAGE_OUT_PLOC, this); lp_var_t voltageOutACSBoardSideA = - lp_var_t(sid.objectId, P60System::PDU1_VOLTAGE_OUT_ACS_BOARD_SIDE_A, this); + lp_var_t(sid.objectId, P60System::pool::PDU1_VOLTAGE_OUT_ACS_BOARD_SIDE_A, this); lp_var_t voltageOutChannel8 = - lp_var_t(sid.objectId, P60System::PDU1_VOLTAGE_OUT_CHANNEL8, this); + lp_var_t(sid.objectId, P60System::pool::PDU1_VOLTAGE_OUT_CHANNEL8, this); /** Measured VCC */ - lp_var_t vcc = lp_var_t(sid.objectId, P60System::PDU1_VCC, this); + lp_var_t vcc = lp_var_t(sid.objectId, P60System::pool::PDU1_VCC, this); /** Measured VBAT */ - lp_var_t vbat = lp_var_t(sid.objectId, P60System::PDU1_VBAT, this); + lp_var_t vbat = lp_var_t(sid.objectId, P60System::pool::PDU1_VBAT, this); lp_var_t temperature = - lp_var_t(sid.objectId, P60System::PDU1_TEMPERATURE, this); + lp_var_t(sid.objectId, P60System::pool::PDU1_TEMPERATURE, this); /** Output converter enable status */ lp_var_t converterEnable1 = - lp_var_t(sid.objectId, P60System::PDU1_CONV_EN_1, this); + lp_var_t(sid.objectId, P60System::pool::PDU1_CONV_EN_1, this); lp_var_t converterEnable2 = - lp_var_t(sid.objectId, P60System::PDU1_CONV_EN_2, this); + lp_var_t(sid.objectId, P60System::pool::PDU1_CONV_EN_2, this); lp_var_t converterEnable3 = - lp_var_t(sid.objectId, P60System::PDU1_CONV_EN_3, this); + lp_var_t(sid.objectId, P60System::pool::PDU1_CONV_EN_3, this); /** Output channels enable status */ lp_var_t outEnabledTCSBoard3V3 = - lp_var_t(sid.objectId, P60System::PDU1_OUT_EN_TCS_BOARD_3V3, this); + lp_var_t(sid.objectId, P60System::pool::PDU1_OUT_EN_TCS_BOARD_3V3, this); lp_var_t outEnabledSyrlinks = - lp_var_t(sid.objectId, P60System::PDU1_OUT_EN_SYRLINKS, this); + lp_var_t(sid.objectId, P60System::pool::PDU1_OUT_EN_SYRLINKS, this); lp_var_t outEnabledStarTracker = - lp_var_t(sid.objectId, P60System::PDU1_OUT_EN_STAR_TRACKER, this); + lp_var_t(sid.objectId, P60System::pool::PDU1_OUT_EN_STAR_TRACKER, this); lp_var_t outEnabledMGT = - lp_var_t(sid.objectId, P60System::PDU1_OUT_EN_MGT, this); + lp_var_t(sid.objectId, P60System::pool::PDU1_OUT_EN_MGT, this); lp_var_t outEnabledSUSNominal = - lp_var_t(sid.objectId, P60System::PDU1_OUT_EN_SUS_NOMINAL, this); + lp_var_t(sid.objectId, P60System::pool::PDU1_OUT_EN_SUS_NOMINAL, this); lp_var_t outEnabledSolarCellExp = - lp_var_t(sid.objectId, P60System::PDU1_OUT_EN_SOLAR_CELL_EXP, this); + lp_var_t(sid.objectId, P60System::pool::PDU1_OUT_EN_SOLAR_CELL_EXP, this); lp_var_t outEnabledPLOC = - lp_var_t(sid.objectId, P60System::PDU1_OUT_EN_PLOC, this); + lp_var_t(sid.objectId, P60System::pool::PDU1_OUT_EN_PLOC, this); lp_var_t outEnabledAcsBoardSideA = - lp_var_t(sid.objectId, P60System::PDU1_OUT_EN_ACS_BOARD_SIDE_A, this); + lp_var_t(sid.objectId, P60System::pool::PDU1_OUT_EN_ACS_BOARD_SIDE_A, this); lp_var_t outEnabledChannel8 = - lp_var_t(sid.objectId, P60System::PDU1_OUT_EN_CHANNEL8, this); - lp_var_t bootcause = lp_var_t(sid.objectId, P60System::PDU1_BOOTCAUSE, this); + lp_var_t(sid.objectId, P60System::pool::PDU1_OUT_EN_CHANNEL8, this); + lp_var_t bootcause = + lp_var_t(sid.objectId, P60System::pool::PDU1_BOOTCAUSE, this); /** Number of reboots */ - lp_var_t bootcount = lp_var_t(sid.objectId, P60System::PDU1_BOOTCNT, this); + lp_var_t bootcount = + lp_var_t(sid.objectId, P60System::pool::PDU1_BOOTCNT, this); /** Uptime in seconds */ - lp_var_t uptime = lp_var_t(sid.objectId, P60System::PDU1_UPTIME, this); + lp_var_t uptime = lp_var_t(sid.objectId, P60System::pool::PDU1_UPTIME, this); lp_var_t resetcause = - lp_var_t(sid.objectId, P60System::PDU1_RESETCAUSE, this); + lp_var_t(sid.objectId, P60System::pool::PDU1_RESETCAUSE, this); /** Battery mode: 1 = Critical, 2 = Safe, 3 = Normal, 4 = Full */ - lp_var_t battMode = lp_var_t(sid.objectId, P60System::PDU1_BATT_MODE, this); + lp_var_t battMode = + lp_var_t(sid.objectId, P60System::pool::PDU1_BATT_MODE, this); /** Number of detected latchups on each output channel */ lp_var_t latchupsTcsBoard3V3 = - lp_var_t(sid.objectId, P60System::PDU1_LATCHUP_TCS_BOARD_3V3, this); + lp_var_t(sid.objectId, P60System::pool::PDU1_LATCHUP_TCS_BOARD_3V3, this); lp_var_t latchupsSyrlinks = - lp_var_t(sid.objectId, P60System::PDU1_LATCHUP_SYRLINKS, this); + lp_var_t(sid.objectId, P60System::pool::PDU1_LATCHUP_SYRLINKS, this); lp_var_t latchupsStarTracker = - lp_var_t(sid.objectId, P60System::PDU1_LATCHUP_STAR_TRACKER, this); + lp_var_t(sid.objectId, P60System::pool::PDU1_LATCHUP_STAR_TRACKER, this); lp_var_t latchupsMgt = - lp_var_t(sid.objectId, P60System::PDU1_LATCHUP_MGT, this); + lp_var_t(sid.objectId, P60System::pool::PDU1_LATCHUP_MGT, this); lp_var_t latchupsSusNominal = - lp_var_t(sid.objectId, P60System::PDU1_LATCHUP_SUS_NOMINAL, this); + lp_var_t(sid.objectId, P60System::pool::PDU1_LATCHUP_SUS_NOMINAL, this); lp_var_t latchupsSolarCellExp = - lp_var_t(sid.objectId, P60System::PDU1_LATCHUP_SOLAR_CELL_EXP, this); + lp_var_t(sid.objectId, P60System::pool::PDU1_LATCHUP_SOLAR_CELL_EXP, this); lp_var_t latchupsPloc = - lp_var_t(sid.objectId, P60System::PDU1_LATCHUP_PLOC, this); + lp_var_t(sid.objectId, P60System::pool::PDU1_LATCHUP_PLOC, this); lp_var_t latchupsAcsBoardSideA = - lp_var_t(sid.objectId, P60System::PDU1_LATCHUP_ACS_BOARD_SIDE_A, this); + lp_var_t(sid.objectId, P60System::pool::PDU1_LATCHUP_ACS_BOARD_SIDE_A, this); lp_var_t latchupsChannel8 = - lp_var_t(sid.objectId, P60System::PDU1_LATCHUP_CHANNEL8, this); + lp_var_t(sid.objectId, P60System::pool::PDU1_LATCHUP_CHANNEL8, this); /** * There are 8 devices on the PDU. FRAM, ADCs, temperature sensor etc. Each device is * identified by an ID. Refer also to gs-man-nanopower-p60-pdu-200-1.pdf on pages 17 and 18. */ - lp_var_t device0 = lp_var_t(sid.objectId, P60System::PDU1_DEVICE_0, this); - lp_var_t device1 = lp_var_t(sid.objectId, P60System::PDU1_DEVICE_1, this); - lp_var_t device2 = lp_var_t(sid.objectId, P60System::PDU1_DEVICE_2, this); - lp_var_t device3 = lp_var_t(sid.objectId, P60System::PDU1_DEVICE_3, this); - lp_var_t device4 = lp_var_t(sid.objectId, P60System::PDU1_DEVICE_4, this); - lp_var_t device5 = lp_var_t(sid.objectId, P60System::PDU1_DEVICE_5, this); - lp_var_t device6 = lp_var_t(sid.objectId, P60System::PDU1_DEVICE_6, this); - lp_var_t device7 = lp_var_t(sid.objectId, P60System::PDU1_DEVICE_7, this); + lp_var_t device0 = lp_var_t(sid.objectId, P60System::pool::PDU1_DEVICE_0, this); + lp_var_t device1 = lp_var_t(sid.objectId, P60System::pool::PDU1_DEVICE_1, this); + lp_var_t device2 = lp_var_t(sid.objectId, P60System::pool::PDU1_DEVICE_2, this); + lp_var_t device3 = lp_var_t(sid.objectId, P60System::pool::PDU1_DEVICE_3, this); + lp_var_t device4 = lp_var_t(sid.objectId, P60System::pool::PDU1_DEVICE_4, this); + lp_var_t device5 = lp_var_t(sid.objectId, P60System::pool::PDU1_DEVICE_5, this); + lp_var_t device6 = lp_var_t(sid.objectId, P60System::pool::PDU1_DEVICE_6, this); + lp_var_t device7 = lp_var_t(sid.objectId, P60System::pool::PDU1_DEVICE_7, this); /** The status of each device. 0 = None, 1 = Ok, 2 = Error, 3 = Not found */ lp_var_t device0Status = - lp_var_t(sid.objectId, P60System::PDU1_DEVICE_0_STATUS, this); + lp_var_t(sid.objectId, P60System::pool::PDU1_DEVICE_0_STATUS, this); lp_var_t device1Status = - lp_var_t(sid.objectId, P60System::PDU1_DEVICE_1_STATUS, this); + lp_var_t(sid.objectId, P60System::pool::PDU1_DEVICE_1_STATUS, this); lp_var_t device2Status = - lp_var_t(sid.objectId, P60System::PDU1_DEVICE_2_STATUS, this); + lp_var_t(sid.objectId, P60System::pool::PDU1_DEVICE_2_STATUS, this); lp_var_t device3Status = - lp_var_t(sid.objectId, P60System::PDU1_DEVICE_3_STATUS, this); + lp_var_t(sid.objectId, P60System::pool::PDU1_DEVICE_3_STATUS, this); lp_var_t device4Status = - lp_var_t(sid.objectId, P60System::PDU1_DEVICE_4_STATUS, this); + lp_var_t(sid.objectId, P60System::pool::PDU1_DEVICE_4_STATUS, this); lp_var_t device5Status = - lp_var_t(sid.objectId, P60System::PDU1_DEVICE_5_STATUS, this); + lp_var_t(sid.objectId, P60System::pool::PDU1_DEVICE_5_STATUS, this); lp_var_t device6Status = - lp_var_t(sid.objectId, P60System::PDU1_DEVICE_6_STATUS, this); + lp_var_t(sid.objectId, P60System::pool::PDU1_DEVICE_6_STATUS, this); lp_var_t device7Status = - lp_var_t(sid.objectId, P60System::PDU1_DEVICE_7_STATUS, this); + lp_var_t(sid.objectId, P60System::pool::PDU1_DEVICE_7_STATUS, this); /** Number of reboots triggered by the ground watchdog */ lp_var_t gndWdtReboots = - lp_var_t(sid.objectId, P60System::PDU1_WDT_CNT_GND, this); + lp_var_t(sid.objectId, P60System::pool::PDU1_WDT_CNT_GND, this); /** Number of reboots triggered through the I2C watchdog. Not relevant for EIVE. */ lp_var_t i2cWdtReboots = - lp_var_t(sid.objectId, P60System::PDU1_WDT_CNT_I2C, this); + lp_var_t(sid.objectId, P60System::pool::PDU1_WDT_CNT_I2C, this); /** Number of reboots triggered through the CAN watchdog */ lp_var_t canWdtReboots = - lp_var_t(sid.objectId, P60System::PDU1_WDT_CNT_CAN, this); + lp_var_t(sid.objectId, P60System::pool::PDU1_WDT_CNT_CAN, this); /** Number of reboots triggered through the CSP watchdog */ lp_var_t csp1WdtReboots = - lp_var_t(sid.objectId, P60System::PDU1_WDT_CNT_CSP1, this); + lp_var_t(sid.objectId, P60System::pool::PDU1_WDT_CNT_CSP1, this); lp_var_t csp2WdtReboots = - lp_var_t(sid.objectId, P60System::PDU1_WDT_CNT_CSP2, this); + lp_var_t(sid.objectId, P60System::pool::PDU1_WDT_CNT_CSP2, this); /** Ground watchdog remaining seconds before rebooting */ lp_var_t groundWatchdogSecondsLeft = - lp_var_t(sid.objectId, P60System::PDU1_WDT_GND_LEFT, this); + lp_var_t(sid.objectId, P60System::pool::PDU1_WDT_GND_LEFT, this); /** I2C watchdog remaining seconds before rebooting. Not relevant for EIVE. */ lp_var_t i2cWatchdogSecondsLeft = - lp_var_t(sid.objectId, P60System::PDU1_WDT_I2C_LEFT, this); + lp_var_t(sid.objectId, P60System::pool::PDU1_WDT_I2C_LEFT, this); /** CAN watchdog remaining seconds before rebooting. */ lp_var_t canWatchdogSecondsLeft = - lp_var_t(sid.objectId, P60System::PDU1_WDT_CAN_LEFT, this); + lp_var_t(sid.objectId, P60System::pool::PDU1_WDT_CAN_LEFT, this); /** CSP watchdogs remaining pings before rebooting. */ lp_var_t csp2WatchdogPingsLeft = - lp_var_t(sid.objectId, P60System::PDU1_WDT_CSP_LEFT1, this); + lp_var_t(sid.objectId, P60System::pool::PDU1_WDT_CSP_LEFT1, this); lp_var_t csp1WatchdogPingsLeft = - lp_var_t(sid.objectId, P60System::PDU1_WDT_CSP_LEFT2, this); + lp_var_t(sid.objectId, P60System::pool::PDU1_WDT_CSP_LEFT2, this); }; } // namespace PDU1 @@ -867,163 +728,166 @@ class PDU2HkTableDataset : public StaticLocalDataSet { /** Measured output currents */ lp_var_t currentOutQ7S = - lp_var_t(sid.objectId, P60System::PDU2_CURRENT_OUT_Q7S, this); + lp_var_t(sid.objectId, P60System::pool::PDU2_CURRENT_OUT_Q7S, this); lp_var_t currentOutPayloadPCDUCh1 = - lp_var_t(sid.objectId, P60System::PDU2_CURRENT_OUT_PAYLOAD_PCDU_CH1, this); + lp_var_t(sid.objectId, P60System::pool::PDU2_CURRENT_OUT_PAYLOAD_PCDU_CH1, this); lp_var_t currentOutReactionWheels = - lp_var_t(sid.objectId, P60System::PDU2_CURRENT_OUT_RW, this); + lp_var_t(sid.objectId, P60System::pool::PDU2_CURRENT_OUT_RW, this); lp_var_t currentOutTCSBoardHeaterIn = - lp_var_t(sid.objectId, P60System::PDU2_CURRENT_OUT_TCS_BOARD_HEATER_IN, this); + lp_var_t(sid.objectId, P60System::pool::PDU2_CURRENT_OUT_TCS_BOARD_HEATER_IN, this); lp_var_t currentOutSUSRedundant = - lp_var_t(sid.objectId, P60System::PDU2_CURRENT_OUT_SUS_REDUNDANT, this); + lp_var_t(sid.objectId, P60System::pool::PDU2_CURRENT_OUT_SUS_REDUNDANT, this); lp_var_t currentOutDeplMechanism = - lp_var_t(sid.objectId, P60System::PDU2_CURRENT_OUT_DEPLOYMENT_MECHANISM, this); + lp_var_t(sid.objectId, P60System::pool::PDU2_CURRENT_OUT_DEPLOYMENT_MECHANISM, this); lp_var_t currentOutPayloadPCDUCh6 = - lp_var_t(sid.objectId, P60System::PDU2_CURRENT_OUT_PAYLOAD_PCDU_CH6, this); + lp_var_t(sid.objectId, P60System::pool::PDU2_CURRENT_OUT_PAYLOAD_PCDU_CH6, this); lp_var_t currentOutACSBoardSideB = - lp_var_t(sid.objectId, P60System::PDU2_CURRENT_OUT_ACS_BOARD_SIDE_B, this); + lp_var_t(sid.objectId, P60System::pool::PDU2_CURRENT_OUT_ACS_BOARD_SIDE_B, this); lp_var_t currentOutPayloadCamera = - lp_var_t(sid.objectId, P60System::PDU2_CURRENT_OUT_PAYLOAD_CAMERA, this); + lp_var_t(sid.objectId, P60System::pool::PDU2_CURRENT_OUT_PAYLOAD_CAMERA, this); /** Measured voltage of output channels */ lp_var_t voltageOutQ7S = - lp_var_t(sid.objectId, P60System::PDU2_VOLTAGE_OUT_Q7S, this); + lp_var_t(sid.objectId, P60System::pool::PDU2_VOLTAGE_OUT_Q7S, this); lp_var_t voltageOutPayloadPCDUCh1 = - lp_var_t(sid.objectId, P60System::PDU2_VOLTAGE_OUT_PAYLOAD_PCDU_CH1, this); + lp_var_t(sid.objectId, P60System::pool::PDU2_VOLTAGE_OUT_PAYLOAD_PCDU_CH1, this); lp_var_t voltageOutReactionWheels = - lp_var_t(sid.objectId, P60System::PDU2_VOLTAGE_OUT_RW, this); + lp_var_t(sid.objectId, P60System::pool::PDU2_VOLTAGE_OUT_RW, this); lp_var_t voltageOutTCSBoardHeaterIn = - lp_var_t(sid.objectId, P60System::PDU2_VOLTAGE_OUT_TCS_BOARD_HEATER_IN, this); + lp_var_t(sid.objectId, P60System::pool::PDU2_VOLTAGE_OUT_TCS_BOARD_HEATER_IN, this); lp_var_t voltageOutSUSRedundant = - lp_var_t(sid.objectId, P60System::PDU2_VOLTAGE_OUT_SUS_REDUNDANT, this); + lp_var_t(sid.objectId, P60System::pool::PDU2_VOLTAGE_OUT_SUS_REDUNDANT, this); lp_var_t voltageOutDeplMechanism = - lp_var_t(sid.objectId, P60System::PDU2_VOLTAGE_OUT_DEPLOYMENT_MECHANISM, this); + lp_var_t(sid.objectId, P60System::pool::PDU2_VOLTAGE_OUT_DEPLOYMENT_MECHANISM, this); lp_var_t voltageOutPayloadPCDUCh6 = - lp_var_t(sid.objectId, P60System::PDU2_VOLTAGE_OUT_PAYLOAD_PCDU_CH6, this); + lp_var_t(sid.objectId, P60System::pool::PDU2_VOLTAGE_OUT_PAYLOAD_PCDU_CH6, this); lp_var_t voltageOutACSBoardSideB = - lp_var_t(sid.objectId, P60System::PDU2_VOLTAGE_OUT_ACS_BOARD_SIDE_B, this); + lp_var_t(sid.objectId, P60System::pool::PDU2_VOLTAGE_OUT_ACS_BOARD_SIDE_B, this); lp_var_t voltageOutPayloadCamera = - lp_var_t(sid.objectId, P60System::PDU2_VOLTAGE_OUT_PAYLOAD_CAMERA, this); + lp_var_t(sid.objectId, P60System::pool::PDU2_VOLTAGE_OUT_PAYLOAD_CAMERA, this); /** Measured VCC */ - lp_var_t vcc = lp_var_t(sid.objectId, P60System::PDU2_VCC, this); + lp_var_t vcc = lp_var_t(sid.objectId, P60System::pool::PDU2_VCC, this); /** Measured VBAT */ - lp_var_t vbat = lp_var_t(sid.objectId, P60System::PDU2_VBAT, this); + lp_var_t vbat = lp_var_t(sid.objectId, P60System::pool::PDU2_VBAT, this); lp_var_t temperature = - lp_var_t(sid.objectId, P60System::PDU2_TEMPERATURE, this); + lp_var_t(sid.objectId, P60System::pool::PDU2_TEMPERATURE, this); /** Output converter enable status */ lp_var_t converterEnable1 = - lp_var_t(sid.objectId, P60System::PDU2_CONV_EN_1, this); + lp_var_t(sid.objectId, P60System::pool::PDU2_CONV_EN_1, this); lp_var_t converterEnable2 = - lp_var_t(sid.objectId, P60System::PDU2_CONV_EN_2, this); + lp_var_t(sid.objectId, P60System::pool::PDU2_CONV_EN_2, this); lp_var_t converterEnable3 = - lp_var_t(sid.objectId, P60System::PDU2_CONV_EN_3, this); + lp_var_t(sid.objectId, P60System::pool::PDU2_CONV_EN_3, this); /** Output channels enable status */ lp_var_t outEnabledQ7S = - lp_var_t(sid.objectId, P60System::PDU2_OUT_EN_Q7S, this); + lp_var_t(sid.objectId, P60System::pool::PDU2_OUT_EN_Q7S, this); lp_var_t outEnabledPlPCDUCh1 = - lp_var_t(sid.objectId, P60System::PDU2_OUT_EN_PAYLOAD_PCDU_CH1, this); + lp_var_t(sid.objectId, P60System::pool::PDU2_OUT_EN_PAYLOAD_PCDU_CH1, this); lp_var_t outEnabledReactionWheels = - lp_var_t(sid.objectId, P60System::PDU2_OUT_EN_RW, this); + lp_var_t(sid.objectId, P60System::pool::PDU2_OUT_EN_RW, this); lp_var_t outEnabledTCSBoardHeaterIn = - lp_var_t(sid.objectId, P60System::PDU2_OUT_EN_TCS_BOARD_HEATER_IN, this); + lp_var_t(sid.objectId, P60System::pool::PDU2_OUT_EN_TCS_BOARD_HEATER_IN, this); lp_var_t outEnabledSUSRedundant = - lp_var_t(sid.objectId, P60System::PDU2_OUT_EN_SUS_REDUNDANT, this); + lp_var_t(sid.objectId, P60System::pool::PDU2_OUT_EN_SUS_REDUNDANT, this); lp_var_t outEnabledDeplMechanism = - lp_var_t(sid.objectId, P60System::PDU2_OUT_EN_DEPLOYMENT_MECHANISM, this); + lp_var_t(sid.objectId, P60System::pool::PDU2_OUT_EN_DEPLOYMENT_MECHANISM, this); lp_var_t outEnabledPlPCDUCh6 = - lp_var_t(sid.objectId, P60System::PDU2_OUT_EN_PAYLOAD_PCDU_CH6, this); + lp_var_t(sid.objectId, P60System::pool::PDU2_OUT_EN_PAYLOAD_PCDU_CH6, this); lp_var_t outEnabledAcsBoardSideB = - lp_var_t(sid.objectId, P60System::PDU2_OUT_EN_ACS_BOARD_SIDE_B, this); + lp_var_t(sid.objectId, P60System::pool::PDU2_OUT_EN_ACS_BOARD_SIDE_B, this); lp_var_t outEnabledPayloadCamera = - lp_var_t(sid.objectId, P60System::PDU2_OUT_EN_PAYLOAD_CAMERA, this); + lp_var_t(sid.objectId, P60System::pool::PDU2_OUT_EN_PAYLOAD_CAMERA, this); - lp_var_t bootcause = lp_var_t(sid.objectId, P60System::PDU2_BOOTCAUSE, this); + lp_var_t bootcause = + lp_var_t(sid.objectId, P60System::pool::PDU2_BOOTCAUSE, this); /** Number of reboots */ - lp_var_t bootcount = lp_var_t(sid.objectId, P60System::PDU2_BOOTCNT, this); + lp_var_t bootcount = + lp_var_t(sid.objectId, P60System::pool::PDU2_BOOTCNT, this); /** Uptime in seconds */ - lp_var_t uptime = lp_var_t(sid.objectId, P60System::PDU2_UPTIME, this); + lp_var_t uptime = lp_var_t(sid.objectId, P60System::pool::PDU2_UPTIME, this); lp_var_t resetcause = - lp_var_t(sid.objectId, P60System::PDU2_RESETCAUSE, this); + lp_var_t(sid.objectId, P60System::pool::PDU2_RESETCAUSE, this); /** Battery mode: 1 = Critical, 2 = Safe, 3 = Normal, 4 = Full */ - lp_var_t battMode = lp_var_t(sid.objectId, P60System::PDU2_BATT_MODE, this); + lp_var_t battMode = + lp_var_t(sid.objectId, P60System::pool::PDU2_BATT_MODE, this); /** Number of detected latchups on each output channel */ lp_var_t latchupsQ7S = - lp_var_t(sid.objectId, P60System::PDU2_LATCHUP_Q7S, this); + lp_var_t(sid.objectId, P60System::pool::PDU2_LATCHUP_Q7S, this); lp_var_t latchupsPayloadPcduCh1 = - lp_var_t(sid.objectId, P60System::PDU2_LATCHUP_PAYLOAD_PCDU_CH1, this); + lp_var_t(sid.objectId, P60System::pool::PDU2_LATCHUP_PAYLOAD_PCDU_CH1, this); lp_var_t latchupsRw = - lp_var_t(sid.objectId, P60System::PDU2_LATCHUP_RW, this); + lp_var_t(sid.objectId, P60System::pool::PDU2_LATCHUP_RW, this); lp_var_t latchupsTcsBoardHeaterIn = - lp_var_t(sid.objectId, P60System::PDU2_LATCHUP_TCS_BOARD_HEATER_IN, this); + lp_var_t(sid.objectId, P60System::pool::PDU2_LATCHUP_TCS_BOARD_HEATER_IN, this); lp_var_t latchupsSusRedundant = - lp_var_t(sid.objectId, P60System::PDU2_LATCHUP_SUS_REDUNDANT, this); + lp_var_t(sid.objectId, P60System::pool::PDU2_LATCHUP_SUS_REDUNDANT, this); lp_var_t latchupsDeplMenchanism = - lp_var_t(sid.objectId, P60System::PDU2_LATCHUP_DEPLOYMENT_MECHANISM, this); + lp_var_t(sid.objectId, P60System::pool::PDU2_LATCHUP_DEPLOYMENT_MECHANISM, this); lp_var_t latchupsPayloadPcduCh6 = - lp_var_t(sid.objectId, P60System::PDU2_LATCHUP_PAYLOAD_PCDU_CH6, this); + lp_var_t(sid.objectId, P60System::pool::PDU2_LATCHUP_PAYLOAD_PCDU_CH6, this); lp_var_t latchupsAcsBoardSideB = - lp_var_t(sid.objectId, P60System::PDU2_LATCHUP_ACS_BOARD_SIDE_B, this); + lp_var_t(sid.objectId, P60System::pool::PDU2_LATCHUP_ACS_BOARD_SIDE_B, this); lp_var_t latchupsPayloadCamera = - lp_var_t(sid.objectId, P60System::PDU2_LATCHUP_PAYLOAD_CAMERA, this); + lp_var_t(sid.objectId, P60System::pool::PDU2_LATCHUP_PAYLOAD_CAMERA, this); /** * There are 8 devices on the PDU. FRAM, ADCs, temperature sensor etc. Each device is * identified by an ID. Refer also to gs-man-nanopower-p60-pdu-200-1.pdf on pages 17 and 18. */ - lp_var_t device0 = lp_var_t(sid.objectId, P60System::PDU2_DEVICE_0, this); - lp_var_t device1 = lp_var_t(sid.objectId, P60System::PDU2_DEVICE_1, this); - lp_var_t device2 = lp_var_t(sid.objectId, P60System::PDU2_DEVICE_2, this); - lp_var_t device3 = lp_var_t(sid.objectId, P60System::PDU2_DEVICE_3, this); - lp_var_t device4 = lp_var_t(sid.objectId, P60System::PDU2_DEVICE_4, this); - lp_var_t device5 = lp_var_t(sid.objectId, P60System::PDU2_DEVICE_5, this); - lp_var_t device6 = lp_var_t(sid.objectId, P60System::PDU2_DEVICE_6, this); - lp_var_t device7 = lp_var_t(sid.objectId, P60System::PDU2_DEVICE_7, this); + lp_var_t device0 = lp_var_t(sid.objectId, P60System::pool::PDU2_DEVICE_0, this); + lp_var_t device1 = lp_var_t(sid.objectId, P60System::pool::PDU2_DEVICE_1, this); + lp_var_t device2 = lp_var_t(sid.objectId, P60System::pool::PDU2_DEVICE_2, this); + lp_var_t device3 = lp_var_t(sid.objectId, P60System::pool::PDU2_DEVICE_3, this); + lp_var_t device4 = lp_var_t(sid.objectId, P60System::pool::PDU2_DEVICE_4, this); + lp_var_t device5 = lp_var_t(sid.objectId, P60System::pool::PDU2_DEVICE_5, this); + lp_var_t device6 = lp_var_t(sid.objectId, P60System::pool::PDU2_DEVICE_6, this); + lp_var_t device7 = lp_var_t(sid.objectId, P60System::pool::PDU2_DEVICE_7, this); /** The status of each device. 0 = None, 1 = Ok, 2 = Error, 3 = Not found */ lp_var_t device0Status = - lp_var_t(sid.objectId, P60System::PDU2_DEVICE_0_STATUS, this); + lp_var_t(sid.objectId, P60System::pool::PDU2_DEVICE_0_STATUS, this); lp_var_t device1Status = - lp_var_t(sid.objectId, P60System::PDU2_DEVICE_1_STATUS, this); + lp_var_t(sid.objectId, P60System::pool::PDU2_DEVICE_1_STATUS, this); lp_var_t device2Status = - lp_var_t(sid.objectId, P60System::PDU2_DEVICE_2_STATUS, this); + lp_var_t(sid.objectId, P60System::pool::PDU2_DEVICE_2_STATUS, this); lp_var_t device3Status = - lp_var_t(sid.objectId, P60System::PDU2_DEVICE_3_STATUS, this); + lp_var_t(sid.objectId, P60System::pool::PDU2_DEVICE_3_STATUS, this); lp_var_t device4Status = - lp_var_t(sid.objectId, P60System::PDU2_DEVICE_4_STATUS, this); + lp_var_t(sid.objectId, P60System::pool::PDU2_DEVICE_4_STATUS, this); lp_var_t device5Status = - lp_var_t(sid.objectId, P60System::PDU2_DEVICE_5_STATUS, this); + lp_var_t(sid.objectId, P60System::pool::PDU2_DEVICE_5_STATUS, this); lp_var_t device6Status = - lp_var_t(sid.objectId, P60System::PDU2_DEVICE_6_STATUS, this); + lp_var_t(sid.objectId, P60System::pool::PDU2_DEVICE_6_STATUS, this); lp_var_t device7Status = - lp_var_t(sid.objectId, P60System::PDU2_DEVICE_7_STATUS, this); + lp_var_t(sid.objectId, P60System::pool::PDU2_DEVICE_7_STATUS, this); /** Number of reboots triggered by the ground watchdog */ lp_var_t gndWdtReboots = - lp_var_t(sid.objectId, P60System::PDU2_WDT_CNT_GND, this); + lp_var_t(sid.objectId, P60System::pool::PDU2_WDT_CNT_GND, this); /** Number of reboots triggered through the I2C watchdog. Not relevant for EIVE. */ lp_var_t i2cWdtReboots = - lp_var_t(sid.objectId, P60System::PDU2_WDT_CNT_I2C, this); + lp_var_t(sid.objectId, P60System::pool::PDU2_WDT_CNT_I2C, this); /** Number of reboots triggered through the CAN watchdog */ lp_var_t canWdtReboots = - lp_var_t(sid.objectId, P60System::PDU2_WDT_CNT_CAN, this); + lp_var_t(sid.objectId, P60System::pool::PDU2_WDT_CNT_CAN, this); /** Number of reboots triggered through the CSP watchdog */ lp_var_t csp1WdtReboots = - lp_var_t(sid.objectId, P60System::PDU2_WDT_CNT_CSP1, this); + lp_var_t(sid.objectId, P60System::pool::PDU2_WDT_CNT_CSP1, this); lp_var_t csp2WdtReboots = - lp_var_t(sid.objectId, P60System::PDU2_WDT_CNT_CSP2, this); + lp_var_t(sid.objectId, P60System::pool::PDU2_WDT_CNT_CSP2, this); /** Ground watchdog remaining seconds before rebooting */ lp_var_t groundWatchdogSecondsLeft = - lp_var_t(sid.objectId, P60System::PDU2_WDT_GND_LEFT, this); + lp_var_t(sid.objectId, P60System::pool::PDU2_WDT_GND_LEFT, this); /** I2C watchdog remaining seconds before rebooting. Not relevant for EIVE. */ lp_var_t i2cWatchdogSecondsLeft = - lp_var_t(sid.objectId, P60System::PDU2_WDT_I2C_LEFT, this); + lp_var_t(sid.objectId, P60System::pool::PDU2_WDT_I2C_LEFT, this); /** CAN watchdog remaining seconds before rebooting. */ lp_var_t canWatchdogSecondsLeft = - lp_var_t(sid.objectId, P60System::PDU2_WDT_CAN_LEFT, this); + lp_var_t(sid.objectId, P60System::pool::PDU2_WDT_CAN_LEFT, this); /** CSP watchdog remaining pings before rebooting. */ lp_var_t csp1WatchdogPingsLeft = - lp_var_t(sid.objectId, P60System::PDU2_WDT_CSP_LEFT1, this); + lp_var_t(sid.objectId, P60System::pool::PDU2_WDT_CSP_LEFT1, this); lp_var_t csp2WatchdogPingsLeft = - lp_var_t(sid.objectId, P60System::PDU2_WDT_CSP_LEFT2, this); + lp_var_t(sid.objectId, P60System::pool::PDU2_WDT_CSP_LEFT2, this); }; } // namespace PDU2 @@ -1049,124 +913,131 @@ class HkTableDataset : public StaticLocalDataSet { : StaticLocalDataSet(sid_t(objectId, HK_TABLE_DATA_SET_ID)) {} lp_var_t currentInChannel0 = - lp_var_t(sid.objectId, P60System::ACU_CURRENT_IN_CHANNEL0, this); + lp_var_t(sid.objectId, P60System::pool::ACU_CURRENT_IN_CHANNEL0, this); lp_var_t currentInChannel1 = - lp_var_t(sid.objectId, P60System::ACU_CURRENT_IN_CHANNEL1, this); + lp_var_t(sid.objectId, P60System::pool::ACU_CURRENT_IN_CHANNEL1, this); lp_var_t currentInChannel2 = - lp_var_t(sid.objectId, P60System::ACU_CURRENT_IN_CHANNEL2, this); + lp_var_t(sid.objectId, P60System::pool::ACU_CURRENT_IN_CHANNEL2, this); lp_var_t currentInChannel3 = - lp_var_t(sid.objectId, P60System::ACU_CURRENT_IN_CHANNEL3, this); + lp_var_t(sid.objectId, P60System::pool::ACU_CURRENT_IN_CHANNEL3, this); lp_var_t currentInChannel4 = - lp_var_t(sid.objectId, P60System::ACU_CURRENT_IN_CHANNEL4, this); + lp_var_t(sid.objectId, P60System::pool::ACU_CURRENT_IN_CHANNEL4, this); lp_var_t currentInChannel5 = - lp_var_t(sid.objectId, P60System::ACU_CURRENT_IN_CHANNEL5, this); + lp_var_t(sid.objectId, P60System::pool::ACU_CURRENT_IN_CHANNEL5, this); lp_var_t voltageInChannel0 = - lp_var_t(sid.objectId, P60System::ACU_VOLTAGE_IN_CHANNEL0, this); + lp_var_t(sid.objectId, P60System::pool::ACU_VOLTAGE_IN_CHANNEL0, this); lp_var_t voltageInChannel1 = - lp_var_t(sid.objectId, P60System::ACU_VOLTAGE_IN_CHANNEL1, this); + lp_var_t(sid.objectId, P60System::pool::ACU_VOLTAGE_IN_CHANNEL1, this); lp_var_t voltageInChannel2 = - lp_var_t(sid.objectId, P60System::ACU_VOLTAGE_IN_CHANNEL2, this); + lp_var_t(sid.objectId, P60System::pool::ACU_VOLTAGE_IN_CHANNEL2, this); lp_var_t voltageInChannel3 = - lp_var_t(sid.objectId, P60System::ACU_VOLTAGE_IN_CHANNEL3, this); + lp_var_t(sid.objectId, P60System::pool::ACU_VOLTAGE_IN_CHANNEL3, this); lp_var_t voltageInChannel4 = - lp_var_t(sid.objectId, P60System::ACU_VOLTAGE_IN_CHANNEL4, this); + lp_var_t(sid.objectId, P60System::pool::ACU_VOLTAGE_IN_CHANNEL4, this); lp_var_t voltageInChannel5 = - lp_var_t(sid.objectId, P60System::ACU_VOLTAGE_IN_CHANNEL5, this); + lp_var_t(sid.objectId, P60System::pool::ACU_VOLTAGE_IN_CHANNEL5, this); - lp_var_t vcc = lp_var_t(sid.objectId, P60System::ACU_VCC, this); - lp_var_t vbat = lp_var_t(sid.objectId, P60System::ACU_VBAT, this); + lp_var_t vcc = lp_var_t(sid.objectId, P60System::pool::ACU_VCC, this); + lp_var_t vbat = lp_var_t(sid.objectId, P60System::pool::ACU_VBAT, this); lp_var_t temperature1 = - lp_var_t(sid.objectId, P60System::ACU_TEMPERATURE_1, this); + lp_var_t(sid.objectId, P60System::pool::ACU_TEMPERATURE_1, this); lp_var_t temperature2 = - lp_var_t(sid.objectId, P60System::ACU_TEMPERATURE_2, this); + lp_var_t(sid.objectId, P60System::pool::ACU_TEMPERATURE_2, this); lp_var_t temperature3 = - lp_var_t(sid.objectId, P60System::ACU_TEMPERATURE_3, this); + lp_var_t(sid.objectId, P60System::pool::ACU_TEMPERATURE_3, this); - lp_var_t mpptMode = lp_var_t(sid.objectId, P60System::ACU_MPPT_MODE, this); + lp_var_t mpptMode = + lp_var_t(sid.objectId, P60System::pool::ACU_MPPT_MODE, this); lp_var_t vboostInChannel0 = - lp_var_t(sid.objectId, P60System::ACU_VBOOST_CHANNEL0, this); + lp_var_t(sid.objectId, P60System::pool::ACU_VBOOST_CHANNEL0, this); lp_var_t vboostInChannel1 = - lp_var_t(sid.objectId, P60System::ACU_VBOOST_CHANNEL1, this); + lp_var_t(sid.objectId, P60System::pool::ACU_VBOOST_CHANNEL1, this); lp_var_t vboostInChannel2 = - lp_var_t(sid.objectId, P60System::ACU_VBOOST_CHANNEL2, this); + lp_var_t(sid.objectId, P60System::pool::ACU_VBOOST_CHANNEL2, this); lp_var_t vboostInChannel3 = - lp_var_t(sid.objectId, P60System::ACU_VBOOST_CHANNEL3, this); + lp_var_t(sid.objectId, P60System::pool::ACU_VBOOST_CHANNEL3, this); lp_var_t vboostInChannel4 = - lp_var_t(sid.objectId, P60System::ACU_VBOOST_CHANNEL4, this); + lp_var_t(sid.objectId, P60System::pool::ACU_VBOOST_CHANNEL4, this); lp_var_t vboostInChannel5 = - lp_var_t(sid.objectId, P60System::ACU_VBOOST_CHANNEL5, this); + lp_var_t(sid.objectId, P60System::pool::ACU_VBOOST_CHANNEL5, this); lp_var_t powerInChannel0 = - lp_var_t(sid.objectId, P60System::ACU_POWER_CHANNEL0, this); + lp_var_t(sid.objectId, P60System::pool::ACU_POWER_CHANNEL0, this); lp_var_t powerInChannel1 = - lp_var_t(sid.objectId, P60System::ACU_POWER_CHANNEL1, this); + lp_var_t(sid.objectId, P60System::pool::ACU_POWER_CHANNEL1, this); lp_var_t powerInChannel2 = - lp_var_t(sid.objectId, P60System::ACU_POWER_CHANNEL2, this); + lp_var_t(sid.objectId, P60System::pool::ACU_POWER_CHANNEL2, this); lp_var_t powerInChannel3 = - lp_var_t(sid.objectId, P60System::ACU_POWER_CHANNEL3, this); + lp_var_t(sid.objectId, P60System::pool::ACU_POWER_CHANNEL3, this); lp_var_t powerInChannel4 = - lp_var_t(sid.objectId, P60System::ACU_POWER_CHANNEL4, this); + lp_var_t(sid.objectId, P60System::pool::ACU_POWER_CHANNEL4, this); lp_var_t powerInChannel5 = - lp_var_t(sid.objectId, P60System::ACU_POWER_CHANNEL5, this); + lp_var_t(sid.objectId, P60System::pool::ACU_POWER_CHANNEL5, this); - lp_var_t dac0Enable = lp_var_t(sid.objectId, P60System::ACU_DAC_EN_0, this); - lp_var_t dac1Enable = lp_var_t(sid.objectId, P60System::ACU_DAC_EN_1, this); - lp_var_t dac2Enable = lp_var_t(sid.objectId, P60System::ACU_DAC_EN_2, this); + lp_var_t dac0Enable = + lp_var_t(sid.objectId, P60System::pool::ACU_DAC_EN_0, this); + lp_var_t dac1Enable = + lp_var_t(sid.objectId, P60System::pool::ACU_DAC_EN_1, this); + lp_var_t dac2Enable = + lp_var_t(sid.objectId, P60System::pool::ACU_DAC_EN_2, this); lp_var_t dacRawChannelVal0 = - lp_var_t(sid.objectId, P60System::ACU_DAC_RAW_0, this); + lp_var_t(sid.objectId, P60System::pool::ACU_DAC_RAW_0, this); lp_var_t dacRawChannelVal1 = - lp_var_t(sid.objectId, P60System::ACU_DAC_RAW_1, this); + lp_var_t(sid.objectId, P60System::pool::ACU_DAC_RAW_1, this); lp_var_t dacRawChannelVal2 = - lp_var_t(sid.objectId, P60System::ACU_DAC_RAW_2, this); + lp_var_t(sid.objectId, P60System::pool::ACU_DAC_RAW_2, this); lp_var_t dacRawChannelVal3 = - lp_var_t(sid.objectId, P60System::ACU_DAC_RAW_3, this); + lp_var_t(sid.objectId, P60System::pool::ACU_DAC_RAW_3, this); lp_var_t dacRawChannelVal4 = - lp_var_t(sid.objectId, P60System::ACU_DAC_RAW_4, this); + lp_var_t(sid.objectId, P60System::pool::ACU_DAC_RAW_4, this); lp_var_t dacRawChannelVal5 = - lp_var_t(sid.objectId, P60System::ACU_DAC_RAW_5, this); + lp_var_t(sid.objectId, P60System::pool::ACU_DAC_RAW_5, this); - lp_var_t bootCause = lp_var_t(sid.objectId, P60System::ACU_BOOTCAUSE, this); - lp_var_t bootcnt = lp_var_t(sid.objectId, P60System::ACU_BOOTCNT, this); - lp_var_t uptime = lp_var_t(sid.objectId, P60System::ACU_UPTIME, this); + lp_var_t bootCause = + lp_var_t(sid.objectId, P60System::pool::ACU_BOOTCAUSE, this); + lp_var_t bootcnt = lp_var_t(sid.objectId, P60System::pool::ACU_BOOTCNT, this); + lp_var_t uptime = lp_var_t(sid.objectId, P60System::pool::ACU_UPTIME, this); lp_var_t resetCause = - lp_var_t(sid.objectId, P60System::ACU_RESET_CAUSE, this); - lp_var_t mpptTime = lp_var_t(sid.objectId, P60System::ACU_MPPT_TIME, this); + lp_var_t(sid.objectId, P60System::pool::ACU_RESET_CAUSE, this); + lp_var_t mpptTime = + lp_var_t(sid.objectId, P60System::pool::ACU_MPPT_TIME, this); lp_var_t mpptPeriod = - lp_var_t(sid.objectId, P60System::ACU_MPPT_PERIOD, this); + lp_var_t(sid.objectId, P60System::pool::ACU_MPPT_PERIOD, this); - lp_var_t device0 = lp_var_t(sid.objectId, P60System::ACU_DEVICE_0, this); - lp_var_t device1 = lp_var_t(sid.objectId, P60System::ACU_DEVICE_1, this); - lp_var_t device2 = lp_var_t(sid.objectId, P60System::ACU_DEVICE_2, this); - lp_var_t device3 = lp_var_t(sid.objectId, P60System::ACU_DEVICE_3, this); - lp_var_t device4 = lp_var_t(sid.objectId, P60System::ACU_DEVICE_4, this); - lp_var_t device5 = lp_var_t(sid.objectId, P60System::ACU_DEVICE_5, this); - lp_var_t device6 = lp_var_t(sid.objectId, P60System::ACU_DEVICE_6, this); - lp_var_t device7 = lp_var_t(sid.objectId, P60System::ACU_DEVICE_7, this); + lp_var_t device0 = lp_var_t(sid.objectId, P60System::pool::ACU_DEVICE_0, this); + lp_var_t device1 = lp_var_t(sid.objectId, P60System::pool::ACU_DEVICE_1, this); + lp_var_t device2 = lp_var_t(sid.objectId, P60System::pool::ACU_DEVICE_2, this); + lp_var_t device3 = lp_var_t(sid.objectId, P60System::pool::ACU_DEVICE_3, this); + lp_var_t device4 = lp_var_t(sid.objectId, P60System::pool::ACU_DEVICE_4, this); + lp_var_t device5 = lp_var_t(sid.objectId, P60System::pool::ACU_DEVICE_5, this); + lp_var_t device6 = lp_var_t(sid.objectId, P60System::pool::ACU_DEVICE_6, this); + lp_var_t device7 = lp_var_t(sid.objectId, P60System::pool::ACU_DEVICE_7, this); lp_var_t device0Status = - lp_var_t(sid.objectId, P60System::ACU_DEVICE_0_STATUS, this); + lp_var_t(sid.objectId, P60System::pool::ACU_DEVICE_0_STATUS, this); lp_var_t device1Status = - lp_var_t(sid.objectId, P60System::ACU_DEVICE_1_STATUS, this); + lp_var_t(sid.objectId, P60System::pool::ACU_DEVICE_1_STATUS, this); lp_var_t device2Status = - lp_var_t(sid.objectId, P60System::ACU_DEVICE_2_STATUS, this); + lp_var_t(sid.objectId, P60System::pool::ACU_DEVICE_2_STATUS, this); lp_var_t device3Status = - lp_var_t(sid.objectId, P60System::ACU_DEVICE_3_STATUS, this); + lp_var_t(sid.objectId, P60System::pool::ACU_DEVICE_3_STATUS, this); lp_var_t device4Status = - lp_var_t(sid.objectId, P60System::ACU_DEVICE_4_STATUS, this); + lp_var_t(sid.objectId, P60System::pool::ACU_DEVICE_4_STATUS, this); lp_var_t device5Status = - lp_var_t(sid.objectId, P60System::ACU_DEVICE_5_STATUS, this); + lp_var_t(sid.objectId, P60System::pool::ACU_DEVICE_5_STATUS, this); lp_var_t device6Status = - lp_var_t(sid.objectId, P60System::ACU_DEVICE_6_STATUS, this); + lp_var_t(sid.objectId, P60System::pool::ACU_DEVICE_6_STATUS, this); lp_var_t device7Status = - lp_var_t(sid.objectId, P60System::ACU_DEVICE_7_STATUS, this); + lp_var_t(sid.objectId, P60System::pool::ACU_DEVICE_7_STATUS, this); - lp_var_t wdtCntGnd = lp_var_t(sid.objectId, P60System::ACU_WDT_CNT_GND, this); + lp_var_t wdtCntGnd = + lp_var_t(sid.objectId, P60System::pool::ACU_WDT_CNT_GND, this); lp_var_t wdtGndLeft = - lp_var_t(sid.objectId, P60System::ACU_WDT_GND_LEFT, this); + lp_var_t(sid.objectId, P60System::pool::ACU_WDT_GND_LEFT, this); }; } // namespace ACU diff --git a/mission/system/AcsBoardAssembly.cpp b/mission/system/AcsBoardAssembly.cpp index e319f32b..0d65d20e 100644 --- a/mission/system/AcsBoardAssembly.cpp +++ b/mission/system/AcsBoardAssembly.cpp @@ -143,13 +143,13 @@ ReturnValue_t AcsBoardAssembly::handleNormalOrOnModeCmd(Mode_t mode, Submode_t s cmdSeq(helper.mgm1Rm3100IdSideA, helper.mgm1SideAMode, ModeTableIdx::MGM_1_A); if (gpsUsable) { gpioHandler(gpioIds::GNSS_0_NRESET, true, - "AcsBoardAssembly::handleNormalOrOnModeCmd: Could not pull nReset pin" - "of GNSS 0 high (used GNSS)"); + "AcsBoardAssembly::handleNormalOrOnModeCmd: Could not pull nReset pin" + "of GNSS 0 high (used GNSS)"); gpioHandler(gpioIds::GNSS_1_NRESET, false, - "AcsBoardAssembly::handleNormalOrOnModeCmd: Could not pull nReset pin" - "of GNSS 1 low (unused GNSS)"); + "AcsBoardAssembly::handleNormalOrOnModeCmd: Could not pull nReset pin" + "of GNSS 1 low (unused GNSS)"); gpioHandler(gpioIds::GNSS_SELECT, false, - "AcsBoardAssembly::handleNormalOrOnModeCmd: Could not pull GNSS select low"); + "AcsBoardAssembly::handleNormalOrOnModeCmd: Could not pull GNSS select low"); } break; } @@ -168,13 +168,13 @@ ReturnValue_t AcsBoardAssembly::handleNormalOrOnModeCmd(Mode_t mode, Submode_t s cmdSeq(helper.mgm3Rm3100IdSideB, helper.mgm3SideBMode, ModeTableIdx::MGM_3_B); if (gpsUsable) { gpioHandler(gpioIds::GNSS_0_NRESET, false, - "AcsBoardAssembly::handleNormalOrOnModeCmd: Could not pull nReset pin" - "of GNSS 0 low (unused GNSS)"); + "AcsBoardAssembly::handleNormalOrOnModeCmd: Could not pull nReset pin" + "of GNSS 0 low (unused GNSS)"); gpioHandler(gpioIds::GNSS_1_NRESET, true, - "AcsBoardAssembly::handleNormalOrOnModeCmd: Could not pull nReset pin" - "of GNSS 1 high (used GNSS)"); + "AcsBoardAssembly::handleNormalOrOnModeCmd: Could not pull nReset pin" + "of GNSS 1 high (used GNSS)"); gpioHandler(gpioIds::GNSS_SELECT, true, - "AcsBoardAssembly::handleNormalOrOnModeCmd: Could not pull GNSS select high"); + "AcsBoardAssembly::handleNormalOrOnModeCmd: Could not pull GNSS select high"); } break; } @@ -191,11 +191,11 @@ ReturnValue_t AcsBoardAssembly::handleNormalOrOnModeCmd(Mode_t mode, Submode_t s ReturnValue_t status = RETURN_OK; if (gpsUsable) { gpioHandler(gpioIds::GNSS_0_NRESET, true, - "AcsBoardAssembly::handleNormalOrOnModeCmd: Could not pull nReset pin" - "of GNSS 0 high (used GNSS)"); + "AcsBoardAssembly::handleNormalOrOnModeCmd: Could not pull nReset pin" + "of GNSS 0 high (used GNSS)"); gpioHandler(gpioIds::GNSS_1_NRESET, true, - "AcsBoardAssembly::handleNormalOrOnModeCmd: Could not pull nReset pin" - "of GNSS 1 high (used GNSS)"); + "AcsBoardAssembly::handleNormalOrOnModeCmd: Could not pull nReset pin" + "of GNSS 1 high (used GNSS)"); if (defaultSubmode == Submodes::A_SIDE) { status = gpioIF->pullLow(gpioIds::GNSS_SELECT); } else { @@ -245,7 +245,7 @@ void AcsBoardAssembly::selectGpsInDualMode(duallane::Submodes side) { void AcsBoardAssembly::gpioHandler(gpioId_t gpio, bool high, std::string error) { ReturnValue_t result = RETURN_OK; - if(high) { + if (high) { result = gpioIF->pullHigh(gpio); } else { result = gpioIF->pullLow(gpio); diff --git a/tmtc b/tmtc index a1478466..0fc8369b 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit a14784666f6d8ce0e3d993ae60edd235363a95e1 +Subproject commit 0fc8369bbcb7162305c8154568e0158b778c65b3 From 6020b20fc99990d8b8a85bad06110162d7a7c182 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 4 Apr 2022 18:47:09 +0200 Subject: [PATCH 08/19] hk handling --- linux/devices/GPSHyperionLinuxController.cpp | 4 +++- mission/devices/P60DockHandler.cpp | 3 ++- mission/devices/PDU1Handler.cpp | 2 -- tmtc | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/linux/devices/GPSHyperionLinuxController.cpp b/linux/devices/GPSHyperionLinuxController.cpp index a811fbc5..ca35264e 100644 --- a/linux/devices/GPSHyperionLinuxController.cpp +++ b/linux/devices/GPSHyperionLinuxController.cpp @@ -76,9 +76,11 @@ ReturnValue_t GPSHyperionLinuxController::initializeLocalDataPool( localDataPoolMap.emplace(GpsHyperion::SATS_IN_USE, new PoolEntry()); localDataPoolMap.emplace(GpsHyperion::SATS_IN_VIEW, new PoolEntry()); localDataPoolMap.emplace(GpsHyperion::FIX_MODE, new PoolEntry()); + bool enablePeriodicHk = false; #if OBSW_ENABLE_PERIODIC_HK == 1 - poolManager.subscribeForPeriodicPacket(gpsSet.getSid(), true, 2.0, false); + enablePeriodicHk = true; #endif + poolManager.subscribeForPeriodicPacket(gpsSet.getSid(), enablePeriodicHk, 2.0, false); return HasReturnvaluesIF::RETURN_OK; } diff --git a/mission/devices/P60DockHandler.cpp b/mission/devices/P60DockHandler.cpp index 5ad4ffee..9db22146 100644 --- a/mission/devices/P60DockHandler.cpp +++ b/mission/devices/P60DockHandler.cpp @@ -101,6 +101,7 @@ void P60DockHandler::parseHkTableReply(const uint8_t *packet) { dataOffset += 4; p60dockHkTableDataset.bootcause = *(packet + dataOffset) << 24 | + *(packet + dataOffset + 1) << 16 | *(packet + dataOffset + 2) << 8 | *(packet + dataOffset + 3); dataOffset += 6; @@ -258,7 +259,7 @@ ReturnValue_t P60DockHandler::initializeLocalDataPool(localpool::DataPool &local localDataPoolMap.emplace(pool::P60DOCK_ANT6_DEPL, new PoolEntry({0})); localDataPoolMap.emplace(pool::P60DOCK_AR6_DEPL, new PoolEntry({0})); - + poolManager.subscribeForPeriodicPacket(p60dockHkTableDataset.getSid(), false, 0.4, false); return HasReturnvaluesIF::RETURN_OK; } diff --git a/mission/devices/PDU1Handler.cpp b/mission/devices/PDU1Handler.cpp index 264fd098..e0c369a3 100644 --- a/mission/devices/PDU1Handler.cpp +++ b/mission/devices/PDU1Handler.cpp @@ -426,9 +426,7 @@ ReturnValue_t PDU1Handler::initializeLocalDataPool(localpool::DataPool &localDat localDataPoolMap.emplace(P60System::pool::PDU1_WDT_CAN_LEFT, new PoolEntry({0})); localDataPoolMap.emplace(P60System::pool::PDU1_WDT_CSP_LEFT1, new PoolEntry({0})); localDataPoolMap.emplace(P60System::pool::PDU1_WDT_CSP_LEFT2, new PoolEntry({0})); -#if OBSW_ENABLE_PERIODIC_HK == 1 poolManager.subscribeForPeriodicPacket(pdu1HkTableDataset.getSid(), false, 0.4, true); -#endif return HasReturnvaluesIF::RETURN_OK; } diff --git a/tmtc b/tmtc index 0fc8369b..923929ca 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 0fc8369bbcb7162305c8154568e0158b778c65b3 +Subproject commit 923929ca5511e70b460f6edeaab607b259f0bff5 From 40403b81c3396ae5ca6be3f39bf7b35be53de901 Mon Sep 17 00:00:00 2001 From: Jakob Meier Date: Tue, 5 Apr 2022 08:38:36 +0200 Subject: [PATCH 09/19] debug flag --- mission/devices/SyrlinksHkHandler.cpp | 28 ++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/mission/devices/SyrlinksHkHandler.cpp b/mission/devices/SyrlinksHkHandler.cpp index c64ac747..24d17a86 100644 --- a/mission/devices/SyrlinksHkHandler.cpp +++ b/mission/devices/SyrlinksHkHandler.cpp @@ -11,7 +11,7 @@ SyrlinksHkHandler::SyrlinksHkHandler(object_id_t objectId, object_id_t comIF, Co txDataset(this), temperatureSet(this), powerSwitch(powerSwitch) { - if (comCookie == NULL) { + if (comCookie == nullptr) { sif::warning << "SyrlinksHkHandler: Invalid com cookie" << std::endl; } } @@ -78,14 +78,14 @@ ReturnValue_t SyrlinksHkHandler::buildNormalDeviceCommand(DeviceCommandId_t* id) << "command id" << std::endl; break; } - return buildCommandFromCommand(*id, NULL, 0); + return buildCommandFromCommand(*id, nullptr, 0); } ReturnValue_t SyrlinksHkHandler::buildTransitionDeviceCommand(DeviceCommandId_t* id) { switch (startupState) { case StartupState::ENABLE_TEMPERATURE_PROTECTION: { *id = syrlinks::WRITE_LCL_CONFIG; - return HasReturnvaluesIF::RETURN_OK; + return buildCommandFromCommand(*id, nullptr, 0); } default: break; @@ -167,10 +167,12 @@ ReturnValue_t SyrlinksHkHandler::buildCommandFromCommand(DeviceCommandId_t devic } case (syrlinks::ENABLE_DEBUG): { debug = true; + rawPacketLen = 0; return RETURN_OK; } case (syrlinks::DISABLE_DEBUG): { debug = false; + rawPacketLen = 0; return RETURN_OK; } default: @@ -469,7 +471,7 @@ ReturnValue_t SyrlinksHkHandler::parseReplyStatus(const char* status) { case '0': return RETURN_OK; case '1': - sif::debug << "SyrlinksHkHandler::parseReplyStatus: Uart faming or parity error" << std::endl; + sif::debug << "SyrlinksHkHandler::parseReplyStatus: Uart framing or parity error" << std::endl; return UART_FRAMIN_OR_PARITY_ERROR_ACK; case '2': sif::debug << "SyrlinksHkHandler::parseReplyStatus: Bad character detected" << std::endl; @@ -555,8 +557,10 @@ void SyrlinksHkHandler::parseRxStatusRegistersReply(const uint8_t* packet) { void SyrlinksHkHandler::parseLclConfigReply(const uint8_t* packet) { uint16_t offset = syrlinks::MESSAGE_HEADER_SIZE; uint8_t lclConfig = convertHexStringToUint8(reinterpret_cast(packet + offset)); - sif::info << "SyrlinksHkHandler::parseRxStatusRegistersReply: Lcl config: " - << static_cast(lclConfig) << std::endl; + if (debug) { + sif::info << "SyrlinksHkHandler::parseRxStatusRegistersReply: Lcl config: " + << static_cast(lclConfig) << std::endl; + } } void SyrlinksHkHandler::parseTxStatusReply(const uint8_t* packet) { @@ -564,8 +568,10 @@ void SyrlinksHkHandler::parseTxStatusReply(const uint8_t* packet) { uint16_t offset = syrlinks::MESSAGE_HEADER_SIZE; txDataset.txStatus = convertHexStringToUint8(reinterpret_cast(packet + offset)); #if OBSW_DEBUG_SYRLINKS == 1 + if (debug) { sif::info << "Syrlinks TX Status: 0x" << std::hex << (unsigned int)txDataset.txStatus.value << std::endl; + } #endif } @@ -574,8 +580,10 @@ void SyrlinksHkHandler::parseTxWaveformReply(const uint8_t* packet) { uint16_t offset = syrlinks::MESSAGE_HEADER_SIZE; txDataset.txWaveform = convertHexStringToUint8(reinterpret_cast(packet + offset)); #if OBSW_DEBUG_SYRLINKS == 1 + if (debug) { sif::info << "Syrlinks TX Waveform: 0x" << std::hex << (unsigned int)txDataset.txWaveform.value << std::endl; + } #endif } @@ -585,7 +593,9 @@ void SyrlinksHkHandler::parseAgcLowByte(const uint8_t* packet) { txDataset.txAgcValue = agcValueHighByte << 8 | convertHexStringToUint8(reinterpret_cast(packet + offset)); #if OBSW_DEBUG_SYRLINKS == 1 - sif::info << "Syrlinks TX AGC Value: " << txDataset.txAgcValue << std::endl; + if (debug) { + sif::info << "Syrlinks TX AGC Value: " << txDataset.txAgcValue << std::endl; + } #endif } @@ -597,7 +607,7 @@ void SyrlinksHkHandler::parseAgcHighByte(const uint8_t* packet) { void SyrlinksHkHandler::setNormalDatapoolEntriesInvalid() {} -uint32_t SyrlinksHkHandler::getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) { return 5000; } +uint32_t SyrlinksHkHandler::getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) { return 500; } ReturnValue_t SyrlinksHkHandler::initializeLocalDataPool(localpool::DataPool& localDataPoolMap, LocalDataPoolManager& poolManager) { @@ -635,7 +645,7 @@ ReturnValue_t SyrlinksHkHandler::handleAckReply(const uint8_t* packet) { } void SyrlinksHkHandler::prepareCommand(std::string command, DeviceCommandId_t commandId) { - command.copy(reinterpret_cast(commandBuffer), readTxWaveform.size(), 0); + command.copy(reinterpret_cast(commandBuffer), command.size(), 0); rawPacketLen = command.size(); rememberCommandId = commandId; rawPacket = commandBuffer; From f91efd8c1ea1da0292903da49b70456c6d487f9c Mon Sep 17 00:00:00 2001 From: Jakob Meier Date: Tue, 5 Apr 2022 11:50:45 +0200 Subject: [PATCH 10/19] prepared pr --- bsp_hosted/acsDummies/GpsDummy.cpp | 7 ---- bsp_hosted/acsDummies/GpsDummy.h | 13 -------- mission/controller/AcsController.cpp | 48 ---------------------------- mission/controller/AcsController.h | 18 ----------- tmtc | 2 +- 5 files changed, 1 insertion(+), 87 deletions(-) delete mode 100644 bsp_hosted/acsDummies/GpsDummy.cpp delete mode 100644 bsp_hosted/acsDummies/GpsDummy.h delete mode 100644 mission/controller/AcsController.cpp delete mode 100644 mission/controller/AcsController.h diff --git a/bsp_hosted/acsDummies/GpsDummy.cpp b/bsp_hosted/acsDummies/GpsDummy.cpp deleted file mode 100644 index b4331798..00000000 --- a/bsp_hosted/acsDummies/GpsDummy.cpp +++ /dev/null @@ -1,7 +0,0 @@ -#include "GpsDummy.h" - -GpsDummy::GpsDummy() { -} - -GpsDummy::~GpsDummy() { -} diff --git a/bsp_hosted/acsDummies/GpsDummy.h b/bsp_hosted/acsDummies/GpsDummy.h deleted file mode 100644 index f25bf1f2..00000000 --- a/bsp_hosted/acsDummies/GpsDummy.h +++ /dev/null @@ -1,13 +0,0 @@ -#ifndef BSP_HOSTED_ACSDUMMIES_GPSDUMMY_H_ -#define BSP_HOSTED_ACSDUMMIES_GPSDUMMY_H_ - -/** - * @brief Dummy class to simulate sending of GPS data to ACS controller. - */ -class GpsDummy : public ExtendedControllerBase { - public: - GpsDummy(); - virtual ~GpsDummy(); -}; - -#endif /* BSP_HOSTED_ACSDUMMIES_GPSDUMMY_H_ */ diff --git a/mission/controller/AcsController.cpp b/mission/controller/AcsController.cpp deleted file mode 100644 index 28f7032b..00000000 --- a/mission/controller/AcsController.cpp +++ /dev/null @@ -1,48 +0,0 @@ -#include "AcsController.h" - -AcsController::AcsController() { -} - -AcsController::~AcsController() { -} - -ReturnValue_t AcsController::initialize() { - - ControllerBase::initialize(); -} - -ReturnValue_t AcsController::handleCommandMessage(CommandMessage * message) { - ReturnValue_t result = actionHelper.handleActionMessage(message); - if (result == HasReturnvaluesIF::RETURN_OK) { - return HasReturnvaluesIF::RETURN_OK; - } - return result; -} - -void AcsController::performControlOperation() { - if (mode != MODE_OFF) { - monitoring.monitor(&acsParameters); - switch (submode) { - case SUBMODE_SAFE: - performSafe(SAFE_CONTROLLER); - break; - case SUBMODE_IDLE: - performPointing(IDLE_CONTROLLER); - break; - case SUBMODE_NADIR: - performPointing(NADIR_CONTROLLER); - break; - case SUBMODE_TARGET: - performPointing(TARGET_CONTROLLER); - break; - case SUBMODE_INERTIAL: - performPointing(INERTIAL_CONTROLLER); - break; - case SUBMODE_ROTATION: - performPointing(ROTATION_CONTROLLER); - break; - default: - break; - } - } -} diff --git a/mission/controller/AcsController.h b/mission/controller/AcsController.h deleted file mode 100644 index 20f19c15..00000000 --- a/mission/controller/AcsController.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef MISSION_CONTROLLER_ACSCONTROLLER_H_ -#define MISSION_CONTROLLER_ACSCONTROLLER_H_ - -#include "fsfw/controller/ControllerBase.h" - -class AcsController : public ControllerBase { - public: - AcsController(); - virtual ~AcsController(); - - ReturnValue_t initialize() override; - - protected: - ReturnValue_t handleCommandMessage(CommandMessage *message); - void performControlOperation(); -}; - -#endif /* MISSION_CONTROLLER_ACSCONTROLLER_H_ */ diff --git a/tmtc b/tmtc index 592f3754..f8d6fc4c 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 592f37544f252466f702502ffb0140840ab75d8c +Subproject commit f8d6fc4c2b2276c58247d626df3a461131027d2b From 1f4328d9a0bc0aaf67a90304d66f9059378d6bde Mon Sep 17 00:00:00 2001 From: Jakob Meier Date: Tue, 5 Apr 2022 11:52:01 +0200 Subject: [PATCH 11/19] prepared pr --- mission/devices/SyrlinksFaultFlagMonitoring.cpp | 7 ------- mission/devices/SyrlinksFaultFlagMonitoring.h | 10 ---------- 2 files changed, 17 deletions(-) delete mode 100644 mission/devices/SyrlinksFaultFlagMonitoring.cpp delete mode 100644 mission/devices/SyrlinksFaultFlagMonitoring.h diff --git a/mission/devices/SyrlinksFaultFlagMonitoring.cpp b/mission/devices/SyrlinksFaultFlagMonitoring.cpp deleted file mode 100644 index 79b752d7..00000000 --- a/mission/devices/SyrlinksFaultFlagMonitoring.cpp +++ /dev/null @@ -1,7 +0,0 @@ -#include "SyrlinksFaultFlagMonitoring.h" - -SyrlinksFaultFlagMonitoring::SyrlinksFaultFlagMonitoring() { -} - -SyrlinksFaultFlagMonitoring::~SyrlinksFaultFlagMonitoring() { -} diff --git a/mission/devices/SyrlinksFaultFlagMonitoring.h b/mission/devices/SyrlinksFaultFlagMonitoring.h deleted file mode 100644 index 7959ca55..00000000 --- a/mission/devices/SyrlinksFaultFlagMonitoring.h +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef MISSION_DEVICES_SYRLINKSFAULTFLAGMONITORING_H_ -#define MISSION_DEVICES_SYRLINKSFAULTFLAGMONITORING_H_ - -class SyrlinksFaultFlagMonitoring : public ExecutableObjectIF { - public: - SyrlinksFaultFlagMonitoring(); - virtual ~SyrlinksFaultFlagMonitoring(); -}; - -#endif /* MISSION_DEVICES_SYRLINKSFAULTFLAGMONITORING_H_ */ From 29b7c97892f5f3ab3df50cf4c14de235ecb93503 Mon Sep 17 00:00:00 2001 From: Jakob Meier Date: Tue, 5 Apr 2022 12:00:12 +0200 Subject: [PATCH 12/19] tmtc update --- tmtc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tmtc b/tmtc index f8d6fc4c..28ca0aa3 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit f8d6fc4c2b2276c58247d626df3a461131027d2b +Subproject commit 28ca0aa36313798c16ffe1e4424c2b1a6409a4a6 From 146868da214262db3aa131e94ecb610e8b762c7b Mon Sep 17 00:00:00 2001 From: Jakob Meier Date: Tue, 5 Apr 2022 14:43:20 +0200 Subject: [PATCH 13/19] fsfw update --- fsfw | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fsfw b/fsfw index fbf9626f..7df51f72 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit fbf9626fde2961cf08bd88bf87f5c1bca900e287 +Subproject commit 7df51f72029d7b0f1571a74cd2a71ca74bbaa086 From 3cfd0deb22207f52915159629e9b4b078c46652e Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 5 Apr 2022 19:29:09 +0200 Subject: [PATCH 14/19] set p60 dock HK vars to valid --- fsfw | 2 +- mission/devices/P60DockHandler.cpp | 1 + tmtc | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/fsfw b/fsfw index e4c6a69f..aded4fae 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit e4c6a69f776cd8056985ce56ba6528bd842a1ea8 +Subproject commit aded4fae1e4f8a8a325c49b8c0d4bb4d7408d676 diff --git a/mission/devices/P60DockHandler.cpp b/mission/devices/P60DockHandler.cpp index 9db22146..0afa3458 100644 --- a/mission/devices/P60DockHandler.cpp +++ b/mission/devices/P60DockHandler.cpp @@ -205,6 +205,7 @@ void P60DockHandler::parseHkTableReply(const uint8_t *packet) { p60dockHkTableDataset.ant6Depl = *(packet + dataOffset); dataOffset += 3; p60dockHkTableDataset.ar6Depl = *(packet + dataOffset); + p60dockHkTableDataset.setValidity(true, true); } ReturnValue_t P60DockHandler::initializeLocalDataPool(localpool::DataPool &localDataPoolMap, diff --git a/tmtc b/tmtc index 923929ca..a038e4c1 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 923929ca5511e70b460f6edeaab607b259f0bff5 +Subproject commit a038e4c175a96c1d0e9e6de8371244f60f3bd204 From 36db47466f9b77cb5c30c934fc24f45414e17878 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 5 Apr 2022 19:43:28 +0200 Subject: [PATCH 15/19] tmtc update --- tmtc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tmtc b/tmtc index a038e4c1..5b2dfa55 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit a038e4c175a96c1d0e9e6de8371244f60f3bd204 +Subproject commit 5b2dfa55eb7b6caffeffc55ab8e8cd450db488fd From 65d504bed1d480deca213ca4a2211eae432e6792 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 5 Apr 2022 19:49:57 +0200 Subject: [PATCH 16/19] p60 dock HK is diagnostic again --- mission/devices/P60DockHandler.cpp | 2 +- tmtc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mission/devices/P60DockHandler.cpp b/mission/devices/P60DockHandler.cpp index 0afa3458..3093e844 100644 --- a/mission/devices/P60DockHandler.cpp +++ b/mission/devices/P60DockHandler.cpp @@ -260,7 +260,7 @@ ReturnValue_t P60DockHandler::initializeLocalDataPool(localpool::DataPool &local localDataPoolMap.emplace(pool::P60DOCK_ANT6_DEPL, new PoolEntry({0})); localDataPoolMap.emplace(pool::P60DOCK_AR6_DEPL, new PoolEntry({0})); - poolManager.subscribeForPeriodicPacket(p60dockHkTableDataset.getSid(), false, 0.4, false); + poolManager.subscribeForPeriodicPacket(p60dockHkTableDataset.getSid(), false, 0.4, true); return HasReturnvaluesIF::RETURN_OK; } diff --git a/tmtc b/tmtc index 5b2dfa55..3f5d77a5 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 5b2dfa55eb7b6caffeffc55ab8e8cd450db488fd +Subproject commit 3f5d77a5e56b6a9fe8951439ddc417bf54d6f0d6 From f325d139da3b0504392d81c50ee2d6f3cc751a19 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 6 Apr 2022 12:10:22 +0200 Subject: [PATCH 17/19] p60 dock HK does not need to be diagnostic --- mission/devices/P60DockHandler.cpp | 2 +- tmtc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mission/devices/P60DockHandler.cpp b/mission/devices/P60DockHandler.cpp index 3093e844..455784fb 100644 --- a/mission/devices/P60DockHandler.cpp +++ b/mission/devices/P60DockHandler.cpp @@ -260,7 +260,7 @@ ReturnValue_t P60DockHandler::initializeLocalDataPool(localpool::DataPool &local localDataPoolMap.emplace(pool::P60DOCK_ANT6_DEPL, new PoolEntry({0})); localDataPoolMap.emplace(pool::P60DOCK_AR6_DEPL, new PoolEntry({0})); - poolManager.subscribeForPeriodicPacket(p60dockHkTableDataset.getSid(), false, 0.4, true); + poolManager.subscribeForPeriodicPacket(p60dockHkTableDataset.getSid(), false, 10.0, false); return HasReturnvaluesIF::RETURN_OK; } diff --git a/tmtc b/tmtc index 3f5d77a5..1c105752 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 3f5d77a5e56b6a9fe8951439ddc417bf54d6f0d6 +Subproject commit 1c105752642084acf21f78b1b2302f0f4d26aec9 From bc47402a6d0a2d72dfd09a9c48334c1bf50ed7d6 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 7 Apr 2022 09:57:52 +0200 Subject: [PATCH 18/19] run auto-formatter --- mission/devices/SyrlinksHkHandler.cpp | 43 ++++++++++++++------------- mission/devices/SyrlinksHkHandler.h | 13 ++++---- 2 files changed, 27 insertions(+), 29 deletions(-) diff --git a/mission/devices/SyrlinksHkHandler.cpp b/mission/devices/SyrlinksHkHandler.cpp index 24d17a86..9108a6f1 100644 --- a/mission/devices/SyrlinksHkHandler.cpp +++ b/mission/devices/SyrlinksHkHandler.cpp @@ -192,10 +192,10 @@ void SyrlinksHkHandler::fillCommandAndReplyMap() { true, syrlinks::ACK_REPLY); this->insertInCommandAndReplyMap(syrlinks::WRITE_LCL_CONFIG, 1, nullptr, syrlinks::ACK_SIZE, false, true, syrlinks::ACK_REPLY); - this->insertInCommandAndReplyMap(syrlinks::CONFIG_BPSK, 1, nullptr, syrlinks::ACK_SIZE, - false, true, syrlinks::ACK_REPLY); - this->insertInCommandAndReplyMap(syrlinks::CONFIG_OQPSK, 1, nullptr, syrlinks::ACK_SIZE, - false, true, syrlinks::ACK_REPLY); + this->insertInCommandAndReplyMap(syrlinks::CONFIG_BPSK, 1, nullptr, syrlinks::ACK_SIZE, false, + true, syrlinks::ACK_REPLY); + this->insertInCommandAndReplyMap(syrlinks::CONFIG_OQPSK, 1, nullptr, syrlinks::ACK_SIZE, false, + true, syrlinks::ACK_REPLY); this->insertInCommandMap(syrlinks::ENABLE_DEBUG); this->insertInCommandMap(syrlinks::DISABLE_DEBUG); this->insertInCommandAndReplyMap(syrlinks::READ_LCL_CONFIG, 1, nullptr, @@ -471,7 +471,8 @@ ReturnValue_t SyrlinksHkHandler::parseReplyStatus(const char* status) { case '0': return RETURN_OK; case '1': - sif::debug << "SyrlinksHkHandler::parseReplyStatus: Uart framing or parity error" << std::endl; + sif::debug << "SyrlinksHkHandler::parseReplyStatus: Uart framing or parity error" + << std::endl; return UART_FRAMIN_OR_PARITY_ERROR_ACK; case '2': sif::debug << "SyrlinksHkHandler::parseReplyStatus: Bad character detected" << std::endl; @@ -541,15 +542,15 @@ void SyrlinksHkHandler::parseRxStatusRegistersReply(const uint8_t* packet) { #if OBSW_VERBOSE_LEVEL >= 1 && OBSW_DEBUG_SYRLINKS == 1 if (debug) { - sif::info << "Syrlinks RX Status: 0x" << std::hex << (unsigned int)rxDataset.rxStatus.value - << std::endl; - sif::info << "Syrlinks RX Sensitivity: " << std::dec << rxDataset.rxSensitivity << std::endl; - sif::info << "Syrlinks RX Frequency Shift: " << rxDataset.rxFrequencyShift << std::endl; - sif::info << "Syrlinks RX IQ Power: " << rxDataset.rxIqPower << std::endl; - sif::info << "Syrlinks RX AGC Value: " << rxDataset.rxAgcValue << std::endl; - sif::info << "Syrlinks RX Demod Eb: " << rxDataset.rxDemodEb << std::endl; - sif::info << "Syrlinks RX Demod N0: " << rxDataset.rxDemodN0 << std::endl; - sif::info << "Syrlinks RX Datarate: " << (unsigned int)rxDataset.rxDataRate.value << std::endl; + sif::info << "Syrlinks RX Status: 0x" << std::hex << (unsigned int)rxDataset.rxStatus.value + << std::endl; + sif::info << "Syrlinks RX Sensitivity: " << std::dec << rxDataset.rxSensitivity << std::endl; + sif::info << "Syrlinks RX Frequency Shift: " << rxDataset.rxFrequencyShift << std::endl; + sif::info << "Syrlinks RX IQ Power: " << rxDataset.rxIqPower << std::endl; + sif::info << "Syrlinks RX AGC Value: " << rxDataset.rxAgcValue << std::endl; + sif::info << "Syrlinks RX Demod Eb: " << rxDataset.rxDemodEb << std::endl; + sif::info << "Syrlinks RX Demod N0: " << rxDataset.rxDemodN0 << std::endl; + sif::info << "Syrlinks RX Datarate: " << (unsigned int)rxDataset.rxDataRate.value << std::endl; } #endif } @@ -558,8 +559,8 @@ void SyrlinksHkHandler::parseLclConfigReply(const uint8_t* packet) { uint16_t offset = syrlinks::MESSAGE_HEADER_SIZE; uint8_t lclConfig = convertHexStringToUint8(reinterpret_cast(packet + offset)); if (debug) { - sif::info << "SyrlinksHkHandler::parseRxStatusRegistersReply: Lcl config: " - << static_cast(lclConfig) << std::endl; + sif::info << "SyrlinksHkHandler::parseRxStatusRegistersReply: Lcl config: " + << static_cast(lclConfig) << std::endl; } } @@ -569,8 +570,8 @@ void SyrlinksHkHandler::parseTxStatusReply(const uint8_t* packet) { txDataset.txStatus = convertHexStringToUint8(reinterpret_cast(packet + offset)); #if OBSW_DEBUG_SYRLINKS == 1 if (debug) { - sif::info << "Syrlinks TX Status: 0x" << std::hex << (unsigned int)txDataset.txStatus.value - << std::endl; + sif::info << "Syrlinks TX Status: 0x" << std::hex << (unsigned int)txDataset.txStatus.value + << std::endl; } #endif } @@ -581,8 +582,8 @@ void SyrlinksHkHandler::parseTxWaveformReply(const uint8_t* packet) { txDataset.txWaveform = convertHexStringToUint8(reinterpret_cast(packet + offset)); #if OBSW_DEBUG_SYRLINKS == 1 if (debug) { - sif::info << "Syrlinks TX Waveform: 0x" << std::hex << (unsigned int)txDataset.txWaveform.value - << std::endl; + sif::info << "Syrlinks TX Waveform: 0x" << std::hex << (unsigned int)txDataset.txWaveform.value + << std::endl; } #endif } @@ -594,7 +595,7 @@ void SyrlinksHkHandler::parseAgcLowByte(const uint8_t* packet) { convertHexStringToUint8(reinterpret_cast(packet + offset)); #if OBSW_DEBUG_SYRLINKS == 1 if (debug) { - sif::info << "Syrlinks TX AGC Value: " << txDataset.txAgcValue << std::endl; + sif::info << "Syrlinks TX AGC Value: " << txDataset.txAgcValue << std::endl; } #endif } diff --git a/mission/devices/SyrlinksHkHandler.h b/mission/devices/SyrlinksHkHandler.h index 7eab1b01..78ae6d99 100644 --- a/mission/devices/SyrlinksHkHandler.h +++ b/mission/devices/SyrlinksHkHandler.h @@ -1,12 +1,13 @@ #ifndef MISSION_DEVICES_SYRLINKSHKHANDLER_H_ #define MISSION_DEVICES_SYRLINKSHKHANDLER_H_ +#include + #include "devices/powerSwitcherList.h" #include "fsfw/devicehandlers/DeviceHandlerBase.h" -#include "mission/devices/devicedefinitions/SyrlinksDefinitions.h" -#include "fsfw_hal/linux/gpio/Gpio.h" #include "fsfw/timemanager/Countdown.h" -#include +#include "fsfw_hal/linux/gpio/Gpio.h" +#include "mission/devices/devicedefinitions/SyrlinksDefinitions.h" /** * @brief This is the device handler for the syrlinks transceiver. It handles the command @@ -102,11 +103,7 @@ class SyrlinksHkHandler : public DeviceHandlerBase { uint8_t commandBuffer[syrlinks::MAX_COMMAND_SIZE]; - enum class StartupState { - OFF, - ENABLE_TEMPERATURE_PROTECTION, - DONE - }; + enum class StartupState { OFF, ENABLE_TEMPERATURE_PROTECTION, DONE }; StartupState startupState = StartupState::OFF; From 81e33348bb80f2b97bcb36f036117a5d267af1c6 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 7 Apr 2022 10:06:20 +0200 Subject: [PATCH 19/19] tmtc update --- tmtc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tmtc b/tmtc index 1c105752..8f2ff303 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 1c105752642084acf21f78b1b2302f0f4d26aec9 +Subproject commit 8f2ff3034fff627b807f32c02fd9e676126bae5f