Update for new yocto rootfs #217

Merged
meierj merged 38 commits from mueller/yocto-rootfs into develop 2022-04-22 10:21:54 +02:00
25 changed files with 1264 additions and 1517 deletions
Showing only changes of commit e7e810eb20 - Show all commits

View File

@ -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_CLOCK[] = "rx_clock_enable_ltc2872";
static constexpr char RS485_EN_RX_DATA[] = "rx_data_enable_ltc2872"; static constexpr char RS485_EN_RX_DATA[] = "rx_data_enable_ltc2872";
static constexpr char PDEC_RESET[] = "pdec_reset"; 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_VBAT0[] = "enable_plpcdu_vbat0";
static constexpr char PL_PCDU_ENABLE_VBAT1[] = "enable_plpcdu_vbat1"; static constexpr char PL_PCDU_ENABLE_VBAT1[] = "enable_plpcdu_vbat1";

View File

@ -628,7 +628,7 @@ void ObjectFactory::createSolarArrayDeploymentComponents() {
void ObjectFactory::createSyrlinksComponents() { void ObjectFactory::createSyrlinksComponents() {
UartCookie* syrlinksUartCookie = UartCookie* syrlinksUartCookie =
new UartCookie(objects::SYRLINKS_HK_HANDLER, q7s::UART_SYRLINKS_DEV, UartModes::NON_CANONICAL, 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(); syrlinksUartCookie->setParityEven();
new SyrlinksHkHandler(objects::SYRLINKS_HK_HANDLER, objects::UART_COM_IF, syrlinksUartCookie, new SyrlinksHkHandler(objects::SYRLINKS_HK_HANDLER, objects::UART_COM_IF, syrlinksUartCookie,
@ -662,8 +662,8 @@ void ObjectFactory::createPayloadComponents(LinuxLibgpioIF* gpioComIF) {
auto supvGpioCookie = new GpioCookie; auto supvGpioCookie = new GpioCookie;
supvGpioCookie->addGpio(gpioIds::ENABLE_SUPV_UART, gpioConfigSupv); supvGpioCookie->addGpio(gpioIds::ENABLE_SUPV_UART, gpioConfigSupv);
gpioComIF->addGpios(supvGpioCookie); gpioComIF->addGpios(supvGpioCookie);
auto supervisorCookie = new UartCookie( auto supervisorCookie = new UartCookie(objects::PLOC_SUPERVISOR_HANDLER,
objects::PLOC_SUPERVISOR_HANDLER, q7s::UART_PLOC_SUPERVSIOR_DEV, UartModes::NON_CANONICAL, q7s::UART_PLOC_SUPERVSIOR_DEV, UartModes::NON_CANONICAL,
uart::PLOC_SUPERVISOR_BAUD, supv::MAX_PACKET_SIZE * 20); uart::PLOC_SUPERVISOR_BAUD, supv::MAX_PACKET_SIZE * 20);
supervisorCookie->setNoFixedSizeReply(); supervisorCookie->setNoFixedSizeReply();
new PlocSupervisorHandler(objects::PLOC_SUPERVISOR_HANDLER, objects::UART_COM_IF, new PlocSupervisorHandler(objects::PLOC_SUPERVISOR_HANDLER, objects::UART_COM_IF,

View File

@ -15,11 +15,7 @@ static int OBSW_ALREADY_RUNNING = -2;
int obsw::obsw() { int obsw::obsw() {
using namespace fsfw; using namespace fsfw;
std::cout << "-- EIVE OBSW --" << std::endl; std::cout << "-- EIVE OBSW --" << std::endl;
#ifdef TE0720_1CFA
std::cout << "-- Compiled for Linux (TE0720) --" << std::endl;
#else
std::cout << "-- Compiled for Linux (Xiphos Q7S) --" << std::endl; std::cout << "-- Compiled for Linux (Xiphos Q7S) --" << std::endl;
#endif
std::cout << "-- OBSW v" << SW_VERSION << "." << SW_SUBVERSION << "." << SW_REVISION << ", FSFW v" std::cout << "-- OBSW v" << SW_VERSION << "." << SW_SUBVERSION << "." << SW_REVISION << ", FSFW v"
<< FSFW_VERSION << "--" << std::endl; << FSFW_VERSION << "--" << std::endl;
std::cout << "-- " << __DATE__ << " " << __TIME__ << " --" << std::endl; std::cout << "-- " << __DATE__ << " " << __TIME__ << " --" << std::endl;

2
fsfw

@ -1 +1 @@
Subproject commit 1bc7a918694030d1f49f1d2998a289d77b132849 Subproject commit 43917d98c025b446aa0d79d2166b1f031fb288ae

View File

@ -79,9 +79,11 @@ ReturnValue_t GPSHyperionLinuxController::initializeLocalDataPool(
localDataPoolMap.emplace(GpsHyperion::SATS_IN_USE, new PoolEntry<uint8_t>()); localDataPoolMap.emplace(GpsHyperion::SATS_IN_USE, new PoolEntry<uint8_t>());
localDataPoolMap.emplace(GpsHyperion::SATS_IN_VIEW, new PoolEntry<uint8_t>()); localDataPoolMap.emplace(GpsHyperion::SATS_IN_VIEW, new PoolEntry<uint8_t>());
localDataPoolMap.emplace(GpsHyperion::FIX_MODE, new PoolEntry<uint8_t>()); localDataPoolMap.emplace(GpsHyperion::FIX_MODE, new PoolEntry<uint8_t>());
bool enablePeriodicHk = false;
#if OBSW_ENABLE_PERIODIC_HK == 1 #if OBSW_ENABLE_PERIODIC_HK == 1
poolManager.subscribeForPeriodicPacket(gpsSet.getSid(), true, 2.0, false); enablePeriodicHk = true;
#endif #endif
poolManager.subscribeForPeriodicPacket(gpsSet.getSid(), enablePeriodicHk, 2.0, false);
return HasReturnvaluesIF::RETURN_OK; return HasReturnvaluesIF::RETURN_OK;
} }

View File

@ -1541,6 +1541,6 @@ class LatchupStatusReport : public StaticLocalDataSet<LATCHUP_RPT_SET_ENTRIES> {
lp_var_t<uint32_t> isSet = lp_var_t<uint32_t> isSet =
lp_var_t<uint32_t>(sid.objectId, PoolIds::LATCHUP_RPT_TIME_IS_SET, this); lp_var_t<uint32_t>(sid.objectId, PoolIds::LATCHUP_RPT_TIME_IS_SET, this);
}; };
} // namespace PLOC_SPV } // namespace supv
#endif /* MISSION_DEVICES_DEVICEDEFINITIONS_PLOCSVPDEFINITIONS_H_ */ #endif /* MISSION_DEVICES_DEVICEDEFINITIONS_PLOCSVPDEFINITIONS_H_ */

View File

@ -1,9 +1,9 @@
#include "PlocMPSoCHandler.h" #include "PlocMPSoCHandler.h"
#include "linux/devices/devicedefinitions/PlocSupervisorDefinitions.h"
#include "OBSWConfig.h" #include "OBSWConfig.h"
#include "fsfw/datapool/PoolReadGuard.h" #include "fsfw/datapool/PoolReadGuard.h"
#include "fsfw/globalfunctions/CRC.h" #include "fsfw/globalfunctions/CRC.h"
#include "linux/devices/devicedefinitions/PlocSupervisorDefinitions.h"
PlocMPSoCHandler::PlocMPSoCHandler(object_id_t objectId, object_id_t uartComIFid, PlocMPSoCHandler::PlocMPSoCHandler(object_id_t objectId, object_id_t uartComIFid,
CookieIF* comCookie, PlocMPSoCHelper* plocMPSoCHelper, CookieIF* comCookie, PlocMPSoCHelper* plocMPSoCHelper,
@ -87,8 +87,8 @@ void PlocMPSoCHandler::performOperationHook() {
} }
} }
CommandMessage message; CommandMessage message;
for (ReturnValue_t result = commandActionHelperQueue->receiveMessage(&message); result == RETURN_OK; for (ReturnValue_t result = commandActionHelperQueue->receiveMessage(&message);
result = commandActionHelperQueue->receiveMessage(&message)) { result == RETURN_OK; result = commandActionHelperQueue->receiveMessage(&message)) {
result = commandActionHelper.handleReply(&message); result = commandActionHelper.handleReply(&message);
if (result == RETURN_OK) { if (result == RETURN_OK) {
continue; continue;
@ -703,32 +703,25 @@ size_t PlocMPSoCHandler::getNextReplyLength(DeviceCommandId_t commandId) {
return replyLen; return replyLen;
} }
MessageQueueIF* PlocMPSoCHandler::getCommandQueuePtr() { MessageQueueIF* PlocMPSoCHandler::getCommandQueuePtr() { return commandActionHelperQueue; }
return commandActionHelperQueue;
}
void PlocMPSoCHandler::stepSuccessfulReceived(ActionId_t actionId, uint8_t step) { void PlocMPSoCHandler::stepSuccessfulReceived(ActionId_t actionId, uint8_t step) { return; }
return;
}
void PlocMPSoCHandler::stepFailedReceived(ActionId_t actionId, uint8_t step, void PlocMPSoCHandler::stepFailedReceived(ActionId_t actionId, uint8_t step,
ReturnValue_t returnCode) { ReturnValue_t returnCode) {
switch (actionId) { switch (actionId) {
case supv::START_MPSOC: case supv::START_MPSOC:
sif::warning << "PlocMPSoCHandler::stepFailedReceived: Failed to start MPSoC" sif::warning << "PlocMPSoCHandler::stepFailedReceived: Failed to start MPSoC" << std::endl;
<< std::endl;
powerState = PowerState::OFF; powerState = PowerState::OFF;
break; break;
case supv::SHUTDOWN_MPSOC: case supv::SHUTDOWN_MPSOC:
triggerEvent(MPSOC_SHUTDOWN_FAILED); triggerEvent(MPSOC_SHUTDOWN_FAILED);
sif::warning << "PlocMPSoCHandler::stepFailedReceived: Failed to shutdown MPSoC" sif::warning << "PlocMPSoCHandler::stepFailedReceived: Failed to shutdown MPSoC" << std::endl;
<< std::endl;
// TODO: Setting state to on or off here? // TODO: Setting state to on or off here?
powerState = PowerState::ON; powerState = PowerState::ON;
break; break;
default: default:
sif::debug sif::debug << "PlocMPSoCHandler::stepFailedReceived: Received unexpected action reply"
<< "PlocMPSoCHandler::stepFailedReceived: Received unexpected action reply"
<< std::endl; << std::endl;
break; break;
} }

View File

@ -489,8 +489,8 @@ ReturnValue_t PlocSupervisorHandler::enableReplyInReplyMap(DeviceCommandMap::ite
switch (command->first) { switch (command->first) {
case supv::GET_HK_REPORT: { case supv::GET_HK_REPORT: {
enabledReplies = 3; enabledReplies = 3;
result = DeviceHandlerBase::enableReplyInReplyMap(command, enabledReplies, true, result =
supv::HK_REPORT); DeviceHandlerBase::enableReplyInReplyMap(command, enabledReplies, true, supv::HK_REPORT);
if (result != RETURN_OK) { if (result != RETURN_OK) {
sif::debug << "PlocSupervisorHandler::enableReplyInReplyMap: Reply with id " sif::debug << "PlocSupervisorHandler::enableReplyInReplyMap: Reply with id "
<< supv::HK_REPORT << " not in replyMap" << std::endl; << supv::HK_REPORT << " not in replyMap" << std::endl;
@ -589,15 +589,15 @@ ReturnValue_t PlocSupervisorHandler::enableReplyInReplyMap(DeviceCommandMap::ite
result = result =
DeviceHandlerBase::enableReplyInReplyMap(command, enabledReplies, true, supv::ACK_REPORT); DeviceHandlerBase::enableReplyInReplyMap(command, enabledReplies, true, supv::ACK_REPORT);
if (result != RETURN_OK) { if (result != RETURN_OK) {
sif::debug << "PlocSupervisorHandler::enableReplyInReplyMap: Reply with id " sif::debug << "PlocSupervisorHandler::enableReplyInReplyMap: Reply with id " << supv::ACK_REPORT
<< supv::ACK_REPORT << " not in replyMap" << std::endl; << " not in replyMap" << std::endl;
} }
result = result =
DeviceHandlerBase::enableReplyInReplyMap(command, enabledReplies, true, supv::EXE_REPORT); DeviceHandlerBase::enableReplyInReplyMap(command, enabledReplies, true, supv::EXE_REPORT);
if (result != RETURN_OK) { if (result != RETURN_OK) {
sif::debug << "PlocSupervisorHandler::enableReplyInReplyMap: Reply with id " sif::debug << "PlocSupervisorHandler::enableReplyInReplyMap: Reply with id " << supv::EXE_REPORT
<< supv::EXE_REPORT << " not in replyMap" << std::endl; << " not in replyMap" << std::endl;
} }
return RETURN_OK; return RETURN_OK;
@ -1459,8 +1459,7 @@ ReturnValue_t PlocSupervisorHandler::handleMramDumpFile(DeviceCommandId_t id) {
return MRAM_FILE_NOT_EXISTS; return MRAM_FILE_NOT_EXISTS;
} }
std::ofstream file(activeMramFile, std::ios_base::app | std::ios_base::out); std::ofstream file(activeMramFile, std::ios_base::app | std::ios_base::out);
file.write( file.write(reinterpret_cast<const char*>(spacePacketBuffer + supv::SPACE_PACKET_HEADER_LENGTH),
reinterpret_cast<const char*>(spacePacketBuffer + supv::SPACE_PACKET_HEADER_LENGTH),
packetLen - 1); packetLen - 1);
file.close(); file.close();
return RETURN_OK; return RETURN_OK;

View File

@ -262,12 +262,11 @@ void PlocUpdater::commandUpdateAvailable() {
calcImageCrc(); calcImageCrc();
supv::UpdateInfo packet(supv::APID_UPDATE_AVAILABLE, static_cast<uint8_t>(image), supv::UpdateInfo packet(supv::APID_UPDATE_AVAILABLE, static_cast<uint8_t>(image),
static_cast<uint8_t>(partition), imageSize, imageCrc, static_cast<uint8_t>(partition), imageSize, imageCrc, numOfUpdatePackets);
numOfUpdatePackets);
result = commandActionHelper.commandAction(objects::PLOC_SUPERVISOR_HANDLER, result =
supv::UPDATE_AVAILABLE, packet.getWholeData(), commandActionHelper.commandAction(objects::PLOC_SUPERVISOR_HANDLER, supv::UPDATE_AVAILABLE,
packet.getFullSize()); packet.getWholeData(), packet.getFullSize());
if (result != RETURN_OK) { if (result != RETURN_OK) {
sif::warning << "PlocUpdater::commandUpdateAvailable: Failed to send update available" sif::warning << "PlocUpdater::commandUpdateAvailable: Failed to send update available"
<< " packet to supervisor handler" << std::endl; << " packet to supervisor handler" << std::endl;
@ -311,9 +310,9 @@ void PlocUpdater::commandUpdatePacket() {
} }
packet.makeCrc(); packet.makeCrc();
result = commandActionHelper.commandAction(objects::PLOC_SUPERVISOR_HANDLER, result =
supv::UPDATE_IMAGE_DATA, packet.getWholeData(), commandActionHelper.commandAction(objects::PLOC_SUPERVISOR_HANDLER, supv::UPDATE_IMAGE_DATA,
packet.getFullSize()); packet.getWholeData(), packet.getFullSize());
if (result != RETURN_OK) { if (result != RETURN_OK) {
sif::warning << "PlocUpdater::commandUpdateAvailable: Failed to send update" sif::warning << "PlocUpdater::commandUpdateAvailable: Failed to send update"
@ -335,11 +334,9 @@ void PlocUpdater::commandUpdateVerify() {
ReturnValue_t result = RETURN_OK; ReturnValue_t result = RETURN_OK;
supv::UpdateInfo packet(supv::APID_UPDATE_VERIFY, static_cast<uint8_t>(image), supv::UpdateInfo packet(supv::APID_UPDATE_VERIFY, static_cast<uint8_t>(image),
static_cast<uint8_t>(partition), imageSize, imageCrc, static_cast<uint8_t>(partition), imageSize, imageCrc, numOfUpdatePackets);
numOfUpdatePackets);
result = result = commandActionHelper.commandAction(objects::PLOC_SUPERVISOR_HANDLER, supv::UPDATE_VERIFY,
commandActionHelper.commandAction(objects::PLOC_SUPERVISOR_HANDLER, supv::UPDATE_VERIFY,
packet.getWholeData(), packet.getFullSize()); packet.getWholeData(), packet.getFullSize());
if (result != RETURN_OK) { if (result != RETURN_OK) {
sif::warning << "PlocUpdater::commandUpdateAvailable: Failed to send update available" sif::warning << "PlocUpdater::commandUpdateAvailable: Failed to send update available"

View File

@ -7,12 +7,12 @@
#include "ArcsecJsonParamBase.h" #include "ArcsecJsonParamBase.h"
#include "OBSWConfig.h" #include "OBSWConfig.h"
#include "StrHelper.h" #include "StrHelper.h"
#include "devices/powerSwitcherList.h"
#include "fsfw/devicehandlers/DeviceHandlerBase.h" #include "fsfw/devicehandlers/DeviceHandlerBase.h"
#include "fsfw/src/fsfw/serialize/SerializeAdapter.h" #include "fsfw/src/fsfw/serialize/SerializeAdapter.h"
#include "fsfw/timemanager/Countdown.h" #include "fsfw/timemanager/Countdown.h"
#include "linux/devices/devicedefinitions/StarTrackerDefinitions.h" #include "linux/devices/devicedefinitions/StarTrackerDefinitions.h"
#include "thirdparty/arcsec_star_tracker/common/SLIP.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. * @brief This is the device handler for the star tracker from arcsec.

View File

@ -37,6 +37,8 @@ class AxiPtmeConfig : public SystemObject {
* The default implementation of the PTME generates a clock where the high level is * 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 * only one bit clock period long. This might be too short to match the setup and hold
* times of the S-and transceiver. * times of the S-and transceiver.
* Default: Enables TX clock manipulator
*
*/ */
ReturnValue_t enableTxclockManipulator(); ReturnValue_t enableTxclockManipulator();
ReturnValue_t disableTxclockManipulator(); 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 * Enable inversion will update data on falling edge (not the configuration required by the
* syrlinks) * syrlinks)
* Disable clock inversion. Data updated on rising edge. * Disable clock inversion. Data updated on rising edge.
* Default: Inversion is disabled
*/ */
ReturnValue_t enableTxclockInversion(); ReturnValue_t enableTxclockInversion();
ReturnValue_t disableTxclockInversion(); ReturnValue_t disableTxclockInversion();
@ -54,7 +57,7 @@ class AxiPtmeConfig : public SystemObject {
private: private:
// Address of register storing the bitrate configuration parameter // Address of register storing the bitrate configuration parameter
static const uint32_t CADU_BITRATE_REG = 0x0; 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 COMMON_CONFIG_REG = 0x4;
static const uint32_t ADRESS_DIVIDER = 4; static const uint32_t ADRESS_DIVIDER = 4;

View File

@ -194,81 +194,82 @@ void ACUHandler::parseHkTableReply(const uint8_t *packet) {
ReturnValue_t ACUHandler::initializeLocalDataPool(localpool::DataPool &localDataPoolMap, ReturnValue_t ACUHandler::initializeLocalDataPool(localpool::DataPool &localDataPoolMap,
LocalDataPoolManager &poolManager) { LocalDataPoolManager &poolManager) {
localDataPoolMap.emplace(P60System::ACU_CURRENT_IN_CHANNEL0, new PoolEntry<int16_t>({0})); using namespace P60System;
localDataPoolMap.emplace(P60System::ACU_CURRENT_IN_CHANNEL1, new PoolEntry<int16_t>({0})); localDataPoolMap.emplace(pool::ACU_CURRENT_IN_CHANNEL0, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::ACU_CURRENT_IN_CHANNEL2, new PoolEntry<int16_t>({0})); localDataPoolMap.emplace(pool::ACU_CURRENT_IN_CHANNEL1, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::ACU_CURRENT_IN_CHANNEL3, new PoolEntry<int16_t>({0})); localDataPoolMap.emplace(pool::ACU_CURRENT_IN_CHANNEL2, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::ACU_CURRENT_IN_CHANNEL4, new PoolEntry<int16_t>({0})); localDataPoolMap.emplace(pool::ACU_CURRENT_IN_CHANNEL3, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::ACU_CURRENT_IN_CHANNEL5, new PoolEntry<int16_t>({0})); localDataPoolMap.emplace(pool::ACU_CURRENT_IN_CHANNEL4, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(pool::ACU_CURRENT_IN_CHANNEL5, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::ACU_VOLTAGE_IN_CHANNEL0, new PoolEntry<uint16_t>({0})); localDataPoolMap.emplace(pool::ACU_VOLTAGE_IN_CHANNEL0, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::ACU_VOLTAGE_IN_CHANNEL1, new PoolEntry<uint16_t>({0})); localDataPoolMap.emplace(pool::ACU_VOLTAGE_IN_CHANNEL1, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::ACU_VOLTAGE_IN_CHANNEL2, new PoolEntry<uint16_t>({0})); localDataPoolMap.emplace(pool::ACU_VOLTAGE_IN_CHANNEL2, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::ACU_VOLTAGE_IN_CHANNEL3, new PoolEntry<uint16_t>({0})); localDataPoolMap.emplace(pool::ACU_VOLTAGE_IN_CHANNEL3, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::ACU_VOLTAGE_IN_CHANNEL4, new PoolEntry<uint16_t>({0})); localDataPoolMap.emplace(pool::ACU_VOLTAGE_IN_CHANNEL4, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::ACU_VOLTAGE_IN_CHANNEL5, new PoolEntry<uint16_t>({0})); localDataPoolMap.emplace(pool::ACU_VOLTAGE_IN_CHANNEL5, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::ACU_VCC, new PoolEntry<uint16_t>({0})); localDataPoolMap.emplace(pool::ACU_VCC, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::ACU_VBAT, new PoolEntry<uint16_t>({0})); localDataPoolMap.emplace(pool::ACU_VBAT, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::ACU_TEMPERATURE_1, new PoolEntry<int16_t>({0})); localDataPoolMap.emplace(pool::ACU_TEMPERATURE_1, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::ACU_TEMPERATURE_2, new PoolEntry<int16_t>({0})); localDataPoolMap.emplace(pool::ACU_TEMPERATURE_2, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::ACU_TEMPERATURE_3, new PoolEntry<int16_t>({0})); localDataPoolMap.emplace(pool::ACU_TEMPERATURE_3, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::ACU_MPPT_MODE, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(pool::ACU_MPPT_MODE, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::ACU_VBOOST_CHANNEL0, new PoolEntry<uint16_t>({0})); localDataPoolMap.emplace(pool::ACU_VBOOST_CHANNEL0, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::ACU_VBOOST_CHANNEL1, new PoolEntry<uint16_t>({0})); localDataPoolMap.emplace(pool::ACU_VBOOST_CHANNEL1, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::ACU_VBOOST_CHANNEL2, new PoolEntry<uint16_t>({0})); localDataPoolMap.emplace(pool::ACU_VBOOST_CHANNEL2, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::ACU_VBOOST_CHANNEL3, new PoolEntry<uint16_t>({0})); localDataPoolMap.emplace(pool::ACU_VBOOST_CHANNEL3, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::ACU_VBOOST_CHANNEL4, new PoolEntry<uint16_t>({0})); localDataPoolMap.emplace(pool::ACU_VBOOST_CHANNEL4, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::ACU_VBOOST_CHANNEL5, new PoolEntry<uint16_t>({0})); localDataPoolMap.emplace(pool::ACU_VBOOST_CHANNEL5, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::ACU_POWER_CHANNEL0, new PoolEntry<uint16_t>({0})); localDataPoolMap.emplace(pool::ACU_POWER_CHANNEL0, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::ACU_POWER_CHANNEL1, new PoolEntry<uint16_t>({0})); localDataPoolMap.emplace(pool::ACU_POWER_CHANNEL1, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::ACU_POWER_CHANNEL2, new PoolEntry<uint16_t>({0})); localDataPoolMap.emplace(pool::ACU_POWER_CHANNEL2, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::ACU_POWER_CHANNEL3, new PoolEntry<uint16_t>({0})); localDataPoolMap.emplace(pool::ACU_POWER_CHANNEL3, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::ACU_POWER_CHANNEL4, new PoolEntry<uint16_t>({0})); localDataPoolMap.emplace(pool::ACU_POWER_CHANNEL4, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::ACU_POWER_CHANNEL5, new PoolEntry<uint16_t>({0})); localDataPoolMap.emplace(pool::ACU_POWER_CHANNEL5, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::ACU_DAC_EN_0, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(pool::ACU_DAC_EN_0, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::ACU_DAC_EN_1, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(pool::ACU_DAC_EN_1, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::ACU_DAC_EN_2, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(pool::ACU_DAC_EN_2, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::ACU_DAC_RAW_0, new PoolEntry<uint16_t>({0})); localDataPoolMap.emplace(pool::ACU_DAC_RAW_0, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::ACU_DAC_RAW_1, new PoolEntry<uint16_t>({0})); localDataPoolMap.emplace(pool::ACU_DAC_RAW_1, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::ACU_DAC_RAW_2, new PoolEntry<uint16_t>({0})); localDataPoolMap.emplace(pool::ACU_DAC_RAW_2, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::ACU_DAC_RAW_3, new PoolEntry<uint16_t>({0})); localDataPoolMap.emplace(pool::ACU_DAC_RAW_3, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::ACU_DAC_RAW_4, new PoolEntry<uint16_t>({0})); localDataPoolMap.emplace(pool::ACU_DAC_RAW_4, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::ACU_DAC_RAW_5, new PoolEntry<uint16_t>({0})); localDataPoolMap.emplace(pool::ACU_DAC_RAW_5, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::ACU_BOOTCAUSE, new PoolEntry<uint32_t>({0})); localDataPoolMap.emplace(pool::ACU_BOOTCAUSE, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::ACU_BOOTCNT, new PoolEntry<uint32_t>({0})); localDataPoolMap.emplace(pool::ACU_BOOTCNT, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::ACU_UPTIME, new PoolEntry<uint32_t>({0})); localDataPoolMap.emplace(pool::ACU_UPTIME, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::ACU_RESET_CAUSE, new PoolEntry<uint16_t>({0})); localDataPoolMap.emplace(pool::ACU_RESET_CAUSE, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::ACU_MPPT_TIME, new PoolEntry<uint16_t>({0})); localDataPoolMap.emplace(pool::ACU_MPPT_TIME, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::ACU_MPPT_PERIOD, new PoolEntry<uint16_t>({0})); localDataPoolMap.emplace(pool::ACU_MPPT_PERIOD, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::ACU_DEVICE_0, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(pool::ACU_DEVICE_0, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::ACU_DEVICE_1, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(pool::ACU_DEVICE_1, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::ACU_DEVICE_2, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(pool::ACU_DEVICE_2, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::ACU_DEVICE_3, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(pool::ACU_DEVICE_3, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::ACU_DEVICE_4, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(pool::ACU_DEVICE_4, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::ACU_DEVICE_5, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(pool::ACU_DEVICE_5, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::ACU_DEVICE_6, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(pool::ACU_DEVICE_6, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::ACU_DEVICE_7, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(pool::ACU_DEVICE_7, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::ACU_DEVICE_0_STATUS, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(pool::ACU_DEVICE_0_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::ACU_DEVICE_1_STATUS, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(pool::ACU_DEVICE_1_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::ACU_DEVICE_2_STATUS, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(pool::ACU_DEVICE_2_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::ACU_DEVICE_3_STATUS, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(pool::ACU_DEVICE_3_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::ACU_DEVICE_4_STATUS, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(pool::ACU_DEVICE_4_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::ACU_DEVICE_5_STATUS, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(pool::ACU_DEVICE_5_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::ACU_DEVICE_6_STATUS, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(pool::ACU_DEVICE_6_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::ACU_DEVICE_7_STATUS, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(pool::ACU_DEVICE_7_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::ACU_WDT_CNT_GND, new PoolEntry<uint32_t>({0})); localDataPoolMap.emplace(pool::ACU_WDT_CNT_GND, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::ACU_WDT_GND_LEFT, new PoolEntry<uint32_t>({0})); localDataPoolMap.emplace(pool::ACU_WDT_GND_LEFT, new PoolEntry<uint32_t>({0}));
return HasReturnvaluesIF::RETURN_OK; return HasReturnvaluesIF::RETURN_OK;
} }

View File

@ -71,95 +71,29 @@ void P60DockHandler::letChildHandleHkReply(DeviceCommandId_t id, const uint8_t *
} }
void P60DockHandler::parseHkTableReply(const uint8_t *packet) { void P60DockHandler::parseHkTableReply(const uint8_t *packet) {
using namespace P60Dock;
uint16_t dataOffset = 0; 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 * Fist 10 bytes contain the gomspace header. Each variable is preceded by the 16-bit table
* address. * address.
*/ */
dataOffset += 12; dataOffset += 12;
p60dockHkTableDataset.currentAcuVcc = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); for (uint8_t idx = 0; idx < hk::CHNLS_LEN; idx++) {
p60dockHkTableDataset.currents[idx] = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
dataOffset += 4; dataOffset += 4;
p60dockHkTableDataset.currentPdu1Vcc = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); }
for (uint8_t idx = 0; idx < hk::CHNLS_LEN; idx++) {
p60dockHkTableDataset.voltages[idx] = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
dataOffset += 4; dataOffset += 4;
p60dockHkTableDataset.currentX3IdleVcc = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); }
dataOffset += 4; for (uint8_t idx = 0; idx < hk::CHNLS_LEN; idx++) {
p60dockHkTableDataset.currentPdu2Vcc = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); p60dockHkTableDataset.outputEnables[idx] = *(packet + dataOffset);
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; dataOffset += 3;
}
p60dockHkTableDataset.temperature1 = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); p60dockHkTableDataset.temperature1 = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
dataOffset += 4; dataOffset += 4;
@ -167,6 +101,7 @@ void P60DockHandler::parseHkTableReply(const uint8_t *packet) {
dataOffset += 4; dataOffset += 4;
p60dockHkTableDataset.bootcause = *(packet + dataOffset) << 24 | p60dockHkTableDataset.bootcause = *(packet + dataOffset) << 24 |
*(packet + dataOffset + 1) << 16 | *(packet + dataOffset + 1) << 16 |
*(packet + dataOffset + 2) << 8 | *(packet + dataOffset + 3); *(packet + dataOffset + 2) << 8 | *(packet + dataOffset + 3);
dataOffset += 6; dataOffset += 6;
@ -187,35 +122,10 @@ void P60DockHandler::parseHkTableReply(const uint8_t *packet) {
p60dockHkTableDataset.converter5VStatus = *(packet + dataOffset); p60dockHkTableDataset.converter5VStatus = *(packet + dataOffset);
dataOffset += 3; dataOffset += 3;
p60dockHkTableDataset.latchupsAcuVcc = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); for (uint8_t idx = 0; idx < hk::CHNLS_LEN; idx++) {
dataOffset += 4; p60dockHkTableDataset.latchups[idx] = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
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; dataOffset += 4;
}
p60dockHkTableDataset.dockVbatVoltageValue = p60dockHkTableDataset.dockVbatVoltageValue =
*(packet + dataOffset) << 8 | *(packet + dataOffset + 1); *(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
@ -234,39 +144,14 @@ void P60DockHandler::parseHkTableReply(const uint8_t *packet) {
*(packet + dataOffset) << 8 | *(packet + dataOffset + 1); *(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
dataOffset += 4; dataOffset += 4;
p60dockHkTableDataset.device0 = *(packet + dataOffset); for (uint8_t idx = 0; idx < NUM_DEVS; idx++) {
p60dockHkTableDataset.devicesType[idx] = *(packet + dataOffset);
dataOffset += 3; dataOffset += 3;
p60dockHkTableDataset.device1 = *(packet + dataOffset); }
dataOffset += 3; for (uint8_t idx = 0; idx < NUM_DEVS; idx++) {
p60dockHkTableDataset.device2 = *(packet + dataOffset); p60dockHkTableDataset.devicesStatus[idx] = *(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; dataOffset += 3;
}
p60dockHkTableDataset.dearmStatus = *(packet + dataOffset); p60dockHkTableDataset.dearmStatus = *(packet + dataOffset);
dataOffset += 3; dataOffset += 3;
@ -320,127 +205,62 @@ void P60DockHandler::parseHkTableReply(const uint8_t *packet) {
p60dockHkTableDataset.ant6Depl = *(packet + dataOffset); p60dockHkTableDataset.ant6Depl = *(packet + dataOffset);
dataOffset += 3; dataOffset += 3;
p60dockHkTableDataset.ar6Depl = *(packet + dataOffset); p60dockHkTableDataset.ar6Depl = *(packet + dataOffset);
p60dockHkTableDataset.setValidity(true, true);
p60dockHkTableDataset.commit();
} }
ReturnValue_t P60DockHandler::initializeLocalDataPool(localpool::DataPool &localDataPoolMap, ReturnValue_t P60DockHandler::initializeLocalDataPool(localpool::DataPool &localDataPoolMap,
LocalDataPoolManager &poolManager) { LocalDataPoolManager &poolManager) {
localDataPoolMap.emplace(P60System::P60DOCK_CURRENT_ACU_VCC, new PoolEntry<int16_t>({0})); using namespace P60System;
localDataPoolMap.emplace(P60System::P60DOCK_CURRENT_PDU1_VCC, new PoolEntry<int16_t>({0})); localDataPoolMap.emplace(pool::CURRENTS, &hkCurrents);
localDataPoolMap.emplace(P60System::P60DOCK_CURRENT_X3_IDLE_VCC, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_CURRENT_PDU2_VCC, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_CURRENT_ACU_VBAT, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_CURRENT_PDU1_VBAT, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_CURRENT_X3_IDLE_VBAT, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_CURRENT_PDU2_VBAT, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_CURRENT_STACK_VBAT, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_CURRENT_STACK_3V3, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_CURRENT_STACK_5V, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_CURRENT_GS3V3, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_CURRENT_GS5V, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_VOLTAGE_ACU_VCC, new PoolEntry<uint16_t>({0})); localDataPoolMap.emplace(pool::VOLTAGES, &hkVoltages);
localDataPoolMap.emplace(P60System::P60DOCK_VOLTAGE_PDU1_VCC, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_VOLTAGE_X3_IDLE_VCC, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_VOLTAGE_PDU2_VCC, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_VOLTAGE_ACU_VBAT, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_VOLTAGE_PDU1_VBAT, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_VOLTAGE_X3_IDLE_VBAT, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_VOLTAGE_PDU2_VBAT, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_VOLTAGE_STACK_VBAT, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_VOLTAGE_STACK_3V3, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_VOLTAGE_STACK_5V, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_VOLTAGE_GS3V3, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_VOLTAGE_GS5V, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_OUTPUTENABLE_ACU_VCC, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(pool::OUTPUT_ENABLE, &outputEnables);
localDataPoolMap.emplace(P60System::P60DOCK_OUTPUTENABLE_PDU1_VCC, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_OUTPUTENABLE_X3_IDLE_VCC,
new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_OUTPUTENABLE_PDU2_VCC, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_OUTPUTENABLE_ACU_VBAT, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_OUTPUTENABLE_PDU1_VBAT, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_OUTPUTENABLE_X3_IDLE_VBAT,
new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_OUTPUTENABLE_PDU2_VBAT, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_OUTPUTENABLE_STACK_VBAT, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_OUTPUTENABLE_STACK_3V3, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_OUTPUTENABLE_STACK_5V, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_OUTPUTENABLE_GS3V3, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_OUTPUTENABLE_GS5V, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_TEMPERATURE_1, new PoolEntry<int16_t>({0})); localDataPoolMap.emplace(pool::P60DOCK_TEMPERATURE_1, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_TEMPERATURE_2, new PoolEntry<int16_t>({0})); localDataPoolMap.emplace(pool::P60DOCK_TEMPERATURE_2, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_BOOT_CAUSE, new PoolEntry<uint32_t>({0})); localDataPoolMap.emplace(pool::P60DOCK_BOOT_CAUSE, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_BOOT_CNT, new PoolEntry<uint32_t>({0})); localDataPoolMap.emplace(pool::P60DOCK_BOOT_CNT, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_UPTIME, new PoolEntry<uint32_t>({0})); localDataPoolMap.emplace(pool::P60DOCK_UPTIME, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_RESETCAUSE, new PoolEntry<uint16_t>({0})); localDataPoolMap.emplace(pool::P60DOCK_RESETCAUSE, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_BATT_MODE, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(pool::P60DOCK_BATT_MODE, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_HEATER_ON, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(pool::P60DOCK_HEATER_ON, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_CONV_5V_ENABLE_STATUS, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(pool::P60DOCK_CONV_5V_ENABLE_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_LATCHUP_ACU_VCC, new PoolEntry<uint16_t>({0})); localDataPoolMap.emplace(pool::LATCHUPS, &latchups);
localDataPoolMap.emplace(P60System::P60DOCK_LATCHUP_PDU1_VCC, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_LATCHUP_X3_IDLE_VCC, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_LATCHUP_PDU2_VCC, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_LATCHUP_ACU_VBAT, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_LATCHUP_PDU1_VBAT, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_LATCHUP_X3_IDLE_VBAT, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_LATCHUP_PDU2_VBAT, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_LATCHUP_STACK_VBAT, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_LATCHUP_STACK_3V3, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_LATCHUP_STACK_5V, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_LATCHUP_GS3V3, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_LATCHUP_GS5V, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_VBAT_VALUE, new PoolEntry<uint16_t>({0})); localDataPoolMap.emplace(pool::P60DOCK_DOCK_VBAT, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_VCC_CURRENT_VALUE, new PoolEntry<int16_t>({0})); localDataPoolMap.emplace(pool::P60DOCK_DOCK_VCC_CURRENT, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_BATTERY_CURRENT, new PoolEntry<int16_t>({0})); localDataPoolMap.emplace(pool::P60DOCK_BATTERY_CURRENT, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_BATTERY_VOLTAGE, new PoolEntry<uint16_t>({0})); localDataPoolMap.emplace(pool::P60DOCK_BATTERY_VOLTAGE, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_BATTERY_TEMPERATURE_1, new PoolEntry<int16_t>({0})); localDataPoolMap.emplace(pool::P60DOCK_BATTERY_TEMPERATURE_1, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_BATTERY_TEMPERATURE_2, new PoolEntry<int16_t>({0})); localDataPoolMap.emplace(pool::P60DOCK_BATTERY_TEMPERATURE_2, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_DEVICE_0, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(pool::DEVICES_TYPE, &devicesType);
localDataPoolMap.emplace(P60System::P60DOCK_DEVICE_1, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(pool::DEVICES_STATUS, &devicesStatus);
localDataPoolMap.emplace(P60System::P60DOCK_DEVICE_2, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_DEVICE_3, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_DEVICE_4, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_DEVICE_5, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_DEVICE_6, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_DEVICE_7, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_DEVICE_0_STATUS, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(pool::P60DOCK_DEARM_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_DEVICE_1_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_DEVICE_2_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_DEVICE_3_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_DEVICE_4_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_DEVICE_5_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_DEVICE_6_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_DEVICE_7_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_DEARM_STATUS, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(pool::P60DOCK_WDT_CNT_GND, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(pool::P60DOCK_WDT_CNT_I2C, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(pool::P60DOCK_WDT_CNT_CAN, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(pool::P60DOCK_WDT_CNT_CSP_1, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(pool::P60DOCK_WDT_CNT_CSP_2, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_WDT_CNT_GND, new PoolEntry<uint32_t>({0})); localDataPoolMap.emplace(pool::P60DOCK_WDT_GND_LEFT, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_WDT_CNT_I2C, new PoolEntry<uint32_t>({0})); localDataPoolMap.emplace(pool::P60DOCK_WDT_I2C_LEFT, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_WDT_CNT_CAN, new PoolEntry<uint32_t>({0})); localDataPoolMap.emplace(pool::P60DOCK_WDT_CAN_LEFT, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_WDT_CNT_CSP_1, new PoolEntry<uint32_t>({0})); localDataPoolMap.emplace(pool::P60DOCK_WDT_CSP_LEFT_1, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_WDT_CNT_CSP_2, new PoolEntry<uint32_t>({0})); localDataPoolMap.emplace(pool::P60DOCK_WDT_CSP_LEFT_2, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_WDT_GND_LEFT, new PoolEntry<uint32_t>({0})); localDataPoolMap.emplace(pool::P60DOCK_BATT_CHARGE_CURRENT, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_WDT_I2C_LEFT, new PoolEntry<uint32_t>({0})); localDataPoolMap.emplace(pool::P60DOCK_BATT_DISCHARGE_CURRENT, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_WDT_CAN_LEFT, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_WDT_CSP_LEFT_1, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_WDT_CSP_LEFT_2, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_BATT_CHARGE_CURRENT, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_BATT_DISCHARGE_CURRENT, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_ANT6_DEPL, new PoolEntry<int8_t>({0}));
localDataPoolMap.emplace(P60System::P60DOCK_AR6_DEPL, new PoolEntry<int8_t>({0}));
localDataPoolMap.emplace(pool::P60DOCK_ANT6_DEPL, new PoolEntry<int8_t>({0}));
localDataPoolMap.emplace(pool::P60DOCK_AR6_DEPL, new PoolEntry<int8_t>({0}));
poolManager.subscribeForPeriodicPacket(p60dockHkTableDataset.getSid(), false, 10.0, false);
return HasReturnvaluesIF::RETURN_OK; return HasReturnvaluesIF::RETURN_OK;
} }
@ -474,6 +294,7 @@ ReturnValue_t P60DockHandler::printStatus(DeviceCommandId_t cmd) {
} }
void P60DockHandler::printHkTableSwitchIV() { void P60DockHandler::printHkTableSwitchIV() {
using namespace P60Dock;
sif::info << "P60 Dock Info:" << std::endl; sif::info << "P60 Dock Info:" << std::endl;
sif::info << "Boot Cause: " << p60dockHkTableDataset.bootcause sif::info << "Boot Cause: " << p60dockHkTableDataset.bootcause
<< " | Boot Count: " << std::setw(4) << std::right << p60dockHkTableDataset.bootCount << " | Boot Count: " << std::setw(4) << std::right << p60dockHkTableDataset.bootCount
@ -488,70 +309,43 @@ void P60DockHandler::printHkTableSwitchIV() {
sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "BATT" << std::dec << "| -, " sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "BATT" << std::dec << "| -, "
<< std::setw(4) << std::right << p60dockHkTableDataset.batteryCurrent.value << ", " << std::setw(4) << std::right << p60dockHkTableDataset.batteryCurrent.value << ", "
<< std::setw(5) << p60dockHkTableDataset.batteryVoltage.value << std::endl; << 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 << "| " auto genericPrintoutHandler = [&](std::string name, uint8_t idx) {
<< unsigned(p60dockHkTableDataset.outputEnableStatePdu1Vcc.value) << ", " sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << name << std::dec << "| "
<< std::setw(4) << std::right << p60dockHkTableDataset.currentPdu1Vcc.value << ", " << unsigned(p60dockHkTableDataset.outputEnables[idx]) << ", " << std::setw(4)
<< std::setw(5) << p60dockHkTableDataset.voltagePdu1Vcc.value << std::endl; << std::right << p60dockHkTableDataset.currents[idx] << ", " << std::setw(5)
sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "PDU1 VBAT" << std::dec << "| " << p60dockHkTableDataset.voltages[idx] << std::endl;
<< unsigned(p60dockHkTableDataset.outputEnableStatePdu1Vbat.value) << ", " };
<< std::setw(4) << std::right << p60dockHkTableDataset.currentPdu1Vbat.value << ", "
<< std::setw(5) << p60dockHkTableDataset.voltagePdu1Vbat.value << std::endl;
sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "PDU2 VCC" << std::dec << "| " genericPrintoutHandler("ACU VCC", hk::ACU_VCC);
<< unsigned(p60dockHkTableDataset.outputEnableStatePdu2Vcc.value) << ", " genericPrintoutHandler("ACU VBAT", hk::ACU_VBAT);
<< std::setw(4) << std::right << p60dockHkTableDataset.currentPdu2Vcc.value << ", " genericPrintoutHandler("PDU1 VCC", hk::PDU1_VCC);
<< std::setw(5) << p60dockHkTableDataset.voltagePdu2Vcc.value << std::endl; genericPrintoutHandler("PDU1 VBAT", hk::PDU1_VBAT);
sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "PDU2 VBAT" << std::dec << "| " genericPrintoutHandler("PDU2 VCC", hk::PDU2_VCC);
<< unsigned(p60dockHkTableDataset.outputEnableStatePdu2Vbat.value) << ", " genericPrintoutHandler("PDU2 VBAT", hk::PDU2_VBAT);
<< std::setw(4) << std::right << p60dockHkTableDataset.currentPdu2Vbat.value << ", " genericPrintoutHandler("Stack VBAT", hk::STACK_VBAT);
<< std::setw(5) << p60dockHkTableDataset.voltagePdu2Vbat.value << std::endl; genericPrintoutHandler("Stack 3V3", hk::STACK_3V3);
sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "Stack VBAT" << std::dec << "| " genericPrintoutHandler("Stack 5V", hk::STACK_5V);
<< 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;
} }
void P60DockHandler::printHkTableLatchups() { void P60DockHandler::printHkTableLatchups() {
using namespace P60Dock;
sif::info << "P60 Latchup Information" << std::endl; sif::info << "P60 Latchup Information" << std::endl;
sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "ACU VCC" << std::dec << "| " auto genericPrintoutHandler = [&](std::string name, uint8_t idx) {
<< std::setw(4) << std::right << p60dockHkTableDataset.latchupsAcuVcc << std::endl; sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << name << std::dec << "| "
sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "ACU VBAT" << std::dec << "| " << std::setw(4) << std::right << p60dockHkTableDataset.latchups[idx] << std::endl;
<< std::setw(4) << std::right << p60dockHkTableDataset.latchupsAcuVbat << std::endl; };
sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "PDU1 VCC" << std::dec << "| " genericPrintoutHandler("ACU VCC", hk::ACU_VCC);
<< std::setw(4) << std::right << p60dockHkTableDataset.latchupsPdu1Vcc << std::endl; genericPrintoutHandler("ACU VBAT", hk::ACU_VBAT);
sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "PDU1 VBAT" << std::dec << "| " genericPrintoutHandler("PDU1 VCC", hk::PDU1_VCC);
<< std::setw(4) << std::right << p60dockHkTableDataset.latchupsPdu1Vbat << std::endl; genericPrintoutHandler("PDU1 VBAT", hk::PDU1_VBAT);
sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "PDU2 VCC" << std::dec << "| " genericPrintoutHandler("PDU2 VCC", hk::PDU2_VCC);
<< std::setw(4) << std::right << p60dockHkTableDataset.latchupsPdu2Vcc << std::endl; genericPrintoutHandler("PDU2 VBAT", hk::PDU2_VBAT);
sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "PDU2 VBAT" << std::dec << "| " genericPrintoutHandler("STACK VBAT", hk::STACK_VBAT);
<< std::setw(4) << std::right << p60dockHkTableDataset.latchupsPdu2Vbat << std::endl; genericPrintoutHandler("STACK 3V3", hk::STACK_3V3);
sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "Stack 3V3" << std::dec << "| " genericPrintoutHandler("STACK 5V", hk::STACK_5V);
<< std::setw(4) << std::right << p60dockHkTableDataset.latchupsStack3V3 << std::endl; genericPrintoutHandler("GS 3V3", hk::GS3V3);
sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "Stack 5V" << std::dec << "| " genericPrintoutHandler("GS 5V", hk::GS5V);
<< std::setw(4) << std::right << p60dockHkTableDataset.latchupsStack5V << std::endl; genericPrintoutHandler("X3 VBAT", hk::X3_IDLE_VBAT);
sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "GS 3V3" << std::dec << "| " genericPrintoutHandler("X3 VCC", hk::X3_IDLE_VCC);
<< 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;
} }

View File

@ -39,6 +39,13 @@ class P60DockHandler : public GomspaceDeviceHandler {
P60Dock::HkTableDataset p60dockHkTableDataset; P60Dock::HkTableDataset p60dockHkTableDataset;
static constexpr uint8_t MAX_CHANNEL_STR_WIDTH = 16; static constexpr uint8_t MAX_CHANNEL_STR_WIDTH = 16;
PoolEntry<int16_t> hkCurrents = PoolEntry<int16_t>(P60Dock::hk::CHNLS_LEN);
PoolEntry<uint16_t> hkVoltages = PoolEntry<uint16_t>(P60Dock::hk::CHNLS_LEN);
PoolEntry<uint8_t> outputEnables = PoolEntry<uint8_t>(P60Dock::hk::CHNLS_LEN);
PoolEntry<uint16_t> latchups = PoolEntry<uint16_t>(P60Dock::hk::CHNLS_LEN);
PoolEntry<uint8_t> devicesType = PoolEntry<uint8_t>(P60Dock::NUM_DEVS);
PoolEntry<uint8_t> devicesStatus = PoolEntry<uint8_t>(P60Dock::NUM_DEVS);
/** /**
* @brief Function extracts the hk table information from the received csp packet and stores * @brief Function extracts the hk table information from the received csp packet and stores
* the values in the p60dockHkTableDataset. * the values in the p60dockHkTableDataset.

View File

@ -376,221 +376,210 @@ object_id_t PCDUHandler::getObjectId() const { return SystemObject::getObjectId(
ReturnValue_t PCDUHandler::initializeLocalDataPool(localpool::DataPool& localDataPoolMap, ReturnValue_t PCDUHandler::initializeLocalDataPool(localpool::DataPool& localDataPoolMap,
LocalDataPoolManager& poolManager) { LocalDataPoolManager& poolManager) {
using namespace pcduSwitches; using namespace pcduSwitches;
localDataPoolMap.emplace(P60System::PDU2_CURRENT_OUT_Q7S, new PoolEntry<int16_t>({0})); using namespace P60System;
localDataPoolMap.emplace(P60System::PDU2_CURRENT_OUT_PAYLOAD_PCDU_CH1, localDataPoolMap.emplace(pool::PDU2_CURRENT_OUT_Q7S, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(pool::PDU2_CURRENT_OUT_PAYLOAD_PCDU_CH1, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(pool::PDU2_CURRENT_OUT_RW, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(pool::PDU2_CURRENT_OUT_TCS_BOARD_HEATER_IN, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(pool::PDU2_CURRENT_OUT_SUS_REDUNDANT, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(pool::PDU2_CURRENT_OUT_DEPLOYMENT_MECHANISM,
new PoolEntry<int16_t>({0})); new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_CURRENT_OUT_RW, new PoolEntry<int16_t>({0})); localDataPoolMap.emplace(pool::PDU2_CURRENT_OUT_PAYLOAD_PCDU_CH6, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_CURRENT_OUT_TCS_BOARD_HEATER_IN, localDataPoolMap.emplace(pool::PDU2_CURRENT_OUT_ACS_BOARD_SIDE_B, new PoolEntry<int16_t>({0}));
new PoolEntry<int16_t>({0})); localDataPoolMap.emplace(pool::PDU2_CURRENT_OUT_PAYLOAD_CAMERA, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_CURRENT_OUT_SUS_REDUNDANT, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_CURRENT_OUT_DEPLOYMENT_MECHANISM,
new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_CURRENT_OUT_PAYLOAD_PCDU_CH6,
new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_CURRENT_OUT_ACS_BOARD_SIDE_B,
new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_CURRENT_OUT_PAYLOAD_CAMERA, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_VOLTAGE_OUT_Q7S, new PoolEntry<int16_t>({0})); localDataPoolMap.emplace(pool::PDU2_VOLTAGE_OUT_Q7S, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_VOLTAGE_OUT_PAYLOAD_PCDU_CH1, localDataPoolMap.emplace(pool::PDU2_VOLTAGE_OUT_PAYLOAD_PCDU_CH1, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(pool::PDU2_VOLTAGE_OUT_RW, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(pool::PDU2_VOLTAGE_OUT_TCS_BOARD_HEATER_IN, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(pool::PDU2_VOLTAGE_OUT_SUS_REDUNDANT, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(pool::PDU2_VOLTAGE_OUT_DEPLOYMENT_MECHANISM,
new PoolEntry<int16_t>({0})); new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_VOLTAGE_OUT_RW, new PoolEntry<int16_t>({0})); localDataPoolMap.emplace(pool::PDU2_VOLTAGE_OUT_PAYLOAD_PCDU_CH6, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_VOLTAGE_OUT_TCS_BOARD_HEATER_IN, localDataPoolMap.emplace(pool::PDU2_VOLTAGE_OUT_ACS_BOARD_SIDE_B, new PoolEntry<int16_t>({0}));
new PoolEntry<int16_t>({0})); localDataPoolMap.emplace(pool::PDU2_VOLTAGE_OUT_PAYLOAD_CAMERA, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_VOLTAGE_OUT_SUS_REDUNDANT, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_VOLTAGE_OUT_DEPLOYMENT_MECHANISM,
new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_VOLTAGE_OUT_PAYLOAD_PCDU_CH6,
new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_VOLTAGE_OUT_ACS_BOARD_SIDE_B,
new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_VOLTAGE_OUT_PAYLOAD_CAMERA, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_VCC, new PoolEntry<int16_t>({0})); localDataPoolMap.emplace(pool::PDU2_VCC, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_VBAT, new PoolEntry<int16_t>({0})); localDataPoolMap.emplace(pool::PDU2_VBAT, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_TEMPERATURE, new PoolEntry<int16_t>({0})); localDataPoolMap.emplace(pool::PDU2_TEMPERATURE, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_CONV_EN_1, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(pool::PDU2_CONV_EN_1, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_CONV_EN_2, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(pool::PDU2_CONV_EN_2, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_CONV_EN_3, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(pool::PDU2_CONV_EN_3, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_OUT_EN_Q7S, localDataPoolMap.emplace(pool::PDU2_OUT_EN_Q7S,
new PoolEntry<uint8_t>({INIT_SWITCH_STATES[Switches::PDU2_CH0_Q7S]})); new PoolEntry<uint8_t>({INIT_SWITCH_STATES[Switches::PDU2_CH0_Q7S]}));
localDataPoolMap.emplace( localDataPoolMap.emplace(
P60System::PDU2_OUT_EN_PAYLOAD_PCDU_CH1, pool::PDU2_OUT_EN_PAYLOAD_PCDU_CH1,
new PoolEntry<uint8_t>({INIT_SWITCH_STATES[Switches::PDU2_CH1_PL_PCDU_BATT_0_14V8]})); new PoolEntry<uint8_t>({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<uint8_t>({INIT_SWITCH_STATES[Switches::PDU2_CH2_RW_5V]})); new PoolEntry<uint8_t>({INIT_SWITCH_STATES[Switches::PDU2_CH2_RW_5V]}));
#ifdef TE0720_1CFA #ifdef TE0720_1CFA
localDataPoolMap.emplace(P60System::PDU2_OUT_EN_TCS_BOARD_HEATER_IN, new PoolEntry<uint8_t>({1})); localDataPoolMap.emplace(pool::PDU2_OUT_EN_TCS_BOARD_HEATER_IN, new PoolEntry<uint8_t>({1}));
#else #else
localDataPoolMap.emplace( localDataPoolMap.emplace(
P60System::PDU2_OUT_EN_TCS_BOARD_HEATER_IN, pool::PDU2_OUT_EN_TCS_BOARD_HEATER_IN,
new PoolEntry<uint8_t>({INIT_SWITCH_STATES[Switches::PDU2_CH3_TCS_BOARD_HEATER_IN_8V]})); new PoolEntry<uint8_t>({INIT_SWITCH_STATES[Switches::PDU2_CH3_TCS_BOARD_HEATER_IN_8V]}));
#endif #endif
localDataPoolMap.emplace( localDataPoolMap.emplace(
P60System::PDU2_OUT_EN_SUS_REDUNDANT, pool::PDU2_OUT_EN_SUS_REDUNDANT,
new PoolEntry<uint8_t>({INIT_SWITCH_STATES[Switches::PDU2_CH4_SUS_REDUNDANT_3V3]})); new PoolEntry<uint8_t>({INIT_SWITCH_STATES[Switches::PDU2_CH4_SUS_REDUNDANT_3V3]}));
localDataPoolMap.emplace( localDataPoolMap.emplace(
P60System::PDU2_OUT_EN_DEPLOYMENT_MECHANISM, pool::PDU2_OUT_EN_DEPLOYMENT_MECHANISM,
new PoolEntry<uint8_t>({INIT_SWITCH_STATES[Switches::PDU2_CH5_DEPLOYMENT_MECHANISM_8V]})); new PoolEntry<uint8_t>({INIT_SWITCH_STATES[Switches::PDU2_CH5_DEPLOYMENT_MECHANISM_8V]}));
localDataPoolMap.emplace( localDataPoolMap.emplace(
P60System::PDU2_OUT_EN_PAYLOAD_PCDU_CH6, pool::PDU2_OUT_EN_PAYLOAD_PCDU_CH6,
new PoolEntry<uint8_t>({INIT_SWITCH_STATES[Switches::PDU2_CH6_PL_PCDU_BATT_1_14V8]})); new PoolEntry<uint8_t>({INIT_SWITCH_STATES[Switches::PDU2_CH6_PL_PCDU_BATT_1_14V8]}));
localDataPoolMap.emplace( localDataPoolMap.emplace(
P60System::PDU2_OUT_EN_ACS_BOARD_SIDE_B, pool::PDU2_OUT_EN_ACS_BOARD_SIDE_B,
new PoolEntry<uint8_t>({INIT_SWITCH_STATES[Switches::PDU2_CH7_ACS_BOARD_SIDE_B_3V3]})); new PoolEntry<uint8_t>({INIT_SWITCH_STATES[Switches::PDU2_CH7_ACS_BOARD_SIDE_B_3V3]}));
localDataPoolMap.emplace( localDataPoolMap.emplace(
P60System::PDU2_OUT_EN_PAYLOAD_CAMERA, pool::PDU2_OUT_EN_PAYLOAD_CAMERA,
new PoolEntry<uint8_t>({INIT_SWITCH_STATES[Switches::PDU2_CH8_PAYLOAD_CAMERA]})); new PoolEntry<uint8_t>({INIT_SWITCH_STATES[Switches::PDU2_CH8_PAYLOAD_CAMERA]}));
localDataPoolMap.emplace(P60System::PDU2_BOOTCAUSE, new PoolEntry<uint32_t>({0})); localDataPoolMap.emplace(pool::PDU2_BOOTCAUSE, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_BOOTCNT, new PoolEntry<uint32_t>({0})); localDataPoolMap.emplace(pool::PDU2_BOOTCNT, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_UPTIME, new PoolEntry<uint32_t>({0})); localDataPoolMap.emplace(pool::PDU2_UPTIME, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_RESETCAUSE, new PoolEntry<uint16_t>({0})); localDataPoolMap.emplace(pool::PDU2_RESETCAUSE, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_BATT_MODE, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(pool::PDU2_BATT_MODE, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_LATCHUP_Q7S, new PoolEntry<uint16_t>({0})); localDataPoolMap.emplace(pool::PDU2_LATCHUP_Q7S, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_LATCHUP_PAYLOAD_PCDU_CH1, new PoolEntry<uint16_t>({0})); localDataPoolMap.emplace(pool::PDU2_LATCHUP_PAYLOAD_PCDU_CH1, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_LATCHUP_RW, new PoolEntry<uint16_t>({0})); localDataPoolMap.emplace(pool::PDU2_LATCHUP_RW, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_LATCHUP_TCS_BOARD_HEATER_IN, localDataPoolMap.emplace(pool::PDU2_LATCHUP_TCS_BOARD_HEATER_IN, new PoolEntry<uint16_t>({0}));
new PoolEntry<uint16_t>({0})); localDataPoolMap.emplace(pool::PDU2_LATCHUP_TCS_BOARD_HEATER_IN, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_LATCHUP_TCS_BOARD_HEATER_IN, localDataPoolMap.emplace(pool::PDU2_LATCHUP_SUS_REDUNDANT, new PoolEntry<uint16_t>({0}));
new PoolEntry<uint16_t>({0})); localDataPoolMap.emplace(pool::PDU2_LATCHUP_DEPLOYMENT_MECHANISM, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_LATCHUP_SUS_REDUNDANT, new PoolEntry<uint16_t>({0})); localDataPoolMap.emplace(pool::PDU2_LATCHUP_PAYLOAD_PCDU_CH6, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_LATCHUP_DEPLOYMENT_MECHANISM, localDataPoolMap.emplace(pool::PDU2_LATCHUP_ACS_BOARD_SIDE_B, new PoolEntry<uint16_t>({0}));
new PoolEntry<uint16_t>({0})); localDataPoolMap.emplace(pool::PDU2_LATCHUP_PAYLOAD_CAMERA, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_LATCHUP_PAYLOAD_PCDU_CH6, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_LATCHUP_ACS_BOARD_SIDE_B, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_LATCHUP_PAYLOAD_CAMERA, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_DEVICE_0, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(pool::PDU2_DEVICE_0, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_DEVICE_1, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(pool::PDU2_DEVICE_1, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_DEVICE_2, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(pool::PDU2_DEVICE_2, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_DEVICE_3, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(pool::PDU2_DEVICE_3, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_DEVICE_4, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(pool::PDU2_DEVICE_4, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_DEVICE_5, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(pool::PDU2_DEVICE_5, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_DEVICE_6, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(pool::PDU2_DEVICE_6, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_DEVICE_7, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(pool::PDU2_DEVICE_7, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_DEVICE_0_STATUS, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(pool::PDU2_DEVICE_0_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_DEVICE_1_STATUS, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(pool::PDU2_DEVICE_1_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_DEVICE_2_STATUS, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(pool::PDU2_DEVICE_2_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_DEVICE_3_STATUS, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(pool::PDU2_DEVICE_3_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_DEVICE_4_STATUS, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(pool::PDU2_DEVICE_4_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_DEVICE_5_STATUS, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(pool::PDU2_DEVICE_5_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_DEVICE_6_STATUS, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(pool::PDU2_DEVICE_6_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_DEVICE_7_STATUS, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(pool::PDU2_DEVICE_7_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_WDT_CNT_GND, new PoolEntry<uint32_t>({0})); localDataPoolMap.emplace(pool::PDU2_WDT_CNT_GND, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_WDT_CNT_I2C, new PoolEntry<uint32_t>({0})); localDataPoolMap.emplace(pool::PDU2_WDT_CNT_I2C, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_WDT_CNT_CAN, new PoolEntry<uint32_t>({0})); localDataPoolMap.emplace(pool::PDU2_WDT_CNT_CAN, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_WDT_CNT_CSP1, new PoolEntry<uint32_t>({0})); localDataPoolMap.emplace(pool::PDU2_WDT_CNT_CSP1, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_WDT_CNT_CSP2, new PoolEntry<uint32_t>({0})); localDataPoolMap.emplace(pool::PDU2_WDT_CNT_CSP2, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_WDT_GND_LEFT, new PoolEntry<uint32_t>({0})); localDataPoolMap.emplace(pool::PDU2_WDT_GND_LEFT, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_WDT_I2C_LEFT, new PoolEntry<uint32_t>({0})); localDataPoolMap.emplace(pool::PDU2_WDT_I2C_LEFT, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_WDT_CAN_LEFT, new PoolEntry<uint32_t>({0})); localDataPoolMap.emplace(pool::PDU2_WDT_CAN_LEFT, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_WDT_CSP_LEFT1, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(pool::PDU2_WDT_CSP_LEFT1, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_WDT_CSP_LEFT2, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(pool::PDU2_WDT_CSP_LEFT2, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_CURRENT_OUT_TCS_BOARD_3V3, new PoolEntry<int16_t>({0})); localDataPoolMap.emplace(pool::PDU1_CURRENT_OUT_TCS_BOARD_3V3, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_CURRENT_OUT_SYRLINKS, new PoolEntry<int16_t>({0})); localDataPoolMap.emplace(pool::PDU1_CURRENT_OUT_SYRLINKS, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_CURRENT_OUT_STAR_TRACKER, new PoolEntry<int16_t>({0})); localDataPoolMap.emplace(pool::PDU1_CURRENT_OUT_STAR_TRACKER, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_CURRENT_OUT_MGT, new PoolEntry<int16_t>({0})); localDataPoolMap.emplace(pool::PDU1_CURRENT_OUT_MGT, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_CURRENT_OUT_SUS_NOMINAL, new PoolEntry<int16_t>({0})); localDataPoolMap.emplace(pool::PDU1_CURRENT_OUT_SUS_NOMINAL, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_CURRENT_OUT_SOLAR_CELL_EXP, new PoolEntry<int16_t>({0})); localDataPoolMap.emplace(pool::PDU1_CURRENT_OUT_SOLAR_CELL_EXP, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_CURRENT_OUT_PLOC, new PoolEntry<int16_t>({0})); localDataPoolMap.emplace(pool::PDU1_CURRENT_OUT_PLOC, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_CURRENT_OUT_ACS_BOARD_SIDE_A, localDataPoolMap.emplace(pool::PDU1_CURRENT_OUT_ACS_BOARD_SIDE_A, new PoolEntry<int16_t>({0}));
new PoolEntry<int16_t>({0})); localDataPoolMap.emplace(pool::PDU1_CURRENT_OUT_CHANNEL8, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_CURRENT_OUT_CHANNEL8, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace( localDataPoolMap.emplace(
P60System::PDU1_VOLTAGE_OUT_TCS_BOARD_3V3, pool::PDU1_VOLTAGE_OUT_TCS_BOARD_3V3,
new PoolEntry<int16_t>({INIT_SWITCH_STATES[Switches::PDU1_CH0_TCS_BOARD_3V3]})); new PoolEntry<int16_t>({INIT_SWITCH_STATES[Switches::PDU1_CH0_TCS_BOARD_3V3]}));
localDataPoolMap.emplace( localDataPoolMap.emplace(
P60System::PDU1_VOLTAGE_OUT_SYRLINKS, pool::PDU1_VOLTAGE_OUT_SYRLINKS,
new PoolEntry<int16_t>({INIT_SWITCH_STATES[Switches::PDU1_CH1_SYRLINKS_12V]})); new PoolEntry<int16_t>({INIT_SWITCH_STATES[Switches::PDU1_CH1_SYRLINKS_12V]}));
localDataPoolMap.emplace( localDataPoolMap.emplace(
P60System::PDU1_VOLTAGE_OUT_STAR_TRACKER, pool::PDU1_VOLTAGE_OUT_STAR_TRACKER,
new PoolEntry<int16_t>({INIT_SWITCH_STATES[Switches::PDU1_CH2_STAR_TRACKER_5V]})); new PoolEntry<int16_t>({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<int16_t>({INIT_SWITCH_STATES[Switches::PDU1_CH3_MGT_5V]})); new PoolEntry<int16_t>({INIT_SWITCH_STATES[Switches::PDU1_CH3_MGT_5V]}));
localDataPoolMap.emplace( localDataPoolMap.emplace(
P60System::PDU1_VOLTAGE_OUT_SUS_NOMINAL, pool::PDU1_VOLTAGE_OUT_SUS_NOMINAL,
new PoolEntry<int16_t>({INIT_SWITCH_STATES[Switches::PDU1_CH4_SUS_NOMINAL_3V3]})); new PoolEntry<int16_t>({INIT_SWITCH_STATES[Switches::PDU1_CH4_SUS_NOMINAL_3V3]}));
localDataPoolMap.emplace( localDataPoolMap.emplace(
P60System::PDU1_VOLTAGE_OUT_SOLAR_CELL_EXP, pool::PDU1_VOLTAGE_OUT_SOLAR_CELL_EXP,
new PoolEntry<int16_t>({INIT_SWITCH_STATES[Switches::PDU1_CH5_SOLAR_CELL_EXP_5V]})); new PoolEntry<int16_t>({INIT_SWITCH_STATES[Switches::PDU1_CH5_SOLAR_CELL_EXP_5V]}));
localDataPoolMap.emplace( localDataPoolMap.emplace(
P60System::PDU1_VOLTAGE_OUT_PLOC, pool::PDU1_VOLTAGE_OUT_PLOC,
new PoolEntry<int16_t>({INIT_SWITCH_STATES[Switches::PDU1_CH6_PLOC_12V]})); new PoolEntry<int16_t>({INIT_SWITCH_STATES[Switches::PDU1_CH6_PLOC_12V]}));
localDataPoolMap.emplace( localDataPoolMap.emplace(
P60System::PDU1_VOLTAGE_OUT_ACS_BOARD_SIDE_A, pool::PDU1_VOLTAGE_OUT_ACS_BOARD_SIDE_A,
new PoolEntry<int16_t>({INIT_SWITCH_STATES[Switches::PDU1_CH7_ACS_A_SIDE_3V3]})); new PoolEntry<int16_t>({INIT_SWITCH_STATES[Switches::PDU1_CH7_ACS_A_SIDE_3V3]}));
localDataPoolMap.emplace( localDataPoolMap.emplace(
P60System::PDU1_VOLTAGE_OUT_CHANNEL8, pool::PDU1_VOLTAGE_OUT_CHANNEL8,
new PoolEntry<int16_t>({INIT_SWITCH_STATES[Switches::PDU1_CH8_UNOCCUPIED]})); new PoolEntry<int16_t>({INIT_SWITCH_STATES[Switches::PDU1_CH8_UNOCCUPIED]}));
localDataPoolMap.emplace(P60System::PDU1_VCC, new PoolEntry<int16_t>({0})); localDataPoolMap.emplace(pool::PDU1_VCC, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_VBAT, new PoolEntry<int16_t>({0})); localDataPoolMap.emplace(pool::PDU1_VBAT, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_TEMPERATURE, new PoolEntry<int16_t>({0})); localDataPoolMap.emplace(pool::PDU1_TEMPERATURE, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_CONV_EN_1, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(pool::PDU1_CONV_EN_1, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_CONV_EN_2, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(pool::PDU1_CONV_EN_2, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_CONV_EN_3, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(pool::PDU1_CONV_EN_3, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_OUT_EN_TCS_BOARD_3V3, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(pool::PDU1_OUT_EN_TCS_BOARD_3V3, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_OUT_EN_SYRLINKS, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(pool::PDU1_OUT_EN_SYRLINKS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_OUT_EN_STAR_TRACKER, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(pool::PDU1_OUT_EN_STAR_TRACKER, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_OUT_EN_MGT, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(pool::PDU1_OUT_EN_MGT, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_OUT_EN_SUS_NOMINAL, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(pool::PDU1_OUT_EN_SUS_NOMINAL, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_OUT_EN_SOLAR_CELL_EXP, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(pool::PDU1_OUT_EN_SOLAR_CELL_EXP, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_OUT_EN_PLOC, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(pool::PDU1_OUT_EN_PLOC, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_OUT_EN_ACS_BOARD_SIDE_A, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(pool::PDU1_OUT_EN_ACS_BOARD_SIDE_A, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_OUT_EN_CHANNEL8, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(pool::PDU1_OUT_EN_CHANNEL8, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_BOOTCAUSE, new PoolEntry<uint32_t>({0})); localDataPoolMap.emplace(pool::PDU1_BOOTCAUSE, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_BOOTCNT, new PoolEntry<uint32_t>({0})); localDataPoolMap.emplace(pool::PDU1_BOOTCNT, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_UPTIME, new PoolEntry<uint32_t>({0})); localDataPoolMap.emplace(pool::PDU1_UPTIME, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_RESETCAUSE, new PoolEntry<uint16_t>({0})); localDataPoolMap.emplace(pool::PDU1_RESETCAUSE, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_BATT_MODE, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(pool::PDU1_BATT_MODE, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_LATCHUP_TCS_BOARD_3V3, new PoolEntry<uint16_t>({0})); localDataPoolMap.emplace(pool::PDU1_LATCHUP_TCS_BOARD_3V3, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_LATCHUP_SYRLINKS, new PoolEntry<uint16_t>({0})); localDataPoolMap.emplace(pool::PDU1_LATCHUP_SYRLINKS, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_LATCHUP_STAR_TRACKER, new PoolEntry<uint16_t>({0})); localDataPoolMap.emplace(pool::PDU1_LATCHUP_STAR_TRACKER, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_LATCHUP_MGT, new PoolEntry<uint16_t>({0})); localDataPoolMap.emplace(pool::PDU1_LATCHUP_MGT, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_LATCHUP_SUS_NOMINAL, new PoolEntry<uint16_t>({0})); localDataPoolMap.emplace(pool::PDU1_LATCHUP_SUS_NOMINAL, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_LATCHUP_SOLAR_CELL_EXP, new PoolEntry<uint16_t>({0})); localDataPoolMap.emplace(pool::PDU1_LATCHUP_SOLAR_CELL_EXP, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_LATCHUP_PLOC, new PoolEntry<uint16_t>({0})); localDataPoolMap.emplace(pool::PDU1_LATCHUP_PLOC, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_LATCHUP_ACS_BOARD_SIDE_A, new PoolEntry<uint16_t>({0})); localDataPoolMap.emplace(pool::PDU1_LATCHUP_ACS_BOARD_SIDE_A, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_LATCHUP_CHANNEL8, new PoolEntry<uint16_t>({0})); localDataPoolMap.emplace(pool::PDU1_LATCHUP_CHANNEL8, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_DEVICE_0, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(pool::PDU1_DEVICE_0, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_DEVICE_1, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(pool::PDU1_DEVICE_1, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_DEVICE_2, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(pool::PDU1_DEVICE_2, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_DEVICE_3, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(pool::PDU1_DEVICE_3, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_DEVICE_4, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(pool::PDU1_DEVICE_4, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_DEVICE_5, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(pool::PDU1_DEVICE_5, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_DEVICE_6, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(pool::PDU1_DEVICE_6, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_DEVICE_7, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(pool::PDU1_DEVICE_7, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_DEVICE_0_STATUS, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(pool::PDU1_DEVICE_0_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_DEVICE_1_STATUS, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(pool::PDU1_DEVICE_1_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_DEVICE_2_STATUS, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(pool::PDU1_DEVICE_2_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_DEVICE_3_STATUS, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(pool::PDU1_DEVICE_3_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_DEVICE_4_STATUS, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(pool::PDU1_DEVICE_4_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_DEVICE_5_STATUS, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(pool::PDU1_DEVICE_5_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_DEVICE_6_STATUS, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(pool::PDU1_DEVICE_6_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_DEVICE_7_STATUS, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(pool::PDU1_DEVICE_7_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_WDT_CNT_GND, new PoolEntry<uint32_t>({0})); localDataPoolMap.emplace(pool::PDU1_WDT_CNT_GND, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_WDT_CNT_I2C, new PoolEntry<uint32_t>({0})); localDataPoolMap.emplace(pool::PDU1_WDT_CNT_I2C, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_WDT_CNT_CAN, new PoolEntry<uint32_t>({0})); localDataPoolMap.emplace(pool::PDU1_WDT_CNT_CAN, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_WDT_CNT_CSP1, new PoolEntry<uint32_t>({0})); localDataPoolMap.emplace(pool::PDU1_WDT_CNT_CSP1, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_WDT_CNT_CSP2, new PoolEntry<uint32_t>({0})); localDataPoolMap.emplace(pool::PDU1_WDT_CNT_CSP2, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_WDT_GND_LEFT, new PoolEntry<uint32_t>({0})); localDataPoolMap.emplace(pool::PDU1_WDT_GND_LEFT, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_WDT_I2C_LEFT, new PoolEntry<uint32_t>({0})); localDataPoolMap.emplace(pool::PDU1_WDT_I2C_LEFT, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_WDT_CAN_LEFT, new PoolEntry<uint32_t>({0})); localDataPoolMap.emplace(pool::PDU1_WDT_CAN_LEFT, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_WDT_CSP_LEFT1, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(pool::PDU1_WDT_CSP_LEFT1, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_WDT_CSP_LEFT2, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(pool::PDU1_WDT_CSP_LEFT2, new PoolEntry<uint8_t>({0}));
return HasReturnvaluesIF::RETURN_OK; return HasReturnvaluesIF::RETURN_OK;
} }

View File

@ -329,92 +329,104 @@ void PDU1Handler::parseHkTableReply(const uint8_t *packet) {
ReturnValue_t PDU1Handler::initializeLocalDataPool(localpool::DataPool &localDataPoolMap, ReturnValue_t PDU1Handler::initializeLocalDataPool(localpool::DataPool &localDataPoolMap,
LocalDataPoolManager &poolManager) { LocalDataPoolManager &poolManager) {
localDataPoolMap.emplace(P60System::PDU1_CURRENT_OUT_TCS_BOARD_3V3, new PoolEntry<int16_t>({0})); localDataPoolMap.emplace(P60System::pool::PDU1_CURRENT_OUT_TCS_BOARD_3V3,
localDataPoolMap.emplace(P60System::PDU1_CURRENT_OUT_SYRLINKS, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_CURRENT_OUT_STAR_TRACKER, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_CURRENT_OUT_MGT, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_CURRENT_OUT_SUS_NOMINAL, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_CURRENT_OUT_SOLAR_CELL_EXP, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_CURRENT_OUT_PLOC, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_CURRENT_OUT_ACS_BOARD_SIDE_A,
new PoolEntry<int16_t>({0})); new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_CURRENT_OUT_CHANNEL8, new PoolEntry<int16_t>({0})); localDataPoolMap.emplace(P60System::pool::PDU1_CURRENT_OUT_SYRLINKS, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU1_CURRENT_OUT_STAR_TRACKER,
localDataPoolMap.emplace(P60System::PDU1_VOLTAGE_OUT_TCS_BOARD_3V3, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_VOLTAGE_OUT_SYRLINKS, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_VOLTAGE_OUT_STAR_TRACKER, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_VOLTAGE_OUT_MGT, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_VOLTAGE_OUT_SUS_NOMINAL, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_VOLTAGE_OUT_SOLAR_CELL_EXP, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_VOLTAGE_OUT_PLOC, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_VOLTAGE_OUT_ACS_BOARD_SIDE_A,
new PoolEntry<int16_t>({0})); new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_VOLTAGE_OUT_CHANNEL8, new PoolEntry<int16_t>({0})); localDataPoolMap.emplace(P60System::pool::PDU1_CURRENT_OUT_MGT, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU1_CURRENT_OUT_SUS_NOMINAL,
new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU1_CURRENT_OUT_SOLAR_CELL_EXP,
new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU1_CURRENT_OUT_PLOC, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU1_CURRENT_OUT_ACS_BOARD_SIDE_A,
new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU1_CURRENT_OUT_CHANNEL8, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_VCC, new PoolEntry<int16_t>({0})); localDataPoolMap.emplace(P60System::pool::PDU1_VOLTAGE_OUT_TCS_BOARD_3V3,
localDataPoolMap.emplace(P60System::PDU1_VBAT, new PoolEntry<int16_t>({0})); new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_TEMPERATURE, new PoolEntry<int16_t>({0})); localDataPoolMap.emplace(P60System::pool::PDU1_VOLTAGE_OUT_SYRLINKS, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_CONV_EN_1, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(P60System::pool::PDU1_VOLTAGE_OUT_STAR_TRACKER,
localDataPoolMap.emplace(P60System::PDU1_CONV_EN_2, new PoolEntry<uint8_t>({0})); new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_CONV_EN_3, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(P60System::pool::PDU1_VOLTAGE_OUT_MGT, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU1_VOLTAGE_OUT_SUS_NOMINAL,
new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU1_VOLTAGE_OUT_SOLAR_CELL_EXP,
new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU1_VOLTAGE_OUT_PLOC, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU1_VOLTAGE_OUT_ACS_BOARD_SIDE_A,
new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU1_VOLTAGE_OUT_CHANNEL8, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_OUT_EN_TCS_BOARD_3V3, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(P60System::pool::PDU1_VCC, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_OUT_EN_SYRLINKS, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(P60System::pool::PDU1_VBAT, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_OUT_EN_STAR_TRACKER, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(P60System::pool::PDU1_TEMPERATURE, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_OUT_EN_MGT, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(P60System::pool::PDU1_CONV_EN_1, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_OUT_EN_SUS_NOMINAL, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(P60System::pool::PDU1_CONV_EN_2, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_OUT_EN_SOLAR_CELL_EXP, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(P60System::pool::PDU1_CONV_EN_3, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_OUT_EN_PLOC, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_OUT_EN_ACS_BOARD_SIDE_A, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_OUT_EN_CHANNEL8, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_BOOTCAUSE, new PoolEntry<uint32_t>({0})); localDataPoolMap.emplace(P60System::pool::PDU1_OUT_EN_TCS_BOARD_3V3, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_BOOTCNT, new PoolEntry<uint32_t>({0})); localDataPoolMap.emplace(P60System::pool::PDU1_OUT_EN_SYRLINKS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_UPTIME, new PoolEntry<uint32_t>({0})); localDataPoolMap.emplace(P60System::pool::PDU1_OUT_EN_STAR_TRACKER, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_RESETCAUSE, new PoolEntry<uint16_t>({0})); localDataPoolMap.emplace(P60System::pool::PDU1_OUT_EN_MGT, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_BATT_MODE, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(P60System::pool::PDU1_OUT_EN_SUS_NOMINAL, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU1_OUT_EN_SOLAR_CELL_EXP,
new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU1_OUT_EN_PLOC, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU1_OUT_EN_ACS_BOARD_SIDE_A,
new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU1_OUT_EN_CHANNEL8, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_LATCHUP_TCS_BOARD_3V3, new PoolEntry<uint16_t>({0})); localDataPoolMap.emplace(P60System::pool::PDU1_BOOTCAUSE, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_LATCHUP_SYRLINKS, new PoolEntry<uint16_t>({0})); localDataPoolMap.emplace(P60System::pool::PDU1_BOOTCNT, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_LATCHUP_STAR_TRACKER, new PoolEntry<uint16_t>({0})); localDataPoolMap.emplace(P60System::pool::PDU1_UPTIME, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_LATCHUP_MGT, new PoolEntry<uint16_t>({0})); localDataPoolMap.emplace(P60System::pool::PDU1_RESETCAUSE, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_LATCHUP_SUS_NOMINAL, new PoolEntry<uint16_t>({0})); localDataPoolMap.emplace(P60System::pool::PDU1_BATT_MODE, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_LATCHUP_SOLAR_CELL_EXP, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_LATCHUP_PLOC, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_LATCHUP_ACS_BOARD_SIDE_A, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_LATCHUP_CHANNEL8, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_DEVICE_0, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(P60System::pool::PDU1_LATCHUP_TCS_BOARD_3V3,
localDataPoolMap.emplace(P60System::PDU1_DEVICE_1, new PoolEntry<uint8_t>({0})); new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_DEVICE_2, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(P60System::pool::PDU1_LATCHUP_SYRLINKS, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_DEVICE_3, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(P60System::pool::PDU1_LATCHUP_STAR_TRACKER,
localDataPoolMap.emplace(P60System::PDU1_DEVICE_4, new PoolEntry<uint8_t>({0})); new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_DEVICE_5, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(P60System::pool::PDU1_LATCHUP_MGT, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_DEVICE_6, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(P60System::pool::PDU1_LATCHUP_SUS_NOMINAL, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_DEVICE_7, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(P60System::pool::PDU1_LATCHUP_SOLAR_CELL_EXP,
new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU1_LATCHUP_PLOC, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU1_LATCHUP_ACS_BOARD_SIDE_A,
new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU1_LATCHUP_CHANNEL8, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_DEVICE_0_STATUS, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(P60System::pool::PDU1_DEVICE_0, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_DEVICE_1_STATUS, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(P60System::pool::PDU1_DEVICE_1, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_DEVICE_2_STATUS, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(P60System::pool::PDU1_DEVICE_2, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_DEVICE_3_STATUS, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(P60System::pool::PDU1_DEVICE_3, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_DEVICE_4_STATUS, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(P60System::pool::PDU1_DEVICE_4, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_DEVICE_5_STATUS, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(P60System::pool::PDU1_DEVICE_5, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_DEVICE_6_STATUS, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(P60System::pool::PDU1_DEVICE_6, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_DEVICE_7_STATUS, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(P60System::pool::PDU1_DEVICE_7, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_WDT_CNT_GND, new PoolEntry<uint32_t>({0})); localDataPoolMap.emplace(P60System::pool::PDU1_DEVICE_0_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_WDT_CNT_I2C, new PoolEntry<uint32_t>({0})); localDataPoolMap.emplace(P60System::pool::PDU1_DEVICE_1_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_WDT_CNT_CAN, new PoolEntry<uint32_t>({0})); localDataPoolMap.emplace(P60System::pool::PDU1_DEVICE_2_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_WDT_CNT_CSP1, new PoolEntry<uint32_t>({0})); localDataPoolMap.emplace(P60System::pool::PDU1_DEVICE_3_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_WDT_CNT_CSP2, new PoolEntry<uint32_t>({0})); localDataPoolMap.emplace(P60System::pool::PDU1_DEVICE_4_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_WDT_GND_LEFT, new PoolEntry<uint32_t>({0})); localDataPoolMap.emplace(P60System::pool::PDU1_DEVICE_5_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_WDT_I2C_LEFT, new PoolEntry<uint32_t>({0})); localDataPoolMap.emplace(P60System::pool::PDU1_DEVICE_6_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_WDT_CAN_LEFT, new PoolEntry<uint32_t>({0})); localDataPoolMap.emplace(P60System::pool::PDU1_DEVICE_7_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_WDT_CSP_LEFT1, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU1_WDT_CSP_LEFT2, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(P60System::pool::PDU1_WDT_CNT_GND, new PoolEntry<uint32_t>({0}));
#if OBSW_ENABLE_PERIODIC_HK == 1 localDataPoolMap.emplace(P60System::pool::PDU1_WDT_CNT_I2C, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU1_WDT_CNT_CAN, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU1_WDT_CNT_CSP1, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU1_WDT_CNT_CSP2, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU1_WDT_GND_LEFT, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU1_WDT_I2C_LEFT, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU1_WDT_CAN_LEFT, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU1_WDT_CSP_LEFT1, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU1_WDT_CSP_LEFT2, new PoolEntry<uint8_t>({0}));
poolManager.subscribeForPeriodicPacket(pdu1HkTableDataset.getSid(), false, 0.4, true); poolManager.subscribeForPeriodicPacket(pdu1HkTableDataset.getSid(), false, 0.4, true);
#endif
return HasReturnvaluesIF::RETURN_OK; return HasReturnvaluesIF::RETURN_OK;
} }

View File

@ -266,104 +266,94 @@ void PDU2Handler::parseHkTableReply(const uint8_t *packet) {
ReturnValue_t PDU2Handler::initializeLocalDataPool(localpool::DataPool &localDataPoolMap, ReturnValue_t PDU2Handler::initializeLocalDataPool(localpool::DataPool &localDataPoolMap,
LocalDataPoolManager &poolManager) { LocalDataPoolManager &poolManager) {
localDataPoolMap.emplace(P60System::PDU2_CURRENT_OUT_Q7S, new PoolEntry<int16_t>({0})); using namespace P60System;
localDataPoolMap.emplace(P60System::PDU2_CURRENT_OUT_PAYLOAD_PCDU_CH1, localDataPoolMap.emplace(pool::PDU2_CURRENT_OUT_Q7S, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(pool::PDU2_CURRENT_OUT_PAYLOAD_PCDU_CH1, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(pool::PDU2_CURRENT_OUT_RW, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(pool::PDU2_CURRENT_OUT_TCS_BOARD_HEATER_IN, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(pool::PDU2_CURRENT_OUT_SUS_REDUNDANT, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(pool::PDU2_CURRENT_OUT_DEPLOYMENT_MECHANISM,
new PoolEntry<int16_t>({0})); new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_CURRENT_OUT_RW, new PoolEntry<int16_t>({0})); localDataPoolMap.emplace(pool::PDU2_CURRENT_OUT_PAYLOAD_PCDU_CH6, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_CURRENT_OUT_TCS_BOARD_HEATER_IN, localDataPoolMap.emplace(pool::PDU2_CURRENT_OUT_ACS_BOARD_SIDE_B, new PoolEntry<int16_t>({0}));
new PoolEntry<int16_t>({0})); localDataPoolMap.emplace(pool::PDU2_CURRENT_OUT_PAYLOAD_CAMERA, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_CURRENT_OUT_SUS_REDUNDANT, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_CURRENT_OUT_DEPLOYMENT_MECHANISM,
new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_CURRENT_OUT_PAYLOAD_PCDU_CH6,
new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_CURRENT_OUT_ACS_BOARD_SIDE_B,
new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_CURRENT_OUT_PAYLOAD_CAMERA, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_VOLTAGE_OUT_Q7S, new PoolEntry<int16_t>({0})); localDataPoolMap.emplace(pool::PDU2_VOLTAGE_OUT_Q7S, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_VOLTAGE_OUT_PAYLOAD_PCDU_CH1, localDataPoolMap.emplace(pool::PDU2_VOLTAGE_OUT_PAYLOAD_PCDU_CH1, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(pool::PDU2_VOLTAGE_OUT_RW, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(pool::PDU2_VOLTAGE_OUT_TCS_BOARD_HEATER_IN, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(pool::PDU2_VOLTAGE_OUT_SUS_REDUNDANT, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(pool::PDU2_VOLTAGE_OUT_DEPLOYMENT_MECHANISM,
new PoolEntry<int16_t>({0})); new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_VOLTAGE_OUT_RW, new PoolEntry<int16_t>({0})); localDataPoolMap.emplace(pool::PDU2_VOLTAGE_OUT_PAYLOAD_PCDU_CH6, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_VOLTAGE_OUT_TCS_BOARD_HEATER_IN, localDataPoolMap.emplace(pool::PDU2_VOLTAGE_OUT_ACS_BOARD_SIDE_B, new PoolEntry<int16_t>({0}));
new PoolEntry<int16_t>({0})); localDataPoolMap.emplace(pool::PDU2_VOLTAGE_OUT_PAYLOAD_CAMERA, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_VOLTAGE_OUT_SUS_REDUNDANT, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_VOLTAGE_OUT_DEPLOYMENT_MECHANISM,
new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_VOLTAGE_OUT_PAYLOAD_PCDU_CH6,
new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_VOLTAGE_OUT_ACS_BOARD_SIDE_B,
new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_VOLTAGE_OUT_PAYLOAD_CAMERA, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_VCC, new PoolEntry<int16_t>({0})); localDataPoolMap.emplace(pool::PDU2_VCC, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_VBAT, new PoolEntry<int16_t>({0})); localDataPoolMap.emplace(pool::PDU2_VBAT, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_TEMPERATURE, new PoolEntry<int16_t>({0})); localDataPoolMap.emplace(pool::PDU2_TEMPERATURE, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_CONV_EN_1, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(pool::PDU2_CONV_EN_1, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_CONV_EN_2, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(pool::PDU2_CONV_EN_2, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_CONV_EN_3, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(pool::PDU2_CONV_EN_3, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_OUT_EN_Q7S, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(pool::PDU2_OUT_EN_Q7S, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_OUT_EN_PAYLOAD_PCDU_CH1, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(pool::PDU2_OUT_EN_PAYLOAD_PCDU_CH1, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_OUT_EN_RW, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(pool::PDU2_OUT_EN_RW, new PoolEntry<uint8_t>({0}));
#ifdef TE0720_1CFA #ifdef TE0720_1CFA
localDataPoolMap.emplace(P60System::PDU2_OUT_EN_TCS_BOARD_HEATER_IN, new PoolEntry<uint8_t>({1})); localDataPoolMap.emplace(pool::PDU2_OUT_EN_TCS_BOARD_HEATER_IN, new PoolEntry<uint8_t>({1}));
#else #else
localDataPoolMap.emplace(P60System::PDU2_OUT_EN_TCS_BOARD_HEATER_IN, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(pool::PDU2_OUT_EN_TCS_BOARD_HEATER_IN, new PoolEntry<uint8_t>({0}));
#endif #endif
localDataPoolMap.emplace(P60System::PDU2_OUT_EN_SUS_REDUNDANT, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(pool::PDU2_OUT_EN_SUS_REDUNDANT, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_OUT_EN_DEPLOYMENT_MECHANISM, localDataPoolMap.emplace(pool::PDU2_OUT_EN_DEPLOYMENT_MECHANISM, new PoolEntry<uint8_t>({0}));
new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(pool::PDU2_OUT_EN_PAYLOAD_PCDU_CH6, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_OUT_EN_PAYLOAD_PCDU_CH6, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(pool::PDU2_OUT_EN_ACS_BOARD_SIDE_B, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_OUT_EN_ACS_BOARD_SIDE_B, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(pool::PDU2_OUT_EN_PAYLOAD_CAMERA, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_OUT_EN_PAYLOAD_CAMERA, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_BOOTCAUSE, new PoolEntry<uint32_t>({0})); localDataPoolMap.emplace(pool::PDU2_BOOTCAUSE, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_BOOTCNT, new PoolEntry<uint32_t>({0})); localDataPoolMap.emplace(pool::PDU2_BOOTCNT, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_UPTIME, new PoolEntry<uint32_t>({0})); localDataPoolMap.emplace(pool::PDU2_UPTIME, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_RESETCAUSE, new PoolEntry<uint16_t>({0})); localDataPoolMap.emplace(pool::PDU2_RESETCAUSE, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_BATT_MODE, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(pool::PDU2_BATT_MODE, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_LATCHUP_Q7S, new PoolEntry<uint16_t>({0})); localDataPoolMap.emplace(pool::PDU2_LATCHUP_Q7S, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_LATCHUP_PAYLOAD_PCDU_CH1, new PoolEntry<uint16_t>({0})); localDataPoolMap.emplace(pool::PDU2_LATCHUP_PAYLOAD_PCDU_CH1, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_LATCHUP_RW, new PoolEntry<uint16_t>({0})); localDataPoolMap.emplace(pool::PDU2_LATCHUP_RW, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_LATCHUP_TCS_BOARD_HEATER_IN, localDataPoolMap.emplace(pool::PDU2_LATCHUP_TCS_BOARD_HEATER_IN, new PoolEntry<uint16_t>({0}));
new PoolEntry<uint16_t>({0})); localDataPoolMap.emplace(pool::PDU2_LATCHUP_SUS_REDUNDANT, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_LATCHUP_SUS_REDUNDANT, new PoolEntry<uint16_t>({0})); localDataPoolMap.emplace(pool::PDU2_LATCHUP_DEPLOYMENT_MECHANISM, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_LATCHUP_DEPLOYMENT_MECHANISM, localDataPoolMap.emplace(pool::PDU2_LATCHUP_PAYLOAD_PCDU_CH6, new PoolEntry<uint16_t>({0}));
new PoolEntry<uint16_t>({0})); localDataPoolMap.emplace(pool::PDU2_LATCHUP_ACS_BOARD_SIDE_B, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_LATCHUP_PAYLOAD_PCDU_CH6, new PoolEntry<uint16_t>({0})); localDataPoolMap.emplace(pool::PDU2_LATCHUP_PAYLOAD_CAMERA, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_LATCHUP_ACS_BOARD_SIDE_B, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_LATCHUP_PAYLOAD_CAMERA, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_DEVICE_0, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(pool::PDU2_DEVICE_0, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_DEVICE_1, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(pool::PDU2_DEVICE_1, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_DEVICE_2, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(pool::PDU2_DEVICE_2, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_DEVICE_3, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(pool::PDU2_DEVICE_3, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_DEVICE_4, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(pool::PDU2_DEVICE_4, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_DEVICE_5, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(pool::PDU2_DEVICE_5, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_DEVICE_6, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(pool::PDU2_DEVICE_6, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_DEVICE_7, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(pool::PDU2_DEVICE_7, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_DEVICE_0_STATUS, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(pool::PDU2_DEVICE_0_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_DEVICE_1_STATUS, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(pool::PDU2_DEVICE_1_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_DEVICE_2_STATUS, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(pool::PDU2_DEVICE_2_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_DEVICE_3_STATUS, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(pool::PDU2_DEVICE_3_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_DEVICE_4_STATUS, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(pool::PDU2_DEVICE_4_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_DEVICE_5_STATUS, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(pool::PDU2_DEVICE_5_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_DEVICE_6_STATUS, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(pool::PDU2_DEVICE_6_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_DEVICE_7_STATUS, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(pool::PDU2_DEVICE_7_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_WDT_CNT_GND, new PoolEntry<uint32_t>({0})); localDataPoolMap.emplace(pool::PDU2_WDT_CNT_GND, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_WDT_CNT_I2C, new PoolEntry<uint32_t>({0})); localDataPoolMap.emplace(pool::PDU2_WDT_CNT_I2C, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_WDT_CNT_CAN, new PoolEntry<uint32_t>({0})); localDataPoolMap.emplace(pool::PDU2_WDT_CNT_CAN, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_WDT_CNT_CSP1, new PoolEntry<uint32_t>({0})); localDataPoolMap.emplace(pool::PDU2_WDT_CNT_CSP1, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_WDT_CNT_CSP2, new PoolEntry<uint32_t>({0})); localDataPoolMap.emplace(pool::PDU2_WDT_CNT_CSP2, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_WDT_GND_LEFT, new PoolEntry<uint32_t>({0})); localDataPoolMap.emplace(pool::PDU2_WDT_GND_LEFT, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_WDT_I2C_LEFT, new PoolEntry<uint32_t>({0})); localDataPoolMap.emplace(pool::PDU2_WDT_I2C_LEFT, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_WDT_CAN_LEFT, new PoolEntry<uint32_t>({0})); localDataPoolMap.emplace(pool::PDU2_WDT_CAN_LEFT, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_WDT_CSP_LEFT1, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(pool::PDU2_WDT_CSP_LEFT1, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::PDU2_WDT_CSP_LEFT2, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(pool::PDU2_WDT_CSP_LEFT2, new PoolEntry<uint8_t>({0}));
#if OBSW_ENABLE_PERIODIC_HK == 1 #if OBSW_ENABLE_PERIODIC_HK == 1
poolManager.subscribeForPeriodicPacket(pdu2HkTableDataset.getSid(), false, 0.4, true); poolManager.subscribeForPeriodicPacket(pdu2HkTableDataset.getSid(), false, 0.4, true);
#endif #endif

View File

@ -9,17 +9,27 @@ SyrlinksHkHandler::SyrlinksHkHandler(object_id_t objectId, object_id_t comIF, Co
: DeviceHandlerBase(objectId, comIF, comCookie), : DeviceHandlerBase(objectId, comIF, comCookie),
rxDataset(this), rxDataset(this),
txDataset(this), txDataset(this),
temperatureSet(this),
powerSwitch(powerSwitch) { powerSwitch(powerSwitch) {
if (comCookie == NULL) { if (comCookie == nullptr) {
sif::error << "SyrlinksHkHandler: Invalid com cookie" << std::endl; sif::warning << "SyrlinksHkHandler: Invalid com cookie" << std::endl;
} }
} }
SyrlinksHkHandler::~SyrlinksHkHandler() {} SyrlinksHkHandler::~SyrlinksHkHandler() {}
void SyrlinksHkHandler::doStartUp() { void SyrlinksHkHandler::doStartUp() {
if (mode == _MODE_START_UP) { switch (startupState) {
setMode(MODE_ON); case StartupState::OFF: {
startupState = StartupState::ENABLE_TEMPERATURE_PROTECTION;
break;
}
case StartupState::DONE: {
setMode(_MODE_TO_ON);
break;
}
default:
break;
} }
} }
@ -27,158 +37,144 @@ void SyrlinksHkHandler::doShutDown() { setMode(_MODE_POWER_DOWN); }
ReturnValue_t SyrlinksHkHandler::buildNormalDeviceCommand(DeviceCommandId_t* id) { ReturnValue_t SyrlinksHkHandler::buildNormalDeviceCommand(DeviceCommandId_t* id) {
switch (nextCommand) { switch (nextCommand) {
case (SYRLINKS::READ_RX_STATUS_REGISTERS): case (syrlinks::READ_RX_STATUS_REGISTERS):
*id = SYRLINKS::READ_RX_STATUS_REGISTERS; *id = syrlinks::READ_RX_STATUS_REGISTERS;
nextCommand = SYRLINKS::READ_TX_STATUS; nextCommand = syrlinks::READ_TX_STATUS;
break; break;
case (SYRLINKS::READ_TX_STATUS): case (syrlinks::READ_TX_STATUS):
*id = SYRLINKS::READ_TX_STATUS; *id = syrlinks::READ_TX_STATUS;
nextCommand = SYRLINKS::READ_TX_WAVEFORM; nextCommand = syrlinks::READ_TX_WAVEFORM;
break; break;
case (SYRLINKS::READ_TX_WAVEFORM): case (syrlinks::READ_TX_WAVEFORM):
*id = SYRLINKS::READ_TX_WAVEFORM; *id = syrlinks::READ_TX_WAVEFORM;
nextCommand = SYRLINKS::READ_TX_AGC_VALUE_HIGH_BYTE; nextCommand = syrlinks::READ_TX_AGC_VALUE_HIGH_BYTE;
break; break;
case (SYRLINKS::READ_TX_AGC_VALUE_HIGH_BYTE): case (syrlinks::READ_TX_AGC_VALUE_HIGH_BYTE):
*id = SYRLINKS::READ_TX_AGC_VALUE_HIGH_BYTE; *id = syrlinks::READ_TX_AGC_VALUE_HIGH_BYTE;
nextCommand = SYRLINKS::READ_TX_AGC_VALUE_LOW_BYTE; nextCommand = syrlinks::READ_TX_AGC_VALUE_LOW_BYTE;
break; break;
case (SYRLINKS::READ_TX_AGC_VALUE_LOW_BYTE): case (syrlinks::READ_TX_AGC_VALUE_LOW_BYTE):
*id = SYRLINKS::READ_TX_AGC_VALUE_LOW_BYTE; *id = syrlinks::READ_TX_AGC_VALUE_LOW_BYTE;
nextCommand = SYRLINKS::TEMP_POWER_AMPLIFIER_HIGH_BYTE; nextCommand = syrlinks::TEMP_POWER_AMPLIFIER_HIGH_BYTE;
break; break;
case (SYRLINKS::TEMP_POWER_AMPLIFIER_HIGH_BYTE): case (syrlinks::TEMP_POWER_AMPLIFIER_HIGH_BYTE):
*id = SYRLINKS::TEMP_POWER_AMPLIFIER_HIGH_BYTE; *id = syrlinks::TEMP_POWER_AMPLIFIER_HIGH_BYTE;
nextCommand = SYRLINKS::TEMP_POWER_AMPLIFIER_LOW_BYTE; nextCommand = syrlinks::TEMP_POWER_AMPLIFIER_LOW_BYTE;
break; break;
case (SYRLINKS::TEMP_POWER_AMPLIFIER_LOW_BYTE): case (syrlinks::TEMP_POWER_AMPLIFIER_LOW_BYTE):
*id = SYRLINKS::TEMP_POWER_AMPLIFIER_LOW_BYTE; *id = syrlinks::TEMP_POWER_AMPLIFIER_LOW_BYTE;
nextCommand = SYRLINKS::TEMP_BASEBAND_BOARD_HIGH_BYTE; nextCommand = syrlinks::TEMP_BASEBAND_BOARD_HIGH_BYTE;
break; break;
case (SYRLINKS::TEMP_BASEBAND_BOARD_HIGH_BYTE): case (syrlinks::TEMP_BASEBAND_BOARD_HIGH_BYTE):
*id = SYRLINKS::TEMP_BASEBAND_BOARD_HIGH_BYTE; *id = syrlinks::TEMP_BASEBAND_BOARD_HIGH_BYTE;
nextCommand = SYRLINKS::TEMP_BASEBAND_BOARD_LOW_BYTE; nextCommand = syrlinks::TEMP_BASEBAND_BOARD_LOW_BYTE;
break; break;
case (SYRLINKS::TEMP_BASEBAND_BOARD_LOW_BYTE): case (syrlinks::TEMP_BASEBAND_BOARD_LOW_BYTE):
*id = SYRLINKS::TEMP_BASEBAND_BOARD_LOW_BYTE; *id = syrlinks::TEMP_BASEBAND_BOARD_LOW_BYTE;
nextCommand = SYRLINKS::READ_RX_STATUS_REGISTERS; nextCommand = syrlinks::READ_RX_STATUS_REGISTERS;
break; break;
default: default:
sif::debug << "SyrlinksHkHandler::buildNormalDeviceCommand: rememberCommandId has invalid" sif::debug << "SyrlinksHkHandler::buildNormalDeviceCommand: rememberCommandId has invalid"
<< "command id" << std::endl; << "command id" << std::endl;
break; break;
} }
return buildCommandFromCommand(*id, NULL, 0); return buildCommandFromCommand(*id, nullptr, 0);
} }
ReturnValue_t SyrlinksHkHandler::buildTransitionDeviceCommand(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 buildCommandFromCommand(*id, nullptr, 0);
}
default:
break;
}
return NOTHING_TO_SEND;
} }
ReturnValue_t SyrlinksHkHandler::buildCommandFromCommand(DeviceCommandId_t deviceCommand, ReturnValue_t SyrlinksHkHandler::buildCommandFromCommand(DeviceCommandId_t deviceCommand,
const uint8_t* commandData, const uint8_t* commandData,
size_t commandDataLen) { size_t commandDataLen) {
switch (deviceCommand) { switch (deviceCommand) {
case (SYRLINKS::RESET_UNIT): { case (syrlinks::RESET_UNIT): {
resetCommand.copy(reinterpret_cast<char*>(commandBuffer), resetCommand.size(), 0); prepareCommand(resetCommand, deviceCommand);
rawPacketLen = resetCommand.size();
rawPacket = commandBuffer;
return RETURN_OK; return RETURN_OK;
} }
case (SYRLINKS::SET_TX_MODE_STANDBY): { case (syrlinks::SET_TX_MODE_STANDBY): {
setTxModeStandby.copy(reinterpret_cast<char*>(commandBuffer), setTxModeStandby.size(), 0); prepareCommand(setTxModeStandby, deviceCommand);
rawPacketLen = setTxModeStandby.size();
rawPacket = commandBuffer;
return RETURN_OK; return RETURN_OK;
} }
case (SYRLINKS::SET_TX_MODE_MODULATION): { case (syrlinks::SET_TX_MODE_MODULATION): {
setTxModeModulation.copy(reinterpret_cast<char*>(commandBuffer), setTxModeModulation.size(), prepareCommand(setTxModeModulation, deviceCommand);
0);
rawPacketLen = setTxModeModulation.size();
rawPacket = commandBuffer;
return RETURN_OK; return RETURN_OK;
} }
case (SYRLINKS::SET_TX_MODE_CW): { case (syrlinks::SET_TX_MODE_CW): {
setTxModeCw.copy(reinterpret_cast<char*>(commandBuffer), setTxModeCw.size(), 0); prepareCommand(setTxModeCw, deviceCommand);
rawPacketLen = setTxModeCw.size();
rawPacket = commandBuffer;
return RETURN_OK; return RETURN_OK;
} }
case (SYRLINKS::WRITE_LCL_CONFIG): { case (syrlinks::WRITE_LCL_CONFIG): {
writeLclConfig.copy(reinterpret_cast<char*>(commandBuffer), writeLclConfig.size(), 0); prepareCommand(writeLclConfig, deviceCommand);
rawPacketLen = writeLclConfig.size();
rawPacket = commandBuffer;
return RETURN_OK; return RETURN_OK;
} }
case (SYRLINKS::READ_RX_STATUS_REGISTERS): { case (syrlinks::READ_RX_STATUS_REGISTERS): {
readRxStatusRegCommand.copy(reinterpret_cast<char*>(commandBuffer), prepareCommand(readRxStatusRegCommand, deviceCommand);
readRxStatusRegCommand.size(), 0);
rawPacketLen = readRxStatusRegCommand.size();
rawPacket = commandBuffer;
return RETURN_OK; return RETURN_OK;
} }
case (SYRLINKS::READ_LCL_CONFIG): { case (syrlinks::READ_LCL_CONFIG): {
readLclConfig.copy(reinterpret_cast<char*>(commandBuffer), readLclConfig.size(), 0); prepareCommand(readLclConfig, deviceCommand);
rawPacketLen = readLclConfig.size();
rawPacket = commandBuffer;
rememberCommandId = SYRLINKS::READ_LCL_CONFIG;
return RETURN_OK; return RETURN_OK;
} }
case (SYRLINKS::READ_TX_STATUS): { case (syrlinks::READ_TX_STATUS): {
readTxStatus.copy(reinterpret_cast<char*>(commandBuffer), readTxStatus.size(), 0); prepareCommand(readTxStatus, deviceCommand);
rawPacketLen = readTxStatus.size();
rememberCommandId = SYRLINKS::READ_TX_STATUS;
rawPacket = commandBuffer;
return RETURN_OK; return RETURN_OK;
} }
case (SYRLINKS::READ_TX_WAVEFORM): { case (syrlinks::READ_TX_WAVEFORM): {
readTxWaveform.copy(reinterpret_cast<char*>(commandBuffer), readTxWaveform.size(), 0); prepareCommand(readTxWaveform, deviceCommand);
rawPacketLen = readTxWaveform.size();
rememberCommandId = SYRLINKS::READ_TX_WAVEFORM;
rawPacket = commandBuffer;
return RETURN_OK; return RETURN_OK;
} }
case (SYRLINKS::READ_TX_AGC_VALUE_HIGH_BYTE): { case (syrlinks::READ_TX_AGC_VALUE_HIGH_BYTE): {
readTxAgcValueHighByte.copy(reinterpret_cast<char*>(commandBuffer), readTxAgcValueHighByte.size(), 0); prepareCommand(readTxAgcValueHighByte, deviceCommand);
rawPacketLen = readTxAgcValueHighByte.size();
rememberCommandId = SYRLINKS::READ_TX_AGC_VALUE_HIGH_BYTE;
rawPacket = commandBuffer;
return RETURN_OK; return RETURN_OK;
} }
case (SYRLINKS::READ_TX_AGC_VALUE_LOW_BYTE): { case (syrlinks::READ_TX_AGC_VALUE_LOW_BYTE): {
readTxAgcValueLowByte.copy(reinterpret_cast<char*>(commandBuffer), readTxAgcValueLowByte.size(), 0); prepareCommand(readTxAgcValueLowByte, deviceCommand);
rawPacketLen = readTxAgcValueLowByte.size();
rememberCommandId = SYRLINKS::READ_TX_AGC_VALUE_LOW_BYTE;
rawPacket = commandBuffer;
return RETURN_OK; return RETURN_OK;
} }
case (SYRLINKS::TEMP_POWER_AMPLIFIER_HIGH_BYTE): case (syrlinks::TEMP_POWER_AMPLIFIER_HIGH_BYTE): {
tempPowerAmpBoardHighByte.copy(reinterpret_cast<char*>(commandBuffer), tempPowerAmpBoardHighByte.size(), prepareCommand(tempPowerAmpBoardHighByte, deviceCommand);
0);
rawPacketLen = tempPowerAmpBoardHighByte.size();
rememberCommandId = SYRLINKS::TEMP_POWER_AMPLIFIER_HIGH_BYTE;
rawPacket = commandBuffer;
return RETURN_OK; return RETURN_OK;
case (SYRLINKS::TEMP_POWER_AMPLIFIER_LOW_BYTE): }
tempPowerAmpBoardLowByte.copy(reinterpret_cast<char*>(commandBuffer), tempPowerAmpBoardLowByte.size(), case (syrlinks::TEMP_POWER_AMPLIFIER_LOW_BYTE): {
0); prepareCommand(tempPowerAmpBoardLowByte, deviceCommand);
rawPacketLen = tempPowerAmpBoardLowByte.size();
rememberCommandId = SYRLINKS::TEMP_POWER_AMPLIFIER_LOW_BYTE;
rawPacket = commandBuffer;
return RETURN_OK; return RETURN_OK;
case (SYRLINKS::TEMP_BASEBAND_BOARD_HIGH_BYTE): }
tempBasebandBoardHighByte.copy(reinterpret_cast<char*>(commandBuffer), tempBasebandBoardHighByte.size(), case (syrlinks::TEMP_BASEBAND_BOARD_HIGH_BYTE): {
0); prepareCommand(tempBasebandBoardHighByte, deviceCommand);
rawPacketLen = tempBasebandBoardHighByte.size();
rememberCommandId = SYRLINKS::TEMP_BASEBAND_BOARD_HIGH_BYTE;
rawPacket = commandBuffer;
return RETURN_OK; return RETURN_OK;
case (SYRLINKS::TEMP_BASEBAND_BOARD_LOW_BYTE): }
tempBasebandBoardLowByte.copy(reinterpret_cast<char*>(commandBuffer), tempBasebandBoardLowByte.size(), 0); case (syrlinks::TEMP_BASEBAND_BOARD_LOW_BYTE): {
rawPacketLen = tempBasebandBoardLowByte.size(); prepareCommand(tempBasebandBoardLowByte, deviceCommand);
rememberCommandId = SYRLINKS::TEMP_BASEBAND_BOARD_LOW_BYTE;
rawPacket = commandBuffer;
return RETURN_OK; return RETURN_OK;
}
case (syrlinks::CONFIG_BPSK): {
prepareCommand(configBPSK, deviceCommand);
return RETURN_OK;
}
case (syrlinks::CONFIG_OQPSK): {
prepareCommand(configOQPSK, deviceCommand);
return RETURN_OK;
}
case (syrlinks::ENABLE_DEBUG): {
debug = true;
rawPacketLen = 0;
return RETURN_OK;
}
case (syrlinks::DISABLE_DEBUG): {
debug = false;
rawPacketLen = 0;
return RETURN_OK;
}
default: default:
return DeviceHandlerIF::COMMAND_NOT_IMPLEMENTED; return DeviceHandlerIF::COMMAND_NOT_IMPLEMENTED;
} }
@ -186,36 +182,42 @@ ReturnValue_t SyrlinksHkHandler::buildCommandFromCommand(DeviceCommandId_t devic
} }
void SyrlinksHkHandler::fillCommandAndReplyMap() { void SyrlinksHkHandler::fillCommandAndReplyMap() {
this->insertInCommandAndReplyMap(SYRLINKS::RESET_UNIT, 1, nullptr, SYRLINKS::ACK_SIZE, false, this->insertInCommandAndReplyMap(syrlinks::RESET_UNIT, 1, nullptr, syrlinks::ACK_SIZE, false,
true, SYRLINKS::ACK_REPLY); true, syrlinks::ACK_REPLY);
this->insertInCommandAndReplyMap(SYRLINKS::SET_TX_MODE_STANDBY, 1, nullptr, SYRLINKS::ACK_SIZE, this->insertInCommandAndReplyMap(syrlinks::SET_TX_MODE_STANDBY, 1, nullptr, syrlinks::ACK_SIZE,
false, true, SYRLINKS::ACK_REPLY); false, true, syrlinks::ACK_REPLY);
this->insertInCommandAndReplyMap(SYRLINKS::SET_TX_MODE_MODULATION, 1, nullptr, SYRLINKS::ACK_SIZE, this->insertInCommandAndReplyMap(syrlinks::SET_TX_MODE_MODULATION, 1, nullptr, syrlinks::ACK_SIZE,
false, true, SYRLINKS::ACK_REPLY); false, true, syrlinks::ACK_REPLY);
this->insertInCommandAndReplyMap(SYRLINKS::SET_TX_MODE_CW, 1, nullptr, SYRLINKS::ACK_SIZE, false, this->insertInCommandAndReplyMap(syrlinks::SET_TX_MODE_CW, 1, nullptr, syrlinks::ACK_SIZE, false,
true, SYRLINKS::ACK_REPLY); true, syrlinks::ACK_REPLY);
this->insertInCommandAndReplyMap(SYRLINKS::WRITE_LCL_CONFIG, 1, nullptr, SYRLINKS::ACK_SIZE, this->insertInCommandAndReplyMap(syrlinks::WRITE_LCL_CONFIG, 1, nullptr, syrlinks::ACK_SIZE,
false, true, SYRLINKS::ACK_REPLY); false, true, syrlinks::ACK_REPLY);
this->insertInCommandAndReplyMap(SYRLINKS::READ_LCL_CONFIG, 1, nullptr, this->insertInCommandAndReplyMap(syrlinks::CONFIG_BPSK, 1, nullptr, syrlinks::ACK_SIZE, false,
SYRLINKS::READ_ONE_REGISTER_REPLY_SIE); true, syrlinks::ACK_REPLY);
this->insertInCommandAndReplyMap(SYRLINKS::READ_TX_STATUS, 1, &txDataset, this->insertInCommandAndReplyMap(syrlinks::CONFIG_OQPSK, 1, nullptr, syrlinks::ACK_SIZE, false,
SYRLINKS::READ_ONE_REGISTER_REPLY_SIE); true, syrlinks::ACK_REPLY);
this->insertInCommandAndReplyMap(SYRLINKS::READ_TX_WAVEFORM, 1, &txDataset, this->insertInCommandMap(syrlinks::ENABLE_DEBUG);
SYRLINKS::READ_ONE_REGISTER_REPLY_SIE); this->insertInCommandMap(syrlinks::DISABLE_DEBUG);
this->insertInCommandAndReplyMap(SYRLINKS::READ_TX_AGC_VALUE_HIGH_BYTE, 1, &txDataset, this->insertInCommandAndReplyMap(syrlinks::READ_LCL_CONFIG, 1, nullptr,
SYRLINKS::READ_ONE_REGISTER_REPLY_SIE); syrlinks::READ_ONE_REGISTER_REPLY_SIE);
this->insertInCommandAndReplyMap(SYRLINKS::READ_TX_AGC_VALUE_LOW_BYTE, 1, &txDataset, this->insertInCommandAndReplyMap(syrlinks::READ_TX_STATUS, 1, &txDataset,
SYRLINKS::READ_ONE_REGISTER_REPLY_SIE); syrlinks::READ_ONE_REGISTER_REPLY_SIE);
this->insertInCommandAndReplyMap(SYRLINKS::TEMP_POWER_AMPLIFIER_HIGH_BYTE, 1, nullptr, this->insertInCommandAndReplyMap(syrlinks::READ_TX_WAVEFORM, 1, &txDataset,
SYRLINKS::READ_ONE_REGISTER_REPLY_SIE); syrlinks::READ_ONE_REGISTER_REPLY_SIE);
this->insertInCommandAndReplyMap(SYRLINKS::TEMP_POWER_AMPLIFIER_LOW_BYTE, 1, nullptr, this->insertInCommandAndReplyMap(syrlinks::READ_TX_AGC_VALUE_HIGH_BYTE, 1, &txDataset,
SYRLINKS::READ_ONE_REGISTER_REPLY_SIE); syrlinks::READ_ONE_REGISTER_REPLY_SIE);
this->insertInCommandAndReplyMap(SYRLINKS::TEMP_BASEBAND_BOARD_HIGH_BYTE, 1, nullptr, this->insertInCommandAndReplyMap(syrlinks::READ_TX_AGC_VALUE_LOW_BYTE, 1, &txDataset,
SYRLINKS::READ_ONE_REGISTER_REPLY_SIE); syrlinks::READ_ONE_REGISTER_REPLY_SIE);
this->insertInCommandAndReplyMap(SYRLINKS::TEMP_BASEBAND_BOARD_LOW_BYTE, 1, nullptr, this->insertInCommandAndReplyMap(syrlinks::TEMP_POWER_AMPLIFIER_HIGH_BYTE, 1, nullptr,
SYRLINKS::READ_ONE_REGISTER_REPLY_SIE); syrlinks::READ_ONE_REGISTER_REPLY_SIE);
this->insertInCommandAndReplyMap(SYRLINKS::READ_RX_STATUS_REGISTERS, 1, &rxDataset, this->insertInCommandAndReplyMap(syrlinks::TEMP_POWER_AMPLIFIER_LOW_BYTE, 1, nullptr,
SYRLINKS::RX_STATUS_REGISTERS_REPLY_SIZE); 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, ReturnValue_t SyrlinksHkHandler::scanForReply(const uint8_t* start, size_t remainingSize,
@ -223,25 +225,25 @@ ReturnValue_t SyrlinksHkHandler::scanForReply(const uint8_t* start, size_t remai
ReturnValue_t result = RETURN_OK; ReturnValue_t result = RETURN_OK;
if (*start != '<') { 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; return MISSING_START_FRAME_CHARACTER;
} }
switch (*(start + 1)) { switch (*(start + 1)) {
case ('A'): case ('A'):
*foundLen = SYRLINKS::ACK_SIZE; *foundLen = syrlinks::ACK_SIZE;
*foundId = SYRLINKS::ACK_REPLY; *foundId = syrlinks::ACK_REPLY;
break; break;
case ('E'): case ('E'):
*foundLen = SYRLINKS::RX_STATUS_REGISTERS_REPLY_SIZE; *foundLen = syrlinks::RX_STATUS_REGISTERS_REPLY_SIZE;
*foundId = SYRLINKS::READ_RX_STATUS_REGISTERS; *foundId = syrlinks::READ_RX_STATUS_REGISTERS;
break; break;
case ('R'): case ('R'):
*foundId = rememberCommandId; *foundId = rememberCommandId;
*foundLen = SYRLINKS::READ_ONE_REGISTER_REPLY_SIE; *foundLen = syrlinks::READ_ONE_REGISTER_REPLY_SIE;
break; break;
default: default:
sif::error << "SyrlinksHkHandler::scanForReply: Unknown reply identifier" << std::endl; sif::warning << "SyrlinksHkHandler::scanForReply: Unknown reply identifier" << std::endl;
result = IGNORE_REPLY_DATA; result = IGNORE_REPLY_DATA;
break; break;
} }
@ -262,124 +264,142 @@ ReturnValue_t SyrlinksHkHandler::interpretDeviceReply(DeviceCommandId_t id, cons
ReturnValue_t result; ReturnValue_t result;
switch (id) { switch (id) {
case (SYRLINKS::ACK_REPLY): case (syrlinks::ACK_REPLY): {
result = verifyReply(packet, SYRLINKS::ACK_SIZE); result = verifyReply(packet, syrlinks::ACK_SIZE);
if (result != RETURN_OK) { if (result != RETURN_OK) {
sif::error << "SyrlinksHkHandler::interpretDeviceReply: Acknowledgment reply has " sif::warning << "SyrlinksHkHandler::interpretDeviceReply: Acknowledgment reply has "
"invalid crc" "invalid crc"
<< std::endl; << std::endl;
return CRC_FAILURE; return CRC_FAILURE;
} }
result = result = handleAckReply(packet);
parseReplyStatus(reinterpret_cast<const char*>(packet + SYRLINKS::MESSAGE_HEADER_SIZE));
if (result != RETURN_OK) { if (result != RETURN_OK) {
return result; return result;
} }
break; 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) { 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; << "has invalid crc" << std::endl;
return CRC_FAILURE; return CRC_FAILURE;
} }
parseRxStatusRegistersReply(packet); parseRxStatusRegistersReply(packet);
break; 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) { 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; << "has invalid crc" << std::endl;
return CRC_FAILURE; return CRC_FAILURE;
} }
parseLclConfigReply(packet); parseLclConfigReply(packet);
break; 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) { 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; << "has invalid crc" << std::endl;
return CRC_FAILURE; return CRC_FAILURE;
} }
parseTxStatusReply(packet); parseTxStatusReply(packet);
break; 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) { 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; << "has invalid crc" << std::endl;
return CRC_FAILURE; return CRC_FAILURE;
} }
parseTxWaveformReply(packet); parseTxWaveformReply(packet);
break; 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) { 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; << "has invalid crc" << std::endl;
return CRC_FAILURE; return CRC_FAILURE;
} }
parseAgcHighByte(packet); parseAgcHighByte(packet);
break; 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) { 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; << "has invalid crc" << std::endl;
return CRC_FAILURE; return CRC_FAILURE;
} }
parseAgcLowByte(packet); parseAgcLowByte(packet);
break; 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) { 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; << "high byte reply has invalid crc" << std::endl;
return CRC_FAILURE; return CRC_FAILURE;
} }
rawTempBasebandBoard = convertHexStringToUint8(reinterpret_cast<const char*>( rawTempBasebandBoard = convertHexStringToUint8(reinterpret_cast<const char*>(
packet + SYRLINKS::MESSAGE_HEADER_SIZE)) packet + syrlinks::MESSAGE_HEADER_SIZE))
<< 8; << 8;
break; 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) { 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" " low byte reply has invalid crc"
<< std::endl; << std::endl;
return CRC_FAILURE; return CRC_FAILURE;
} }
rawTempBasebandBoard |= convertHexStringToUint8( rawTempBasebandBoard |= convertHexStringToUint8(
reinterpret_cast<const char*>(packet + SYRLINKS::MESSAGE_HEADER_SIZE)); reinterpret_cast<const char*>(packet + syrlinks::MESSAGE_HEADER_SIZE));
tempBasebandBoard = calcTempVal(rawTempBasebandBoard); tempBasebandBoard = calcTempVal(rawTempBasebandBoard);
temperatureSet.temperatureBasebandBoard = tempBasebandBoard;
PoolReadGuard rg(&temperatureSet);
if (debug) {
sif::info << "Syrlinks temperature baseband board: " << tempBasebandBoard << " °C" sif::info << "Syrlinks temperature baseband board: " << tempBasebandBoard << " °C"
<< std::endl; << std::endl;
}
break; 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) { 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; << "board high byte reply has invalid crc" << std::endl;
return CRC_FAILURE; return CRC_FAILURE;
} }
rawTempPowerAmplifier = 0; rawTempPowerAmplifier = 0;
rawTempPowerAmplifier = convertHexStringToUint8(reinterpret_cast<const char*>( rawTempPowerAmplifier = convertHexStringToUint8(reinterpret_cast<const char*>(
packet + SYRLINKS::MESSAGE_HEADER_SIZE)) packet + syrlinks::MESSAGE_HEADER_SIZE))
<< 8; << 8;
break; 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) { 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; << " board low byte reply has invalid crc" << std::endl;
return CRC_FAILURE; return CRC_FAILURE;
} }
rawTempPowerAmplifier |= convertHexStringToUint8( rawTempPowerAmplifier |= convertHexStringToUint8(
reinterpret_cast<const char*>(packet + SYRLINKS::MESSAGE_HEADER_SIZE)); reinterpret_cast<const char*>(packet + syrlinks::MESSAGE_HEADER_SIZE));
tempPowerAmplifier = calcTempVal(rawTempPowerAmplifier); tempPowerAmplifier = calcTempVal(rawTempPowerAmplifier);
PoolReadGuard rg(&temperatureSet);
temperatureSet.temperaturePowerAmplifier = tempPowerAmplifier;
if (debug) {
sif::info << "Syrlinks temperature power amplifier board: " << tempPowerAmplifier << " °C" sif::info << "Syrlinks temperature power amplifier board: " << tempPowerAmplifier << " °C"
<< std::endl; << std::endl;
}
break; break;
}
default: { default: {
sif::debug << "SyrlinksHkHandler::interpretDeviceReply: Unknown device reply id" << std::endl; sif::debug << "SyrlinksHkHandler::interpretDeviceReply: Unknown device reply id" << std::endl;
return DeviceHandlerIF::UNKNOWN_DEVICE_REPLY; return DeviceHandlerIF::UNKNOWN_DEVICE_REPLY;
@ -394,8 +414,10 @@ LocalPoolDataSetBase* SyrlinksHkHandler::getDataSetHandle(sid_t sid) {
return &rxDataset; return &rxDataset;
} else if (sid == txDataset.getSid()) { } else if (sid == txDataset.getSid()) {
return &txDataset; return &txDataset;
} else if (sid == temperatureSet.getSid()) {
return &temperatureSet;
} else { } else {
sif::error << "SyrlinksHkHandler::getDataSetHandle: Invalid sid" << std::endl; sif::warning << "SyrlinksHkHandler::getDataSetHandle: Invalid sid" << std::endl;
return nullptr; return nullptr;
} }
} }
@ -449,7 +471,8 @@ ReturnValue_t SyrlinksHkHandler::parseReplyStatus(const char* status) {
case '0': case '0':
return RETURN_OK; return RETURN_OK;
case '1': 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; return UART_FRAMIN_OR_PARITY_ERROR_ACK;
case '2': case '2':
sif::debug << "SyrlinksHkHandler::parseReplyStatus: Bad character detected" << std::endl; sif::debug << "SyrlinksHkHandler::parseReplyStatus: Bad character detected" << std::endl;
@ -479,11 +502,11 @@ ReturnValue_t SyrlinksHkHandler::verifyReply(const uint8_t* packet, uint8_t size
int result = 0; int result = 0;
/* Calculate crc from received packet */ /* Calculate crc from received packet */
uint16_t crc = 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); std::string recalculatedCrc = convertUint16ToHexString(crc);
const char* startOfCrc = const char* startOfCrc =
reinterpret_cast<const char*>(packet + size - SYRLINKS::SIZE_CRC_AND_TERMINATION); reinterpret_cast<const char*>(packet + size - syrlinks::SIZE_CRC_AND_TERMINATION);
const char* endOfCrc = reinterpret_cast<const char*>(packet + size - 1); const char* endOfCrc = reinterpret_cast<const char*>(packet + size - 1);
std::string replyCrc(startOfCrc, endOfCrc); std::string replyCrc(startOfCrc, endOfCrc);
@ -497,7 +520,7 @@ ReturnValue_t SyrlinksHkHandler::verifyReply(const uint8_t* packet, uint8_t size
void SyrlinksHkHandler::parseRxStatusRegistersReply(const uint8_t* packet) { void SyrlinksHkHandler::parseRxStatusRegistersReply(const uint8_t* packet) {
PoolReadGuard readHelper(&rxDataset); PoolReadGuard readHelper(&rxDataset);
uint16_t offset = SYRLINKS::MESSAGE_HEADER_SIZE; uint16_t offset = syrlinks::MESSAGE_HEADER_SIZE;
rxDataset.rxStatus = convertHexStringToUint8(reinterpret_cast<const char*>(packet + offset)); rxDataset.rxStatus = convertHexStringToUint8(reinterpret_cast<const char*>(packet + offset));
offset += 2; offset += 2;
rxDataset.rxSensitivity = rxDataset.rxSensitivity =
@ -518,6 +541,7 @@ void SyrlinksHkHandler::parseRxStatusRegistersReply(const uint8_t* packet) {
rxDataset.rxDataRate = convertHexStringToUint8(reinterpret_cast<const char*>(packet + offset)); rxDataset.rxDataRate = convertHexStringToUint8(reinterpret_cast<const char*>(packet + offset));
#if OBSW_VERBOSE_LEVEL >= 1 && OBSW_DEBUG_SYRLINKS == 1 #if OBSW_VERBOSE_LEVEL >= 1 && OBSW_DEBUG_SYRLINKS == 1
if (debug) {
sif::info << "Syrlinks RX Status: 0x" << std::hex << (unsigned int)rxDataset.rxStatus.value sif::info << "Syrlinks RX Status: 0x" << std::hex << (unsigned int)rxDataset.rxStatus.value
<< std::endl; << std::endl;
sif::info << "Syrlinks RX Sensitivity: " << std::dec << rxDataset.rxSensitivity << std::endl; sif::info << "Syrlinks RX Sensitivity: " << std::dec << rxDataset.rxSensitivity << std::endl;
@ -527,49 +551,58 @@ void SyrlinksHkHandler::parseRxStatusRegistersReply(const uint8_t* packet) {
sif::info << "Syrlinks RX Demod Eb: " << rxDataset.rxDemodEb << 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 Demod N0: " << rxDataset.rxDemodN0 << std::endl;
sif::info << "Syrlinks RX Datarate: " << (unsigned int)rxDataset.rxDataRate.value << std::endl; sif::info << "Syrlinks RX Datarate: " << (unsigned int)rxDataset.rxDataRate.value << std::endl;
}
#endif #endif
} }
void SyrlinksHkHandler::parseLclConfigReply(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<const char*>(packet + offset)); uint8_t lclConfig = convertHexStringToUint8(reinterpret_cast<const char*>(packet + offset));
if (debug) {
sif::info << "SyrlinksHkHandler::parseRxStatusRegistersReply: Lcl config: " sif::info << "SyrlinksHkHandler::parseRxStatusRegistersReply: Lcl config: "
<< static_cast<unsigned int>(lclConfig) << std::endl; << static_cast<unsigned int>(lclConfig) << std::endl;
} }
}
void SyrlinksHkHandler::parseTxStatusReply(const uint8_t* packet) { void SyrlinksHkHandler::parseTxStatusReply(const uint8_t* packet) {
PoolReadGuard readHelper(&txDataset); PoolReadGuard readHelper(&txDataset);
uint16_t offset = SYRLINKS::MESSAGE_HEADER_SIZE; uint16_t offset = syrlinks::MESSAGE_HEADER_SIZE;
txDataset.txStatus = convertHexStringToUint8(reinterpret_cast<const char*>(packet + offset)); txDataset.txStatus = convertHexStringToUint8(reinterpret_cast<const char*>(packet + offset));
#if OBSW_VERBOSE_LEVEL >= 1 && OBSW_DEBUG_SYRLINKS == 1 #if OBSW_DEBUG_SYRLINKS == 1
if (debug) {
sif::info << "Syrlinks TX Status: 0x" << std::hex << (unsigned int)txDataset.txStatus.value sif::info << "Syrlinks TX Status: 0x" << std::hex << (unsigned int)txDataset.txStatus.value
<< std::endl; << std::endl;
}
#endif #endif
} }
void SyrlinksHkHandler::parseTxWaveformReply(const uint8_t* packet) { void SyrlinksHkHandler::parseTxWaveformReply(const uint8_t* packet) {
PoolReadGuard readHelper(&txDataset); PoolReadGuard readHelper(&txDataset);
uint16_t offset = SYRLINKS::MESSAGE_HEADER_SIZE; uint16_t offset = syrlinks::MESSAGE_HEADER_SIZE;
txDataset.txWaveform = convertHexStringToUint8(reinterpret_cast<const char*>(packet + offset)); txDataset.txWaveform = convertHexStringToUint8(reinterpret_cast<const char*>(packet + offset));
#if OBSW_VERBOSE_LEVEL >= 1 && OBSW_DEBUG_SYRLINKS == 1 #if OBSW_DEBUG_SYRLINKS == 1
if (debug) {
sif::info << "Syrlinks TX Waveform: 0x" << std::hex << (unsigned int)txDataset.txWaveform.value sif::info << "Syrlinks TX Waveform: 0x" << std::hex << (unsigned int)txDataset.txWaveform.value
<< std::endl; << std::endl;
}
#endif #endif
} }
void SyrlinksHkHandler::parseAgcLowByte(const uint8_t* packet) { void SyrlinksHkHandler::parseAgcLowByte(const uint8_t* packet) {
PoolReadGuard readHelper(&txDataset); PoolReadGuard readHelper(&txDataset);
uint16_t offset = SYRLINKS::MESSAGE_HEADER_SIZE; uint16_t offset = syrlinks::MESSAGE_HEADER_SIZE;
txDataset.txAgcValue = agcValueHighByte << 8 | txDataset.txAgcValue = agcValueHighByte << 8 |
convertHexStringToUint8(reinterpret_cast<const char*>(packet + offset)); convertHexStringToUint8(reinterpret_cast<const char*>(packet + offset));
#if OBSW_VERBOSE_LEVEL >= 1 && OBSW_DEBUG_SYRLINKS == 1 #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 #endif
} }
void SyrlinksHkHandler::parseAgcHighByte(const uint8_t* packet) { void SyrlinksHkHandler::parseAgcHighByte(const uint8_t* packet) {
PoolReadGuard readHelper(&txDataset); PoolReadGuard readHelper(&txDataset);
uint16_t offset = SYRLINKS::MESSAGE_HEADER_SIZE; uint16_t offset = syrlinks::MESSAGE_HEADER_SIZE;
agcValueHighByte = convertHexStringToUint8(reinterpret_cast<const char*>(packet + offset)); agcValueHighByte = convertHexStringToUint8(reinterpret_cast<const char*>(packet + offset));
} }
@ -579,18 +612,20 @@ uint32_t SyrlinksHkHandler::getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo)
ReturnValue_t SyrlinksHkHandler::initializeLocalDataPool(localpool::DataPool& localDataPoolMap, ReturnValue_t SyrlinksHkHandler::initializeLocalDataPool(localpool::DataPool& localDataPoolMap,
LocalDataPoolManager& poolManager) { LocalDataPoolManager& poolManager) {
localDataPoolMap.emplace(SYRLINKS::RX_STATUS, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(syrlinks::RX_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(SYRLINKS::RX_SENSITIVITY, new PoolEntry<uint32_t>({0})); localDataPoolMap.emplace(syrlinks::RX_SENSITIVITY, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(SYRLINKS::RX_FREQUENCY_SHIFT, new PoolEntry<uint32_t>({0})); localDataPoolMap.emplace(syrlinks::RX_FREQUENCY_SHIFT, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(SYRLINKS::RX_IQ_POWER, new PoolEntry<uint16_t>({0})); localDataPoolMap.emplace(syrlinks::RX_IQ_POWER, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(SYRLINKS::RX_AGC_VALUE, new PoolEntry<uint16_t>({0})); localDataPoolMap.emplace(syrlinks::RX_AGC_VALUE, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(SYRLINKS::RX_DEMOD_EB, new PoolEntry<uint32_t>({0})); localDataPoolMap.emplace(syrlinks::RX_DEMOD_EB, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(SYRLINKS::RX_DEMOD_N0, new PoolEntry<uint32_t>({0})); localDataPoolMap.emplace(syrlinks::RX_DEMOD_N0, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(SYRLINKS::RX_DATA_RATE, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(syrlinks::RX_DATA_RATE, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(SYRLINKS::TX_STATUS, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(syrlinks::TX_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(SYRLINKS::TX_WAVEFORM, new PoolEntry<uint8_t>({0})); localDataPoolMap.emplace(syrlinks::TX_WAVEFORM, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(SYRLINKS::TX_AGC_VALUE, new PoolEntry<uint16_t>({0})); localDataPoolMap.emplace(syrlinks::TX_AGC_VALUE, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(syrlinks::TEMP_BASEBAND_BOARD, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(syrlinks::TEMP_POWER_AMPLIFIER, new PoolEntry<uint16_t>({0}));
return HasReturnvaluesIF::RETURN_OK; return HasReturnvaluesIF::RETURN_OK;
} }
@ -598,3 +633,21 @@ ReturnValue_t SyrlinksHkHandler::initializeLocalDataPool(localpool::DataPool& lo
void SyrlinksHkHandler::setModeNormal() { mode = MODE_NORMAL; } void SyrlinksHkHandler::setModeNormal() { mode = MODE_NORMAL; }
float SyrlinksHkHandler::calcTempVal(uint16_t raw) { return 0.126984 * raw - 67.87; } 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<const char*>(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;
}
void SyrlinksHkHandler::prepareCommand(std::string command, DeviceCommandId_t commandId) {
command.copy(reinterpret_cast<char*>(commandBuffer), command.size(), 0);
rawPacketLen = command.size();
rememberCommandId = commandId;
rawPacket = commandBuffer;
}

View File

@ -1,10 +1,13 @@
#ifndef MISSION_DEVICES_SYRLINKSHKHANDLER_H_ #ifndef MISSION_DEVICES_SYRLINKSHKHANDLER_H_
#define MISSION_DEVICES_SYRLINKSHKHANDLER_H_ #define MISSION_DEVICES_SYRLINKSHKHANDLER_H_
#include <string.h>
#include "devices/powerSwitcherList.h" #include "devices/powerSwitcherList.h"
#include "fsfw/devicehandlers/DeviceHandlerBase.h" #include "fsfw/devicehandlers/DeviceHandlerBase.h"
#include "fsfw/timemanager/Countdown.h"
#include "fsfw_hal/linux/gpio/Gpio.h"
#include "mission/devices/devicedefinitions/SyrlinksDefinitions.h" #include "mission/devices/devicedefinitions/SyrlinksDefinitions.h"
#include <string.h>
/** /**
* @brief This is the device handler for the syrlinks transceiver. It handles the command * @brief This is the device handler for the syrlinks transceiver. It handles the command
@ -64,8 +67,12 @@ class SyrlinksHkHandler : public DeviceHandlerBase {
std::string setTxModeStandby = "<W04:4000:7E58>"; std::string setTxModeStandby = "<W04:4000:7E58>";
/** W - write, 04 - 4 bytes in data field, 01 - value, 40 register to write value */ /** W - write, 04 - 4 bytes in data field, 01 - value, 40 register to write value */
std::string setTxModeModulation = "<W04:4001:4D69>"; std::string setTxModeModulation = "<W04:4001:4D69>";
std::string configBPSK = "<W04:4007:E7CF>";
std::string configOQPSK = "<W04:400B:1063>";
std::string setTxModeCw = "<W04:4010:4968>"; std::string setTxModeCw = "<W04:4010:4968>";
std::string writeLclConfig = "<W04:0707:3FE4>"; std::string writeLclConfig = "<W04:0707:3FE4>";
std::string setWaveformOQPSK = "<W04:4403:E1FA>";
std::string setWaveformBPSK = "<W04:4406:1E0F>";
std::string readTxStatus = "<R02:40:7555>"; std::string readTxStatus = "<R02:40:7555>";
std::string readTxWaveform = "<R02:44:B991>"; std::string readTxWaveform = "<R02:44:B991>";
std::string readTxAgcValueHighByte = "<R02:46:DFF3>"; std::string readTxAgcValueHighByte = "<R02:46:DFF3>";
@ -80,10 +87,11 @@ class SyrlinksHkHandler : public DeviceHandlerBase {
* In some cases it is not possible to extract from the received reply the information about * 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. * 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::RxDataset rxDataset;
SYRLINKS::TxDataset txDataset; syrlinks::TxDataset txDataset;
syrlinks::TemperatureSet temperatureSet;
const power::Switch_t powerSwitch = power::NO_SWITCH; const power::Switch_t powerSwitch = power::NO_SWITCH;
@ -93,13 +101,19 @@ class SyrlinksHkHandler : public DeviceHandlerBase {
float tempPowerAmplifier = 0; float tempPowerAmplifier = 0;
float tempBasebandBoard = 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 * 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. * 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. * @brief This function converts an uint16_t into its hexadecimal string representation.
@ -192,6 +206,10 @@ class SyrlinksHkHandler : public DeviceHandlerBase {
* @brief Calculates temperature in degree celcius form raw value * @brief Calculates temperature in degree celcius form raw value
*/ */
float calcTempVal(uint16_t); float calcTempVal(uint16_t);
ReturnValue_t handleAckReply(const uint8_t* packet);
void prepareCommand(std::string command, DeviceCommandId_t commandId);
}; };
#endif /* MISSION_DEVICES_SYRLINKSHKHANDLER_H_ */ #endif /* MISSION_DEVICES_SYRLINKSHKHANDLER_H_ */

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
#ifndef MISSION_DEVICES_DEVICEDEFINITIONS_SYRLINKSDEFINITIONS_H_ #ifndef MISSION_DEVICES_DEVICEDEFINITIONS_SYRLINKSDEFINITIONS_H_
#define 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 NONE = 0;
static const DeviceCommandId_t RESET_UNIT = 1; static const DeviceCommandId_t RESET_UNIT = 1;
@ -24,6 +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_POWER_AMPLIFIER_LOW_BYTE = 14;
static const DeviceCommandId_t TEMP_BASEBAND_BOARD_HIGH_BYTE = 15; static const DeviceCommandId_t TEMP_BASEBAND_BOARD_HIGH_BYTE = 15;
static const DeviceCommandId_t TEMP_BASEBAND_BOARD_LOW_BYTE = 16; static const DeviceCommandId_t TEMP_BASEBAND_BOARD_LOW_BYTE = 16;
static const DeviceCommandId_t CONFIG_OQPSK = 17;
// 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 */ /** Size of a simple transmission success response */
static const uint8_t ACK_SIZE = 12; static const uint8_t ACK_SIZE = 12;
@ -36,6 +41,7 @@ static const uint8_t READ_ONE_REGISTER_REPLY_SIE = 13;
static const uint8_t RX_DATASET_ID = 0x1; static const uint8_t RX_DATASET_ID = 0x1;
static const uint8_t TX_DATASET_ID = 0x2; 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_REPLY_SIZE = RX_STATUS_REGISTERS_REPLY_SIZE;
static const size_t MAX_COMMAND_SIZE = 15; static const size_t MAX_COMMAND_SIZE = 15;
@ -44,6 +50,7 @@ static const size_t CRC_FIELD_SIZE = 4;
static const uint8_t RX_DATASET_SIZE = 8; static const uint8_t RX_DATASET_SIZE = 8;
static const uint8_t TX_DATASET_SIZE = 3; static const uint8_t TX_DATASET_SIZE = 3;
static const uint8_t TEMPERATURE_SET_SIZE = 3;
enum SyrlinksPoolIds : lp_id_t { enum SyrlinksPoolIds : lp_id_t {
RX_STATUS, RX_STATUS,
@ -60,6 +67,8 @@ enum SyrlinksPoolIds : lp_id_t {
TX_WAVEFORM, TX_WAVEFORM,
TX_PCM_INDEX, TX_PCM_INDEX,
TX_AGC_VALUE, TX_AGC_VALUE,
TEMP_POWER_AMPLIFIER,
TEMP_BASEBAND_BOARD
}; };
class RxDataset : public StaticLocalDataSet<RX_DATASET_SIZE> { class RxDataset : public StaticLocalDataSet<RX_DATASET_SIZE> {
@ -89,6 +98,18 @@ class TxDataset : public StaticLocalDataSet<TX_DATASET_SIZE> {
lp_var_t<uint16_t> txAgcValue = lp_var_t<uint16_t>(sid.objectId, TX_AGC_VALUE, this); lp_var_t<uint16_t> txAgcValue = lp_var_t<uint16_t>(sid.objectId, TX_AGC_VALUE, this);
}; };
} // namespace SYRLINKS class TemperatureSet : public StaticLocalDataSet<TEMPERATURE_SET_SIZE> {
public:
TemperatureSet(HasLocalDataPoolIF* owner) : StaticLocalDataSet(owner, TEMPERATURE_SET_ID) {}
TemperatureSet(object_id_t objectId) : StaticLocalDataSet(sid_t(objectId, TEMPERATURE_SET_ID)) {}
lp_var_t<uint16_t> temperaturePowerAmplifier =
lp_var_t<uint16_t>(sid.objectId, TEMP_POWER_AMPLIFIER, this);
lp_var_t<uint16_t> temperatureBasebandBoard =
lp_var_t<uint16_t>(sid.objectId, TEMP_BASEBAND_BOARD, this);
};
} // namespace syrlinks
#endif /* MISSION_DEVICES_DEVICEDEFINITIONS_SYRLINKSDEFINITIONS_H_ */ #endif /* MISSION_DEVICES_DEVICEDEFINITIONS_SYRLINKSDEFINITIONS_H_ */

View File

@ -91,9 +91,9 @@ class CCSDSHandler : public SystemObject,
static const ActionId_t ARBITRARY_RATE = 4; static const ActionId_t ARBITRARY_RATE = 4;
static const ActionId_t ENABLE_TX_CLK_MANIPULATOR = 5; static const ActionId_t ENABLE_TX_CLK_MANIPULATOR = 5;
static const ActionId_t DISABLE_TX_CLK_MANIPULATOR = 6; 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; 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; static const ActionId_t UPDATE_ON_FALLING_EDGE = 8;
// Syrlinks supports two bitrates (200 kbps and 1000 kbps) // Syrlinks supports two bitrates (200 kbps and 1000 kbps)

2
tmtc

@ -1 +1 @@
Subproject commit a39c7007c6aef8cac559b38cdf1b9c8815c346ee Subproject commit 8f2ff3034fff627b807f32c02fd9e676126bae5f