systemctl helper #596

Merged
meggert merged 5 commits from feature_systemctl_helper into develop 2023-04-14 08:25:10 +02:00
3 changed files with 7 additions and 5 deletions
Showing only changes of commit bc6531f7a5 - Show all commits

View File

@ -25,6 +25,7 @@ will consitute of a breaking change warranting a new major release:
bytes were not written properly.
- Bugfix for STR where an invalid reply was received for special requests
like firmware updates.
- Bugfix for shell command executors in command controller which lead to a crash.
## Added

View File

@ -369,20 +369,21 @@ ReturnValue_t CoreController::executeAction(ActionId_t actionId, MessageQueueId_
return actionReboot(data, size);
}
case (EXECUTE_SHELL_CMD_BLOCKING): {
std::string cmd = std::string(cmd, size);
int result = std::system(cmd.c_str());
std::string cmdToExecute = std::string(reinterpret_cast<const char*>(data), size);
int result = std::system(cmdToExecute.c_str());
if (result != 0) {
// TODO: Data reply with returnalue maybe?
return returnvalue::FAILED;
}
return EXECUTION_FINISHED;
}
case (EXECUTE_SHELL_CMD_NON_BLOCKING): {
std::string cmd = std::string(cmd, size);
std::string cmdToExecute = std::string(reinterpret_cast<const char*>(data), size);
if (cmdExecutor.getCurrentState() == CommandExecutor::States::PENDING or
shellCmdIsExecuting) {
return HasActionsIF::IS_BUSY;
}
cmdExecutor.load(cmd, false, false);
cmdExecutor.load(cmdToExecute, false, false);
ReturnValue_t result = cmdExecutor.execute();
if (result != returnvalue::OK) {
return result;

2
tmtc

@ -1 +1 @@
Subproject commit 005e15b21bdb58109b90ffbe4be9fc76e85ca38f
Subproject commit f8da9cff7c5d6d6bdd483f90ccefb67b2d1e11a4