mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
Update Json Interface (Enable/Disable components during runtime) (#150)
* Update Hyperion.h * Add files via upload * Update CMakeLists.txt * Update Hyperion.cpp * Update JsonClientConnection.cpp * Update JsonClientConnection.h * Update JsonSchemas.qrc * Add files via upload * Update schema.json * Update JsonConnection.cpp * Update JsonConnection.h * Update hyperion-remote.cpp
This commit is contained in:
committed by
brindosch
parent
f183032270
commit
bfb06966de
@@ -192,6 +192,25 @@ void JsonConnection::clearAll()
|
||||
parseReply(reply);
|
||||
}
|
||||
|
||||
void JsonConnection::setComponentState(const std::string& component, const bool state)
|
||||
{
|
||||
state ? std::cout << "Enable Component " : std::cout << "Disable Component ";
|
||||
std::cout << component << std::endl;
|
||||
|
||||
// create command
|
||||
Json::Value command;
|
||||
command["command"] = "componentstate";
|
||||
Json::Value & parameter = command["componentstate"];
|
||||
parameter["component"] = component;
|
||||
parameter["state"] = state;
|
||||
|
||||
// send command message
|
||||
Json::Value reply = sendMessage(command);
|
||||
|
||||
// parse reply message
|
||||
parseReply(reply);
|
||||
}
|
||||
|
||||
void JsonConnection::setSource(int priority)
|
||||
{
|
||||
// create command
|
||||
|
||||
Reference in New Issue
Block a user