save structs for datasets

This commit is contained in:
Jakob Meier 2021-02-03 08:09:54 +01:00
parent fd1e4f3473
commit be9409c80d
15 changed files with 792 additions and 361 deletions

View File

@ -165,7 +165,7 @@ void InitMission::initTasks(){
UdpBridgeTask->startTask();
UdpPollingTask->startTask();
// GomSpacePstTask->startTask();
GomSpacePstTask->startTask();
PollingSequenceTableTaskDefault->startTask();
PusVerification->startTask();

View File

@ -12,7 +12,7 @@
// debugging.
#define OBSW_ENHANCED_PRINTOUT 1
#define TE0720 1
#define TE0720 0
#include "OBSWVersion.h"

View File

@ -3,7 +3,7 @@
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) {
hkTableSize, &acuHkTableDataset), acuHkTableDataset(this) {
}
ACUHandler::~ACUHandler() {

View File

@ -5,8 +5,8 @@
#include <mission/devices/devicedefinitions/GomspaceDefinitions.h>
/**
* @brief Handler for the ACU of Gomspace. Monitors and controls the battery charging via
* the solar pannels.
* @brief Handler for the ACU from Gomspace. Monitors and controls the battery charging via
* the solar panels.
*/
class ACUHandler: public GomspaceDeviceHandler {
public:
@ -19,6 +19,7 @@ protected:
private:
ACU::HkTableDataset acuHkTableDataset;
};
#endif /* MISSION_DEVICES_ACUHANDLER_H_ */

View File

@ -3,12 +3,17 @@
GomspaceDeviceHandler::GomspaceDeviceHandler(object_id_t objectId, object_id_t comIF,
CookieIF * comCookie, uint16_t maxConfigTableAddress, uint16_t maxHkTableAddress,
uint16_t hkTableSize) :
DeviceHandlerBase(objectId, comIF, comCookie), maxConfigTableAddress(maxConfigTableAddress), maxHkTableAddress(
maxHkTableAddress), hkTableSize(hkTableSize) {
uint16_t hkTableSize, LocalPoolDataSetBase* hkTableDataset) :
DeviceHandlerBase(objectId, comIF, comCookie), maxConfigTableAddress(maxConfigTableAddress),
maxHkTableAddress(maxHkTableAddress), hkTableSize(hkTableSize), hkTableDataset(hkTableDataset) {
mode = MODE_NORMAL;
if (comCookie == NULL) {
sif::error << "GomspaceDeviceHandler invalid com cookie" << std::endl;
sif::error << "GomspaceDeviceHandler::GomspaceDeviceHandler: Invalid com cookie"
<< std::endl;
}
if (hkTableDataset == NULL) {
sif::error << "GomspaceDeviceHandler::GomspaceDeviceHandler: Invalid hk table data set"
<< std::endl;
}
}
@ -88,7 +93,7 @@ void GomspaceDeviceHandler::fillCommandAndReplyMap(){
this->insertInCommandMap(GOMSPACE::REBOOT);
this->insertInCommandAndReplyMap(GOMSPACE::PARAM_SET, 3);
this->insertInCommandAndReplyMap(GOMSPACE::PARAM_GET, 3);
this->insertInCommandAndReplyMap(GOMSPACE::REQUEST_HK_TABLE, 3);
this->insertInCommandAndReplyMap(GOMSPACE::REQUEST_HK_TABLE, 3, hkTableDataset);
this->insertInCommandMap(GOMSPACE::GNDWDT_RESET);
}

View File

@ -33,7 +33,7 @@ public:
*/
GomspaceDeviceHandler(object_id_t objectId, object_id_t comIF,
CookieIF * comCookie, uint16_t maxConfigTableAddress, uint16_t maxHkTableAddress,
uint16_t hkTableSize);
uint16_t hkTableSize, LocalPoolDataSetBase* hkTableDataset);
virtual ~GomspaceDeviceHandler();
protected:
@ -54,6 +54,8 @@ protected:
/** The size of the housekeeping table (table id 4) */
uint16_t hkTableSize;
LocalPoolDataSetBase* hkTableDataset = nullptr;
void doStartUp() override;
void doShutDown() override;
virtual ReturnValue_t buildNormalDeviceCommand(DeviceCommandId_t * id)

View File

@ -190,7 +190,7 @@ void HeaterHandler::handleSwitchOnCommand(HeaterMapIter heaterMapIter) {
/* Check if command waits for main switch being set on and whether the timeout has expired */
if (heaterMapIter->second.waitMainSwitchOn
&& heaterMapIter->second.mainSwitchCountdown.hasTimedOut()) {
//TODO: This requires the initiation of an FDIR procedure
//TODO - This requires the initiation of an FDIR procedure
triggerEvent(MAIN_SWITCH_TIMEOUT);
heaterMapIter->second.active = false;
return;

View File

@ -3,7 +3,7 @@
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) {
hkTableSize, &p60dockHkTableDataset), p60dockHkTableDataset(this) {
}
P60DockHandler::~P60DockHandler() {

View File

@ -2,6 +2,7 @@
#define MISSION_DEVICES_P60DOCKHANDLER_H_
#include "GomspaceDeviceHandler.h"
#include <mission/devices/devicedefinitions/GomspaceDefinitions.h>
/**
@ -16,6 +17,9 @@ public:
protected:
virtual void letChildHandleHkReply(DeviceCommandId_t id, const uint8_t *packet) override;
private:
P60Dock::HkTableDataset p60dockHkTableDataset;
};
#endif /* MISSION_DEVICES_P60DOCKHANDLER_H_ */

View File

@ -87,24 +87,23 @@ void PCDUHandler::handleChangedDataset(sid_t sid, store_address_t storeId) {
if (sid == sid_t(objects::PCDU_HANDLER, PDU2::HK_TABLE_DATA_SET_ID)) {
HousekeepingPacketUpdate packetUpdate(reinterpret_cast<uint8_t*>(&timeStamp),
sizeof(timeStamp), &pdu2HkTableDataset);
const uint8_t** packet_ptr = NULL;
const uint8_t* packet_ptr = NULL;
size_t size;
result = IPCStore->getData(storeId, packet_ptr, &size);
result = IPCStore->getData(storeId, &packet_ptr, &size);
if (result != RETURN_OK) {
sif::error << "PCDUHandler::handleChangedDataset: Failed to get data from IPCStore."
<< std::endl;
//TODO: Is it necessary to trigger an Event here?
result = IPCStore->deleteData(storeId);
if (result != RETURN_OK) {
sif::error << "PCDUHandler::handleChangedDataset: Failed to delete data in IPCStore"
<< std::endl;
}
}
result = packetUpdate.deSerialize(packet_ptr, &size, SerializeIF::Endianness::BIG);
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;
}
updatePdu2SwitchStates();
}
else {
@ -113,6 +112,7 @@ void PCDUHandler::handleChangedDataset(sid_t sid, store_address_t storeId) {
}
void PCDUHandler::updatePdu2SwitchStates() {
//TODO: pool read helper
if (pdu2HkTableDataset.read() != RETURN_OK) {
switchStates[pcduSwitches::Q7S] = pdu2HkTableDataset.outEnabledQ7S.value;
switchStates[pcduSwitches::PAYLOAD_PCDU_CH1] = pdu2HkTableDataset.outEnabledPlPCDUCh1.value;
@ -224,95 +224,95 @@ object_id_t PCDUHandler::getObjectId() const {
ReturnValue_t PCDUHandler::initializeLocalDataPool(localpool::DataPool &localDataPoolMap,
LocalDataPoolManager &poolManager) {
localDataPoolMap.emplace(PDU::PDU2_CURRENT_OUT_Q7S, new PoolEntry<int16_t>( { 0 }));
localDataPoolMap.emplace(PDU::PDU2_CURRENT_OUT_PAYLOAD_PCDU_CH1,
localDataPoolMap.emplace(P60System::PDU2_CURRENT_OUT_Q7S, new PoolEntry<int16_t>( { 0 }));
localDataPoolMap.emplace(P60System::PDU2_CURRENT_OUT_PAYLOAD_PCDU_CH1,
new PoolEntry<int16_t>( { 0 }));
localDataPoolMap.emplace(PDU::PDU2_CURRENT_OUT_RW, new PoolEntry<int16_t>( { 0 }));
localDataPoolMap.emplace(PDU::PDU2_CURRENT_OUT_TCS_BOARD_HEATER_IN,
localDataPoolMap.emplace(P60System::PDU2_CURRENT_OUT_RW, new PoolEntry<int16_t>( { 0 }));
localDataPoolMap.emplace(P60System::PDU2_CURRENT_OUT_TCS_BOARD_HEATER_IN,
new PoolEntry<int16_t>( { 0 }));
localDataPoolMap.emplace(PDU::PDU2_CURRENT_OUT_SUS_REDUNDANT, new PoolEntry<int16_t>( { 0 }));
localDataPoolMap.emplace(PDU::PDU2_CURRENT_OUT_DEPLOYMENT_MECHANISM,
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(PDU::PDU2_CURRENT_OUT_PAYLOAD_PCDU_CH6,
localDataPoolMap.emplace(P60System::PDU2_CURRENT_OUT_PAYLOAD_PCDU_CH6,
new PoolEntry<int16_t>( { 0 }));
localDataPoolMap.emplace(PDU::PDU2_CURRENT_OUT_ACS_BOARD_SIDE_B,
localDataPoolMap.emplace(P60System::PDU2_CURRENT_OUT_ACS_BOARD_SIDE_B,
new PoolEntry<int16_t>( { 0 }));
localDataPoolMap.emplace(PDU::PDU2_CURRENT_OUT_PAYLOAD_CAMERA, new PoolEntry<int16_t>( { 0 }));
localDataPoolMap.emplace(P60System::PDU2_CURRENT_OUT_PAYLOAD_CAMERA, new PoolEntry<int16_t>( { 0 }));
localDataPoolMap.emplace(PDU::PDU2_VOLTAGE_OUT_Q7S, new PoolEntry<int16_t>( { 0 }));
localDataPoolMap.emplace(PDU::PDU2_VOLTAGE_OUT_PAYLOAD_PCDU_CH1,
localDataPoolMap.emplace(P60System::PDU2_VOLTAGE_OUT_Q7S, new PoolEntry<int16_t>( { 0 }));
localDataPoolMap.emplace(P60System::PDU2_VOLTAGE_OUT_PAYLOAD_PCDU_CH1,
new PoolEntry<int16_t>( { 0 }));
localDataPoolMap.emplace(PDU::PDU2_VOLTAGE_OUT_RW, new PoolEntry<int16_t>( { 0 }));
localDataPoolMap.emplace(PDU::PDU2_VOLTAGE_OUT_TCS_BOARD_HEATER_IN,
localDataPoolMap.emplace(P60System::PDU2_VOLTAGE_OUT_RW, new PoolEntry<int16_t>( { 0 }));
localDataPoolMap.emplace(P60System::PDU2_VOLTAGE_OUT_TCS_BOARD_HEATER_IN,
new PoolEntry<int16_t>( { 0 }));
localDataPoolMap.emplace(PDU::PDU2_VOLTAGE_OUT_SUS_REDUNDANT, new PoolEntry<int16_t>( { 0 }));
localDataPoolMap.emplace(PDU::PDU2_VOLTAGE_OUT_DEPLOYMENT_MECHANISM,
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(PDU::PDU2_VOLTAGE_OUT_PAYLOAD_PCDU_CH6,
localDataPoolMap.emplace(P60System::PDU2_VOLTAGE_OUT_PAYLOAD_PCDU_CH6,
new PoolEntry<int16_t>( { 0 }));
localDataPoolMap.emplace(PDU::PDU2_VOLTAGE_OUT_ACS_BOARD_SIDE_B,
localDataPoolMap.emplace(P60System::PDU2_VOLTAGE_OUT_ACS_BOARD_SIDE_B,
new PoolEntry<int16_t>( { 0 }));
localDataPoolMap.emplace(PDU::PDU2_VOLTAGE_OUT_PAYLOAD_CAMERA, new PoolEntry<int16_t>( { 0 }));
localDataPoolMap.emplace(P60System::PDU2_VOLTAGE_OUT_PAYLOAD_CAMERA, new PoolEntry<int16_t>( { 0 }));
localDataPoolMap.emplace(PDU::PDU2_VCC, new PoolEntry<int16_t>( { 0 }));
localDataPoolMap.emplace(PDU::PDU2_VBAT, new PoolEntry<int16_t>( { 0 }));
localDataPoolMap.emplace(PDU::PDU2_TEMPERATURE, new PoolEntry<int16_t>( { 0 }));
localDataPoolMap.emplace(PDU::PDU2_CONV_EN, new PoolEntry<uint8_t>( { 0 }));
localDataPoolMap.emplace(P60System::PDU2_VCC, new PoolEntry<int16_t>( { 0 }));
localDataPoolMap.emplace(P60System::PDU2_VBAT, new PoolEntry<int16_t>( { 0 }));
localDataPoolMap.emplace(P60System::PDU2_TEMPERATURE, new PoolEntry<int16_t>( { 0 }));
localDataPoolMap.emplace(P60System::PDU2_CONV_EN, new PoolEntry<uint8_t>( { 0 }));
localDataPoolMap.emplace(PDU::PDU2_OUT_EN_Q7S, new PoolEntry<uint8_t>( {
localDataPoolMap.emplace(P60System::PDU2_OUT_EN_Q7S, new PoolEntry<uint8_t>( {
pcduSwitches::INIT_STATE_Q7S }));
localDataPoolMap.emplace(PDU::PDU2_OUT_EN_PAYLOAD_PCDU_CH1, new PoolEntry<uint8_t>( {
localDataPoolMap.emplace(P60System::PDU2_OUT_EN_PAYLOAD_PCDU_CH1, new PoolEntry<uint8_t>( {
pcduSwitches::INIT_STATE_PAYLOAD_PCDU_CH1 }));
localDataPoolMap.emplace(PDU::PDU2_OUT_EN_RW, new PoolEntry<uint8_t>( {
localDataPoolMap.emplace(P60System::PDU2_OUT_EN_RW, new PoolEntry<uint8_t>( {
pcduSwitches::INIT_STATE_RW }));
#if TE0720 == 1
localDataPoolMap.emplace(PDU::PDU2_OUT_EN_TCS_BOARD_HEATER_IN, new PoolEntry<uint8_t>( { 1 }));
localDataPoolMap.emplace(P60System::PDU2_OUT_EN_TCS_BOARD_HEATER_IN, new PoolEntry<uint8_t>( { 1 }));
#else
localDataPoolMap.emplace(PDU::PDU2_OUT_EN_TCS_BOARD_HEATER_IN, new PoolEntry<uint8_t>( {pcduSwitches::INIT_STATE_TCS_BOARD_8V_HEATER_IN}));
localDataPoolMap.emplace(P60System::PDU2_OUT_EN_TCS_BOARD_HEATER_IN, new PoolEntry<uint8_t>( {pcduSwitches::INIT_STATE_TCS_BOARD_8V_HEATER_IN}));
#endif
localDataPoolMap.emplace(PDU::PDU2_OUT_EN_SUS_REDUNDANT, new PoolEntry<uint8_t>( {
localDataPoolMap.emplace(P60System::PDU2_OUT_EN_SUS_REDUNDANT, new PoolEntry<uint8_t>( {
pcduSwitches::INIT_STATE_SUS_REDUNDANT }));
localDataPoolMap.emplace(PDU::PDU2_OUT_EN_DEPLOYMENT_MECHANISM, new PoolEntry<uint8_t>( {
localDataPoolMap.emplace(P60System::PDU2_OUT_EN_DEPLOYMENT_MECHANISM, new PoolEntry<uint8_t>( {
pcduSwitches::INIT_STATE_DEPLOYMENT_MECHANISM }));
localDataPoolMap.emplace(PDU::PDU2_OUT_EN_PAYLOAD_PCDU_CH6, new PoolEntry<uint8_t>( {
localDataPoolMap.emplace(P60System::PDU2_OUT_EN_PAYLOAD_PCDU_CH6, new PoolEntry<uint8_t>( {
pcduSwitches::INIT_STATE_PAYLOAD_PCDU_CH6 }));
localDataPoolMap.emplace(PDU::PDU2_OUT_EN_ACS_BOARD_SIDE_B, new PoolEntry<uint8_t>( {
localDataPoolMap.emplace(P60System::PDU2_OUT_EN_ACS_BOARD_SIDE_B, new PoolEntry<uint8_t>( {
pcduSwitches::INIT_STATE_ACS_BOARD_SIDE_B }));
localDataPoolMap.emplace(PDU::PDU2_OUT_EN_PAYLOAD_CAMERA, new PoolEntry<uint8_t>( {
localDataPoolMap.emplace(P60System::PDU2_OUT_EN_PAYLOAD_CAMERA, new PoolEntry<uint8_t>( {
pcduSwitches::INIT_STATE_PAYLOAD_CAMERA }));
localDataPoolMap.emplace(PDU::PDU2_BOOTCAUSE, new PoolEntry<uint32_t>( { 0 }));
localDataPoolMap.emplace(PDU::PDU2_BOOTCNT, new PoolEntry<uint32_t>( { 0 }));
localDataPoolMap.emplace(PDU::PDU2_UPTIME, new PoolEntry<uint32_t>( { 0 }));
localDataPoolMap.emplace(PDU::PDU2_RESETCAUSE, new PoolEntry<uint16_t>( { 0 }));
localDataPoolMap.emplace(PDU::PDU2_BATT_MODE, new PoolEntry<uint8_t>( { 0 }));
localDataPoolMap.emplace(P60System::PDU2_BOOTCAUSE, new PoolEntry<uint32_t>( { 0 }));
localDataPoolMap.emplace(P60System::PDU2_BOOTCNT, new PoolEntry<uint32_t>( { 0 }));
localDataPoolMap.emplace(P60System::PDU2_UPTIME, new PoolEntry<uint32_t>( { 0 }));
localDataPoolMap.emplace(P60System::PDU2_RESETCAUSE, new PoolEntry<uint16_t>( { 0 }));
localDataPoolMap.emplace(P60System::PDU2_BATT_MODE, new PoolEntry<uint8_t>( { 0 }));
localDataPoolMap.emplace(PDU::PDU2_DEVICE_0, new PoolEntry<uint8_t>( { 0 }));
localDataPoolMap.emplace(PDU::PDU2_DEVICE_1, new PoolEntry<uint8_t>( { 0 }));
localDataPoolMap.emplace(PDU::PDU2_DEVICE_2, new PoolEntry<uint8_t>( { 0 }));
localDataPoolMap.emplace(PDU::PDU2_DEVICE_3, new PoolEntry<uint8_t>( { 0 }));
localDataPoolMap.emplace(PDU::PDU2_DEVICE_4, new PoolEntry<uint8_t>( { 0 }));
localDataPoolMap.emplace(PDU::PDU2_DEVICE_5, new PoolEntry<uint8_t>( { 0 }));
localDataPoolMap.emplace(PDU::PDU2_DEVICE_6, new PoolEntry<uint8_t>( { 0 }));
localDataPoolMap.emplace(PDU::PDU2_DEVICE_7, new PoolEntry<uint8_t>( { 0 }));
localDataPoolMap.emplace(P60System::PDU2_DEVICE_0, new PoolEntry<uint8_t>( { 0 }));
localDataPoolMap.emplace(P60System::PDU2_DEVICE_1, new PoolEntry<uint8_t>( { 0 }));
localDataPoolMap.emplace(P60System::PDU2_DEVICE_2, new PoolEntry<uint8_t>( { 0 }));
localDataPoolMap.emplace(P60System::PDU2_DEVICE_3, new PoolEntry<uint8_t>( { 0 }));
localDataPoolMap.emplace(P60System::PDU2_DEVICE_4, new PoolEntry<uint8_t>( { 0 }));
localDataPoolMap.emplace(P60System::PDU2_DEVICE_5, new PoolEntry<uint8_t>( { 0 }));
localDataPoolMap.emplace(P60System::PDU2_DEVICE_6, new PoolEntry<uint8_t>( { 0 }));
localDataPoolMap.emplace(P60System::PDU2_DEVICE_7, new PoolEntry<uint8_t>( { 0 }));
localDataPoolMap.emplace(PDU::PDU2_DEVICE_0_STATUS, new PoolEntry<uint8_t>( { 0 }));
localDataPoolMap.emplace(PDU::PDU2_DEVICE_1_STATUS, new PoolEntry<uint8_t>( { 0 }));
localDataPoolMap.emplace(PDU::PDU2_DEVICE_2_STATUS, new PoolEntry<uint8_t>( { 0 }));
localDataPoolMap.emplace(PDU::PDU2_DEVICE_3_STATUS, new PoolEntry<uint8_t>( { 0 }));
localDataPoolMap.emplace(PDU::PDU2_DEVICE_4_STATUS, new PoolEntry<uint8_t>( { 0 }));
localDataPoolMap.emplace(PDU::PDU2_DEVICE_5_STATUS, new PoolEntry<uint8_t>( { 0 }));
localDataPoolMap.emplace(PDU::PDU2_DEVICE_6_STATUS, new PoolEntry<uint8_t>( { 0 }));
localDataPoolMap.emplace(PDU::PDU2_DEVICE_7_STATUS, new PoolEntry<uint8_t>( { 0 }));
localDataPoolMap.emplace(P60System::PDU2_DEVICE_0_STATUS, new PoolEntry<uint8_t>( { 0 }));
localDataPoolMap.emplace(P60System::PDU2_DEVICE_1_STATUS, new PoolEntry<uint8_t>( { 0 }));
localDataPoolMap.emplace(P60System::PDU2_DEVICE_2_STATUS, new PoolEntry<uint8_t>( { 0 }));
localDataPoolMap.emplace(P60System::PDU2_DEVICE_3_STATUS, new PoolEntry<uint8_t>( { 0 }));
localDataPoolMap.emplace(P60System::PDU2_DEVICE_4_STATUS, new PoolEntry<uint8_t>( { 0 }));
localDataPoolMap.emplace(P60System::PDU2_DEVICE_5_STATUS, new PoolEntry<uint8_t>( { 0 }));
localDataPoolMap.emplace(P60System::PDU2_DEVICE_6_STATUS, new PoolEntry<uint8_t>( { 0 }));
localDataPoolMap.emplace(P60System::PDU2_DEVICE_7_STATUS, new PoolEntry<uint8_t>( { 0 }));
localDataPoolMap.emplace(PDU::PDU2_WDT_CNT_GND, new PoolEntry<uint32_t>( { 0 }));
localDataPoolMap.emplace(PDU::PDU2_WDT_CNT_I2C, new PoolEntry<uint32_t>( { 0 }));
localDataPoolMap.emplace(PDU::PDU2_WDT_CNT_CAN, new PoolEntry<uint32_t>( { 0 }));
localDataPoolMap.emplace(PDU::PDU2_WDT_CNT_CSP, new PoolEntry<uint32_t>( { 0 }));
localDataPoolMap.emplace(PDU::PDU2_WDT_GND_LEFT, new PoolEntry<uint32_t>( { 0 }));
localDataPoolMap.emplace(PDU::PDU2_WDT_I2C_LEFT, new PoolEntry<uint32_t>( { 0 }));
localDataPoolMap.emplace(PDU::PDU2_WDT_CAN_LEFT, new PoolEntry<uint32_t>( { 0 }));
localDataPoolMap.emplace(PDU::PDU2_WDT_CSP_LEFT, new PoolEntry<uint32_t>( { 0 }));
localDataPoolMap.emplace(P60System::PDU2_WDT_CNT_GND, new PoolEntry<uint32_t>( { 0 }));
localDataPoolMap.emplace(P60System::PDU2_WDT_CNT_I2C, new PoolEntry<uint32_t>( { 0 }));
localDataPoolMap.emplace(P60System::PDU2_WDT_CNT_CAN, new PoolEntry<uint32_t>( { 0 }));
localDataPoolMap.emplace(P60System::PDU2_WDT_CNT_CSP, new PoolEntry<uint32_t>( { 0 }));
localDataPoolMap.emplace(P60System::PDU2_WDT_GND_LEFT, new PoolEntry<uint32_t>( { 0 }));
localDataPoolMap.emplace(P60System::PDU2_WDT_I2C_LEFT, new PoolEntry<uint32_t>( { 0 }));
localDataPoolMap.emplace(P60System::PDU2_WDT_CAN_LEFT, new PoolEntry<uint32_t>( { 0 }));
localDataPoolMap.emplace(P60System::PDU2_WDT_CSP_LEFT, new PoolEntry<uint32_t>( { 0 }));
return HasReturnvaluesIF::RETURN_OK;
}

View File

@ -4,7 +4,7 @@
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), hkTableDataset(this) {
hkTableSize, &pdu1HkTableDataset), pdu1HkTableDataset(this) {
}
PDU1Handler::~PDU1Handler() {
@ -19,8 +19,8 @@ ReturnValue_t PDU1Handler::buildNormalDeviceCommand(
void PDU1Handler::letChildHandleHkReply(DeviceCommandId_t id, const uint8_t *packet) {
const uint8_t* payloadPtr = packet + GOMSPACE::GS_HDR_LENGTH;
size_t size = (size_t)hkTableSize;
hkTableDataset.deSerialize(&payloadPtr, &size, SerializeIF::Endianness::BIG);
FullTableReply fullTableReply(id, HK_TABLE_ID, &hkTableDataset);
pdu1HkTableDataset.deSerialize(&payloadPtr, &size, SerializeIF::Endianness::BIG);
FullTableReply fullTableReply(id, HK_TABLE_ID, &pdu1HkTableDataset);
handleDeviceTM(&fullTableReply, id, true);
}

View File

@ -34,7 +34,7 @@ protected:
private:
/** Dataset for the housekeeping table of the PDU1 */
PDU1::PDU1HkTableDataset hkTableDataset;
PDU1::PDU1HkTableDataset pdu1HkTableDataset;
};
#endif /* MISSION_DEVICES_PDU1Handler_H_ */

View File

@ -2,10 +2,10 @@
#include <mission/devices/devicedefinitions/GomSpacePackets.h>
#include <fsfwconfig/OBSWConfig.h>
PDU2Handler::PDU2Handler(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), hkTableDataset(this) {
PDU2Handler::PDU2Handler(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, &pdu2HkTableDataset), pdu2HkTableDataset(this) {
}
PDU2Handler::~PDU2Handler() {
@ -18,88 +18,95 @@ ReturnValue_t PDU2Handler::buildNormalDeviceCommand(
}
void PDU2Handler::letChildHandleHkReply(DeviceCommandId_t id, const uint8_t *packet) {
/* Pointer points to beginning of payload data */
const uint8_t* payloadPtr = packet + GOMSPACE::GS_HDR_LENGTH;
size_t size = (size_t)hkTableSize;
hkTableDataset.deSerialize(&payloadPtr, &size, SerializeIF::Endianness::BIG);
FullTableReply fullTableReply(id, HK_TABLE_ID, &hkTableDataset);
pdu2HkTableDataset.deSerialize(&payloadPtr, &size, SerializeIF::Endianness::BIG);
FullTableReply fullTableReply(id, HK_TABLE_ID, &pdu2HkTableDataset);
handleDeviceTM(&fullTableReply, id, true);
#if OBSW_ENHANCED_PRINTOUT == 1
pdu2HkTableDataset.read();
float temperatureC = pdu2HkTableDataset.temperature.value;
sif::info << "PDU2 Temperature: " << temperatureC << "°C" << std::endl;
pdu2HkTableDataset.commit();
#endif
}
ReturnValue_t PDU2Handler::initializeLocalDataPool(
localpool::DataPool &localDataPoolMap, LocalDataPoolManager &poolManager) {
localDataPoolMap.emplace(PDU::PDU2_CURRENT_OUT_Q7S, new PoolEntry<int16_t>( { 0 }));
localDataPoolMap.emplace(PDU::PDU2_CURRENT_OUT_PAYLOAD_PCDU_CH1, new PoolEntry<int16_t>( { 0 }));
localDataPoolMap.emplace(PDU::PDU2_CURRENT_OUT_RW, new PoolEntry<int16_t>( { 0 }));
localDataPoolMap.emplace(PDU::PDU2_CURRENT_OUT_TCS_BOARD_HEATER_IN, new PoolEntry<int16_t>( { 0 }));
localDataPoolMap.emplace(PDU::PDU2_CURRENT_OUT_SUS_REDUNDANT, new PoolEntry<int16_t>( { 0 }));
localDataPoolMap.emplace(PDU::PDU2_CURRENT_OUT_DEPLOYMENT_MECHANISM, new PoolEntry<int16_t>( { 0 }));
localDataPoolMap.emplace(PDU::PDU2_CURRENT_OUT_PAYLOAD_PCDU_CH6, new PoolEntry<int16_t>( { 0 }));
localDataPoolMap.emplace(PDU::PDU2_CURRENT_OUT_ACS_BOARD_SIDE_B, new PoolEntry<int16_t>( { 0 }));
localDataPoolMap.emplace(PDU::PDU2_CURRENT_OUT_PAYLOAD_CAMERA, new PoolEntry<int16_t>( { 0 }));
localDataPoolMap.emplace(P60System::PDU2_CURRENT_OUT_Q7S, new PoolEntry<int16_t>( { 0 }));
localDataPoolMap.emplace(P60System::PDU2_CURRENT_OUT_PAYLOAD_PCDU_CH1, new PoolEntry<int16_t>( { 0 }));
localDataPoolMap.emplace(P60System::PDU2_CURRENT_OUT_RW, new PoolEntry<int16_t>( { 0 }));
localDataPoolMap.emplace(P60System::PDU2_CURRENT_OUT_TCS_BOARD_HEATER_IN, new PoolEntry<int16_t>( { 0 }));
localDataPoolMap.emplace(P60System::PDU2_CURRENT_OUT_SUS_REDUNDANT, new PoolEntry<int16_t>( { 0 }));
localDataPoolMap.emplace(P60System::PDU2_CURRENT_OUT_DEPLOYMENT_MECHANISM, new PoolEntry<int16_t>( { 0 }));
localDataPoolMap.emplace(P60System::PDU2_CURRENT_OUT_PAYLOAD_PCDU_CH6, new PoolEntry<int16_t>( { 0 }));
localDataPoolMap.emplace(P60System::PDU2_CURRENT_OUT_ACS_BOARD_SIDE_B, new PoolEntry<int16_t>( { 0 }));
localDataPoolMap.emplace(P60System::PDU2_CURRENT_OUT_PAYLOAD_CAMERA, new PoolEntry<int16_t>( { 0 }));
localDataPoolMap.emplace(PDU::PDU2_VOLTAGE_OUT_Q7S, new PoolEntry<int16_t>( { 0 }));
localDataPoolMap.emplace(PDU::PDU2_VOLTAGE_OUT_PAYLOAD_PCDU_CH1, new PoolEntry<int16_t>( { 0 }));
localDataPoolMap.emplace(PDU::PDU2_VOLTAGE_OUT_RW, new PoolEntry<int16_t>( { 0 }));
localDataPoolMap.emplace(PDU::PDU2_VOLTAGE_OUT_TCS_BOARD_HEATER_IN, new PoolEntry<int16_t>( { 0 }));
localDataPoolMap.emplace(PDU::PDU2_VOLTAGE_OUT_TCS_BOARD_HEATER_IN, new PoolEntry<int16_t>( { 0 }));
localDataPoolMap.emplace(PDU::PDU2_VOLTAGE_OUT_SUS_REDUNDANT, new PoolEntry<int16_t>( { 0 }));
localDataPoolMap.emplace(PDU::PDU2_VOLTAGE_OUT_DEPLOYMENT_MECHANISM, new PoolEntry<int16_t>( { 0 }));
localDataPoolMap.emplace(PDU::PDU2_VOLTAGE_OUT_PAYLOAD_PCDU_CH6, new PoolEntry<int16_t>( { 0 }));
localDataPoolMap.emplace(PDU::PDU2_VOLTAGE_OUT_ACS_BOARD_SIDE_B, new PoolEntry<int16_t>( { 0 }));
localDataPoolMap.emplace(PDU::PDU2_VOLTAGE_OUT_PAYLOAD_CAMERA, new PoolEntry<int16_t>( { 0 }));
localDataPoolMap.emplace(P60System::PDU2_VOLTAGE_OUT_Q7S, new PoolEntry<int16_t>( { 0 }));
localDataPoolMap.emplace(P60System::PDU2_VOLTAGE_OUT_PAYLOAD_PCDU_CH1, new PoolEntry<int16_t>( { 0 }));
localDataPoolMap.emplace(P60System::PDU2_VOLTAGE_OUT_RW, new PoolEntry<int16_t>( { 0 }));
localDataPoolMap.emplace(P60System::PDU2_VOLTAGE_OUT_TCS_BOARD_HEATER_IN, new PoolEntry<int16_t>( { 0 }));
localDataPoolMap.emplace(P60System::PDU2_VOLTAGE_OUT_TCS_BOARD_HEATER_IN, new PoolEntry<int16_t>( { 0 }));
localDataPoolMap.emplace(P60System::PDU2_VOLTAGE_OUT_SUS_REDUNDANT, new PoolEntry<int16_t>( { 0 }));
localDataPoolMap.emplace(P60System::PDU2_VOLTAGE_OUT_DEPLOYMENT_MECHANISM, new PoolEntry<int16_t>( { 0 }));
localDataPoolMap.emplace(P60System::PDU2_VOLTAGE_OUT_PAYLOAD_PCDU_CH6, new PoolEntry<int16_t>( { 0 }));
localDataPoolMap.emplace(P60System::PDU2_VOLTAGE_OUT_ACS_BOARD_SIDE_B, new PoolEntry<int16_t>( { 0 }));
localDataPoolMap.emplace(P60System::PDU2_VOLTAGE_OUT_PAYLOAD_CAMERA, new PoolEntry<int16_t>( { 0 }));
localDataPoolMap.emplace(PDU::PDU2_VCC, new PoolEntry<int16_t>( { 0 }));
localDataPoolMap.emplace(PDU::PDU2_VBAT, new PoolEntry<int16_t>( { 0 }));
localDataPoolMap.emplace(PDU::PDU2_TEMPERATURE, new PoolEntry<int16_t>( { 0 }));
localDataPoolMap.emplace(PDU::PDU2_CONV_EN, new PoolEntry<uint8_t>( { 0 }));
localDataPoolMap.emplace(P60System::PDU2_VCC, new PoolEntry<int16_t>( { 0 }));
localDataPoolMap.emplace(P60System::PDU2_VBAT, new PoolEntry<int16_t>( { 0 }));
localDataPoolMap.emplace(P60System::PDU2_TEMPERATURE, new PoolEntry<int16_t>( { 0 }));
localDataPoolMap.emplace(P60System::PDU2_CONV_EN, new PoolEntry<uint8_t>( { 0 }));
localDataPoolMap.emplace(PDU::PDU2_OUT_EN_Q7S, new PoolEntry<uint8_t>( { 0 }));
localDataPoolMap.emplace(PDU::PDU2_OUT_EN_PAYLOAD_PCDU_CH1, new PoolEntry<uint8_t>( { 0 }));
localDataPoolMap.emplace(PDU::PDU2_OUT_EN_RW, new PoolEntry<uint8_t>( { 0 }));
localDataPoolMap.emplace(P60System::PDU2_OUT_EN_Q7S, new PoolEntry<uint8_t>( { 0 }));
localDataPoolMap.emplace(P60System::PDU2_OUT_EN_PAYLOAD_PCDU_CH1, new PoolEntry<uint8_t>( { 0 }));
localDataPoolMap.emplace(P60System::PDU2_OUT_EN_RW, new PoolEntry<uint8_t>( { 0 }));
#if TE0720 == 1
localDataPoolMap.emplace(PDU::PDU2_OUT_EN_TCS_BOARD_HEATER_IN, new PoolEntry<uint8_t>( { 1 }));
localDataPoolMap.emplace(P60System::PDU2_OUT_EN_TCS_BOARD_HEATER_IN, new PoolEntry<uint8_t>( { 1 }));
#else
localDataPoolMap.emplace(PDU::PDU2_OUT_EN_TCS_BOARD_HEATER_IN, new PoolEntry<uint8_t>( { 0 }));
localDataPoolMap.emplace(P60System::PDU2_OUT_EN_TCS_BOARD_HEATER_IN, new PoolEntry<uint8_t>( { 0 }));
#endif
localDataPoolMap.emplace(PDU::PDU2_OUT_EN_SUS_REDUNDANT, new PoolEntry<uint8_t>( { 0 }));
localDataPoolMap.emplace(PDU::PDU2_OUT_EN_DEPLOYMENT_MECHANISM, new PoolEntry<uint8_t>( { 0 }));
localDataPoolMap.emplace(PDU::PDU2_OUT_EN_PAYLOAD_PCDU_CH6, new PoolEntry<uint8_t>( { 0 }));
localDataPoolMap.emplace(PDU::PDU2_OUT_EN_ACS_BOARD_SIDE_B, new PoolEntry<uint8_t>( { 0 }));
localDataPoolMap.emplace(PDU::PDU2_OUT_EN_PAYLOAD_CAMERA, new PoolEntry<uint8_t>( { 0 }));
localDataPoolMap.emplace(P60System::PDU2_OUT_EN_SUS_REDUNDANT, new PoolEntry<uint8_t>( { 0 }));
localDataPoolMap.emplace(P60System::PDU2_OUT_EN_DEPLOYMENT_MECHANISM, new PoolEntry<uint8_t>( { 0 }));
localDataPoolMap.emplace(P60System::PDU2_OUT_EN_PAYLOAD_PCDU_CH6, new PoolEntry<uint8_t>( { 0 }));
localDataPoolMap.emplace(P60System::PDU2_OUT_EN_ACS_BOARD_SIDE_B, new PoolEntry<uint8_t>( { 0 }));
localDataPoolMap.emplace(P60System::PDU2_OUT_EN_PAYLOAD_CAMERA, new PoolEntry<uint8_t>( { 0 }));
localDataPoolMap.emplace(PDU::PDU2_BOOTCAUSE, new PoolEntry<uint32_t>( { 0 }));
localDataPoolMap.emplace(PDU::PDU2_BOOTCNT, new PoolEntry<uint32_t>( { 0 }));
localDataPoolMap.emplace(PDU::PDU2_UPTIME, new PoolEntry<uint32_t>( { 0 }));
localDataPoolMap.emplace(PDU::PDU2_RESETCAUSE, new PoolEntry<uint16_t>( { 0 }));
localDataPoolMap.emplace(PDU::PDU2_BATT_MODE, new PoolEntry<uint8_t>( { 0 }));
localDataPoolMap.emplace(P60System::PDU2_BOOTCAUSE, new PoolEntry<uint32_t>( { 0 }));
localDataPoolMap.emplace(P60System::PDU2_BOOTCNT, new PoolEntry<uint32_t>( { 0 }));
localDataPoolMap.emplace(P60System::PDU2_UPTIME, new PoolEntry<uint32_t>( { 0 }));
localDataPoolMap.emplace(P60System::PDU2_RESETCAUSE, new PoolEntry<uint16_t>( { 0 }));
localDataPoolMap.emplace(P60System::PDU2_BATT_MODE, new PoolEntry<uint8_t>( { 0 }));
localDataPoolMap.emplace(PDU::PDU2_DEVICE_0, new PoolEntry<uint8_t>( { 0 }));
localDataPoolMap.emplace(PDU::PDU2_DEVICE_1, new PoolEntry<uint8_t>( { 0 }));
localDataPoolMap.emplace(PDU::PDU2_DEVICE_2, new PoolEntry<uint8_t>( { 0 }));
localDataPoolMap.emplace(PDU::PDU2_DEVICE_3, new PoolEntry<uint8_t>( { 0 }));
localDataPoolMap.emplace(PDU::PDU2_DEVICE_4, new PoolEntry<uint8_t>( { 0 }));
localDataPoolMap.emplace(PDU::PDU2_DEVICE_5, new PoolEntry<uint8_t>( { 0 }));
localDataPoolMap.emplace(PDU::PDU2_DEVICE_6, new PoolEntry<uint8_t>( { 0 }));
localDataPoolMap.emplace(PDU::PDU2_DEVICE_7, new PoolEntry<uint8_t>( { 0 }));
localDataPoolMap.emplace(P60System::PDU2_DEVICE_0, new PoolEntry<uint8_t>( { 0 }));
localDataPoolMap.emplace(P60System::PDU2_DEVICE_1, new PoolEntry<uint8_t>( { 0 }));
localDataPoolMap.emplace(P60System::PDU2_DEVICE_2, new PoolEntry<uint8_t>( { 0 }));
localDataPoolMap.emplace(P60System::PDU2_DEVICE_3, new PoolEntry<uint8_t>( { 0 }));
localDataPoolMap.emplace(P60System::PDU2_DEVICE_4, new PoolEntry<uint8_t>( { 0 }));
localDataPoolMap.emplace(P60System::PDU2_DEVICE_5, new PoolEntry<uint8_t>( { 0 }));
localDataPoolMap.emplace(P60System::PDU2_DEVICE_6, new PoolEntry<uint8_t>( { 0 }));
localDataPoolMap.emplace(P60System::PDU2_DEVICE_7, new PoolEntry<uint8_t>( { 0 }));
localDataPoolMap.emplace(PDU::PDU2_DEVICE_0_STATUS, new PoolEntry<uint8_t>( { 0 }));
localDataPoolMap.emplace(PDU::PDU2_DEVICE_1_STATUS, new PoolEntry<uint8_t>( { 0 }));
localDataPoolMap.emplace(PDU::PDU2_DEVICE_2_STATUS, new PoolEntry<uint8_t>( { 0 }));
localDataPoolMap.emplace(PDU::PDU2_DEVICE_3_STATUS, new PoolEntry<uint8_t>( { 0 }));
localDataPoolMap.emplace(PDU::PDU2_DEVICE_4_STATUS, new PoolEntry<uint8_t>( { 0 }));
localDataPoolMap.emplace(PDU::PDU2_DEVICE_5_STATUS, new PoolEntry<uint8_t>( { 0 }));
localDataPoolMap.emplace(PDU::PDU2_DEVICE_6_STATUS, new PoolEntry<uint8_t>( { 0 }));
localDataPoolMap.emplace(PDU::PDU2_DEVICE_7_STATUS, new PoolEntry<uint8_t>( { 0 }));
localDataPoolMap.emplace(P60System::PDU2_DEVICE_0_STATUS, new PoolEntry<uint8_t>( { 0 }));
localDataPoolMap.emplace(P60System::PDU2_DEVICE_1_STATUS, new PoolEntry<uint8_t>( { 0 }));
localDataPoolMap.emplace(P60System::PDU2_DEVICE_2_STATUS, new PoolEntry<uint8_t>( { 0 }));
localDataPoolMap.emplace(P60System::PDU2_DEVICE_3_STATUS, new PoolEntry<uint8_t>( { 0 }));
localDataPoolMap.emplace(P60System::PDU2_DEVICE_4_STATUS, new PoolEntry<uint8_t>( { 0 }));
localDataPoolMap.emplace(P60System::PDU2_DEVICE_5_STATUS, new PoolEntry<uint8_t>( { 0 }));
localDataPoolMap.emplace(P60System::PDU2_DEVICE_6_STATUS, new PoolEntry<uint8_t>( { 0 }));
localDataPoolMap.emplace(P60System::PDU2_DEVICE_7_STATUS, new PoolEntry<uint8_t>( { 0 }));
localDataPoolMap.emplace(PDU::PDU2_WDT_CNT_GND, new PoolEntry<uint32_t>( { 0 }));
localDataPoolMap.emplace(PDU::PDU2_WDT_CNT_I2C, new PoolEntry<uint32_t>( { 0 }));
localDataPoolMap.emplace(PDU::PDU2_WDT_CNT_CAN, new PoolEntry<uint32_t>( { 0 }));
localDataPoolMap.emplace(PDU::PDU2_WDT_CNT_CSP, new PoolEntry<uint32_t>( { 0 }));
localDataPoolMap.emplace(PDU::PDU2_WDT_GND_LEFT, new PoolEntry<uint32_t>( { 0 }));
localDataPoolMap.emplace(PDU::PDU2_WDT_I2C_LEFT, new PoolEntry<uint32_t>( { 0 }));
localDataPoolMap.emplace(PDU::PDU2_WDT_CAN_LEFT, new PoolEntry<uint32_t>( { 0 }));
localDataPoolMap.emplace(PDU::PDU2_WDT_CSP_LEFT, new PoolEntry<uint32_t>( { 0 }));
localDataPoolMap.emplace(P60System::PDU2_WDT_CNT_GND, new PoolEntry<uint32_t>( { 0 }));
localDataPoolMap.emplace(P60System::PDU2_WDT_CNT_I2C, new PoolEntry<uint32_t>( { 0 }));
localDataPoolMap.emplace(P60System::PDU2_WDT_CNT_CAN, new PoolEntry<uint32_t>( { 0 }));
localDataPoolMap.emplace(P60System::PDU2_WDT_CNT_CSP, new PoolEntry<uint32_t>( { 0 }));
localDataPoolMap.emplace(P60System::PDU2_WDT_GND_LEFT, new PoolEntry<uint32_t>( { 0 }));
localDataPoolMap.emplace(P60System::PDU2_WDT_I2C_LEFT, new PoolEntry<uint32_t>( { 0 }));
localDataPoolMap.emplace(P60System::PDU2_WDT_CAN_LEFT, new PoolEntry<uint32_t>( { 0 }));
localDataPoolMap.emplace(P60System::PDU2_WDT_CSP_LEFT, new PoolEntry<uint32_t>( { 0 }));
return HasReturnvaluesIF::RETURN_OK;
}

View File

@ -36,7 +36,7 @@ protected:
private:
/** Dataset for the housekeeping table of the PDU2 */
PDU2::PDU2HkTableDataset hkTableDataset;
PDU2::PDU2HkTableDataset pdu2HkTableDataset;
};
#endif /* MISSION_DEVICES_PDU2HANDLER_H_ */

File diff suppressed because it is too large Load Diff