Ferenc Szontágh
2024-06-25 4f0f4a9d9d2f1a1430839121682c514be22cc641
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#ifndef COMMAND_H
#define COMMAND_H
 
#include <serio/serio.h>
#include <string>
#include <unordered_map>
 
// Define the command types as an enum
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"}
};
 
 
 
struct Command {
    CommandType commandType;
    std::string payload;
 
    SERIO_REGISTER(commandType, payload);
};
 
#endif // COMMAND_H