From 3d71cce30b2f317c5449e359928a00f6fba298ae Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 1 Sep 2022 11:04:24 +0200 Subject: [PATCH] bugfix --- fsfw | 2 +- mission/devices/GomspaceDeviceHandler.cpp | 10 ++++++---- mission/devices/GomspaceDeviceHandler.h | 2 +- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/fsfw b/fsfw index 496dac89..cf8fe7ea 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 496dac89e4c094e03578f40d8651485f7f378cb2 +Subproject commit cf8fe7ea728bea077b9936bcf0db96845bc6419e diff --git a/mission/devices/GomspaceDeviceHandler.cpp b/mission/devices/GomspaceDeviceHandler.cpp index aa4459b4..ec0001ac 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): { @@ -93,7 +95,7 @@ ReturnValue_t GomspaceDeviceHandler::buildCommandFromCommand(DeviceCommandId_t d reqType = SpecialRequestTypes::GET_P60DOCK_HK; } result = generateRequestFullTableCmd(reqType, GOMSPACE::TableIds::HK, tableCfg.hkTableSize, - deviceCommand); + deviceCommand, cspCookie); if (result != returnvalue::OK) { return result; } @@ -109,7 +111,7 @@ ReturnValue_t GomspaceDeviceHandler::buildCommandFromCommand(DeviceCommandId_t d reqType = SpecialRequestTypes::GET_P60DOCK_CONFIG; } result = generateRequestFullTableCmd(reqType, GOMSPACE::TableIds::CONFIG, - tableCfg.cfgTableSize, deviceCommand); + tableCfg.cfgTableSize, deviceCommand, cspCookie); if (result != returnvalue::OK) { return result; } @@ -506,13 +508,13 @@ ReturnValue_t GomspaceDeviceHandler::generateResetWatchdogCmd() { ReturnValue_t GomspaceDeviceHandler::generateRequestFullTableCmd(SpecialRequestTypes reqType, uint8_t tableId, uint16_t tableReplySize, - DeviceCommandId_t id) { + DeviceCommandId_t id, + CspCookie* cspCookie) { 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; } - auto* cspCookie = dynamic_cast(comCookie); cspCookie->setRequest(reqType, tableReplySize); cspCookie->setCspPort(CspPorts::P60_PORT_RPARAM_ENUM); rememberRequestedSize = querySize; diff --git a/mission/devices/GomspaceDeviceHandler.h b/mission/devices/GomspaceDeviceHandler.h index af847b8a..da4fc136 100644 --- a/mission/devices/GomspaceDeviceHandler.h +++ b/mission/devices/GomspaceDeviceHandler.h @@ -84,7 +84,7 @@ class GomspaceDeviceHandler : public DeviceHandlerBase { */ virtual ReturnValue_t generateRequestFullTableCmd(GOMSPACE::SpecialRequestTypes reqType, uint8_t tableId, uint16_t tableSize, - DeviceCommandId_t id); + DeviceCommandId_t id, CspCookie* cspCookie); /** * This command handles printing the HK table to the console. This is useful for debugging