start update handler impl
EIVE/eive-obsw/pipeline/head This commit looks good Details

This commit is contained in:
Robin Müller 2022-09-26 11:50:35 +02:00
parent 05adc91f94
commit b3275d015f
No known key found for this signature in database
GPG Key ID: 71B58F8A3CDFA9AC
3 changed files with 20 additions and 1 deletions

View File

@ -1,6 +1,7 @@
#include "CoreController.h"
#include <fsfw/events/EventManager.h>
#include <fsfw/filesystem/HasFileSystemIF.h>
#include <fsfw/ipc/QueueFactory.h>
#include "OBSWConfig.h"
@ -200,6 +201,24 @@ ReturnValue_t CoreController::executeAction(ActionId_t actionId, MessageQueueId_
return HasActionsIF::EXECUTION_FINISHED;
}
case (OBSW_UPDATE_FROM_SD_0): {
using namespace std;
using namespace std::filesystem;
// At the very least, chip and copy ID need to be included in the command
if (size < 2) {
return HasActionsIF::INVALID_PARAMETERS;
}
path archivePath =
path(config::SD_0_MOUNT_POINT) / path(config::OBSW_UPDATE_ARCHIVE_FILE_NAME);
if (not exists(archivePath)) {
return HasFileSystemIF::FILE_DOES_NOT_EXIST;
}
std::ostringstream cmd("tar -xJvf");
cmd << " " << archivePath;
int result = std::system(cmd.str().c_str());
if (result != 0) {
utility::handleSystemError(result,
"CoreController::executeAction: SW Update Decompression");
}
return HasActionsIF::EXECUTION_FINISHED;
}
case (SWITCH_IMG_LOCK): {

View File

@ -54,7 +54,6 @@ class CoreController : public ExtendedControllerBase {
static constexpr char CONF_FOLDER[] = "conf";
static constexpr char OBSW_VERSION_FILE_NAME[] = "obsw_version.txt";
static constexpr char VERSION_FILE_NAME[] = "version.txt";
static constexpr char REBOOT_FILE_NAME[] = "reboot.txt";
static constexpr char TIME_FILE_NAME[] = "time.txt";

View File

@ -10,6 +10,7 @@ static constexpr char SD_1_MOUNT_POINT[] = "/mnt/sd1";
static constexpr char OBSW_UPDATE_ARCHIVE_FILE_NAME[] = "eive-sw-update.tar.xz";
static constexpr char STRIPPED_OBSW_BINARY_FILE_NAME[] = "eive-obsw-stripped";
static constexpr char OBSW_VERSION_FILE_NAME[] = "obsw_version.txt";
static constexpr uint16_t EIVE_PUS_APID = 0x65;
static constexpr uint16_t EIVE_CFDP_APID = 0x66;