implemented socket handler
This commit is contained in:
32
FlippR-Driver/src/utility/InputSocketHandler.h
Normal file
32
FlippR-Driver/src/utility/InputSocketHandler.h
Normal 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
|
||||
Reference in New Issue
Block a user