diff --git a/doc/development/JSON-API _Commands_Overview.md b/doc/development/JSON-API _Commands_Overview.md index bb96189b..d3666b97 100644 --- a/doc/development/JSON-API _Commands_Overview.md +++ b/doc/development/JSON-API _Commands_Overview.md @@ -67,8 +67,7 @@ _http/s Support_ | leddevice | getProperties | Yes | Yes | Yes | | leddevice | identify | Yes | Yes | Yes | | logging | start | Yes | No | Yes | -| logging | stop | Yes | Yes | Yes | -| logging | update | Yes | Yes | Yes | +| logging | stop | Yes | No | Yes | | processing | - | Yes | Yes | Yes | | serverinfo | - | Yes | Yes | Yes | | serverinfo | getInfo | Yes | Yes | Yes | diff --git a/include/api/JsonApiCommand.h b/include/api/JsonApiCommand.h index e7abe96e..ace11c87 100644 --- a/include/api/JsonApiCommand.h +++ b/include/api/JsonApiCommand.h @@ -119,8 +119,7 @@ public: ToggleIdle, ToggleSuspend, TokenRequired, - Unsubscribe, - Update + Unsubscribe }; static QString toString(Type type) { @@ -171,7 +170,6 @@ public: case ToggleSuspend: return "toggleSuspend"; case TokenRequired: return "tokenRequired"; case Unsubscribe: return "unsubscribe"; - case Update: return "update"; default: return "unknown"; } } @@ -301,8 +299,7 @@ public: { {"leddevice", "getProperties"}, { Command::LedDevice, SubCommand::GetProperties, Authorization::Yes, InstanceCmd::Yes, NoListenerCmd::Yes} }, { {"leddevice", "identify"}, { Command::LedDevice, SubCommand::Identify, Authorization::Yes, InstanceCmd::Yes, NoListenerCmd::Yes} }, { {"logging", "start"}, { Command::Logging, SubCommand::Start, Authorization::Yes, InstanceCmd::No, NoListenerCmd::Yes} }, - { {"logging", "stop"}, { Command::Logging, SubCommand::Stop, Authorization::Yes, InstanceCmd::Yes, NoListenerCmd::Yes} }, - { {"logging", "update"}, { Command::Logging, SubCommand::Update, Authorization::Yes, InstanceCmd::Yes, NoListenerCmd::Yes} }, + { {"logging", "stop"}, { Command::Logging, SubCommand::Stop, Authorization::Yes, InstanceCmd::No, NoListenerCmd::Yes} }, { {"processing", ""}, { Command::Processing, SubCommand::Empty, Authorization::Yes, InstanceCmd::Yes, NoListenerCmd::Yes} }, { {"serverinfo", ""}, { Command::ServerInfo, SubCommand::Empty, Authorization::Yes, InstanceCmd::Yes, NoListenerCmd::Yes} }, { {"serverinfo", "getInfo"}, { Command::ServerInfo, SubCommand::GetInfo, Authorization::Yes, InstanceCmd::Yes, NoListenerCmd::Yes} }, diff --git a/libsrc/api/JSONRPC_schema/schema-adjustment.json b/libsrc/api/JSONRPC_schema/schema-adjustment.json index 454b940f..ae5c1ecc 100644 --- a/libsrc/api/JSONRPC_schema/schema-adjustment.json +++ b/libsrc/api/JSONRPC_schema/schema-adjustment.json @@ -8,7 +8,9 @@ "enum" : ["adjustment"] }, "instance" : { - "type" : "integer" + "type" : "integer", + "minimum": 0, + "maximum": 255 }, "tan" : { "type" : "integer" diff --git a/libsrc/api/JSONRPC_schema/schema-clear.json b/libsrc/api/JSONRPC_schema/schema-clear.json index 467b32aa..a0c2e23c 100644 --- a/libsrc/api/JSONRPC_schema/schema-clear.json +++ b/libsrc/api/JSONRPC_schema/schema-clear.json @@ -8,7 +8,9 @@ "enum" : ["clear"] }, "instance" : { - "type" : "integer" + "type" : "integer", + "minimum": 0, + "maximum": 255 }, "tan" : { "type" : "integer" diff --git a/libsrc/api/JSONRPC_schema/schema-clearall.json b/libsrc/api/JSONRPC_schema/schema-clearall.json index 1af31f29..391dca4d 100644 --- a/libsrc/api/JSONRPC_schema/schema-clearall.json +++ b/libsrc/api/JSONRPC_schema/schema-clearall.json @@ -8,7 +8,9 @@ "enum" : ["clearall"] }, "instance" : { - "type" : "integer" + "type" : "integer", + "minimum": 0, + "maximum": 255 }, "tan" : { "type" : "integer" diff --git a/libsrc/api/JSONRPC_schema/schema-color.json b/libsrc/api/JSONRPC_schema/schema-color.json index 6d22b8c6..ff424674 100644 --- a/libsrc/api/JSONRPC_schema/schema-color.json +++ b/libsrc/api/JSONRPC_schema/schema-color.json @@ -8,7 +8,9 @@ "enum" : ["color"] }, "instance" : { - "type" : "integer" + "type" : "integer", + "minimum": 0, + "maximum": 255 }, "tan" : { "type" : "integer" diff --git a/libsrc/api/JSONRPC_schema/schema-componentstate.json b/libsrc/api/JSONRPC_schema/schema-componentstate.json index 4a413928..96edbac1 100644 --- a/libsrc/api/JSONRPC_schema/schema-componentstate.json +++ b/libsrc/api/JSONRPC_schema/schema-componentstate.json @@ -10,7 +10,9 @@ "enum" : ["componentstate"] }, "instance" : { - "type" : "integer" + "type" : "integer", + "minimum": 0, + "maximum": 255 }, "tan" : { "type" : "integer" diff --git a/libsrc/api/JSONRPC_schema/schema-config.json b/libsrc/api/JSONRPC_schema/schema-config.json index 352494b7..204661cf 100644 --- a/libsrc/api/JSONRPC_schema/schema-config.json +++ b/libsrc/api/JSONRPC_schema/schema-config.json @@ -13,7 +13,9 @@ "enum" : ["getconfig","getschema","setconfig","restoreconfig","reload"] }, "instance" : { - "type" : "integer" + "type" : "integer", + "minimum": 0, + "maximum": 255 }, "tan" : { "type" : "integer" diff --git a/libsrc/api/JSONRPC_schema/schema-create-effect.json b/libsrc/api/JSONRPC_schema/schema-create-effect.json index ac1c0137..2eceb9a1 100644 --- a/libsrc/api/JSONRPC_schema/schema-create-effect.json +++ b/libsrc/api/JSONRPC_schema/schema-create-effect.json @@ -8,7 +8,9 @@ "enum" : ["create-effect"] }, "instance" : { - "type" : "integer" + "type" : "integer", + "minimum": 0, + "maximum": 255 }, "tan" : { "type" : "integer" diff --git a/libsrc/api/JSONRPC_schema/schema-delete-effect.json b/libsrc/api/JSONRPC_schema/schema-delete-effect.json index 23dca48d..bdbdee7c 100644 --- a/libsrc/api/JSONRPC_schema/schema-delete-effect.json +++ b/libsrc/api/JSONRPC_schema/schema-delete-effect.json @@ -9,7 +9,9 @@ "enum" : ["delete-effect"] }, "instance" : { - "type" : "integer" + "type" : "integer", + "minimum": 0, + "maximum": 255 }, "tan" : { "type" : "integer" diff --git a/libsrc/api/JSONRPC_schema/schema-effect.json b/libsrc/api/JSONRPC_schema/schema-effect.json index 1c0220bd..6a66ad6c 100644 --- a/libsrc/api/JSONRPC_schema/schema-effect.json +++ b/libsrc/api/JSONRPC_schema/schema-effect.json @@ -8,7 +8,9 @@ "enum" : ["effect"] }, "instance" : { - "type" : "integer" + "type" : "integer", + "minimum": 0, + "maximum": 255 }, "tan" : { "type" : "integer" diff --git a/libsrc/api/JSONRPC_schema/schema-image.json b/libsrc/api/JSONRPC_schema/schema-image.json index 1bfae475..12c39697 100644 --- a/libsrc/api/JSONRPC_schema/schema-image.json +++ b/libsrc/api/JSONRPC_schema/schema-image.json @@ -8,7 +8,9 @@ "enum" : ["image"] }, "instance" : { - "type" : "integer" + "type" : "integer", + "minimum": 0, + "maximum": 255 }, "tan" : { "type" : "integer" diff --git a/libsrc/api/JSONRPC_schema/schema-ledcolors.json b/libsrc/api/JSONRPC_schema/schema-ledcolors.json index 85d287c2..086914ec 100644 --- a/libsrc/api/JSONRPC_schema/schema-ledcolors.json +++ b/libsrc/api/JSONRPC_schema/schema-ledcolors.json @@ -8,7 +8,9 @@ "enum" : ["ledcolors"] }, "instance" : { - "type" : "integer" + "type" : "integer", + "minimum": 0, + "maximum": 255 }, "tan" : { "type" : "integer" diff --git a/libsrc/api/JSONRPC_schema/schema-logging.json b/libsrc/api/JSONRPC_schema/schema-logging.json index aacfa349..d9bd7cf7 100644 --- a/libsrc/api/JSONRPC_schema/schema-logging.json +++ b/libsrc/api/JSONRPC_schema/schema-logging.json @@ -7,9 +7,6 @@ "required" : true, "enum" : ["logging"] }, - "instance" : { - "type" : "integer" - }, "tan" : { "type" : "integer" }, diff --git a/libsrc/api/JSONRPC_schema/schema-processing.json b/libsrc/api/JSONRPC_schema/schema-processing.json index bdb1db4c..6681d3b1 100644 --- a/libsrc/api/JSONRPC_schema/schema-processing.json +++ b/libsrc/api/JSONRPC_schema/schema-processing.json @@ -8,7 +8,9 @@ "enum" : ["processing"] }, "instance" : { - "type" : "integer" + "type" : "integer", + "minimum": 0, + "maximum": 255 }, "tan" : { "type" : "integer" diff --git a/libsrc/api/JSONRPC_schema/schema-serverinfo.json b/libsrc/api/JSONRPC_schema/schema-serverinfo.json index a58c85b7..74b41453 100644 --- a/libsrc/api/JSONRPC_schema/schema-serverinfo.json +++ b/libsrc/api/JSONRPC_schema/schema-serverinfo.json @@ -12,7 +12,9 @@ "enum": ["getInfo", "subscribe", "unsubscribe", "getSubscriptions", "getSubscriptionCommands"] }, "instance" : { - "type" : "integer" + "type" : "integer", + "minimum": 0, + "maximum": 255 }, "data": { "type": ["null", "array"], diff --git a/libsrc/api/JsonAPI.cpp b/libsrc/api/JsonAPI.cpp index fd589d38..c86481f6 100644 --- a/libsrc/api/JsonAPI.cpp +++ b/libsrc/api/JsonAPI.cpp @@ -233,7 +233,9 @@ void JsonAPI::handleMessage(const QString &messageString, const QString &httpAut const quint8 instance = static_cast(message.value("instance").toInt()); if (!setHyperionInstance(instance)) { + cmd.isInstanceCmd = InstanceCmd::No; sendErrorReply(QString("Invalid or stopped instance: %1").arg(instance), cmd); + return; } }