mirror of
https://github.com/binary-kitchen/doorlockd
synced 2024-12-22 18:34:25 +01:00
8ed116bf7f
Signed-off-by: Ralf Ramsauer <ralf@ramses-pyramidenbau.de>
24 lines
558 B
C++
24 lines
558 B
C++
#include <json/json.h>
|
|
|
|
#include "clientmessage.h"
|
|
|
|
Clientmessage::Clientmessage(std::string token,
|
|
Doormessage doormessage) :
|
|
_token(token),
|
|
_doormessage(doormessage)
|
|
{
|
|
}
|
|
|
|
std::string Clientmessage::toJson() const
|
|
{
|
|
Json::StyledWriter writer;
|
|
Json::Value message;
|
|
|
|
message["token"] = _token;
|
|
message["unlockButton"] = _doormessage.isUnlockButton;
|
|
message["lockButton"] = _doormessage.isLockButton;
|
|
message["emergencyUnlock"] = _doormessage.isEmergencyUnlock;
|
|
|
|
return writer.write(message);
|
|
}
|