| | |
| | | #ifndef COMMAND_H |
| | | #define COMMAND_H |
| | | |
| | | #include <msgpack.h> |
| | | #include <serio/serio.h> |
| | | #include <string> |
| | | #include <unordered_map> |
| | | |
| | |
| | | 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 = { |
| | |
| | | {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 |