From 352296d20031f0df68e249cb3eec112ce5606bc8 Mon Sep 17 00:00:00 2001 From: "Robin.Mueller" Date: Thu, 29 Oct 2020 13:52:52 +0100 Subject: [PATCH] action helper update --- action/ActionHelper.cpp | 5 +++++ action/HasActionsIF.h | 9 ++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/action/ActionHelper.cpp b/action/ActionHelper.cpp index fdbd2e3b..0d3baa88 100644 --- a/action/ActionHelper.cpp +++ b/action/ActionHelper.cpp @@ -65,6 +65,11 @@ void ActionHelper::prepareExecution(MessageQueueId_t commandedBy, } result = owner->executeAction(actionId, commandedBy, dataPtr, size); ipcStore->deleteData(dataAddress); + if(result == HasActionsIF::EXECUTION_FINISHED) { + CommandMessage reply; + ActionMessage::setCompletionReply(&reply, actionId, result); + queueToUse->sendMessage(commandedBy, &reply); + } if (result != HasReturnvaluesIF::RETURN_OK) { CommandMessage reply; ActionMessage::setStepReply(&reply, actionId, 0, result); diff --git a/action/HasActionsIF.h b/action/HasActionsIF.h index a26ed588..ad9f4c61 100644 --- a/action/HasActionsIF.h +++ b/action/HasActionsIF.h @@ -47,9 +47,12 @@ public: virtual MessageQueueId_t getCommandQueue() const = 0; /** * Execute or initialize the execution of a certain function. - * When used in conjunction with the ActionHelper class, returning - * a return code which is not equal to RETURN_OK will trigger a step reply - * with step 0. + * The ActionHelpers will execute this function and behave differently + * depending on the returnvalue. + * + * @return + * -@c EXECUTION_FINISHED Finish reply will be generated + * -@c Not RETURN_OK Step failure reply will be generated */ virtual ReturnValue_t executeAction(ActionId_t actionId, MessageQueueId_t commandedBy, const uint8_t* data, size_t size) = 0;