diff --git a/bsp_q7s/core/CoreController.cpp b/bsp_q7s/core/CoreController.cpp index b312c986..c106cd7e 100644 --- a/bsp_q7s/core/CoreController.cpp +++ b/bsp_q7s/core/CoreController.cpp @@ -107,6 +107,59 @@ ReturnValue_t CoreController::initializeAfterTaskCreation() { return result; } +ReturnValue_t CoreController::executeAction(ActionId_t actionId, MessageQueueId_t commandedBy, + const uint8_t *data, size_t size) { + switch (actionId) { + case (LIST_DIRECTORY_INTO_FILE): { + return actionListDirectoryIntoFile(actionId, commandedBy, data, size); + } + case (SWITCH_REBOOT_FILE_HANDLING): { + if (size < 1) { + return HasActionsIF::INVALID_PARAMETERS; + } + std::string path = sdcMan->getCurrentMountPrefix(sdInfo.pref) + REBOOT_FILE; + // Disable the reboot file mechanism + parseRebootFile(path, rebootFile); + if (data[0] == 0) { + rebootFile.enabled = false; + rewriteRebootFile(rebootFile); + } else if (data[0] == 1) { + rebootFile.enabled = true; + rewriteRebootFile(rebootFile); + } else { + return HasActionsIF::INVALID_PARAMETERS; + } + return HasActionsIF::EXECUTION_FINISHED; + } + case (RESET_ALL_REBOOT_COUNTERS): { + resetRebootCount(xsc::ALL_CHIP, xsc::ALL_COPY); + return HasActionsIF::EXECUTION_FINISHED; + } + case (RESET_REBOOT_COUNTER_00): { + resetRebootCount(xsc::CHIP_0, xsc::COPY_0); + return HasActionsIF::EXECUTION_FINISHED; + } + case (RESET_REBOOT_COUNTER_01): { + resetRebootCount(xsc::CHIP_0, xsc::COPY_1); + return HasActionsIF::EXECUTION_FINISHED; + } + case (RESET_REBOOT_COUNTER_10): { + resetRebootCount(xsc::CHIP_1, xsc::COPY_0); + return HasActionsIF::EXECUTION_FINISHED; + } + case (RESET_REBOOT_COUNTER_11): { + resetRebootCount(xsc::CHIP_1, xsc::COPY_1); + return HasActionsIF::EXECUTION_FINISHED; + } + case (REBOOT_OBC): { + return actionPerformReboot(data, size); + } + default: { + return HasActionsIF::INVALID_ACTION_ID; + } + } +} + ReturnValue_t CoreController::checkModeCommand(Mode_t mode, Submode_t submode, uint32_t *msToReachTheMode) { return HasReturnvaluesIF::RETURN_OK; @@ -505,59 +558,6 @@ ReturnValue_t CoreController::sdCardSetup(sd::SdCard sdCard, sd::SdState targetS return HasReturnvaluesIF::RETURN_OK; } -ReturnValue_t CoreController::executeAction(ActionId_t actionId, MessageQueueId_t commandedBy, - const uint8_t *data, size_t size) { - switch (actionId) { - case (LIST_DIRECTORY_INTO_FILE): { - return actionListDirectoryIntoFile(actionId, commandedBy, data, size); - } - case (SWITCH_REBOOT_FILE_HANDLING): { - if (size < 1) { - return HasActionsIF::INVALID_PARAMETERS; - } - std::string path = sdcMan->getCurrentMountPrefix(sdInfo.pref) + REBOOT_FILE; - // Disable the reboot file mechanism - parseRebootFile(path, rebootFile); - if (data[0] == 0) { - rebootFile.enabled = false; - rewriteRebootFile(rebootFile); - } else if (data[0] == 1) { - rebootFile.enabled = true; - rewriteRebootFile(rebootFile); - } else { - return HasActionsIF::INVALID_PARAMETERS; - } - return HasActionsIF::EXECUTION_FINISHED; - } - case (RESET_ALL_REBOOT_COUNTERS): { - resetRebootCount(xsc::ALL_CHIP, xsc::ALL_COPY); - return HasActionsIF::EXECUTION_FINISHED; - } - case (RESET_REBOOT_COUNTER_00): { - resetRebootCount(xsc::CHIP_0, xsc::COPY_0); - return HasActionsIF::EXECUTION_FINISHED; - } - case (RESET_REBOOT_COUNTER_01): { - resetRebootCount(xsc::CHIP_0, xsc::COPY_1); - return HasActionsIF::EXECUTION_FINISHED; - } - case (RESET_REBOOT_COUNTER_10): { - resetRebootCount(xsc::CHIP_1, xsc::COPY_0); - return HasActionsIF::EXECUTION_FINISHED; - } - case (RESET_REBOOT_COUNTER_11): { - resetRebootCount(xsc::CHIP_1, xsc::COPY_1); - return HasActionsIF::EXECUTION_FINISHED; - } - case (REBOOT_OBC): { - return actionPerformReboot(data, size); - } - default: { - return HasActionsIF::INVALID_ACTION_ID; - } - } -} - ReturnValue_t CoreController::sdColdRedundantBlockingInit() { ReturnValue_t result = HasReturnvaluesIF::RETURN_OK; diff --git a/tmtc b/tmtc index a671e864..7e245891 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit a671e86400152d8480c1efde29d69848ca6b6066 +Subproject commit 7e24589184bb7bbd427c66ed55b3c29bbeba927f