fsfw/modes/ModeMessage.cpp

32 lines
870 B
C++
Raw Normal View History

2020-09-26 14:59:40 +02:00
#include "ModeMessage.h"
2020-08-28 18:33:29 +02:00
Mode_t ModeMessage::getMode(const CommandMessage* message) {
return message->getParameter();
}
Submode_t ModeMessage::getSubmode(const CommandMessage* message) {
return message->getParameter2();
}
2020-09-26 14:59:40 +02:00
void ModeMessage::setModeMessage(CommandMessage* message,
Command_t command, Mode_t mode, Submode_t submode) {
2020-08-28 18:33:29 +02:00
message->setCommand( command );
message->setParameter( mode );
message->setParameter2( submode );
}
ReturnValue_t ModeMessage::getCantReachModeReason(const CommandMessage* message) {
return message->getParameter();
}
void ModeMessage::clear(CommandMessage* message) {
message->setCommand(CommandMessage::CMD_NONE);
}
2020-09-26 14:59:40 +02:00
void ModeMessage::setCantReachMode(CommandMessage* message,
ReturnValue_t reason) {
2020-08-28 18:33:29 +02:00
message->setCommand(REPLY_CANT_REACH_MODE);
message->setParameter(reason);
message->setParameter2(0);
}