| | |
| | | #ifndef COMMAND_H |
| | | #define COMMAND_H |
| | | |
| | | #include <serio/serio.h> |
| | | #include <tser/tser.hpp> |
| | | #include <string> |
| | | #include <unordered_map> |
| | | #include <cstdint> |
| | | |
| | | // Define the command types as an enum |
| | | enum class CommandType { |
| | | enum class CommandType |
| | | { |
| | | 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::PluginRegistered, "PluginRegistered"}, |
| | | {CommandType::PluginList, "PluginList"} |
| | | }; |
| | | {CommandType::PluginList, "PluginList"}}; |
| | | |
| | | |
| | | |
| | | struct Command { |
| | | struct Command |
| | | { |
| | | DEFINE_SERIALIZABLE(Command, commandType, payload) |
| | | CommandType commandType; |
| | | std::string payload; |
| | | |
| | | SERIO_REGISTER(commandType, payload); |
| | | }; |
| | | |
| | | #endif // COMMAND_H |
| | | #endif // COMMAND_H |