Ferenc Szontágh
2024-06-25 4f0f4a9d9d2f1a1430839121682c514be22cc641
src/Command.h
@@ -1,7 +1,7 @@
#ifndef COMMAND_H
#define COMMAND_H
#include <msgpack.h>
#include <serio/serio.h>
#include <string>
#include <unordered_map>
@@ -10,6 +10,7 @@
    PluginRegistered = 1000,
    PluginList = 1001
};
SERIO_REGISTER(CommandType::PluginRegistered, CommandType::PluginList)
// Map the CommandType enum to its string representation
static const std::unordered_map<CommandType, std::string> CommandTypeToString = {
@@ -17,15 +18,13 @@
    {CommandType::PluginList, "PluginList"}
};
MSGPACK_ADD_ENUM(CommandType::PluginList)
MSGPACK_ADD_ENUM(CommandType::PluginRegistered)
struct Command {
    CommandType commandType;
    std::string payload;
    MSGPACK_DEFINE(commandType, payload);
    SERIO_REGISTER(commandType, payload);
};
#endif // COMMAND_H