make system components work for EM
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good
This commit is contained in:
@ -32,8 +32,13 @@ xsc::Chip CoreController::CURRENT_CHIP = xsc::Chip::NO_CHIP;
|
||||
xsc::Copy CoreController::CURRENT_COPY = xsc::Copy::NO_COPY;
|
||||
|
||||
CoreController::CoreController(object_id_t objectId)
|
||||
: ExtendedControllerBase(objectId, 5), cmdExecutor(4096), cmdReplyBuf(4096, true), cmdRepliesSizes(128),
|
||||
opDivider5(5), opDivider10(10), hkSet(this) {
|
||||
: ExtendedControllerBase(objectId, 5),
|
||||
cmdExecutor(4096),
|
||||
cmdReplyBuf(4096, true),
|
||||
cmdRepliesSizes(128),
|
||||
opDivider5(5),
|
||||
opDivider10(10),
|
||||
hkSet(this) {
|
||||
cmdExecutor.setRingBuffer(&cmdReplyBuf, &cmdRepliesSizes);
|
||||
try {
|
||||
sdcMan = SdCardManager::instance();
|
||||
@ -102,14 +107,14 @@ void CoreController::performControlOperation() {
|
||||
sdStateMachine();
|
||||
performMountedSdCardOperations();
|
||||
readHkData();
|
||||
if(shellCmdIsExecuting) {
|
||||
if (shellCmdIsExecuting) {
|
||||
bool replyReceived = false;
|
||||
// TODO: We could read the data in the ring buffer and send it as an action data reply.
|
||||
if(cmdExecutor.check(replyReceived) == CommandExecutor::EXECUTION_FINISHED) {
|
||||
if (cmdExecutor.check(replyReceived) == CommandExecutor::EXECUTION_FINISHED) {
|
||||
actionHelper.finish(true, successRecipient, EXECUTE_SHELL_CMD);
|
||||
shellCmdIsExecuting = false;
|
||||
cmdReplyBuf.clear();
|
||||
while(not cmdRepliesSizes.empty()) {
|
||||
while (not cmdRepliesSizes.empty()) {
|
||||
cmdRepliesSizes.pop();
|
||||
}
|
||||
successRecipient = MessageQueueIF::NO_QUEUE;
|
||||
@ -316,14 +321,15 @@ ReturnValue_t CoreController::executeAction(ActionId_t actionId, MessageQueueId_
|
||||
// Warning: This function will never return, because it reboots the system
|
||||
return actionReboot(data, size);
|
||||
}
|
||||
case(EXECUTE_SHELL_CMD): {
|
||||
case (EXECUTE_SHELL_CMD): {
|
||||
std::string cmd = std::string(cmd, size);
|
||||
if(cmdExecutor.getCurrentState() == CommandExecutor::States::PENDING or shellCmdIsExecuting) {
|
||||
if (cmdExecutor.getCurrentState() == CommandExecutor::States::PENDING or
|
||||
shellCmdIsExecuting) {
|
||||
return HasActionsIF::IS_BUSY;
|
||||
}
|
||||
cmdExecutor.load(cmd, false, false);
|
||||
ReturnValue_t result = cmdExecutor.execute();
|
||||
if(result != returnvalue::OK) {
|
||||
if (result != returnvalue::OK) {
|
||||
return result;
|
||||
}
|
||||
shellCmdIsExecuting = true;
|
||||
|
Reference in New Issue
Block a user