Update Json Interface (return config file) (#144)

* Add handleConfigGetCommand Function

* Add handleConfigGetCommand Function

* Add schema-configget.json

* Add configget

* Add new JSON file schema-configget.json

* add --configget command to hyperion-remote

* Add getConfigFile function

* Add getConfigFile function
This commit is contained in:
Paulchen-Panther
2016-08-03 22:03:19 +02:00
committed by redPanther
parent 722d4eb357
commit 0e2f0127fd
8 changed files with 79 additions and 3 deletions

View File

@@ -258,6 +258,8 @@ void JsonClientConnection::handleMessage(const std::string &messageString)
handleAdjustmentCommand(message);
else if (command == "sourceselect")
handleSourceSelectCommand(message);
else if (command == "configget")
handleConfigGetCommand(message);
else
handleNotImplemented();
}
@@ -801,6 +803,18 @@ void JsonClientConnection::handleSourceSelectCommand(const Json::Value & message
}
}
void JsonClientConnection::handleConfigGetCommand(const Json::Value &)
{
// create result
Json::Value result;
result["success"] = true;
Json::Value & config = result["result"];
config = _hyperion->getJsonConfig();
// send the result
sendMessage(result);
}
void JsonClientConnection::handleNotImplemented()
{
sendErrorReply("Command not implemented");

View File

@@ -134,6 +134,12 @@ private:
/// @param message the incoming message
///
void handleSourceSelectCommand(const Json::Value & message);
/// Handle an incoming JSON GetConfig message
///
/// @param message the incoming message
///
void handleConfigGetCommand(const Json::Value & message);
///
/// Handle an incoming JSON message of unknown type

View File

@@ -12,5 +12,6 @@
<file alias="schema-adjustment">schema/schema-adjustment.json</file>
<file alias="schema-effect">schema/schema-effect.json</file>
<file alias="schema-sourceselect">schema/schema-sourceselect.json</file>
<file alias="schema-configget">schema/schema-configget.json</file>
</qresource>
</RCC>

View File

@@ -0,0 +1,12 @@
{
"type":"object",
"required":true,
"properties":{
"command": {
"type" : "string",
"required" : true,
"enum" : ["configget"]
}
},
"additionalProperties": false
}

View File

@@ -5,7 +5,7 @@
"command": {
"type" : "string",
"required" : true,
"enum" : ["color", "image", "effect", "serverinfo", "clear", "clearall", "transform", "correction", "temperature", "adjustment", "sourceselect"]
"enum" : ["color", "image", "effect", "serverinfo", "clear", "clearall", "transform", "correction", "temperature", "adjustment", "sourceselect", "configget"]
}
}
}