From c3665cbd65fd2d836b6acb60969ad8218ae66fb1 Mon Sep 17 00:00:00 2001 From: "Jakob.Meier" Date: Sat, 6 Feb 2021 11:57:45 +0100 Subject: [PATCH] pdu2 dataset update snapshot --- bsp_q7s/InitMission.cpp | 2 +- bsp_q7s/ObjectFactory.cpp | 16 +- bsp_q7s/comIF/CspComIF.cpp | 5 - fsfw | 2 +- fsfwconfig/OBSWConfig.h | 4 +- fsfwconfig/devices/powerSwitcherList.h | 1 + mission/devices/ACUHandler.cpp | 8 +- mission/devices/ACUHandler.h | 3 +- mission/devices/P60DockHandler.cpp | 9 +- mission/devices/P60DockHandler.h | 3 +- mission/devices/PCDUHandler.cpp | 69 +++--- mission/devices/PCDUHandler.h | 13 +- mission/devices/PDU1Handler.cpp | 8 +- mission/devices/PDU1Handler.h | 4 +- mission/devices/PDU2Handler.cpp | 228 ++++++++++++++++-- mission/devices/PDU2Handler.h | 6 +- .../devicedefinitions/GomSpacePackets.h | 20 +- .../devicedefinitions/GomspaceDefinitions.h | 60 ++--- 18 files changed, 312 insertions(+), 149 deletions(-) diff --git a/bsp_q7s/InitMission.cpp b/bsp_q7s/InitMission.cpp index c237eb24..ee39c4ea 100644 --- a/bsp_q7s/InitMission.cpp +++ b/bsp_q7s/InitMission.cpp @@ -139,7 +139,7 @@ void InitMission::initTasks(){ FixedTimeslotTaskIF* GomSpacePstTask = TaskFactory::instance()-> createFixedTimeslotTask("GS_PST_TASK", 50, - PeriodicTaskIF::MINIMUM_STACK_SIZE*4, 3.0, nullptr); + PeriodicTaskIF::MINIMUM_STACK_SIZE*8, 3.0, nullptr); result = pst::gomspacePstInit(GomSpacePstTask); if(result != HasReturnvaluesIF::RETURN_OK) { sif::error << "InitMission::initTasks: GomSpace PST initialization " diff --git a/bsp_q7s/ObjectFactory.cpp b/bsp_q7s/ObjectFactory.cpp index bbfea341..9bf3e82e 100644 --- a/bsp_q7s/ObjectFactory.cpp +++ b/bsp_q7s/ObjectFactory.cpp @@ -81,18 +81,10 @@ void ObjectFactory::produce(){ new I2cComIF(objects::I2C_COM_IF); /* Device Handler */ - new P60DockHandler(objects::P60DOCK_HANDLER, objects::CSP_COM_IF, - p60DockCspCookie, P60Dock::MAX_CONFIGTABLE_ADDRESS, - P60Dock::MAX_HKTABLE_ADDRESS, P60Dock::HK_TABLE_SIZE); - new PDU1Handler(objects::PDU1_HANDLER, objects::CSP_COM_IF, - pdu1CspCookie, PDU::MAX_CONFIGTABLE_ADDRESS, - PDU::MAX_HKTABLE_ADDRESS, PDU::HK_TABLE_SIZE); - new PDU2Handler(objects::PDU2_HANDLER, objects::CSP_COM_IF, - pdu2CspCookie, PDU::MAX_CONFIGTABLE_ADDRESS, - PDU::MAX_HKTABLE_ADDRESS, PDU::HK_TABLE_SIZE); - new ACUHandler(objects::ACU_HANDLER, objects::CSP_COM_IF, - acuCspCookie, ACU::MAX_CONFIGTABLE_ADDRESS, - ACU::MAX_HKTABLE_ADDRESS, ACU::HK_TABLE_SIZE); + new P60DockHandler(objects::P60DOCK_HANDLER, objects::CSP_COM_IF, p60DockCspCookie); + new PDU1Handler(objects::PDU1_HANDLER, objects::CSP_COM_IF, pdu1CspCookie); + new PDU2Handler(objects::PDU2_HANDLER, objects::CSP_COM_IF, pdu2CspCookie); + new ACUHandler(objects::ACU_HANDLER, objects::CSP_COM_IF, acuCspCookie); new PCDUHandler(objects::PCDU_HANDLER); /* Temperature sensors */ Tmp1075Handler* tmp1075Handler_1 = new Tmp1075Handler( diff --git a/bsp_q7s/comIF/CspComIF.cpp b/bsp_q7s/comIF/CspComIF.cpp index b6505d14..4a95487b 100644 --- a/bsp_q7s/comIF/CspComIF.cpp +++ b/bsp_q7s/comIF/CspComIF.cpp @@ -156,15 +156,10 @@ ReturnValue_t CspComIF::cspTransfer(uint8_t cspAddress, uint8_t cspPort, << " device map" << std::endl; } uint8_t* replyBuffer = iter->second.data(); -// uint8_t tmpCmdBuffer[cmdBufferLen]; -// memcpy(tmpCmdBuffer, cmdBuffer, cmdBufferLen); csp_conn_t * conn = csp_connect(CSP_PRIO_HIGH, cspAddress, cspPort, 0, CSP_O_NONE); -// int result = csp_transaction_persistent(conn, timeout_ms, -// tmpCmdBuffer, cmdBufferLen, replyBuffer, querySize); - csp_packet_t* commandPacket = (csp_packet_t*)csp_buffer_get(cmdLen); if (commandPacket == NULL) { sif::error << "CspComIF::cspTransfer: Failed to get memory for a csp packet from the csp " diff --git a/fsfw b/fsfw index 2104d3f3..2f374aef 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 2104d3f38a409a46210849ea23b0ea7fc7efe617 +Subproject commit 2f374aef347a1b0e7a04305eadc768ea63e35077 diff --git a/fsfwconfig/OBSWConfig.h b/fsfwconfig/OBSWConfig.h index 0682a0c3..8df5371b 100644 --- a/fsfwconfig/OBSWConfig.h +++ b/fsfwconfig/OBSWConfig.h @@ -10,10 +10,12 @@ // These defines should be disabled for mission code but are useful for // debugging. -#define OBSW_ENHANCED_PRINTOUT 1 +#define OBSW_ENHANCED_PRINTOUT 0 #define TE0720 0 +#define PDU2_DEBUG 1 + #include "OBSWVersion.h" #ifdef __cplusplus diff --git a/fsfwconfig/devices/powerSwitcherList.h b/fsfwconfig/devices/powerSwitcherList.h index 881c9fa7..6b3a4e11 100644 --- a/fsfwconfig/devices/powerSwitcherList.h +++ b/fsfwconfig/devices/powerSwitcherList.h @@ -26,6 +26,7 @@ namespace pcduSwitches { static const uint8_t INIT_STATE_PAYLOAD_PCDU_CH1 = OFF; static const uint8_t INIT_STATE_RW = OFF; #if TE0720 == 1 + /* Because the TE0720 is not connected to the PCDU, this switch is always on */ static const uint8_t INIT_STATE_TCS_BOARD_8V_HEATER_IN = ON; #else static const uint8_t INIT_STATE_TCS_BOARD_8V_HEATER_IN = OFF; diff --git a/mission/devices/ACUHandler.cpp b/mission/devices/ACUHandler.cpp index d6337c79..f1a823b3 100644 --- a/mission/devices/ACUHandler.cpp +++ b/mission/devices/ACUHandler.cpp @@ -1,9 +1,9 @@ #include "ACUHandler.h" -ACUHandler::ACUHandler(object_id_t objectId, object_id_t comIF, CookieIF * comCookie, - uint16_t maxConfigTableAddress, uint16_t maxHkTableAddress, uint16_t hkTableSize) : - GomspaceDeviceHandler(objectId, comIF, comCookie, maxConfigTableAddress, maxHkTableAddress, - hkTableSize, &acuHkTableDataset), acuHkTableDataset(this) { +ACUHandler::ACUHandler(object_id_t objectId, object_id_t comIF, CookieIF * comCookie) : + GomspaceDeviceHandler(objectId, comIF, comCookie, ACU::MAX_CONFIGTABLE_ADDRESS, + ACU::MAX_HKTABLE_ADDRESS, ACU::HK_TABLE_SIZE, &acuHkTableDataset), acuHkTableDataset( + this) { } ACUHandler::~ACUHandler() { diff --git a/mission/devices/ACUHandler.h b/mission/devices/ACUHandler.h index f596ddd9..e03780a4 100644 --- a/mission/devices/ACUHandler.h +++ b/mission/devices/ACUHandler.h @@ -10,8 +10,7 @@ */ class ACUHandler: public GomspaceDeviceHandler { public: - ACUHandler(object_id_t objectId, object_id_t comIF, CookieIF * comCookie, - uint16_t maxConfigTableAddress, uint16_t maxHkTableAddress, uint16_t hkTableSize); + ACUHandler(object_id_t objectId, object_id_t comIF, CookieIF * comCookie); virtual ~ACUHandler(); protected: diff --git a/mission/devices/P60DockHandler.cpp b/mission/devices/P60DockHandler.cpp index 690a17ad..9f9c42c1 100644 --- a/mission/devices/P60DockHandler.cpp +++ b/mission/devices/P60DockHandler.cpp @@ -1,9 +1,10 @@ #include "P60DockHandler.h" -P60DockHandler::P60DockHandler(object_id_t objectId, object_id_t comIF, CookieIF * comCookie, - uint16_t maxConfigTableAddress, uint16_t maxHkTableAddress, uint16_t hkTableSize) : - GomspaceDeviceHandler(objectId, comIF, comCookie, maxConfigTableAddress, maxHkTableAddress, - hkTableSize, &p60dockHkTableDataset), p60dockHkTableDataset(this) { + +P60DockHandler::P60DockHandler(object_id_t objectId, object_id_t comIF, CookieIF * comCookie) : + GomspaceDeviceHandler(objectId, comIF, comCookie, P60Dock::MAX_CONFIGTABLE_ADDRESS, + P60Dock::MAX_HKTABLE_ADDRESS, P60Dock::HK_TABLE_SIZE, &p60dockHkTableDataset), p60dockHkTableDataset( + this) { } P60DockHandler::~P60DockHandler() { diff --git a/mission/devices/P60DockHandler.h b/mission/devices/P60DockHandler.h index 3c397758..49d2e6a8 100644 --- a/mission/devices/P60DockHandler.h +++ b/mission/devices/P60DockHandler.h @@ -11,8 +11,7 @@ */ class P60DockHandler: public GomspaceDeviceHandler { public: - P60DockHandler(object_id_t objectId, object_id_t comIF, CookieIF * comCookie, - uint16_t maxConfigTableAddress, uint16_t maxHkTableAddress, uint16_t hkTableSize); + P60DockHandler(object_id_t objectId, object_id_t comIF, CookieIF * comCookie); virtual ~P60DockHandler(); protected: diff --git a/mission/devices/PCDUHandler.cpp b/mission/devices/PCDUHandler.cpp index 0508d56c..7b534f1a 100644 --- a/mission/devices/PCDUHandler.cpp +++ b/mission/devices/PCDUHandler.cpp @@ -42,7 +42,7 @@ ReturnValue_t PCDUHandler::initialize() { HasLocalDataPoolIF* pdu2Handler = objectManager->get(objects::PDU2_HANDLER); if(pdu2Handler == nullptr) { - sif::warning << "PCDUHandler::initialize: Invalid pdu2Handler" << std::endl; + sif::error << "PCDUHandler::initialize: Invalid pdu2Handler" << std::endl; return RETURN_FAILED; } result = pdu2Handler->getSubscriptionInterface()->subscribeForSetUpdateMessages( @@ -50,6 +50,7 @@ ReturnValue_t PCDUHandler::initialize() { if (result != RETURN_OK) { sif::error << "PCDUHandler::initialize: Failed to subscribe for set update messages from " << "PDU2Handler" << std::endl; + return result; } return RETURN_OK; @@ -70,6 +71,12 @@ void PCDUHandler::initializeSwitchStates() { void PCDUHandler::readCommandQueue() { ReturnValue_t result; CommandMessage command; + + result = commandQueue->receiveMessage(&command); + if (result != RETURN_OK) { + return; + } + result = poolManager.handleHousekeepingMessage(&command); if (result == RETURN_OK) { return; @@ -82,28 +89,8 @@ MessageQueueId_t PCDUHandler::getCommandQueue() const { void PCDUHandler::handleChangedDataset(sid_t sid, store_address_t storeId) { - ReturnValue_t result; - - if (sid == sid_t(objects::PCDU_HANDLER, PDU2::HK_TABLE_DATA_SET_ID)) { - HousekeepingSnapshot packetUpdate(reinterpret_cast(&timeStamp), - sizeof(timeStamp), &pdu2HkTableDataset); - const uint8_t* packet_ptr = NULL; - size_t size; - result = IPCStore->getData(storeId, &packet_ptr, &size); - if (result != RETURN_OK) { - sif::error << "PCDUHandler::handleChangedDataset: Failed to get data from IPCStore." - << std::endl; - } - result = packetUpdate.deSerialize(&packet_ptr, &size, SerializeIF::Endianness::BIG); - if (result != RETURN_OK) { - sif::error << "PCDUHandler::handleChangedDataset: Failed to deserialize packet in " - << "pdu2HkTableDataset" << std::endl; - } - result = IPCStore->deleteData(storeId); - if (result != RETURN_OK) { - sif::error << "PCDUHandler::handleChangedDataset: Failed to delete data in IPCStore" - << std::endl; - } + if (sid == sid_t(objects::PDU2_HANDLER, PDU2::HK_TABLE_DATA_SET_ID)) { + updatePdu2HousekeepingDataset(storeId); updatePdu2SwitchStates(); } else { @@ -111,17 +98,43 @@ void PCDUHandler::handleChangedDataset(sid_t sid, store_address_t storeId) { } } +void PCDUHandler::updatePdu2HousekeepingDataset(store_address_t storeId) { + ReturnValue_t result; + + HousekeepingSnapshot packetUpdate(reinterpret_cast(&timeStampPdu2HkDataset), + sizeof(timeStampPdu2HkDataset), &pdu2HkTableDataset); + const uint8_t* packet_ptr = NULL; + size_t size; + result = IPCStore->getData(storeId, &packet_ptr, &size); + if (result != RETURN_OK) { + sif::error << "PCDUHandler::handleChangedDataset: Failed to get data from IPCStore." + << std::endl; + } + pdu2HkTableDataset.read(); + result = packetUpdate.deSerialize(&packet_ptr, &size, SerializeIF::Endianness::MACHINE); + if (result != RETURN_OK) { + sif::error << "PCDUHandler::handleChangedDataset: Failed to deserialize packet in " + << "pdu2HkTableDataset" << std::endl; + } + pdu2HkTableDataset.commit(); + result = IPCStore->deleteData(storeId); + if (result != RETURN_OK) { + sif::error << "PCDUHandler::handleChangedDataset: Failed to delete data in IPCStore" + << std::endl; + } +} + void PCDUHandler::updatePdu2SwitchStates() { //TODO: pool read helper - if (pdu2HkTableDataset.read() != RETURN_OK) { + if (pdu2HkTableDataset.read() == RETURN_OK) { switchStates[pcduSwitches::Q7S] = pdu2HkTableDataset.outEnabledQ7S.value; switchStates[pcduSwitches::PAYLOAD_PCDU_CH1] = pdu2HkTableDataset.outEnabledPlPCDUCh1.value; switchStates[pcduSwitches::RW] = pdu2HkTableDataset.outEnabledReactionWheels.value; switchStates[pcduSwitches::TCS_BOARD_8V_HEATER_IN] = pdu2HkTableDataset.outEnabledTCSBoardHeaterIn.value; - switchStates[pcduSwitches::SUS_REDUNDANT] = pdu2HkTableDataset.outEnabledSUS.value; + switchStates[pcduSwitches::SUS_REDUNDANT] = pdu2HkTableDataset.outEnabledSUSRedundant.value; switchStates[pcduSwitches::DEPLOYMENT_MECHANISM] = pdu2HkTableDataset.outEnabledDeplMechanism.value; switchStates[pcduSwitches::PAYLOAD_PCDU_CH6] = pdu2HkTableDataset.outEnabledPlPCDUCh6.value; - switchStates[pcduSwitches::ACS_BOARD_SIDE_B] = pdu2HkTableDataset.outEnabledAcsBoard.value; + switchStates[pcduSwitches::ACS_BOARD_SIDE_B] = pdu2HkTableDataset.outEnabledAcsBoardSideB.value; switchStates[pcduSwitches::PAYLOAD_CAMERA] = pdu2HkTableDataset.outEnabledPayloadCamera.value; } else { @@ -260,7 +273,6 @@ ReturnValue_t PCDUHandler::initializeLocalDataPool(localpool::DataPool &localDat localDataPoolMap.emplace(P60System::PDU2_CONV_EN_1, new PoolEntry( { 0 })); localDataPoolMap.emplace(P60System::PDU2_CONV_EN_2, new PoolEntry( { 0 })); localDataPoolMap.emplace(P60System::PDU2_CONV_EN_3, new PoolEntry( { 0 })); - localDataPoolMap.emplace(P60System::PDU2_DUMMY_BYTE_CONV_EN, new PoolEntry( { 0 })); localDataPoolMap.emplace(P60System::PDU2_OUT_EN_Q7S, new PoolEntry( { pcduSwitches::INIT_STATE_Q7S })); @@ -283,14 +295,12 @@ ReturnValue_t PCDUHandler::initializeLocalDataPool(localpool::DataPool &localDat pcduSwitches::INIT_STATE_ACS_BOARD_SIDE_B })); localDataPoolMap.emplace(P60System::PDU2_OUT_EN_PAYLOAD_CAMERA, new PoolEntry( { pcduSwitches::INIT_STATE_PAYLOAD_CAMERA })); - localDataPoolMap.emplace(P60System::PDU2_DUMMY_BYTE_OUT_EN, new PoolEntry( { 0 })); localDataPoolMap.emplace(P60System::PDU2_BOOTCAUSE, new PoolEntry( { 0 })); localDataPoolMap.emplace(P60System::PDU2_BOOTCNT, new PoolEntry( { 0 })); localDataPoolMap.emplace(P60System::PDU2_UPTIME, new PoolEntry( { 0 })); localDataPoolMap.emplace(P60System::PDU2_RESETCAUSE, new PoolEntry( { 0 })); localDataPoolMap.emplace(P60System::PDU2_BATT_MODE, new PoolEntry( { 0 })); - localDataPoolMap.emplace(P60System::PDU2_DUMMY_BYTE_BATT_MODE, new PoolEntry( { 0 })); localDataPoolMap.emplace(P60System::PDU2_LATCHUP_Q7S, new PoolEntry( { 0 })); localDataPoolMap.emplace(P60System::PDU2_LATCHUP_PAYLOAD_PCDU_CH1, new PoolEntry( { 0 })); @@ -320,7 +330,6 @@ ReturnValue_t PCDUHandler::initializeLocalDataPool(localpool::DataPool &localDat localDataPoolMap.emplace(P60System::PDU2_DEVICE_5_STATUS, new PoolEntry( { 0 })); localDataPoolMap.emplace(P60System::PDU2_DEVICE_6_STATUS, new PoolEntry( { 0 })); localDataPoolMap.emplace(P60System::PDU2_DEVICE_7_STATUS, new PoolEntry( { 0 })); - localDataPoolMap.emplace(P60System::PDU2_DUMMY_DEVICE_STATUS, new PoolEntry( { 0 })); localDataPoolMap.emplace(P60System::PDU2_WDT_CNT_GND, new PoolEntry( { 0 })); localDataPoolMap.emplace(P60System::PDU2_WDT_CNT_I2C, new PoolEntry( { 0 })); diff --git a/mission/devices/PCDUHandler.h b/mission/devices/PCDUHandler.h index 509d61d9..e315e139 100644 --- a/mission/devices/PCDUHandler.h +++ b/mission/devices/PCDUHandler.h @@ -61,7 +61,12 @@ private: */ PDU2::PDU2HkTableDataset pdu2HkTableDataset; /** The timeStamp of the current pdu2HkTableDataset */ - CCSDSTime::CDS_short timeStamp; + CCSDSTime::CDS_short timeStampPdu2HkDataset; + + /** Hk table dataset of PDU1 */ +// PDU1::PDU1HkTableDataset pdu1HkTableDataset; +// /** The timeStamp of the current pdu1HkTableDataset */ +// CCSDSTime::CDS_short timeStampPdu1HkDataset; uint8_t switchStates[pcduSwitches::NUMBER_OF_SWITCHES]; /** @@ -94,6 +99,12 @@ private: */ void updatePdu2SwitchStates(); + /** + * @brief In case of an update snapshot message with a pdu2 hk table dataset, this function + * copies the updated values to the local pdu2HkTableDataset. + */ + void updatePdu2HousekeepingDataset(store_address_t storeId); + /** * @brief Updates all switchStates related to the PDU1. Called each time the PDU1Handler * sends a new hk dataset. diff --git a/mission/devices/PDU1Handler.cpp b/mission/devices/PDU1Handler.cpp index 3d3503e9..1ae6bf30 100644 --- a/mission/devices/PDU1Handler.cpp +++ b/mission/devices/PDU1Handler.cpp @@ -1,10 +1,10 @@ #include "PDU1Handler.h" #include -PDU1Handler::PDU1Handler(object_id_t objectId, object_id_t comIF, CookieIF * comCookie, - uint16_t maxConfigTableAddress, uint16_t maxHkTableAddress, uint16_t hkTableSize) : - GomspaceDeviceHandler(objectId, comIF, comCookie, maxConfigTableAddress, maxHkTableAddress, - hkTableSize, &pdu1HkTableDataset), pdu1HkTableDataset(this) { +PDU1Handler::PDU1Handler(object_id_t objectId, object_id_t comIF, CookieIF * comCookie) : + GomspaceDeviceHandler(objectId, comIF, comCookie, PDU::MAX_CONFIGTABLE_ADDRESS, + PDU::MAX_HKTABLE_ADDRESS, PDU::HK_TABLE_REPLY_SIZE, &pdu1HkTableDataset), pdu1HkTableDataset( + this) { } PDU1Handler::~PDU1Handler() { diff --git a/mission/devices/PDU1Handler.h b/mission/devices/PDU1Handler.h index aadc9327..29b615d3 100644 --- a/mission/devices/PDU1Handler.h +++ b/mission/devices/PDU1Handler.h @@ -21,9 +21,7 @@ */ class PDU1Handler: public GomspaceDeviceHandler { public: - PDU1Handler(object_id_t objectId, object_id_t comIF, - CookieIF * comCookie, uint16_t maxConfigTableAddress, uint16_t maxHkTableAddress, - uint16_t hkTableSize); + PDU1Handler(object_id_t objectId, object_id_t comIF, CookieIF * comCookie); virtual ~PDU1Handler(); protected: /** diff --git a/mission/devices/PDU2Handler.cpp b/mission/devices/PDU2Handler.cpp index c9d80c1a..68a554b4 100644 --- a/mission/devices/PDU2Handler.cpp +++ b/mission/devices/PDU2Handler.cpp @@ -2,10 +2,10 @@ #include #include -PDU2Handler::PDU2Handler(object_id_t objectId, object_id_t comIF, CookieIF * comCookie, - uint16_t maxConfigTableAddress, uint16_t maxHkTableAddress) : - GomspaceDeviceHandler(objectId, comIF, comCookie, maxConfigTableAddress, maxHkTableAddress, - PDU::HK, &pdu2HkTableDataset), pdu2HkTableDataset(this) { +PDU2Handler::PDU2Handler(object_id_t objectId, object_id_t comIF, CookieIF * comCookie) : + GomspaceDeviceHandler(objectId, comIF, comCookie, PDU::MAX_CONFIGTABLE_ADDRESS, + PDU::MAX_HKTABLE_ADDRESS, PDU::HK_TABLE_REPLY_SIZE, &pdu2HkTableDataset), pdu2HkTableDataset( + this) { } PDU2Handler::~PDU2Handler() { @@ -19,27 +19,213 @@ ReturnValue_t PDU2Handler::buildNormalDeviceCommand( void PDU2Handler::letChildHandleHkReply(DeviceCommandId_t id, const uint8_t *packet) { - ReturnValue_t result; + parseHkTableReply(packet); + handleDeviceTM(&pdu2HkTableDataset, id, true); - /* Pointer points to beginning of payload data */ +#if OBSW_ENHANCED_PRINTOUT == 1 && PDU2_DEBUG == 1 pdu2HkTableDataset.read(); - const uint8_t* payloadPtr = packet + 12; - size_t size = (size_t)hkTableSize; - result = pdu2HkTableDataset.deSerialize(&payloadPtr, &size, SerializeIF::Endianness::BIG); - if (result != RETURN_OK) { - sif::debug << "PDU2Handler::letChildHandleHkReply: Failed to deserialize housekeeping " - << "packet array into pdu2HkTableDataset" << std::endl; - return; - } -// FullTableReply fullTableReply(id, HK_TABLE_ID, &pdu2HkTableDataset); -// handleDeviceTM(&fullTableReply, id, true); -#if OBSW_ENHANCED_PRINTOUT == 1 - float temperatureC = pdu2HkTableDataset.temperature.value; - sif::info << "PDU2 Temperature: " << temperatureC << "°C" << std::endl; + sif::info << "PDU2 Q7S current voltage: " << pdu2HkTableDataset.voltageOutQ7S << " mV" << std::endl; + sif::info << "PDU2 VCC: " << pdu2HkTableDataset.vcc << " mV" << std::endl; + float vbat = pdu2HkTableDataset.vbat.value * 0.1; + sif::info << "PDU2 VBAT: " << vbat << std::endl; + float temperatureC = pdu2HkTableDataset.temperature.value * 0.1; + sif::info << "PDU2 Temperature: " << temperatureC << " °C" << std::endl; + sif::info << "PDU2 Q7S enable state: " << unsigned(pdu2HkTableDataset.outEnabledQ7S.value) << std::endl; + sif::info << "PDU2 Payload PCDU channel 1 enable state: " + << unsigned(pdu2HkTableDataset.outEnabledPlPCDUCh1.value) << std::endl; + sif::info << "PDU2 reaction wheels enable state: " + << unsigned(pdu2HkTableDataset.outEnabledReactionWheels.value) << std::endl; + sif::info << "PDU2 TCS Board 8V heater input enable state: " + << unsigned(pdu2HkTableDataset.outEnabledTCSBoardHeaterIn.value) << std::endl; + sif::info << "PDU2 redundant SUS group enable state: " + << unsigned(pdu2HkTableDataset.outEnabledSUSRedundant.value) << std::endl; + sif::info << "PDU2 deployment mechanism enable state: " + << unsigned(pdu2HkTableDataset.outEnabledDeplMechanism.value) << std::endl; + sif::info << "PDU2 PCDU channel 6 enable state: " + << unsigned(pdu2HkTableDataset.outEnabledPlPCDUCh6.value) << std::endl; + sif::info << "PDU2 ACS board side B enable state: " + << unsigned(pdu2HkTableDataset.outEnabledAcsBoardSideB.value) << std::endl; + sif::info << "PDU2 payload camera enable state: " + << unsigned(pdu2HkTableDataset.outEnabledPayloadCamera.value) << std::endl; + sif::info << "PDU2 uptime: " << pdu2HkTableDataset.uptime << " seconds" << std::endl; + sif::info << "PDU2 battery mode: " << unsigned(pdu2HkTableDataset.battMode.value) << std::endl; + sif::info << "PDU2 ground watchdog reboots: " << pdu2HkTableDataset.gndWdtReboots << std::endl; + sif::info << "PDU2 ground watchdog timer seconds left: " + << pdu2HkTableDataset.groundWatchdogSecondsLeft << " seconds" << std::endl; + sif::info << "PDU2 csp1 watchdog pings before reboot: " + << unsigned(pdu2HkTableDataset.csp1WatchdogPingsLeft.value) << std::endl; + sif::info << "PDU2 csp2 watchdog pings before reboot: " + << unsigned(pdu2HkTableDataset.csp2WatchdogPingsLeft.value) << std::endl; pdu2HkTableDataset.commit(); #endif } +void PDU2Handler::parseHkTableReply(const uint8_t *packet) { + uint16_t dataOffset = 0; + pdu2HkTableDataset.read(); + /* Fist 10 bytes contain the gomspace header. Each variable is preceded by the 16-bit table + * address. */ + dataOffset += 12; + pdu2HkTableDataset.currentOutQ7S = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); + dataOffset += 4; + pdu2HkTableDataset.currentOutPayloadPCDUCh1 = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); + dataOffset += 4; + pdu2HkTableDataset.currentOutReactionWheels = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); + dataOffset += 4; + pdu2HkTableDataset.currentOutTCSBoardHeaterIn = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); + dataOffset += 4; + pdu2HkTableDataset.currentOutSUSRedundant = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); + dataOffset += 4; + pdu2HkTableDataset.currentOutDeplMechanism = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); + dataOffset += 4; + pdu2HkTableDataset.currentOutPayloadPCDUCh6 = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); + dataOffset += 4; + pdu2HkTableDataset.currentOutACSBoardSideB = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); + dataOffset += 4; + pdu2HkTableDataset.currentOutPayloadCamera = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); + dataOffset += 4; + + pdu2HkTableDataset.voltageOutQ7S = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); + dataOffset += 4; + pdu2HkTableDataset.voltageOutPayloadPCDUCh1 = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); + dataOffset += 4; + pdu2HkTableDataset.voltageOutReactionWheels = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); + dataOffset += 4; + pdu2HkTableDataset.voltageOutTCSBoardHeaterIn = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); + dataOffset += 4; + pdu2HkTableDataset.voltageOutSUSRedundant = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); + dataOffset += 4; + pdu2HkTableDataset.voltageOutDeplMechanism = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); + dataOffset += 4; + pdu2HkTableDataset.voltageOutPayloadPCDUCh6 = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); + dataOffset += 4; + pdu2HkTableDataset.voltageOutACSBoardSideB = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); + dataOffset += 4; + pdu2HkTableDataset.voltageOutPayloadCamera = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); + dataOffset += 4; + + pdu2HkTableDataset.vcc = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); + dataOffset += 4; + pdu2HkTableDataset.vbat = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); + dataOffset += 4; + pdu2HkTableDataset.temperature = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); + dataOffset += 4; + + pdu2HkTableDataset.converterEnable1 = *(packet + dataOffset); + dataOffset += 3; + pdu2HkTableDataset.converterEnable2 = *(packet + dataOffset); + dataOffset += 3; + pdu2HkTableDataset.converterEnable3 = *(packet + dataOffset); + dataOffset += 3; + + pdu2HkTableDataset.outEnabledQ7S = *(packet + dataOffset); + dataOffset += 3; + pdu2HkTableDataset.outEnabledPlPCDUCh1 = *(packet + dataOffset); + dataOffset += 3; + pdu2HkTableDataset.outEnabledReactionWheels = *(packet + dataOffset); + dataOffset += 3; + pdu2HkTableDataset.outEnabledTCSBoardHeaterIn = *(packet + dataOffset); + dataOffset += 3; + pdu2HkTableDataset.outEnabledSUSRedundant = *(packet + dataOffset); + dataOffset += 3; + pdu2HkTableDataset.outEnabledDeplMechanism = *(packet + dataOffset); + dataOffset += 3; + pdu2HkTableDataset.outEnabledPlPCDUCh6 = *(packet + dataOffset); + dataOffset += 3; + pdu2HkTableDataset.outEnabledAcsBoardSideB = *(packet + dataOffset); + dataOffset += 3; + pdu2HkTableDataset.outEnabledPayloadCamera = *(packet + dataOffset); + dataOffset += 3; + + pdu2HkTableDataset.bootcause = *(packet + dataOffset) << 24 | *(packet + dataOffset + 1) << 16 | *(packet + dataOffset + 2) << 8 | *(packet + dataOffset + 3); + dataOffset += 6; + pdu2HkTableDataset.bootcount = *(packet + dataOffset) << 24 | *(packet + dataOffset + 1) << 16 | *(packet + dataOffset + 2) << 8 | *(packet + dataOffset + 3); + dataOffset += 6; + pdu2HkTableDataset.uptime = *(packet + dataOffset) << 24 | *(packet + dataOffset + 1) << 16 | *(packet + dataOffset + 2) << 8 | *(packet + dataOffset + 3); + dataOffset += 6; + pdu2HkTableDataset.resetcause = *(packet + dataOffset + 1) << 8 | *(packet + dataOffset); + dataOffset += 4; + pdu2HkTableDataset.battMode = *(packet + dataOffset); + /* +10 because here begins the second gomspace csp packet */ + dataOffset += 3 + 10; + + pdu2HkTableDataset.latchupsQ7S = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); + dataOffset += 4; + pdu2HkTableDataset.latchupsPayloadPcduCh1 = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); + dataOffset += 4; + pdu2HkTableDataset.latchupsRw = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); + dataOffset += 4; + pdu2HkTableDataset.latchupsTcsBoardHeaterIn = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); + dataOffset += 4; + pdu2HkTableDataset.latchupsSusRedundant = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); + dataOffset += 4; + pdu2HkTableDataset.latchupsDeplMenchanism = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); + dataOffset += 4; + pdu2HkTableDataset.latchupsPayloadPcduCh6 = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); + dataOffset += 4; + pdu2HkTableDataset.latchupsAcsBoardSideB = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); + dataOffset += 4; + pdu2HkTableDataset.latchupsPayloadCamera = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); + dataOffset += 4; + + pdu2HkTableDataset.device0 = *(packet + dataOffset); + dataOffset += 3; + pdu2HkTableDataset.device1 = *(packet + dataOffset); + dataOffset += 3; + pdu2HkTableDataset.device2 = *(packet + dataOffset); + dataOffset += 3; + pdu2HkTableDataset.device3 = *(packet + dataOffset); + dataOffset += 3; + pdu2HkTableDataset.device4 = *(packet + dataOffset); + dataOffset += 3; + pdu2HkTableDataset.device5 = *(packet + dataOffset); + dataOffset += 3; + pdu2HkTableDataset.device6 = *(packet + dataOffset); + dataOffset += 3; + pdu2HkTableDataset.device7 = *(packet + dataOffset); + dataOffset += 3; + + pdu2HkTableDataset.device0Status = *(packet + dataOffset); + dataOffset += 3; + pdu2HkTableDataset.device1Status = *(packet + dataOffset); + dataOffset += 3; + pdu2HkTableDataset.device2Status = *(packet + dataOffset); + dataOffset += 3; + pdu2HkTableDataset.device3Status = *(packet + dataOffset); + dataOffset += 3; + pdu2HkTableDataset.device4Status = *(packet + dataOffset); + dataOffset += 3; + pdu2HkTableDataset.device5Status = *(packet + dataOffset); + dataOffset += 3; + pdu2HkTableDataset.device6Status = *(packet + dataOffset); + dataOffset += 3; + pdu2HkTableDataset.device7Status = *(packet + dataOffset); + dataOffset += 3; + + pdu2HkTableDataset.gndWdtReboots = *(packet + dataOffset) << 24 | *(packet + dataOffset + 1) << 16 | *(packet + dataOffset + 2) << 8 | *(packet + dataOffset + 3); + dataOffset += 6; + pdu2HkTableDataset.i2cWdtReboots = *(packet + dataOffset) << 24 | *(packet + dataOffset + 1) << 16 | *(packet + dataOffset + 2) << 8 | *(packet + dataOffset + 3); + dataOffset += 6; + pdu2HkTableDataset.canWdtReboots = *(packet + dataOffset) << 24 | *(packet + dataOffset + 1) << 16 | *(packet + dataOffset + 2) << 8 | *(packet + dataOffset + 3); + dataOffset += 6; + pdu2HkTableDataset.csp1WdtReboots = *(packet + dataOffset) << 24 | *(packet + dataOffset + 1) << 16 | *(packet + dataOffset + 2) << 8 | *(packet + dataOffset + 3); + dataOffset += 6; + pdu2HkTableDataset.csp2WdtReboots = *(packet + dataOffset) << 24 | *(packet + dataOffset + 1) << 16 | *(packet + dataOffset + 2) << 8 | *(packet + dataOffset + 3); + dataOffset += 6; + pdu2HkTableDataset.groundWatchdogSecondsLeft = *(packet + dataOffset) << 24 | *(packet + dataOffset + 1) << 16 | *(packet + dataOffset + 2) << 8 | *(packet + dataOffset + 3); + dataOffset += 6; + pdu2HkTableDataset.i2cWatchdogSecondsLeft = *(packet + dataOffset) << 24 | *(packet + dataOffset + 1) << 16 | *(packet + dataOffset + 2) << 8 | *(packet + dataOffset + 3); + dataOffset += 6; + pdu2HkTableDataset.canWatchdogSecondsLeft = *(packet + dataOffset) << 24 | *(packet + dataOffset + 1) << 16 | *(packet + dataOffset + 2) << 8 | *(packet + dataOffset + 3); + dataOffset += 6; + pdu2HkTableDataset.csp1WatchdogPingsLeft = *(packet + dataOffset); + dataOffset += 3; + pdu2HkTableDataset.csp2WatchdogPingsLeft = *(packet + dataOffset); + + pdu2HkTableDataset.commit(); + pdu2HkTableDataset.setChanged(true); +} + ReturnValue_t PDU2Handler::initializeLocalDataPool( localpool::DataPool &localDataPoolMap, LocalDataPoolManager &poolManager) { @@ -70,7 +256,6 @@ ReturnValue_t PDU2Handler::initializeLocalDataPool( localDataPoolMap.emplace(P60System::PDU2_CONV_EN_1, new PoolEntry( { 0 })); localDataPoolMap.emplace(P60System::PDU2_CONV_EN_2, new PoolEntry( { 0 })); localDataPoolMap.emplace(P60System::PDU2_CONV_EN_3, new PoolEntry( { 0 })); - localDataPoolMap.emplace(P60System::PDU2_DUMMY_BYTE_CONV_EN, new PoolEntry( { 0 })); localDataPoolMap.emplace(P60System::PDU2_OUT_EN_Q7S, new PoolEntry( { 0 })); localDataPoolMap.emplace(P60System::PDU2_OUT_EN_PAYLOAD_PCDU_CH1, new PoolEntry( { 0 })); @@ -85,14 +270,12 @@ ReturnValue_t PDU2Handler::initializeLocalDataPool( localDataPoolMap.emplace(P60System::PDU2_OUT_EN_PAYLOAD_PCDU_CH6, new PoolEntry( { 0 })); localDataPoolMap.emplace(P60System::PDU2_OUT_EN_ACS_BOARD_SIDE_B, new PoolEntry( { 0 })); localDataPoolMap.emplace(P60System::PDU2_OUT_EN_PAYLOAD_CAMERA, new PoolEntry( { 0 })); - localDataPoolMap.emplace(P60System::PDU2_DUMMY_BYTE_OUT_EN, new PoolEntry( { 0 })); localDataPoolMap.emplace(P60System::PDU2_BOOTCAUSE, new PoolEntry( { 0 })); localDataPoolMap.emplace(P60System::PDU2_BOOTCNT, new PoolEntry( { 0 })); localDataPoolMap.emplace(P60System::PDU2_UPTIME, new PoolEntry( { 0 })); localDataPoolMap.emplace(P60System::PDU2_RESETCAUSE, new PoolEntry( { 0 })); localDataPoolMap.emplace(P60System::PDU2_BATT_MODE, new PoolEntry( { 0 })); - localDataPoolMap.emplace(P60System::PDU2_DUMMY_BYTE_BATT_MODE, new PoolEntry( { 0 })); localDataPoolMap.emplace(P60System::PDU2_LATCHUP_Q7S, new PoolEntry( { 0 })); localDataPoolMap.emplace(P60System::PDU2_LATCHUP_PAYLOAD_PCDU_CH1, new PoolEntry( { 0 })); @@ -122,7 +305,6 @@ ReturnValue_t PDU2Handler::initializeLocalDataPool( localDataPoolMap.emplace(P60System::PDU2_DEVICE_5_STATUS, new PoolEntry( { 0 })); localDataPoolMap.emplace(P60System::PDU2_DEVICE_6_STATUS, new PoolEntry( { 0 })); localDataPoolMap.emplace(P60System::PDU2_DEVICE_7_STATUS, new PoolEntry( { 0 })); - localDataPoolMap.emplace(P60System::PDU2_DUMMY_DEVICE_STATUS, new PoolEntry( { 0 })); localDataPoolMap.emplace(P60System::PDU2_WDT_CNT_GND, new PoolEntry( { 0 })); localDataPoolMap.emplace(P60System::PDU2_WDT_CNT_I2C, new PoolEntry( { 0 })); diff --git a/mission/devices/PDU2Handler.h b/mission/devices/PDU2Handler.h index bc8c76da..ee30a12f 100644 --- a/mission/devices/PDU2Handler.h +++ b/mission/devices/PDU2Handler.h @@ -20,8 +20,7 @@ */ class PDU2Handler: public GomspaceDeviceHandler { public: - PDU2Handler(object_id_t objectId, object_id_t comIF, CookieIF * comCookie, - uint16_t maxConfigTableAddress, uint16_t maxHkTableAddress, uint16_t hkTableSize); + PDU2Handler(object_id_t objectId, object_id_t comIF, CookieIF * comCookie); virtual ~PDU2Handler(); virtual ReturnValue_t initializeLocalDataPool(localpool::DataPool& localDataPoolMap, @@ -35,8 +34,11 @@ protected: virtual void letChildHandleHkReply(DeviceCommandId_t id, const uint8_t *packet) override; private: + /** Dataset for the housekeeping table of the PDU2 */ PDU2::PDU2HkTableDataset pdu2HkTableDataset; + + void parseHkTableReply(const uint8_t *packet); }; #endif /* MISSION_DEVICES_PDU2HANDLER_H_ */ diff --git a/mission/devices/devicedefinitions/GomSpacePackets.h b/mission/devices/devicedefinitions/GomSpacePackets.h index 4e2ef19f..0570732f 100644 --- a/mission/devices/devicedefinitions/GomSpacePackets.h +++ b/mission/devices/devicedefinitions/GomSpacePackets.h @@ -316,33 +316,33 @@ private: /** - * @brief This class generates the reply containing data from a full table request. + * @brief This class generates the reply containing data from a full housekeeping table request + * of the PDU2. */ -class FullTableReply : public SerialLinkedListAdapter { +class Pdu2FullTableReply : public SerialLinkedListAdapter { public: /** * @brief Constructor * - * @param action_ The command which triggers the full table request. + * @param action_ The command which triggered the full table request. * @param tableId_ The id of the requested table. - * @param tableDataset_ Pointer to the dataset holding the table data. + * @param tableDataset_ The dataset holding the table data. */ - FullTableReply(uint8_t action_, uint8_t tableId_, LocalPoolDataSetBase* tableDataset_) : - action(action_), tableId(tableId_), tableDataset(*tableDataset_) { + Pdu2FullTableReply(uint8_t action_, uint8_t tableId_, PDU2::PDU2HkTableDataset tableDataset_) : + action(action_), tableId(tableId_), tableDataset(tableDataset_) { setLinks(); } private: - FullTableReply(const FullTableReply &reply); + Pdu2FullTableReply(const Pdu2FullTableReply &reply); void setLinks() { setStart(&action); action.setNext(&tableId); tableId.setNext(&tableDataset); - tableDataset.setNext(&tableDataset); } SerializeElement action; SerializeElement tableId; - SerializeElement tableDataset; + SerializeElement tableDataset; }; @@ -413,7 +413,7 @@ public: } private: - GomspaceSetParamMessage(const FullTableReply &reply); + GomspaceSetParamMessage(const GomspaceSetParamMessage &reply); void setLinks() { setStart(&memoryAddress); memoryAddress.setNext(¶meterValueInfo); diff --git a/mission/devices/devicedefinitions/GomspaceDefinitions.h b/mission/devices/devicedefinitions/GomspaceDefinitions.h index 2f10fb89..4821b4c0 100644 --- a/mission/devices/devicedefinitions/GomspaceDefinitions.h +++ b/mission/devices/devicedefinitions/GomspaceDefinitions.h @@ -162,7 +162,6 @@ namespace P60System { PDU1_CONV_EN_1, PDU1_CONV_EN_2, PDU1_CONV_EN_3, - PDU1_DUMMY_BYTE_CONV_EN, PDU1_OUT_EN_TCS_BOARD_3V3, PDU1_OUT_EN_SYRLINKS, PDU1_OUT_EN_STAR_TRACKER, @@ -172,13 +171,11 @@ namespace P60System { PDU1_OUT_EN_PLOC, PDU1_OUT_EN_ACS_BOARD_SIDE_A, PDU1_OUT_EN_CHANNEL8, - PDU1_DUMMY_BYTE_OUT_EN, PDU1_BOOTCAUSE, PDU1_BOOTCNT, PDU1_UPTIME, PDU1_RESETCAUSE, PDU1_BATT_MODE, - PDU1_DUMMY_BYTE_BATT_MODE, PDU1_LATCHUP_TCS_BOARD_3V3, PDU1_LATCHUP_SYRLINKS, PDU1_LATCHUP_STAR_TRACKER, @@ -204,7 +201,6 @@ namespace P60System { PDU1_DEVICE_5_STATUS, PDU1_DEVICE_6_STATUS, PDU1_DEVICE_7_STATUS, - PDU1_DUMMY_DEVICE_STATUS, PDU1_WDT_CNT_GND, PDU1_WDT_CNT_I2C, PDU1_WDT_CNT_CAN, @@ -241,7 +237,6 @@ namespace P60System { PDU2_CONV_EN_1, PDU2_CONV_EN_2, PDU2_CONV_EN_3, - PDU2_DUMMY_BYTE_CONV_EN, PDU2_OUT_EN_Q7S, PDU2_OUT_EN_PAYLOAD_PCDU_CH1, PDU2_OUT_EN_RW, @@ -251,13 +246,11 @@ namespace P60System { PDU2_OUT_EN_PAYLOAD_PCDU_CH6, PDU2_OUT_EN_ACS_BOARD_SIDE_B, PDU2_OUT_EN_PAYLOAD_CAMERA, - PDU2_DUMMY_BYTE_OUT_EN, PDU2_BOOTCAUSE, PDU2_BOOTCNT, PDU2_UPTIME, PDU2_RESETCAUSE, PDU2_BATT_MODE, - PDU2_DUMMY_BYTE_BATT_MODE, PDU2_LATCHUP_Q7S, PDU2_LATCHUP_PAYLOAD_PCDU_CH1, PDU2_LATCHUP_RW, @@ -283,7 +276,6 @@ namespace P60System { PDU2_DEVICE_5_STATUS, PDU2_DEVICE_6_STATUS, PDU2_DEVICE_7_STATUS, - PDU2_DUMMY_DEVICE_STATUS, PDU2_WDT_CNT_GND, PDU2_WDT_CNT_I2C, PDU2_WDT_CNT_CAN, @@ -615,11 +607,9 @@ namespace PDU{ static const uint16_t MAX_REPLY_LENGTH = 318; static const uint16_t MAX_CONFIGTABLE_ADDRESS = 316; static const uint16_t MAX_HKTABLE_ADDRESS = 141; -// static const uint16_t HK_TABLE_SIZE = 142; + /** The size of the reply containing the housekeeping table data */ static const uint16_t HK_TABLE_REPLY_SIZE = 303; - static const uint8_t HK_TABLE_ENTRIES = 60; - /** The length of the header holding information about the received housekeeping table reply */ - static const uint8_t HK_REPLY_HEADER_LENGTH = 13; + static const uint8_t HK_TABLE_ENTRIES = 73; } @@ -643,7 +633,7 @@ namespace PDU1 { * @brief This class defines a dataset for the hk table of the PDU1. */ class PDU1HkTableDataset : - public StaticLocalDataSet { + public StaticLocalDataSet { public: PDU1HkTableDataset(HasLocalDataPoolIF* owner): @@ -707,9 +697,7 @@ namespace PDU1 { P60System::PDU1_CONV_EN_2, this); lp_var_t converterEnable3 = lp_var_t(sid.objectId, P60System::PDU1_CONV_EN_3, this); - /** Dummy byte inserted by the full hk table request. */ - lp_var_t dummyByteConvEn = lp_var_t(sid.objectId, - P60System::PDU1_DUMMY_BYTE_CONV_EN, this); + /** Output channels enable status */ lp_var_t outEnabledTCSBoard3V3 = lp_var_t(sid.objectId, P60System::PDU1_OUT_EN_TCS_BOARD_3V3, this); @@ -742,9 +730,6 @@ namespace PDU1 { /** Battery mode: 1 = Critical, 2 = Safe, 3 = Normal, 4 = Full */ lp_var_t battMode = lp_var_t(sid.objectId, P60System::PDU1_BATT_MODE, this); - /** Dummy byte which is received with full hk table request: */ - lp_var_t dummyByteBattMode = lp_var_t(sid.objectId, - P60System::PDU1_DUMMY_BYTE_BATT_MODE, this); /** Number of detected latchups on each output channel */ lp_var_t latchupsTcsBoard3V3 = lp_var_t(sid.objectId, @@ -803,9 +788,7 @@ namespace PDU1 { P60System::PDU1_DEVICE_6_STATUS, this); lp_var_t device7Status = lp_var_t(sid.objectId, P60System::PDU1_DEVICE_7_STATUS, this); - /** Two dummy bytes will be inserted here by a full hk table request. */ - lp_var_t dummyBytesdeviceStatus = lp_var_t(sid.objectId, - P60System::PDU1_DUMMY_DEVICE_STATUS, this); + /** Number of reboots triggered by the ground watchdog */ lp_var_t gndWdtReboots = lp_var_t(sid.objectId, P60System::PDU1_WDT_CNT_GND, this); @@ -830,9 +813,9 @@ namespace PDU1 { lp_var_t canWatchdogSecondsLeft = lp_var_t(sid.objectId, P60System::PDU1_WDT_CAN_LEFT, this); /** CSP watchdogs remaining pings before rebooting. */ - lp_var_t csp2WatchdogSecondsLeft = lp_var_t(sid.objectId, + lp_var_t csp2WatchdogPingsLeft = lp_var_t(sid.objectId, P60System::PDU1_WDT_CSP_LEFT1, this); - lp_var_t csp1WatchdogSecondsLeft = lp_var_t(sid.objectId, + lp_var_t csp1WatchdogPingsLeft = lp_var_t(sid.objectId, P60System::PDU1_WDT_CSP_LEFT2, this); }; } @@ -858,7 +841,7 @@ namespace PDU2 { * @brief This class defines a dataset for the hk table of the PDU2. */ class PDU2HkTableDataset: - public StaticLocalDataSet { + public StaticLocalDataSet { public: PDU2HkTableDataset(HasLocalDataPoolIF* owner): @@ -884,7 +867,7 @@ namespace PDU2 { P60System::PDU2_CURRENT_OUT_DEPLOYMENT_MECHANISM, this); lp_var_t currentOutPayloadPCDUCh6 = lp_var_t(sid.objectId, P60System::PDU2_CURRENT_OUT_PAYLOAD_PCDU_CH6, this); - lp_var_t currentOutACSBoard = lp_var_t(sid.objectId, + lp_var_t currentOutACSBoardSideB = lp_var_t(sid.objectId, P60System::PDU2_CURRENT_OUT_ACS_BOARD_SIDE_B, this); lp_var_t currentOutPayloadCamera = lp_var_t(sid.objectId, P60System::PDU2_CURRENT_OUT_PAYLOAD_CAMERA, this); @@ -897,13 +880,13 @@ namespace PDU2 { P60System::PDU2_VOLTAGE_OUT_RW, this); lp_var_t voltageOutTCSBoardHeaterIn = lp_var_t(sid.objectId, P60System::PDU2_VOLTAGE_OUT_TCS_BOARD_HEATER_IN, this); - lp_var_t voltageOutSUS = lp_var_t(sid.objectId, + lp_var_t voltageOutSUSRedundant = lp_var_t(sid.objectId, P60System::PDU2_VOLTAGE_OUT_SUS_REDUNDANT, this); lp_var_t voltageOutDeplMechanism = lp_var_t(sid.objectId, P60System::PDU2_VOLTAGE_OUT_DEPLOYMENT_MECHANISM, this); lp_var_t voltageOutPayloadPCDUCh6 = lp_var_t(sid.objectId, P60System::PDU2_VOLTAGE_OUT_PAYLOAD_PCDU_CH6, this); - lp_var_t voltageOutACSBoard = lp_var_t(sid.objectId, + lp_var_t voltageOutACSBoardSideB = lp_var_t(sid.objectId, P60System::PDU2_VOLTAGE_OUT_ACS_BOARD_SIDE_B, this); lp_var_t voltageOutPayloadCamera = lp_var_t(sid.objectId, P60System::PDU2_VOLTAGE_OUT_PAYLOAD_CAMERA, this); @@ -922,8 +905,6 @@ namespace PDU2 { P60System::PDU2_CONV_EN_2, this); lp_var_t converterEnable3 = lp_var_t(sid.objectId, P60System::PDU2_CONV_EN_3, this); - lp_var_t dummyByteConvEn = lp_var_t(sid.objectId, - P60System::PDU2_DUMMY_BYTE_CONV_EN, this); /** Output channels enable status */ lp_var_t outEnabledQ7S = lp_var_t(sid.objectId, P60System::PDU2_OUT_EN_Q7S, this); @@ -933,19 +914,16 @@ namespace PDU2 { P60System::PDU2_OUT_EN_RW, this); lp_var_t outEnabledTCSBoardHeaterIn = lp_var_t(sid.objectId, P60System::PDU2_OUT_EN_TCS_BOARD_HEATER_IN, this); - lp_var_t outEnabledSUS = lp_var_t(sid.objectId, + lp_var_t outEnabledSUSRedundant = lp_var_t(sid.objectId, P60System::PDU2_OUT_EN_SUS_REDUNDANT, this); lp_var_t outEnabledDeplMechanism = lp_var_t(sid.objectId, P60System::PDU2_OUT_EN_DEPLOYMENT_MECHANISM, this); lp_var_t outEnabledPlPCDUCh6 = lp_var_t(sid.objectId, P60System::PDU2_OUT_EN_PAYLOAD_PCDU_CH6, this); - lp_var_t outEnabledAcsBoard = lp_var_t(sid.objectId, + lp_var_t outEnabledAcsBoardSideB = lp_var_t(sid.objectId, P60System::PDU2_OUT_EN_ACS_BOARD_SIDE_B, this); lp_var_t outEnabledPayloadCamera = lp_var_t(sid.objectId, P60System::PDU2_OUT_EN_PAYLOAD_CAMERA, this); - /** Dummy byte which is received with a full hk table request. */ - lp_var_t dummyByteOutEn = lp_var_t(sid.objectId, - P60System::PDU2_DUMMY_BYTE_OUT_EN, this); lp_var_t bootcause = lp_var_t(sid.objectId, P60System::PDU2_BOOTCAUSE, this); @@ -960,9 +938,6 @@ namespace PDU2 { /** Battery mode: 1 = Critical, 2 = Safe, 3 = Normal, 4 = Full */ lp_var_t battMode = lp_var_t(sid.objectId, P60System::PDU2_BATT_MODE, this); - /** Dummy byte which is received with full hk table request: */ - lp_var_t dummyByteBattMode = lp_var_t(sid.objectId, - P60System::PDU2_DUMMY_BYTE_BATT_MODE, this); /** Number of detected latchups on each output channel */ lp_var_t latchupsQ7S = lp_var_t(sid.objectId, @@ -1021,9 +996,6 @@ namespace PDU2 { P60System::PDU2_DEVICE_6_STATUS, this); lp_var_t device7Status = lp_var_t(sid.objectId, P60System::PDU2_DEVICE_7_STATUS, this); - /** Two dummy bytes will be inserted here by a full hk table request. */ - lp_var_t dummyBytesdeviceStatus = lp_var_t(sid.objectId, - P60System::PDU2_DUMMY_DEVICE_STATUS, this); /** Number of reboots triggered by the ground watchdog */ lp_var_t gndWdtReboots = lp_var_t(sid.objectId, @@ -1037,7 +1009,7 @@ namespace PDU2 { /** Number of reboots triggered through the CSP watchdog */ lp_var_t csp1WdtReboots = lp_var_t(sid.objectId, P60System::PDU2_WDT_CNT_CSP1, this); - lp_var_t cs2pWdtReboots = lp_var_t(sid.objectId, + lp_var_t csp2WdtReboots = lp_var_t(sid.objectId, P60System::PDU2_WDT_CNT_CSP2, this); /** Ground watchdog remaining seconds before rebooting */ lp_var_t groundWatchdogSecondsLeft = lp_var_t(sid.objectId, @@ -1049,9 +1021,9 @@ namespace PDU2 { lp_var_t canWatchdogSecondsLeft = lp_var_t(sid.objectId, P60System::PDU2_WDT_CAN_LEFT, this); /** CSP watchdog remaining pings before rebooting. */ - lp_var_t csp1WatchdogSecondsLeft = lp_var_t(sid.objectId, + lp_var_t csp1WatchdogPingsLeft = lp_var_t(sid.objectId, P60System::PDU2_WDT_CSP_LEFT1, this); - lp_var_t csp2WatchdogSecondsLeft = lp_var_t(sid.objectId, + lp_var_t csp2WatchdogPingsLeft = lp_var_t(sid.objectId, P60System::PDU2_WDT_CSP_LEFT2, this); }; }