From b58fc9087966b8c8aa341014cc85007e0146caa2 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Sat, 1 Apr 2023 14:40:34 +0200 Subject: [PATCH] important correction --- mission/payload/ScexDeviceHandler.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/mission/payload/ScexDeviceHandler.cpp b/mission/payload/ScexDeviceHandler.cpp index d0de7919..c4ecc9eb 100644 --- a/mission/payload/ScexDeviceHandler.cpp +++ b/mission/payload/ScexDeviceHandler.cpp @@ -28,6 +28,7 @@ void ScexDeviceHandler::doStartUp() { setMode(MODE_ON); } void ScexDeviceHandler::doShutDown() { reader.reset(); commandActive = false; + fileNameSet = false; multiFileFinishOutstanding = false; setMode(_MODE_POWER_DOWN); } @@ -208,7 +209,11 @@ ReturnValue_t ScexDeviceHandler::interpretDeviceReply(DeviceCommandId_t id, cons ReturnValue_t status = OK; auto multiFileHandler = [&](const char* cmdName) { if ((helper.getPacketCounter() == 1) or (not fileNameSet)) { - return generateNewScexFile(cmdName); + status = generateNewScexFile(cmdName); + if(status != returnvalue::OK) { + return status; + } + fileNameSet = true; } else { ofstream out(fileName, ofstream::binary | ofstream::app); // append