From 1bdccedabe963f93d14fe58ae162bccc7f26360b Mon Sep 17 00:00:00 2001 From: Steffen Gaisser Date: Tue, 29 Sep 2020 15:39:24 +0200 Subject: [PATCH 1/2] Fixes #86 --- pus/CService200ModeCommanding.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/pus/CService200ModeCommanding.cpp b/pus/CService200ModeCommanding.cpp index 32f7e5a7..c63b47a6 100644 --- a/pus/CService200ModeCommanding.cpp +++ b/pus/CService200ModeCommanding.cpp @@ -107,13 +107,23 @@ ReturnValue_t CService200ModeCommanding::prepareWrongModeReply( const CommandMessage *reply, object_id_t objectId) { ModePacket wrongModeReply(objectId, ModeMessage::getMode(reply), ModeMessage::getSubmode(reply)); - return sendTmPacket(Subservice::REPLY_WRONG_MODE_REPLY, &wrongModeReply); + ReturnValue_t result = sendTmPacket(Subservice::REPLY_WRONG_MODE_REPLY, &wrongModeReply); + if(result == RETURN_OK){ + // We want to produce an error here in any case because the mode was not correct + return RETURN_FAILED; + } + return result; } ReturnValue_t CService200ModeCommanding::prepareCantReachModeReply( const CommandMessage *reply, object_id_t objectId) { CantReachModePacket cantReachModePacket(objectId, ModeMessage::getCantReachModeReason(reply)); - return sendTmPacket(Subservice::REPLY_CANT_REACH_MODE, + ReturnValue_t result = sendTmPacket(Subservice::REPLY_CANT_REACH_MODE, &cantReachModePacket); + if(result == RETURN_OK){ + // We want to produce an error here in any case because the mode was not reached + return RETURN_FAILED; + } + return result; } From 303fcec9f656308ef4b50fb1da9f1dcbc2f13192 Mon Sep 17 00:00:00 2001 From: Steffen Gaisser Date: Tue, 29 Sep 2020 17:49:04 +0200 Subject: [PATCH 2/2] Added a missing include --- osal/linux/MessageQueue.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/osal/linux/MessageQueue.cpp b/osal/linux/MessageQueue.cpp index e5c61cae..76f66170 100644 --- a/osal/linux/MessageQueue.cpp +++ b/osal/linux/MessageQueue.cpp @@ -1,5 +1,6 @@ #include "../../serviceinterface/ServiceInterfaceStream.h" #include "MessageQueue.h" +#include "../../objectmanager/ObjectManagerIF.h" #include