diff --git a/CHANGELOG.md b/CHANGELOG.md index ce393fea..30890da2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,10 @@ list yields a list of all related PRs for each release. GomSpace TM tables - Add API to retrieve GomSpace device parameter tables PR: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/pulls/287 +- Add API to save and load GomSpace config tables + PR: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/pulls/293 +- Increase number of allowed consescutive action commands from 3 to 16 + PR: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/pulls/294 # [v1.13.0] 24.08.2022 diff --git a/CMakeLists.txt b/CMakeLists.txt index 03b2b512..4d5b030f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -454,8 +454,9 @@ if(TGT_BSP MATCHES "arm/q7s") target_link_libraries(${LIB_EIVE_MISSION} PUBLIC ${LIB_GPS} ${LIB_ARCSEC}) endif() -target_link_libraries(${UNITTEST_NAME} PRIVATE Catch2 ${LIB_EIVE_MISSION} - rapidcsv ${LIB_DUMMIES} ${LIB_GOMSPACE_CLIENTS}) +target_link_libraries( + ${UNITTEST_NAME} PRIVATE Catch2 ${LIB_EIVE_MISSION} rapidcsv ${LIB_DUMMIES} + ${LIB_GOMSPACE_CLIENTS}) if(TGT_BSP MATCHES "arm/egse") target_link_libraries(${OBSW_NAME} PRIVATE ${LIB_ARCSEC}) diff --git a/fsfw b/fsfw index 9a590a3f..cf8fe7ea 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 9a590a3fcd81ed4dd48de503522b6d71f64205d2 +Subproject commit cf8fe7ea728bea077b9936bcf0db96845bc6419e diff --git a/linux/csp/CspComIF.cpp b/linux/csp/CspComIF.cpp index eb6487ed..5d8c3fd6 100644 --- a/linux/csp/CspComIF.cpp +++ b/linux/csp/CspComIF.cpp @@ -166,6 +166,26 @@ ReturnValue_t CspComIF::sendMessage(CookieIF* cookie, const uint8_t* sendData, s if (result != 0) { return returnvalue::FAILED; } + } else if(req == GOMSPACE::SpecialRequestTypes::SAVE_TABLE) { + if(sendLen < 2) { + return returnvalue::FAILED; + } + const TableInfo* tableInfo = reinterpret_cast(sendData); + int result = gs_rparam_save(cspAddress, cspCookie->getTimeout(), tableInfo->sourceTable, + tableInfo->targetTable); + if (result != 0) { + return returnvalue::FAILED; + } + } else if(req == GOMSPACE::SpecialRequestTypes::LOAD_TABLE) { + if(sendLen < 2) { + return returnvalue::FAILED; + } + const TableInfo* tableInfo = reinterpret_cast(sendData); + int result = gs_rparam_load(cspAddress, cspCookie->getTimeout(), tableInfo->sourceTable, + tableInfo->targetTable); + if (result != 0) { + return returnvalue::FAILED; + } } } else { /* No CSP fixed port was selected. Send data to the specified port and diff --git a/linux/devices/GPSHyperionLinuxController.cpp b/linux/devices/GPSHyperionLinuxController.cpp index 556db7ef..84200baf 100644 --- a/linux/devices/GPSHyperionLinuxController.cpp +++ b/linux/devices/GPSHyperionLinuxController.cpp @@ -87,7 +87,7 @@ ReturnValue_t GPSHyperionLinuxController::initializeLocalDataPool( localDataPoolMap.emplace(GpsHyperion::SATS_IN_USE, new PoolEntry()); localDataPoolMap.emplace(GpsHyperion::SATS_IN_VIEW, new PoolEntry()); localDataPoolMap.emplace(GpsHyperion::FIX_MODE, new PoolEntry()); - poolManager.subscribeForRegularPeriodicPacket({gpsSet.getSid(), 30.0}); + poolManager.subscribeForRegularPeriodicPacket({gpsSet.getSid(), false, 30.0}); return returnvalue::OK; } diff --git a/linux/devices/Max31865RtdLowlevelHandler.cpp b/linux/devices/Max31865RtdLowlevelHandler.cpp index f2815f5f..1be2b1c2 100644 --- a/linux/devices/Max31865RtdLowlevelHandler.cpp +++ b/linux/devices/Max31865RtdLowlevelHandler.cpp @@ -311,7 +311,7 @@ ReturnValue_t Max31865RtdReader::readReceivedMessage(CookieIF* cookie, uint8_t** return returnvalue::FAILED; } auto* rtdCookie = dynamic_cast(cookie); - if(rtdCookie == nullptr) { + if (rtdCookie == nullptr) { return returnvalue::FAILED; } uint8_t* exchangePtr = rtdCookie->exchangeBuf.data(); diff --git a/linux/devices/ploc/PlocSupervisorHandler.cpp b/linux/devices/ploc/PlocSupervisorHandler.cpp index 1cff8884..3846e4a4 100644 --- a/linux/devices/ploc/PlocSupervisorHandler.cpp +++ b/linux/devices/ploc/PlocSupervisorHandler.cpp @@ -417,7 +417,7 @@ ReturnValue_t PlocSupervisorHandler::buildCommandFromCommand(DeviceCommandId_t d break; } case LOGGING_SET_TOPIC: { - if(commandData == nullptr or commandDataLen == 0) { + if (commandData == nullptr or commandDataLen == 0) { return HasActionsIF::INVALID_PARAMETERS; } uint8_t tpc = *(commandData); diff --git a/linux/devices/startracker/StarTrackerHandler.cpp b/linux/devices/startracker/StarTrackerHandler.cpp index 698887b8..a4cd432c 100644 --- a/linux/devices/startracker/StarTrackerHandler.cpp +++ b/linux/devices/startracker/StarTrackerHandler.cpp @@ -1830,7 +1830,7 @@ ReturnValue_t StarTrackerHandler::handleChecksumReply() { } PoolReadGuard rg(&checksumSet); checksumSet.checksum = checksumReply.getChecksum(); - handleDeviceTM(&checksumSet, startracker::CHECKSUM); + handleDeviceTm(checksumSet, startracker::CHECKSUM); #if OBSW_VERBOSE_LEVEL >= 1 && OBSW_DEBUG_STARTRACKER == 1 checksumReply.printChecksum(); #endif /* OBSW_VERBOSE_LEVEL >= 1 && OBSW_DEBUG_STARTRACKER == 1 */ diff --git a/mission/controller/AcsController.cpp b/mission/controller/AcsController.cpp index c6b3207e..09e91e26 100644 --- a/mission/controller/AcsController.cpp +++ b/mission/controller/AcsController.cpp @@ -45,7 +45,7 @@ ReturnValue_t AcsController::initializeLocalDataPool(localpool::DataPool &localD localDataPoolMap.emplace(acsctrl::PoolIds::MGM_3_RM3100_UT, &mgm3PoolVec); localDataPoolMap.emplace(acsctrl::PoolIds::MGM_IMTQ_CAL_NT, &imtqMgmPoolVec); localDataPoolMap.emplace(acsctrl::PoolIds::MGM_IMTQ_CAL_ACT_STATUS, &imtqCalActStatus); - poolManager.subscribeForRegularPeriodicPacket({mgmData.getSid(), 5.0}); + poolManager.subscribeForRegularPeriodicPacket({mgmData.getSid(), false, 5.0}); return returnvalue::OK; } diff --git a/mission/core/GenericFactory.cpp b/mission/core/GenericFactory.cpp index 0a9be3f9..bbd2bb98 100644 --- a/mission/core/GenericFactory.cpp +++ b/mission/core/GenericFactory.cpp @@ -96,7 +96,7 @@ void ObjectFactory::produceGenericObjects(HealthTableIF** healthTable_) { PsbParams(objects::PUS_SERVICE_5_EVENT_REPORTING, apid::EIVE_OBSW, pus::PUS_SERVICE_5), 15, 45); new Service8FunctionManagement(objects::PUS_SERVICE_8_FUNCTION_MGMT, apid::EIVE_OBSW, - pus::PUS_SERVICE_8, 3, 60); + pus::PUS_SERVICE_8, 16, 60); new Service9TimeManagement( PsbParams(objects::PUS_SERVICE_9_TIME_MGMT, apid::EIVE_OBSW, pus::PUS_SERVICE_9)); diff --git a/mission/csp/CspCookie.cpp b/mission/csp/CspCookie.cpp index f6ab1eed..228a8058 100644 --- a/mission/csp/CspCookie.cpp +++ b/mission/csp/CspCookie.cpp @@ -1,10 +1,11 @@ #include "CspCookie.h" +using namespace GOMSPACE; CspCookie::CspCookie(uint16_t maxReplyLength_, uint8_t cspAddress_, uint32_t timeoutMs) : maxReplyLength(maxReplyLength_), cspAddress(cspAddress_), timeoutMs(timeoutMs), - reqType(GOMSPACE::DEFAULT_COM_IF) {} + reqType(SpecialRequestTypes::DEFAULT_COM_IF) {} CspCookie::~CspCookie() {} diff --git a/mission/csp/CspCookie.h b/mission/csp/CspCookie.h index 441eb413..9eb0a639 100644 --- a/mission/csp/CspCookie.h +++ b/mission/csp/CspCookie.h @@ -28,7 +28,7 @@ class CspCookie : public CookieIF { uint32_t getTimeout() const; private: - uint8_t cspPort; + uint8_t cspPort = 0; uint16_t maxReplyLength; uint8_t cspAddress; size_t replyLen = 0; diff --git a/mission/devices/ACUHandler.cpp b/mission/devices/ACUHandler.cpp index f229d248..2a8ffe8b 100644 --- a/mission/devices/ACUHandler.cpp +++ b/mission/devices/ACUHandler.cpp @@ -43,7 +43,7 @@ void ACUHandler::letChildHandleHkReply(DeviceCommandId_t id, const uint8_t *pack } void ACUHandler::letChildHandleConfigReply(DeviceCommandId_t id, const uint8_t *packet) { - handleDeviceTM(packet, ACU::CONFIG_TABLE_SIZE, id); + handleDeviceTm(packet, ACU::CONFIG_TABLE_SIZE, id); } LocalPoolDataSetBase *ACUHandler::getDataSetHandle(sid_t sid) { diff --git a/mission/devices/GomspaceDeviceHandler.cpp b/mission/devices/GomspaceDeviceHandler.cpp index cc4786d0..ebfcf2a9 100644 --- a/mission/devices/GomspaceDeviceHandler.cpp +++ b/mission/devices/GomspaceDeviceHandler.cpp @@ -44,6 +44,8 @@ ReturnValue_t GomspaceDeviceHandler::buildTransitionDeviceCommand(DeviceCommandI ReturnValue_t GomspaceDeviceHandler::buildCommandFromCommand(DeviceCommandId_t deviceCommand, const uint8_t* commandData, size_t commandDataLen) { + auto* cspCookie = dynamic_cast(comCookie); + cspCookie->setRequest(SpecialRequestTypes::DEFAULT_COM_IF, 0); ReturnValue_t result = childCommandHook(deviceCommand, commandData, commandDataLen); switch (deviceCommand) { case (GOMSPACE::PING): { @@ -84,37 +86,87 @@ ReturnValue_t GomspaceDeviceHandler::buildCommandFromCommand(DeviceCommandId_t d break; } case (GOMSPACE::REQUEST_HK_TABLE): { - auto reqType = SpecialRequestTypes::DEFAULT_COM_IF; - if (getObjectId() == objects::PDU1_HANDLER or getObjectId() == objects::PDU2_HANDLER) { - reqType = SpecialRequestTypes::GET_PDU_HK; - } else if (getObjectId() == objects::ACU_HANDLER) { - reqType = SpecialRequestTypes::GET_ACU_HK; - } else if (getObjectId() == objects::P60DOCK_HANDLER) { - reqType = SpecialRequestTypes::GET_P60DOCK_HK; + DeviceType devType; + if(getDevType(devType) != returnvalue::OK) { + return returnvalue::FAILED; } - result = generateRequestFullTableCmd(reqType, GOMSPACE::TableIds::HK, tableCfg.hkTableSize, - deviceCommand); + result = + generateRequestFullHkTableCmd(devType, tableCfg.hkTableSize, deviceCommand, cspCookie); if (result != returnvalue::OK) { return result; } break; } case (GOMSPACE::REQUEST_CONFIG_TABLE): { - auto reqType = SpecialRequestTypes::DEFAULT_COM_IF; - if (getObjectId() == objects::PDU1_HANDLER or getObjectId() == objects::PDU2_HANDLER) { - reqType = SpecialRequestTypes::GET_PDU_CONFIG; - } else if (getObjectId() == objects::ACU_HANDLER) { - reqType = SpecialRequestTypes::GET_ACU_CONFIG; - } else if (getObjectId() == objects::P60DOCK_HANDLER) { - reqType = SpecialRequestTypes::GET_P60DOCK_CONFIG; + DeviceType devType; + if(getDevType(devType) != returnvalue::OK) { + return returnvalue::FAILED; } - result = generateRequestFullTableCmd(reqType, GOMSPACE::TableIds::CONFIG, - tableCfg.cfgTableSize, deviceCommand); + result = generateRequestFullCfgTableCmd(devType, tableCfg.cfgTableSize, + deviceCommand, cspCookie); if (result != returnvalue::OK) { return result; } break; } + case (GOMSPACE::LOAD_TABLE): { + if (commandDataLen != 2) { + return HasActionsIF::INVALID_PARAMETERS; + } + auto* info = reinterpret_cast(cspPacket); + info->sourceTable = commandData[0]; + info->targetTable = commandData[1]; + rawPacket = cspPacket; + rawPacketLen = sizeof(GOMSPACE::TableInfo); + cspCookie->setCspPort(CspPorts::P60_PORT_RPARAM_ENUM); + cspCookie->setRequest(SpecialRequestTypes::LOAD_TABLE, 0); + rememberCommandId = deviceCommand; + break; + } + case (GOMSPACE::SAVE_TABLE_FILE): { + if (commandDataLen > 2) { + return HasActionsIF::INVALID_PARAMETERS; + } + auto* info = reinterpret_cast(cspPacket); + if (commandData[0] != 0 and commandData[0] != 1 and commandData[0] != 2 and + commandData[0] != 4) { + return HasActionsIF::INVALID_PARAMETERS; + } + info->sourceTable = commandData[0]; + if (info->sourceTable != 4) { + if (commandDataLen == 2) { + info->targetTable = commandData[1]; + } else { + info->targetTable = info->sourceTable; + } + } else { + // Will be ignored, still set the value which is always used + info->targetTable = 4; + } + rawPacket = cspPacket; + rawPacketLen = sizeof(GOMSPACE::TableInfo); + cspCookie->setCspPort(CspPorts::P60_PORT_RPARAM_ENUM); + cspCookie->setRequest(SpecialRequestTypes::SAVE_TABLE, 0); + rememberCommandId = deviceCommand; + break; + } + case (GOMSPACE::SAVE_TABLE_DEFAULT): { + if (commandDataLen != 1) { + return HasActionsIF::INVALID_PARAMETERS; + } + auto* info = reinterpret_cast(cspPacket); + if (commandData[0] != 0 and commandData[0] != 1 and commandData[0] != 2) { + return HasActionsIF::INVALID_PARAMETERS; + } + info->sourceTable = commandData[0]; + info->targetTable = info->sourceTable + 4; + rawPacket = cspPacket; + rawPacketLen = sizeof(GOMSPACE::TableInfo); + cspCookie->setCspPort(CspPorts::P60_PORT_RPARAM_ENUM); + cspCookie->setRequest(SpecialRequestTypes::SAVE_TABLE, 0); + rememberCommandId = deviceCommand; + break; + } default: return DeviceHandlerIF::COMMAND_NOT_IMPLEMENTED; } @@ -131,6 +183,9 @@ void GomspaceDeviceHandler::fillCommandAndReplyMap() { this->insertInCommandMap(GOMSPACE::GNDWDT_RESET); this->insertInCommandMap(GOMSPACE::PRINT_SWITCH_V_I); this->insertInCommandMap(GOMSPACE::PRINT_LATCHUPS); + insertInCommandMap(GOMSPACE::SAVE_TABLE_FILE); + insertInCommandMap(GOMSPACE::SAVE_TABLE_DEFAULT); + insertInCommandMap(GOMSPACE::LOAD_TABLE); } ReturnValue_t GomspaceDeviceHandler::scanForReply(const uint8_t* start, size_t remainingSize, @@ -177,7 +232,7 @@ ReturnValue_t GomspaceDeviceHandler::interpretDeviceReply(DeviceCommandId_t id, switch (id) { case (GOMSPACE::PING): { SerializeElement replyTime = *packet; - handleDeviceTM(&replyTime, id, true); + handleDeviceTm(replyTime, true); break; } case (GOMSPACE::PARAM_GET): { @@ -204,7 +259,7 @@ ReturnValue_t GomspaceDeviceHandler::interpretDeviceReply(DeviceCommandId_t id, uint16_t address = cspGetParamReply.getAddress(); /* Pack relevant information into a tm packet */ ParamReply paramReply(action, tableId, address, payloadLength, tempPayloadBuffer); - handleDeviceTM(¶mReply, id, true); + handleDeviceTm(paramReply, id, true); break; } case (GOMSPACE::PARAM_SET): { @@ -443,6 +498,19 @@ bool GomspaceDeviceHandler::validTableId(uint8_t id) { return false; } +ReturnValue_t GomspaceDeviceHandler::getDevType(GOMSPACE::DeviceType& type) const { + if (getObjectId() == objects::PDU1_HANDLER or getObjectId() == objects::PDU2_HANDLER) { + type = DeviceType::PDU; + } else if (getObjectId() == objects::ACU_HANDLER) { + type = DeviceType::ACU; + } else if (getObjectId() == objects::P60DOCK_HANDLER) { + type = DeviceType::P60DOCK; + } else { + return returnvalue::FAILED; + } + return returnvalue::OK; +} + ReturnValue_t GomspaceDeviceHandler::generateResetWatchdogCmd() { WatchdogResetCommand watchdogResetCommand; size_t cspPacketLen = 0; @@ -462,19 +530,40 @@ ReturnValue_t GomspaceDeviceHandler::generateResetWatchdogCmd() { return returnvalue::OK; } -ReturnValue_t GomspaceDeviceHandler::generateRequestFullTableCmd(SpecialRequestTypes reqType, - uint8_t tableId, - uint16_t tableReplySize, - DeviceCommandId_t id) { - uint16_t querySize = tableReplySize; - if (reqType == SpecialRequestTypes::DEFAULT_COM_IF) { - sif::warning << "Default communication for table requests not implemented anymore" << std::endl; - return returnvalue::FAILED; +ReturnValue_t GomspaceDeviceHandler::generateRequestFullHkTableCmd(DeviceType dev, + uint16_t tableReplySize, + DeviceCommandId_t id, + CspCookie* cspCookie) { + if (dev == DeviceType::ACU) { + cspCookie->setRequest(SpecialRequestTypes::GET_ACU_HK, tableReplySize); + } else if (dev == DeviceType::P60DOCK) { + cspCookie->setRequest(SpecialRequestTypes::GET_P60DOCK_HK, tableReplySize); + } else if (dev == DeviceType::PDU) { + cspCookie->setRequest(SpecialRequestTypes::GET_PDU_HK, tableReplySize); } - auto* cspCookie = dynamic_cast(comCookie); - cspCookie->setRequest(reqType, tableReplySize); cspCookie->setCspPort(CspPorts::P60_PORT_RPARAM_ENUM); - rememberRequestedSize = querySize; + rememberRequestedSize = tableReplySize; + rememberCommandId = id; + return returnvalue::OK; +} + +ReturnValue_t GomspaceDeviceHandler::generateRequestFullCfgTableCmd(DeviceType dev, + uint16_t tableReplySize, + DeviceCommandId_t id, + CspCookie* cspCookie) { + if (dev == DeviceType::ACU) { + cspCookie->setRequest(SpecialRequestTypes::GET_ACU_CONFIG, tableReplySize); + } else if (dev == DeviceType::P60DOCK) { + cspCookie->setRequest(SpecialRequestTypes::GET_P60DOCK_CONFIG, tableReplySize); + } else if (dev == DeviceType::PDU) { + cspCookie->setRequest(SpecialRequestTypes::GET_PDU_CONFIG, tableReplySize); + } + cspCookie->setCspPort(CspPorts::P60_PORT_RPARAM_ENUM); + // Unfortunately, this does not work.. + // cspPacket[0] = defaultTable; + // rawPacket = cspPacket; + // rawPacketLen = 1; + rememberRequestedSize = tableReplySize; rememberCommandId = id; return returnvalue::OK; } diff --git a/mission/devices/GomspaceDeviceHandler.h b/mission/devices/GomspaceDeviceHandler.h index af847b8a..528cd2dd 100644 --- a/mission/devices/GomspaceDeviceHandler.h +++ b/mission/devices/GomspaceDeviceHandler.h @@ -82,10 +82,21 @@ class GomspaceDeviceHandler : public DeviceHandlerBase { * @brief The command to generate a request to receive the full housekeeping table is device * specific. Thus the child has to build this command. */ - virtual ReturnValue_t generateRequestFullTableCmd(GOMSPACE::SpecialRequestTypes reqType, - uint8_t tableId, uint16_t tableSize, - DeviceCommandId_t id); - + ReturnValue_t generateRequestFullHkTableCmd(GOMSPACE::DeviceType devType, uint16_t tableSize, + DeviceCommandId_t id, CspCookie *cspCookie); + /** + * Unfortunately, it was not possible to specify the table ID (e.g. request table from + * default store) + * @param devType + * @param tableSize + * @param id + * @param cspCookie + * @return + */ + ReturnValue_t generateRequestFullCfgTableCmd(GOMSPACE::DeviceType devType, + uint16_t tableSize, DeviceCommandId_t id, + CspCookie *cspCookie); + ReturnValue_t getDevType(GOMSPACE::DeviceType& type) const; /** * This command handles printing the HK table to the console. This is useful for debugging * purposes diff --git a/mission/devices/P60DockHandler.cpp b/mission/devices/P60DockHandler.cpp index 4d4d4ed2..8c768847 100644 --- a/mission/devices/P60DockHandler.cpp +++ b/mission/devices/P60DockHandler.cpp @@ -24,11 +24,6 @@ ReturnValue_t P60DockHandler::buildNormalDeviceCommand(DeviceCommandId_t *id) { void P60DockHandler::letChildHandleHkReply(DeviceCommandId_t id, const uint8_t *packet) { parseHkTableReply(packet); - /** - * Hk table will be sent to the commander if hk table request was not triggered by the - * P60DockHandler itself. - */ - handleDeviceTM(&coreHk, id, true); } void P60DockHandler::parseHkTableReply(const uint8_t *packet) { @@ -273,5 +268,5 @@ void P60DockHandler::printHkTableLatchups() { void P60DockHandler::setDebugMode(bool enable) { this->debugMode = enable; } void P60DockHandler::letChildHandleConfigReply(DeviceCommandId_t id, const uint8_t *packet) { - handleDeviceTM(packet, P60Dock::CONFIG_TABLE_SIZE, id); + handleDeviceTm(packet, P60Dock::CONFIG_TABLE_SIZE, id); } diff --git a/mission/devices/PDU1Handler.cpp b/mission/devices/PDU1Handler.cpp index deb747db..9a44da5e 100644 --- a/mission/devices/PDU1Handler.cpp +++ b/mission/devices/PDU1Handler.cpp @@ -22,7 +22,6 @@ ReturnValue_t PDU1Handler::buildNormalDeviceCommand(DeviceCommandId_t *id) { void PDU1Handler::letChildHandleHkReply(DeviceCommandId_t id, const uint8_t *packet) { parseHkTableReply(packet); - handleDeviceTM(&coreHk, id, true); } void PDU1Handler::assignChannelHookFunction(GOMSPACE::ChannelSwitchHook hook, void *args) { @@ -81,7 +80,7 @@ ReturnValue_t PDU1Handler::setParamCallback(SetParamMessageUnpacker &unpacker, } void PDU1Handler::letChildHandleConfigReply(DeviceCommandId_t id, const uint8_t *packet) { - handleDeviceTM(packet, PDU::CONFIG_TABLE_SIZE, id); + handleDeviceTm(packet, PDU::CONFIG_TABLE_SIZE, id); } void PDU1Handler::parseHkTableReply(const uint8_t *packet) { diff --git a/mission/devices/PDU2Handler.cpp b/mission/devices/PDU2Handler.cpp index 65de91a7..4db6999f 100644 --- a/mission/devices/PDU2Handler.cpp +++ b/mission/devices/PDU2Handler.cpp @@ -22,15 +22,10 @@ ReturnValue_t PDU2Handler::buildNormalDeviceCommand(DeviceCommandId_t *id) { void PDU2Handler::letChildHandleHkReply(DeviceCommandId_t id, const uint8_t *packet) { parseHkTableReply(packet); - /** - * Hk table will be sent to the commander if hk table request was not triggered by the - * PDU2Handler itself. - */ - handleDeviceTM(&coreHk, id, true); } void PDU2Handler::letChildHandleConfigReply(DeviceCommandId_t id, const uint8_t *packet) { - handleDeviceTM(packet, PDU::CONFIG_TABLE_SIZE, id); + handleDeviceTm(packet, PDU::CONFIG_TABLE_SIZE, id); } void PDU2Handler::assignChannelHookFunction(GOMSPACE::ChannelSwitchHook hook, void *args) { diff --git a/mission/devices/devicedefinitions/GomspaceDefinitions.h b/mission/devices/devicedefinitions/GomspaceDefinitions.h index 5447bf42..cab71362 100644 --- a/mission/devices/devicedefinitions/GomspaceDefinitions.h +++ b/mission/devices/devicedefinitions/GomspaceDefinitions.h @@ -18,14 +18,23 @@ namespace GOMSPACE { -enum SpecialRequestTypes { +struct TableInfo { + uint8_t sourceTable; + uint8_t targetTable; +}; + +enum DeviceType { PDU, ACU, P60DOCK }; + +enum class SpecialRequestTypes { DEFAULT_COM_IF, GET_PDU_HK, GET_PDU_CONFIG, GET_ACU_HK, GET_ACU_CONFIG, GET_P60DOCK_HK, - GET_P60DOCK_CONFIG + GET_P60DOCK_CONFIG, + SAVE_TABLE, + LOAD_TABLE }; enum CspPorts : uint8_t { @@ -53,14 +62,18 @@ static const uint8_t P60_PORT_GNDWDT_RESET = 9; * Device commands are derived from the rparam.h of the gomspace lib.. * IDs above 50 are reserved for device specific commands. */ +static const DeviceCommandId_t PARAM_GET = 0; //!< [EXPORT] : [COMMAND] static const DeviceCommandId_t PING = 1; //!< [EXPORT] : [COMMAND] static const DeviceCommandId_t NONE = 2; // Set when no command is pending static const DeviceCommandId_t REBOOT = 4; //!< [EXPORT] : [COMMAND] static const DeviceCommandId_t GNDWDT_RESET = 9; //!< [EXPORT] : [COMMAND] -static const DeviceCommandId_t PARAM_GET = 0; //!< [EXPORT] : [COMMAND] -static const DeviceCommandId_t PARAM_SET = 255; //!< [EXPORT] : [COMMAND] static const DeviceCommandId_t REQUEST_HK_TABLE = 16; //!< [EXPORT] : [COMMAND] static const DeviceCommandId_t REQUEST_CONFIG_TABLE = 17; //!< [EXPORT] : [COMMAND] +static const DeviceCommandId_t SAVE_TABLE_FILE = 18; +static const DeviceCommandId_t SAVE_TABLE_DEFAULT = 19; +static const DeviceCommandId_t LOAD_TABLE = 20; +static const DeviceCommandId_t PARAM_SET = 255; //!< [EXPORT] : [COMMAND] + // Not implemented yet // static const DeviceCommandId_t REQUEST_CALIB_TABLE = 18; //!< [EXPORT] : [COMMAND] //! [EXPORT] : [COMMAND] Print switch states, voltages and currents to the console diff --git a/tmtc b/tmtc index 05dd1738..603b7e85 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 05dd17386070b9f333977f1f2b9f5651f9053b65 +Subproject commit 603b7e8574d74ba60692115133cde3cd8b8bd423