4 files modified
2 files added
1 files deleted
| | |
| | | build |
| | | external |
| | | # Compiled Object files |
| | | *.slo |
| | | *.lo |
| | |
| | | [submodule "external/serio"] |
| | | path = external/serio |
| | | url = https://github.com/ShahriarRezghi/serio.git |
| | | [submodule "external/cista"] |
| | | path = external/cista |
| | | url = https://github.com/felixguendling/cista.git |
| New file |
| | |
| | | { |
| | | "files.associations": { |
| | | "string": "cpp" |
| | | } |
| | | } |
| | |
| | | include_directories(${CMAKE_SOURCE_DIR}/src) |
| | | include_directories(${CMAKE_SOURCE_DIR}/plugins) |
| | | |
| | | add_subdirectory(external/serio) |
| | | |
| | | # Main server executable |
| | | add_executable(server |
| | | src/main.cpp |
| | |
| | | ) |
| | | |
| | | # Link libraries |
| | | target_link_libraries(server msgpack nlohmann_json::nlohmann_json) |
| | | |
| | | target_link_libraries(server ${SERIO_LIBRARIES} nlohmann_json::nlohmann_json) |
| | | target_include_directories(server PUBLIC ${SERIO_INCLUDE_DIRS}) |
| | | message(STATUS "Serio: \n\t${SERIO_LIBRARIES} \n\t${SERIO_INCLUDE_DIRS}") |
| | | # Add the plugins subdirectory |
| | | add_subdirectory(src/plugins) |
| New file |
| | |
| | | Subproject commit d372b0b671be02968a16083c4bd2b7318ee6af65 |
| | |
| | | #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 |