This commit is contained in:
Jonas Zeunert
2019-05-22 00:02:10 +02:00
4 changed files with 6 additions and 10 deletions

View File

@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.6.2) cmake_minimum_required(VERSION 3.6.2)
project(flippR_driver_networking) project(flippR_driver_networking)
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/${OUTPUT_PATH}/networking) set(EXECUTABLE_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/${OUTPUT_PATH}/cli)
set(SOURCES set(SOURCES
input/SocketHandler.cpp input/SocketHandler.cpp
output/OutputRequestHandler.cpp output/OutputRequestHandler.cpp

View File

@@ -11,13 +11,11 @@
using Poco::Net::StreamSocket; using Poco::Net::StreamSocket;
using Poco::Net::TCPServerConnection; using Poco::Net::TCPServerConnection;
using flippR_driver::input::InputDriver; using flippR_driver::input::InputDriver;
using flippR_driver::input::detail::EventHandler; using flippR_driver::input::EventHandler;
using flippR_driver::input::Event; using flippR_driver::input::Event;
namespace flippR_driver namespace flippR_driver
{ {
namespace utility
{
namespace networking namespace networking
{ {
namespace input namespace input
@@ -53,7 +51,7 @@ void SocketHandler::handle(Event &event)
this->queue->push(event); this->queue->push(event);
} }
} }
} }
} }
}

View File

@@ -14,16 +14,15 @@
#include "input/InputDriver.h" #include "input/InputDriver.h"
#include "input/EventHandler.h" #include "input/EventHandler.h"
#include "input/Event.h" #include "input/Event.h"
#include "utility/IBlockingQueue.h"
namespace flippR_driver namespace flippR_driver
{ {
namespace utility
{
namespace networking namespace networking
{ {
namespace input namespace input
{ {
class SocketHandler : public Poco::Net::TCPServerConnection, flippR_driver::input::detail::EventHandler class SocketHandler : public Poco::Net::TCPServerConnection, flippR_driver::input::EventHandler
{ {
public: public:
SocketHandler(Poco::Net::StreamSocket streamSocket, std::shared_ptr<flippR_driver::input::InputDriver> input_driver); SocketHandler(Poco::Net::StreamSocket streamSocket, std::shared_ptr<flippR_driver::input::InputDriver> input_driver);
@@ -38,6 +37,5 @@ private:
} }
} }
} }
}
#endif //FLIPPR_CODE_INPUTSOCKETCONNECTION_H #endif //FLIPPR_CODE_INPUTSOCKETCONNECTION_H

View File

@@ -24,7 +24,7 @@ Event::Event(uint8_t address, int priority, std::string name) :
std::string Event::getJsonString() std::string Event::getJsonString()
{ {
nlohmann::json json; nlohmann::json json;
json["name"] = this->name; json["name"] = this->name;
json["address"] = this->address; json["address"] = this->address;
json["priority"] = this->priority; json["priority"] = this->priority;