bugfix for shell cmd executors
All checks were successful
EIVE/eive-obsw/pipeline/pr-develop This commit looks good
All checks were successful
EIVE/eive-obsw/pipeline/pr-develop This commit looks good
This commit is contained in:
@ -25,6 +25,7 @@ will consitute of a breaking change warranting a new major release:
|
|||||||
bytes were not written properly.
|
bytes were not written properly.
|
||||||
- Bugfix for STR where an invalid reply was received for special requests
|
- Bugfix for STR where an invalid reply was received for special requests
|
||||||
like firmware updates.
|
like firmware updates.
|
||||||
|
- Bugfix for shell command executors in command controller which lead to a crash.
|
||||||
|
|
||||||
## Added
|
## Added
|
||||||
|
|
||||||
|
@ -369,20 +369,21 @@ ReturnValue_t CoreController::executeAction(ActionId_t actionId, MessageQueueId_
|
|||||||
return actionReboot(data, size);
|
return actionReboot(data, size);
|
||||||
}
|
}
|
||||||
case (EXECUTE_SHELL_CMD_BLOCKING): {
|
case (EXECUTE_SHELL_CMD_BLOCKING): {
|
||||||
std::string cmd = std::string(cmd, size);
|
std::string cmdToExecute = std::string(reinterpret_cast<const char*>(data), size);
|
||||||
int result = std::system(cmd.c_str());
|
int result = std::system(cmdToExecute.c_str());
|
||||||
if (result != 0) {
|
if (result != 0) {
|
||||||
|
// TODO: Data reply with returnalue maybe?
|
||||||
return returnvalue::FAILED;
|
return returnvalue::FAILED;
|
||||||
}
|
}
|
||||||
return EXECUTION_FINISHED;
|
return EXECUTION_FINISHED;
|
||||||
}
|
}
|
||||||
case (EXECUTE_SHELL_CMD_NON_BLOCKING): {
|
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
|
if (cmdExecutor.getCurrentState() == CommandExecutor::States::PENDING or
|
||||||
shellCmdIsExecuting) {
|
shellCmdIsExecuting) {
|
||||||
return HasActionsIF::IS_BUSY;
|
return HasActionsIF::IS_BUSY;
|
||||||
}
|
}
|
||||||
cmdExecutor.load(cmd, false, false);
|
cmdExecutor.load(cmdToExecute, false, false);
|
||||||
ReturnValue_t result = cmdExecutor.execute();
|
ReturnValue_t result = cmdExecutor.execute();
|
||||||
if (result != returnvalue::OK) {
|
if (result != returnvalue::OK) {
|
||||||
return result;
|
return result;
|
||||||
|
2
tmtc
2
tmtc
Submodule tmtc updated: 005e15b21b...f8da9cff7c
Reference in New Issue
Block a user