service 200 take over

This commit is contained in:
Robin Müller 2020-09-29 16:03:01 +02:00
parent e1eb1a3be1
commit d85096d98b

View File

@ -1,5 +1,5 @@
#include "../pus/CService200ModeCommanding.h" #include "CService200ModeCommanding.h"
#include "../pus/servicepackets/Service200Packets.h" #include "servicepackets/Service200Packets.h"
#include "../modes/HasModesIF.h" #include "../modes/HasModesIF.h"
#include "../serviceinterface/ServiceInterfaceStream.h" #include "../serviceinterface/ServiceInterfaceStream.h"
@ -107,13 +107,23 @@ ReturnValue_t CService200ModeCommanding::prepareWrongModeReply(
const CommandMessage *reply, object_id_t objectId) { const CommandMessage *reply, object_id_t objectId) {
ModePacket wrongModeReply(objectId, ModeMessage::getMode(reply), ModePacket wrongModeReply(objectId, ModeMessage::getMode(reply),
ModeMessage::getSubmode(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( ReturnValue_t CService200ModeCommanding::prepareCantReachModeReply(
const CommandMessage *reply, object_id_t objectId) { const CommandMessage *reply, object_id_t objectId) {
CantReachModePacket cantReachModePacket(objectId, CantReachModePacket cantReachModePacket(objectId,
ModeMessage::getCantReachModeReason(reply)); ModeMessage::getCantReachModeReason(reply));
return sendTmPacket(Subservice::REPLY_CANT_REACH_MODE, ReturnValue_t result = sendTmPacket(Subservice::REPLY_CANT_REACH_MODE,
&cantReachModePacket); &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;
} }