filename fixes scex #546

Merged
muellerr merged 3 commits from scex_filename_fixes into develop 2023-04-01 15:05:05 +02:00
Showing only changes of commit b58fc90879 - Show all commits

View File

@ -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