made message interface more readable (dec instead hex)

This commit is contained in:
Robin Müller 2020-10-04 14:31:06 +02:00
parent 0c1c61558b
commit 20c261514b
2 changed files with 28 additions and 28 deletions

View File

@ -2,46 +2,40 @@
#include "../objectmanager/ObjectManagerIF.h" #include "../objectmanager/ObjectManagerIF.h"
ReturnValue_t FileSystemMessage::setDeleteFileCommand( void FileSystemMessage::setDeleteFileCommand(
CommandMessage* message, store_address_t storageID) { CommandMessage* message, store_address_t storageID) {
message->setCommand(DELETE_FILE); message->setCommand(DELETE_FILE);
message->setParameter2(storageID.raw); message->setParameter2(storageID.raw);
return HasReturnvaluesIF::RETURN_OK;
} }
ReturnValue_t FileSystemMessage::setCreateDirectoryCommand( void FileSystemMessage::setCreateDirectoryCommand(
CommandMessage* message, store_address_t storageID) { CommandMessage* message, store_address_t storageID) {
message->setCommand(CREATE_DIRECTORY); message->setCommand(CREATE_DIRECTORY);
message->setParameter2(storageID.raw); message->setParameter2(storageID.raw);
return HasReturnvaluesIF::RETURN_OK;
} }
ReturnValue_t FileSystemMessage::setDeleteDirectoryCommand( void FileSystemMessage::setDeleteDirectoryCommand(
CommandMessage* message, store_address_t storageID) { CommandMessage* message, store_address_t storageID) {
message->setCommand(DELETE_DIRECTORY); message->setCommand(DELETE_DIRECTORY);
message->setParameter2(storageID.raw); message->setParameter2(storageID.raw);
return HasReturnvaluesIF::RETURN_OK;
} }
ReturnValue_t FileSystemMessage::setWriteCommand(CommandMessage* message, void FileSystemMessage::setWriteCommand(CommandMessage* message,
store_address_t storageID) { store_address_t storageID) {
message->setCommand(WRITE); message->setCommand(WRITE);
message->setParameter2(storageID.raw); message->setParameter2(storageID.raw);
return HasReturnvaluesIF::RETURN_OK;
} }
ReturnValue_t FileSystemMessage::setReadCommand(CommandMessage* message, void FileSystemMessage::setReadCommand(CommandMessage* message,
store_address_t storageID) { store_address_t storageID) {
message->setCommand(READ); message->setCommand(READ);
message->setParameter2(storageID.raw); message->setParameter2(storageID.raw);
return HasReturnvaluesIF::RETURN_OK;
} }
ReturnValue_t FileSystemMessage::setReadReply(CommandMessage* message, void FileSystemMessage::setReadReply(CommandMessage* message,
store_address_t storageID) { store_address_t storageID) {
message->setCommand(READ_REPLY); message->setCommand(READ_REPLY);
message->setParameter2(storageID.raw); message->setParameter2(storageID.raw);
return HasReturnvaluesIF::RETURN_OK;
} }
store_address_t FileSystemMessage::getStoreId(const CommandMessage* message) { store_address_t FileSystemMessage::getStoreId(const CommandMessage* message) {

View File

@ -13,26 +13,32 @@ private:
FileSystemMessage(); //A private ctor inhibits instantiation FileSystemMessage(); //A private ctor inhibits instantiation
public: public:
static const uint8_t MESSAGE_ID = messagetypes::FILE_SYSTEM_MESSAGE; static const uint8_t MESSAGE_ID = messagetypes::FILE_SYSTEM_MESSAGE;
static const Command_t CREATE_FILE = MAKE_COMMAND_ID( 0x01 ); static const Command_t CREATE_FILE = MAKE_COMMAND_ID(1);
static const Command_t DELETE_FILE = MAKE_COMMAND_ID( 0x02 ); static const Command_t DELETE_FILE = MAKE_COMMAND_ID(2);
static const Command_t CREATE_DIRECTORY = MAKE_COMMAND_ID( 0x09 ); static const Command_t CREATE_DIRECTORY = MAKE_COMMAND_ID(9);
static const Command_t DELETE_DIRECTORY = MAKE_COMMAND_ID( 0x0A ); static const Command_t DELETE_DIRECTORY = MAKE_COMMAND_ID(10);
static const Command_t WRITE = MAKE_COMMAND_ID( 0x80 ); static const Command_t WRITE = MAKE_COMMAND_ID(128);
static const Command_t READ = MAKE_COMMAND_ID( 0x81 ); static const Command_t READ = MAKE_COMMAND_ID(129);
static const Command_t READ_REPLY = MAKE_COMMAND_ID( 0x82 ); static const Command_t READ_REPLY = MAKE_COMMAND_ID(130);
static const Command_t COMPLETION_SUCCESS = MAKE_COMMAND_ID(5); static const Command_t COMPLETION_SUCCESS = MAKE_COMMAND_ID(5);
static const Command_t COMPLETION_FAILED = MAKE_COMMAND_ID(6); static const Command_t COMPLETION_FAILED = MAKE_COMMAND_ID(6);
static ReturnValue_t setDeleteFileCommand(CommandMessage* message, store_address_t storageID); static void setDeleteFileCommand(CommandMessage* message,
static ReturnValue_t setCreateDirectoryCommand(CommandMessage* message, store_address_t storageID); store_address_t storeId);
static ReturnValue_t setDeleteDirectoryCommand(CommandMessage* message, store_address_t storageID); static void setCreateDirectoryCommand(CommandMessage* message,
static ReturnValue_t setWriteCommand(CommandMessage* message, store_address_t storageID); store_address_t storeId);
static ReturnValue_t setReadCommand(CommandMessage* message, store_address_t storageID); static void setDeleteDirectoryCommand(CommandMessage* message,
static ReturnValue_t setReadReply(CommandMessage* message, store_address_t storageID); store_address_t storeId);
static store_address_t getStoreId( const CommandMessage* message ); static void setWriteCommand(CommandMessage* message,
store_address_t storeId);
static void setReadCommand(CommandMessage* message,
store_address_t storeId);
static void setReadReply(CommandMessage* message, store_address_t storeId);
static void setSuccessReply(CommandMessage* message); static void setSuccessReply(CommandMessage* message);
static void setFailureReply(CommandMessage* message, ReturnValue_t errorCode); static void setFailureReply(CommandMessage* message,
ReturnValue_t errorCode);
static store_address_t getStoreId(const CommandMessage* message);
static ReturnValue_t getFailureReply(const CommandMessage* message); static ReturnValue_t getFailureReply(const CommandMessage* message);
}; };