messagetype namespace im small letters now
This commit is contained in:
@ -1,9 +1,4 @@
|
||||
/**
|
||||
* @file CommandMessage.cpp
|
||||
* @brief This file defines the CommandMessage class.
|
||||
* @date 20.06.2013
|
||||
* @author baetz
|
||||
*/
|
||||
#include "MissionMessageTypes.h"
|
||||
|
||||
#include <framework/devicehandlers/DeviceHandlerMessage.h>
|
||||
#include <framework/health/HealthMessage.h>
|
||||
@ -15,7 +10,8 @@
|
||||
#include <framework/tmstorage/TmStoreMessage.h>
|
||||
#include <framework/parameters/ParameterMessage.h>
|
||||
|
||||
namespace MESSAGE_TYPE {
|
||||
namespace messagetypes {
|
||||
// Implemented in config.
|
||||
void clearMissionMessage(CommandMessage* message);
|
||||
}
|
||||
|
||||
@ -39,6 +35,10 @@ Command_t CommandMessage::getCommand() const {
|
||||
return command;
|
||||
}
|
||||
|
||||
uint8_t CommandMessage::getMessageType() const {
|
||||
return getCommand() >> 8 & 0xff;
|
||||
}
|
||||
|
||||
void CommandMessage::setCommand(Command_t command) {
|
||||
memcpy(getData(), &command, sizeof(command));
|
||||
}
|
||||
@ -66,36 +66,36 @@ void CommandMessage::setParameter2(uint32_t parameter2) {
|
||||
}
|
||||
|
||||
void CommandMessage::clearCommandMessage() {
|
||||
switch((getCommand()>>8) & 0xff){
|
||||
case MESSAGE_TYPE::MODE_COMMAND:
|
||||
switch(getMessageType()){
|
||||
case messagetypes::MODE_COMMAND:
|
||||
ModeMessage::clear(this);
|
||||
break;
|
||||
case MESSAGE_TYPE::HEALTH_COMMAND:
|
||||
case messagetypes::HEALTH_COMMAND:
|
||||
HealthMessage::clear(this);
|
||||
break;
|
||||
case MESSAGE_TYPE::MODE_SEQUENCE:
|
||||
case messagetypes::MODE_SEQUENCE:
|
||||
ModeSequenceMessage::clear(this);
|
||||
break;
|
||||
case MESSAGE_TYPE::ACTION:
|
||||
case messagetypes::ACTION:
|
||||
ActionMessage::clear(this);
|
||||
break;
|
||||
case MESSAGE_TYPE::DEVICE_HANDLER_COMMAND:
|
||||
case messagetypes::DEVICE_HANDLER_COMMAND:
|
||||
DeviceHandlerMessage::clear(this);
|
||||
break;
|
||||
case MESSAGE_TYPE::MEMORY:
|
||||
case messagetypes::MEMORY:
|
||||
MemoryMessage::clear(this);
|
||||
break;
|
||||
case MESSAGE_TYPE::MONITORING:
|
||||
case messagetypes::MONITORING:
|
||||
MonitoringMessage::clear(this);
|
||||
break;
|
||||
case MESSAGE_TYPE::TM_STORE:
|
||||
case messagetypes::TM_STORE:
|
||||
TmStoreMessage::clear(this);
|
||||
break;
|
||||
case MESSAGE_TYPE::PARAMETER:
|
||||
case messagetypes::PARAMETER:
|
||||
ParameterMessage::clear(this);
|
||||
break;
|
||||
default:
|
||||
MESSAGE_TYPE::clearMissionMessage(this);
|
||||
messagetypes::clearMissionMessage(this);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -19,7 +19,7 @@ public:
|
||||
static const ReturnValue_t UNKNOW_COMMAND = MAKE_RETURN_CODE(0x01);
|
||||
|
||||
|
||||
static const uint8_t MESSAGE_ID = MESSAGE_TYPE::COMMAND;
|
||||
static const uint8_t MESSAGE_ID = messagetypes::COMMAND;
|
||||
//! Used internally, will be ignored
|
||||
static const Command_t CMD_NONE = MAKE_COMMAND_ID( 0 );
|
||||
static const Command_t REPLY_COMMAND_OK = MAKE_COMMAND_ID( 3 );
|
||||
@ -66,6 +66,7 @@ public:
|
||||
*/
|
||||
Command_t getCommand() const;
|
||||
|
||||
uint8_t getMessageType() const;
|
||||
/**
|
||||
* Set the DeviceHandlerCOmmand_t of the message
|
||||
*
|
||||
|
@ -1,9 +1,9 @@
|
||||
#ifndef FRAMEWORK_IPC_FWMESSAGETYPES_H_
|
||||
#define FRAMEWORK_IPC_FWMESSAGETYPES_H_
|
||||
|
||||
namespace MESSAGE_TYPE {
|
||||
namespace messagetypes {
|
||||
//Remember to add new Message Types to the clearCommandMessage function!
|
||||
enum FW_MESSAGE_TYPE {
|
||||
enum FsfwMessageTypes {
|
||||
COMMAND = 0,
|
||||
MODE_COMMAND,
|
||||
HEALTH_COMMAND,
|
||||
|
@ -17,24 +17,29 @@ public:
|
||||
* (till messageSize) to the debug output.
|
||||
*/
|
||||
virtual void print() = 0;
|
||||
|
||||
/**
|
||||
* @brief Get read-only pointer to the raw buffer.
|
||||
* @return
|
||||
*/
|
||||
virtual const uint8_t* getBuffer() const = 0;
|
||||
|
||||
/**
|
||||
* @brief This method is used to get the complete data of the message.
|
||||
*/
|
||||
virtual uint8_t* getBuffer() = 0;
|
||||
|
||||
/**
|
||||
* @brief This method is used to set the sender's message queue id
|
||||
* information prior to sending the message.
|
||||
* @param setId The message queue id that identifies the sending message queue.
|
||||
* @param setId
|
||||
* The message queue id that identifies the sending message queue.
|
||||
*/
|
||||
virtual void setSender(MessageQueueId_t setId) = 0;
|
||||
|
||||
/**
|
||||
* @brief This helper function is used by the MessageQueue class to
|
||||
* check the size of an incoming message.
|
||||
* @details
|
||||
* The method must be overwritten by child classes if size checks shall
|
||||
* be more strict.
|
||||
* @return The default implementation returns HEADER_SIZE.
|
||||
*/
|
||||
virtual size_t getMinimumMessageSize() = 0;
|
||||
};
|
||||
|
Reference in New Issue
Block a user