implemented socket handler

This commit is contained in:
Jonas Zeunert
2018-11-27 02:07:25 +01:00
parent 82ced6ec3c
commit 6b6b185f8e
9 changed files with 140 additions and 7 deletions

View File

@@ -0,0 +1,32 @@
//
// Created by rhetenor on 27.11.18.
//
#ifndef FLIPPR_DRIVER_INPUTSOCKETHANDLER_H
#define FLIPPR_DRIVER_INPUTSOCKETHANDLER_H
#include "SocketHandler.h"
#include "input/IEventHandler.h"
#include <string>
namespace flippR_driver
{
namespace utility
{
class InputSocketHandler : public SocketHandler, IEventHandler
{
public:
InputSocketHandler(boost::asio::io_service &service, std::string socket_file = "/var/run/user/" + std::to_string(getuid())
+ "flippR/S.flippR_input");
void handle(input::Event &event) override;
private:
nlohmann::json serialize_event(input::Event &event);
};
}
}
#endif //FLIPPR_DRIVER_INPUTSOCKETHANDLER_H