#include "PDU2Handler.h" #include 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() { } ReturnValue_t PDU2Handler::buildNormalDeviceCommand( DeviceCommandId_t * id) { *id = GOMSPACE::REQUEST_HK_TABLE; return buildCommandFromCommand(*id, NULL, 0); } void PDU2Handler::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); handleDeviceTM(&fullTableReply, id, true); } ReturnValue_t PDU2Handler::initializeLocalDataPool( localpool::DataPool &localDataPoolMap, LocalDataPoolManager &poolManager) { localDataPoolMap.emplace(PDU::PDU2_CURRENT_OUT_Q7S, new PoolEntry( { 0 })); localDataPoolMap.emplace(PDU::PDU2_CURRENT_OUT_PAYLOAD_PCDU_CH1, new PoolEntry( { 0 })); localDataPoolMap.emplace(PDU::PDU2_CURRENT_OUT_RW, new PoolEntry( { 0 })); localDataPoolMap.emplace(PDU::PDU2_CURRENT_OUT_TCS_BOARD_HEATER_IN, new PoolEntry( { 0 })); localDataPoolMap.emplace(PDU::PDU2_CURRENT_OUT_SUS_REDUNDANT, new PoolEntry( { 0 })); localDataPoolMap.emplace(PDU::PDU2_CURRENT_OUT_DEPLOYMENT_MECHANISM, new PoolEntry( { 0 })); localDataPoolMap.emplace(PDU::PDU2_CURRENT_OUT_PAYLOAD_PCDU_CH6, new PoolEntry( { 0 })); localDataPoolMap.emplace(PDU::PDU2_CURRENT_OUT_ACS_BOARD_SIDE_B, new PoolEntry( { 0 })); localDataPoolMap.emplace(PDU::PDU2_CURRENT_OUT_PAYLOAD_CAMERA, new PoolEntry( { 0 })); localDataPoolMap.emplace(PDU::PDU2_VOLTAGE_OUT_Q7S, new PoolEntry( { 0 })); localDataPoolMap.emplace(PDU::PDU2_VOLTAGE_OUT_PAYLOAD_PCDU_CH1, new PoolEntry( { 0 })); localDataPoolMap.emplace(PDU::PDU2_VOLTAGE_OUT_RW, new PoolEntry( { 0 })); localDataPoolMap.emplace(PDU::PDU2_VOLTAGE_OUT_TCS_BOARD_HEATER_IN, new PoolEntry( { 0 })); localDataPoolMap.emplace(PDU::PDU2_VOLTAGE_OUT_SUS_REDUNDANT, new PoolEntry( { 0 })); localDataPoolMap.emplace(PDU::PDU2_VOLTAGE_OUT_DEPLOYMENT_MECHANISM, new PoolEntry( { 0 })); localDataPoolMap.emplace(PDU::PDU2_VOLTAGE_OUT_PAYLOAD_PCDU_CH6, new PoolEntry( { 0 })); localDataPoolMap.emplace(PDU::PDU2_VOLTAGE_OUT_ACS_BOARD_SIDE_B, new PoolEntry( { 0 })); localDataPoolMap.emplace(PDU::PDU2_VOLTAGE_OUT_PAYLOAD_CAMERA, new PoolEntry( { 0 })); localDataPoolMap.emplace(PDU::PDU2_VCC, new PoolEntry( { 0 })); localDataPoolMap.emplace(PDU::PDU2_VBAT, new PoolEntry( { 0 })); localDataPoolMap.emplace(PDU::PDU2_TEMPERATURE, new PoolEntry( { 0 })); localDataPoolMap.emplace(PDU::PDU2_CONV_EN, new PoolEntry( { 0 })); localDataPoolMap.emplace(PDU::PDU2_OUT_EN_Q7S, new PoolEntry( { 0 })); localDataPoolMap.emplace(PDU::PDU2_OUT_EN_PAYLOAD_PCDU_CH1, new PoolEntry( { 0 })); localDataPoolMap.emplace(PDU::PDU2_OUT_EN_RW, new PoolEntry( { 0 })); localDataPoolMap.emplace(PDU::PDU2_OUT_EN_TCS_BOARD_HEATER_IN, new PoolEntry( { 0 })); localDataPoolMap.emplace(PDU::PDU2_OUT_EN_SUS_REDUNDANT, new PoolEntry( { 0 })); localDataPoolMap.emplace(PDU::PDU2_OUT_EN_DEPLOYMENT_MECHANISM, new PoolEntry( { 0 })); localDataPoolMap.emplace(PDU::PDU2_OUT_EN_PAYLOAD_PCDU_CH6, new PoolEntry( { 0 })); localDataPoolMap.emplace(PDU::PDU2_OUT_EN_ACS_BOARD_SIDE_B, new PoolEntry( { 0 })); localDataPoolMap.emplace(PDU::PDU2_OUT_EN_PAYLOAD_CAMERA, new PoolEntry( { 0 })); localDataPoolMap.emplace(PDU::PDU2_BOOTCAUSE, new PoolEntry( { 0 })); localDataPoolMap.emplace(PDU::PDU2_BOOTCNT, new PoolEntry( { 0 })); localDataPoolMap.emplace(PDU::PDU2_UPTIME, new PoolEntry( { 0 })); localDataPoolMap.emplace(PDU::PDU2_RESETCAUSE, new PoolEntry( { 0 })); localDataPoolMap.emplace(PDU::PDU2_BATT_MODE, new PoolEntry( { 0 })); localDataPoolMap.emplace(PDU::PDU2_DEVICE_0, new PoolEntry( { 0 })); localDataPoolMap.emplace(PDU::PDU2_DEVICE_1, new PoolEntry( { 0 })); localDataPoolMap.emplace(PDU::PDU2_DEVICE_2, new PoolEntry( { 0 })); localDataPoolMap.emplace(PDU::PDU2_DEVICE_3, new PoolEntry( { 0 })); localDataPoolMap.emplace(PDU::PDU2_DEVICE_4, new PoolEntry( { 0 })); localDataPoolMap.emplace(PDU::PDU2_DEVICE_5, new PoolEntry( { 0 })); localDataPoolMap.emplace(PDU::PDU2_DEVICE_6, new PoolEntry( { 0 })); localDataPoolMap.emplace(PDU::PDU2_DEVICE_7, new PoolEntry( { 0 })); localDataPoolMap.emplace(PDU::PDU2_DEVICE_0_STATUS, new PoolEntry( { 0 })); localDataPoolMap.emplace(PDU::PDU2_DEVICE_1_STATUS, new PoolEntry( { 0 })); localDataPoolMap.emplace(PDU::PDU2_DEVICE_2_STATUS, new PoolEntry( { 0 })); localDataPoolMap.emplace(PDU::PDU2_DEVICE_3_STATUS, new PoolEntry( { 0 })); localDataPoolMap.emplace(PDU::PDU2_DEVICE_4_STATUS, new PoolEntry( { 0 })); localDataPoolMap.emplace(PDU::PDU2_DEVICE_5_STATUS, new PoolEntry( { 0 })); localDataPoolMap.emplace(PDU::PDU2_DEVICE_6_STATUS, new PoolEntry( { 0 })); localDataPoolMap.emplace(PDU::PDU2_DEVICE_7_STATUS, new PoolEntry( { 0 })); localDataPoolMap.emplace(PDU::PDU2_WDT_CNT_GND, new PoolEntry( { 0 })); localDataPoolMap.emplace(PDU::PDU2_WDT_CNT_I2C, new PoolEntry( { 0 })); localDataPoolMap.emplace(PDU::PDU2_WDT_CNT_CAN, new PoolEntry( { 0 })); localDataPoolMap.emplace(PDU::PDU2_WDT_CNT_CSP, new PoolEntry( { 0 })); localDataPoolMap.emplace(PDU::PDU2_WDT_GND_LEFT, new PoolEntry( { 0 })); localDataPoolMap.emplace(PDU::PDU2_WDT_I2C_LEFT, new PoolEntry( { 0 })); localDataPoolMap.emplace(PDU::PDU2_WDT_CAN_LEFT, new PoolEntry( { 0 })); localDataPoolMap.emplace(PDU::PDU2_WDT_CSP_LEFT, new PoolEntry( { 0 })); return HasReturnvaluesIF::RETURN_OK; }