From 509d144117baa902777d373e2e892cbc0a1d81fe Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 17 Mar 2023 11:09:29 +0100 Subject: [PATCH 1/2] SA DEPLY updates --- .../devices/SolarArrayDeploymentHandler.cpp | 19 +++++++++++++------ tmtc | 2 +- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/mission/devices/SolarArrayDeploymentHandler.cpp b/mission/devices/SolarArrayDeploymentHandler.cpp index e4356630..aa471a1c 100644 --- a/mission/devices/SolarArrayDeploymentHandler.cpp +++ b/mission/devices/SolarArrayDeploymentHandler.cpp @@ -157,10 +157,14 @@ ReturnValue_t SolarArrayDeploymentHandler::performAutonomousDepl(sd::SdCard sdCa return returnvalue::OK; } -bool SolarArrayDeploymentHandler::autonomousDeplForFile(sd::SdCard sdCard, const char* filename, +bool SolarArrayDeploymentHandler::autonomousDeplForFile(sd::SdCard sdCard, const char* infoFile, bool dryRun) { using namespace std; - ifstream file(filename); + std::error_code e; + ifstream file(infoFile); + if (file.bad()) { + return false; + } string line; string word; unsigned int lineNum = 0; @@ -240,15 +244,18 @@ bool SolarArrayDeploymentHandler::autonomousDeplForFile(sd::SdCard sdCard, const } } if (deplState == AutonomousDeplState::DONE) { - remove(filename); + std::filesystem::remove(infoFile, e); if (sdCard == sd::SdCard::SLOT_0) { - remove(SD_0_DEPL_FILE); + std::filesystem::remove(SD_0_DEPL_FILE, e); } else { - remove(SD_1_DEPL_FILE); + std::filesystem::remove(SD_1_DEPL_FILE, e); } triggerEvent(AUTONOMOUS_DEPLOYMENT_COMPLETED); } else { - std::ofstream of(filename); + std::ofstream of(infoFile); + if (of.bad()) { + return false; + } of << "phase: "; if (deplState == AutonomousDeplState::INIT) { of << PHASE_INIT_STR << "\n"; diff --git a/tmtc b/tmtc index 4f48c25b..350e5d77 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 4f48c25bf757b6c056072049fe5965da890b4f5b +Subproject commit 350e5d77b8113cc9e21eb72242fc37536368f541 -- 2.43.0 From 9a5901235ca1d6e96ae7e2d9a68a0815269fd04a Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 17 Mar 2023 16:19:04 +0100 Subject: [PATCH 2/2] changelog --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 061ceca9..743c0aef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,11 @@ will consitute of a breaking change warranting a new major release: # [unreleased] +## Fixed + +- SA deployment file handling: Use exceptionless API. +- Fix deadlock in SD card manager constructor: Double lock of preferred SD card lock. + ## Added - Failure of Safe Mode Ctrl will now trigger an event. As this can only be caused by sensors not -- 2.43.0