wrote socket handler
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user