From e36371342754b5b37f77e514c64bca89a3f838e8 Mon Sep 17 00:00:00 2001 From: smanes0213 Date: Mon, 6 Jul 2026 17:00:58 +0530 Subject: [PATCH 1/2] Add ITestStateControl to thunderinterfaces/qa_interfaces with @json 1.0.0 annotation; JsonGenerator auto-produces JTestStateControl.h Signed-off-by: smanes0213 --- qa_interfaces/ITestStateControl.h | 59 +++++++++++++++++++++++++++++++ qa_interfaces/QAIds.h | 5 ++- 2 files changed, 63 insertions(+), 1 deletion(-) create mode 100644 qa_interfaces/ITestStateControl.h diff --git a/qa_interfaces/ITestStateControl.h b/qa_interfaces/ITestStateControl.h new file mode 100644 index 00000000..c6a40713 --- /dev/null +++ b/qa_interfaces/ITestStateControl.h @@ -0,0 +1,59 @@ +/* + * If not stated otherwise in this file or this component's LICENSE file the + * following copyright and licenses apply: + * + * Copyright 2020 Metrological + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include "Module.h" + +namespace Thunder { +namespace QualityAssurance { + + // @json 1.0.0 + struct EXTERNAL ITestStateControl : virtual public Core::IUnknown { + + enum { ID = ID_TESTSTATECONTROL }; + + // @event + struct EXTERNAL INotification : virtual public Core::IUnknown { + enum { ID = ID_TESTSTATECONTROL_NOTIFICATION }; + + ~INotification() override = default; + + // @brief Fires whenever the IStateControl state changes + // @param state New state value ("resumed", "suspended", "uninitialized", "exited") + virtual void StateChanged(const string& state) = 0; + }; + + ~ITestStateControl() override = default; + + virtual Core::hresult Register(INotification* notification) = 0; + virtual Core::hresult Unregister(INotification* notification) = 0; + + // @property + // @brief Current IStateControl state of the plugin + virtual Core::hresult State(string& state /* @out */) const = 0; + + // @brief Request a state change + // @param command State command: "resume" or "suspend" + // @retval ERROR_INCORRECT_URL Unknown command string + virtual Core::hresult Request(const string& command) = 0; + }; + +} // namespace QualityAssurance +} // namespace Thunder diff --git a/qa_interfaces/QAIds.h b/qa_interfaces/QAIds.h index 4e522b77..421f0dc4 100644 --- a/qa_interfaces/QAIds.h +++ b/qa_interfaces/QAIds.h @@ -84,7 +84,10 @@ namespace QualityAssurance { ID_BENCHMARK_RESULT_ITERATOR = ID_BENCHMARK + 2, ID_BENCHMARK_PAYLOAD = RPC::IDS::ID_EXTERNAL_QA_INTERFACE_OFFSET + 0x050, - ID_BENCHMARK_PAYLOADTYPE_ITERATOR = ID_BENCHMARK_PAYLOAD + 1 + ID_BENCHMARK_PAYLOADTYPE_ITERATOR = ID_BENCHMARK_PAYLOAD + 1, + + ID_TESTSTATECONTROL = RPC::IDS::ID_EXTERNAL_QA_INTERFACE_OFFSET + 0x070, + ID_TESTSTATECONTROL_NOTIFICATION = ID_TESTSTATECONTROL + 1 }; } } From 1d5a0447add5ea5eec54ce2987a05da832528432 Mon Sep 17 00:00:00 2001 From: smanes0213 Date: Mon, 6 Jul 2026 17:08:57 +0530 Subject: [PATCH 2/2] Resolve review comments --- qa_interfaces/ITestStateControl.h | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/qa_interfaces/ITestStateControl.h b/qa_interfaces/ITestStateControl.h index c6a40713..d35399ab 100644 --- a/qa_interfaces/ITestStateControl.h +++ b/qa_interfaces/ITestStateControl.h @@ -46,12 +46,20 @@ namespace QualityAssurance { virtual Core::hresult Unregister(INotification* notification) = 0; // @property - // @brief Current IStateControl state of the plugin + // @brief Current IStateControl lifecycle state of the plugin + // @detail Returns the full lifecycle state, which is a superset of the + // two-value enum in the production StateControl JSON-RPC schema + // (jsonrpc/StateControl.json). The additional values are + // intentional for QA use: + // "uninitialized" – no state command has been issued yet + // "resumed" – plugin is active (matches schema) + // "suspended" – plugin is suspended (matches schema) + // "exited" – plugin is shutting down virtual Core::hresult State(string& state /* @out */) const = 0; // @brief Request a state change // @param command State command: "resume" or "suspend" - // @retval ERROR_INCORRECT_URL Unknown command string + // @retval ERROR_UNKNOWN_KEY Unrecognised command string virtual Core::hresult Request(const string& command) = 0; };