wrote socket handler

This commit is contained in:
Johannes Wendel
2019-04-25 21:33:55 +02:00
parent 7a87cf5661
commit 30ab854db6
8 changed files with 260 additions and 296 deletions

View File

@@ -6,6 +6,8 @@
*/
#include "input/Event.h"
#include <Poco/JSON/Object.h>
#include "utility/config.h"
namespace flippR_driver
@@ -19,6 +21,17 @@ Event::Event(uint8_t address, int priority, std::string name) :
CLOG_IF(VLOG_IS_ON(0), INFO, INPUT_LOGGER) << "Created event: " << name << ", address: " << address;
}
std::string Event::getJsonString()
{
Poco::JSON::Object json;
json.set("name", this->name);
json.set("address", this->address);
json.set("priority", this->priority);
std::stringstream stringstream;
json.stringify(stringstream);
}
bool operator==(const Event& left, const Event& right)
{
return left.name == right.name;