diff --git a/.github/workflows/Linux build template.yml b/.github/workflows/Linux build template.yml index 9f3c0ebd..ca16bc08 100644 --- a/.github/workflows/Linux build template.yml +++ b/.github/workflows/Linux build template.yml @@ -16,22 +16,49 @@ jobs: # ----- Packages & artifacts ----- name: Build type - ${{matrix.build_type}}${{matrix.architecture == '32' && ' x86' || ''}} steps: - - name: Install necessary packages - uses: nick-fields/retry@v3 - with: - timeout_minutes: 10 - max_attempts: 10 - command: | - sudo gem install apt-spy2 - sudo apt-spy2 fix --commit --launchpad --country=US - echo "deb http://archive.ubuntu.com/ubuntu/ jammy main universe restricted multiverse" | sudo tee -a /etc/apt/sources.list - echo "deb http://archive.ubuntu.com/ubuntu/ jammy-updates main universe restricted multiverse" | sudo tee -a /etc/apt/sources.list - sudo dpkg --add-architecture i386 - sudo apt-get update - sudo apt install python3-pip build-essential cmake ninja-build libusb-1.0-0-dev ${{matrix.architecture == '32' && 'zlib1g-dev:i386 libssl-dev:i386 gcc-13-multilib g++-13-multilib' || 'zlib1g-dev libssl-dev'}} - python3 -m venv venv - source venv/bin/activate - pip install jsonref + - name: Prepare apt (add i386 if needed) + if: ${{ matrix.architecture == '32' }} + run: | + sudo dpkg --add-architecture i386 + + - name: Update apt indices (with retries) + shell: bash + run: | + set -euo pipefail + for attempt in {1..5}; do + if sudo apt-get update -o Acquire::Retries=5 -o Acquire::http::Timeout=30; then + break + fi + echo "apt-get update failed (attempt $attempt), retrying..." + sleep $((attempt*10)) + done + + - name: Install system dependencies + shell: bash + run: | + set -euo pipefail + export DEBIAN_FRONTEND=noninteractive + PKGS="python3-venv python3-pip build-essential cmake ninja-build libusb-1.0-0-dev" + if [ "${{ matrix.architecture }}" = "32" ]; then + PKGS="$PKGS zlib1g-dev:i386 libssl-dev:i386 libsbc-dev:i386 gcc-13-multilib g++-13-multilib" + else + PKGS="$PKGS zlib1g-dev libssl-dev libsbc-dev" + fi + for attempt in {1..4}; do + if sudo apt-get install -y --no-install-recommends $PKGS; then + break + fi + echo "apt-get install failed (attempt $attempt), cleaning up & retrying..." + sudo apt-get clean + sleep $((attempt*15)) + done + + - name: Set up Python environment + run: | + python3 -m venv venv + source venv/bin/activate + pip install --upgrade pip + pip install jsonref - name: Download artifacts uses: actions/download-artifact@v4 diff --git a/.github/workflows/cla.yml b/.github/workflows/cla.yml new file mode 100644 index 00000000..92a65e2e --- /dev/null +++ b/.github/workflows/cla.yml @@ -0,0 +1,19 @@ +name: "CLA" +on: + issue_comment: + types: [created] + pull_request_target: + types: [opened,closed,synchronize] + +permissions: + contents: read + pull-requests: write + actions: write + statuses: write + +jobs: + CLA-Lite: + name: "Signature" + uses: rdkcentral/cmf-actions/.github/workflows/cla.yml@main + secrets: + PERSONAL_ACCESS_TOKEN: ${{ secrets.CLA_ASSISTANT }} diff --git a/CMakeLists.txt b/CMakeLists.txt index 984e9764..62c190bf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -48,5 +48,6 @@ if (BUILD_REFERENCE) endif() add_subdirectory(interfaces) +add_subdirectory(example_interfaces) add_subdirectory(qa_interfaces) add_subdirectory(definitions) diff --git a/definitions/CMakeLists.txt b/definitions/CMakeLists.txt index d2a15c56..7e780b75 100644 --- a/definitions/CMakeLists.txt +++ b/definitions/CMakeLists.txt @@ -50,6 +50,11 @@ set(WORKING_VARIABLE ${INTERFACES_PATTERNS}) list(TRANSFORM WORKING_VARIABLE PREPEND "${CMAKE_SOURCE_DIR}/qa_interfaces/") file(GLOB QA_INTERFACE_FILE ${WORKING_VARIABLE}) +separate_arguments(INTERFACES_PATTERNS) +set(WORKING_VARIABLE ${INTERFACES_PATTERNS}) +list(TRANSFORM WORKING_VARIABLE PREPEND "${CMAKE_SOURCE_DIR}/example_interfaces/") +file(GLOB EXAMPLE_INTERFACE_FILE ${WORKING_VARIABLE}) + set(PUBLIC_HEADERS "definitions.h" "ValuePoint.h" "Module.h") if(NOT GENERATOR_SEARCH_PATH) @@ -60,6 +65,7 @@ JsonGenerator(CODE INPUT ${JSON_FILE} OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/genera JsonGenerator(CODE INPUT ${QA_JSON_FILE} OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/qa_generated" INCLUDE_PATH ${GENERATOR_SEARCH_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/../jsonrpc/" CPPIFDIR "${CMAKE_CURRENT_SOURCE_DIR}/../qa_interfaces/" IFDIR "${CMAKE_CURRENT_SOURCE_DIR}/../jsonrpc/" CPP_INTERFACE_PATH "qa_interfaces" JSON_INTERFACE_PATH "qa_interfaces/json") JsonGenerator(CODE INPUT ${INTERFACE_FILE} OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/generated" INCLUDE_PATH ${GENERATOR_SEARCH_PATH}) JsonGenerator(CODE NAMESPACE Thunder::QualityAssurance INPUT ${QA_INTERFACE_FILE} OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/qa_generated" INCLUDE_PATH ${GENERATOR_SEARCH_PATH} CPP_INTERFACE_PATH "qa_interfaces" JSON_INTERFACE_PATH "qa_interfaces/json" ) +JsonGenerator(CODE NAMESPACE Thunder::Example INPUT ${EXAMPLE_INTERFACE_FILE} OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/example_generated" INCLUDE_PATH ${GENERATOR_SEARCH_PATH} CPP_INTERFACE_PATH "example_interfaces" JSON_INTERFACE_PATH "example_interfaces/json") file(GLOB JSON_ENUM_SOURCES "${CMAKE_CURRENT_BINARY_DIR}/generated/JsonEnum*.cpp") file(GLOB JSON_LINK_HEADERS "${CMAKE_CURRENT_BINARY_DIR}/generated/J*.h") @@ -67,14 +73,19 @@ file(GLOB JSON_LINK_HEADERS "${CMAKE_CURRENT_BINARY_DIR}/generated/J*.h") file(GLOB QA_JSON_ENUM_SOURCES "${CMAKE_CURRENT_BINARY_DIR}/qa_generated/JsonEnum*.cpp") file(GLOB QA_JSON_LINK_HEADERS "${CMAKE_CURRENT_BINARY_DIR}/qa_generated/J*.h") +file(GLOB EXAMPLE_JSON_ENUM_SOURCES "${CMAKE_CURRENT_BINARY_DIR}/example_generated/JsonEnum*.cpp") +file(GLOB EXAMPLE_JSON_LINK_HEADERS "${CMAKE_CURRENT_BINARY_DIR}/example_generated/J*.h") + list(APPEND JSON_LINK_HEADERS "Module.h") list(APPEND QA_JSON_LINK_HEADERS "Module.h") +list(APPEND EXAMPLE_JSON_LINK_HEADERS "Module.h") add_library(${Target} SHARED Definitions.cpp Module.cpp ${JSON_ENUM_SOURCES} ${QA_JSON_ENUM_SOURCES} + ${EXAMPLE_JSON_ENUM_SOURCES} ) target_link_libraries(${Target} @@ -122,6 +133,11 @@ install( DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${NAMESPACE}/qa_interfaces/json COMPONENT ${NAMESPACE}_Test_Development ) +install( + FILES ${EXAMPLE_JSON_LINK_HEADERS} + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${NAMESPACE}/example_interfaces/json COMPONENT ${NAMESPACE}_Example_Development +) + InstallPackageConfig( TARGETS ${Target} DESCRIPTION "${PROJECT_DESCRIPTION}" diff --git a/definitions/Definitions.cpp b/definitions/Definitions.cpp index ef2d0143..80b456e4 100644 --- a/definitions/Definitions.cpp +++ b/definitions/Definitions.cpp @@ -65,6 +65,7 @@ #include #include #include +#include #include #include #include @@ -95,6 +96,10 @@ #include #include #include + +#include +#include +#include #endif namespace Thunder { @@ -153,15 +158,6 @@ ENUM_CONVERSION_BEGIN(Exchange::IStream::state) { Exchange::IStream::state::Error, _TXT(_T("Error")) }, ENUM_CONVERSION_END(Exchange::IStream::state) -ENUM_CONVERSION_BEGIN(Exchange::IPower::PCState) - { Exchange::IPower::On, _TXT(_T("on")) }, - { Exchange::IPower::ActiveStandby, _TXT(_T("active")) }, - { Exchange::IPower::PassiveStandby, _TXT(_T("passive")) }, - { Exchange::IPower::SuspendToRAM, _TXT(_T("suspended")) }, - { Exchange::IPower::Hibernate, _TXT(_T("hibernate")) }, - { Exchange::IPower::PowerOff, _TXT(_T("off")) }, -ENUM_CONVERSION_END(Exchange::IPower::PCState) - ENUM_CONVERSION_BEGIN(Exchange::External::Metadata::protocol) { Exchange::External::Metadata::protocol::I2C, _TXT(_T("I2C")) }, { Exchange::External::Metadata::protocol::ONEWIRE, _TXT(_T("1W")) }, diff --git a/definitions/Definitions.vcxproj b/definitions/Definitions.vcxproj index 1dfe654c..3056aedd 100644 --- a/definitions/Definitions.vcxproj +++ b/definitions/Definitions.vcxproj @@ -35,7 +35,6 @@ - @@ -45,7 +44,6 @@ - @@ -53,12 +51,11 @@ - - + @@ -104,7 +101,7 @@ $(ProjectDir)../interfaces/json/JLocationSync.h $(ProjectDir)../interfaces/json/JLocationSync.h $(ProjectDir)../interfaces/json/JLocationSync.h - + python "$(ToolPath)\JsonGenerator\JsonGenerator.py" -I "$(FrameworkPath)\" -I "$(ProjectDir)\" --keep-empty --case-convention legacy -c -j "$(ProjectDir)../interfaces" -o "$(ProjectDir)../interfaces/json" "%(FullPath)" --force python "$(ToolPath)\JsonGenerator\JsonGenerator.py" -I "$(FrameworkPath)\" -I "$(ProjectDir)\" --keep-empty --case-convention legacy -c -j "$(ProjectDir)../interfaces" -o "$(ProjectDir)../interfaces/json" "%(FullPath)" --force @@ -147,6 +144,96 @@ $(ProjectDir)../interfaces/json/JOpenCDM.h $(ProjectDir)../interfaces/json/JOpenCDM.h + + ClInclude + ClInclude + ClInclude + ClInclude + $(ProjectDir)../interfaces/json/JTimeSync.h + $(ProjectDir)../interfaces/json/JTimeSync.h + $(ProjectDir)../interfaces/json/JTimeSync.h + $(ProjectDir)../interfaces/json/JTimeSync.h + + + python "$(ToolPath)\JsonGenerator\JsonGenerator.py" -I "$(FrameworkPath)\" -I "$(ProjectDir)\" --keep-empty --case-convention legacy -c -j "$(ProjectDir)../interfaces" -o "$(ProjectDir)../interfaces/json" "%(FullPath)" --force + python "$(ToolPath)\JsonGenerator\JsonGenerator.py" -I "$(FrameworkPath)\" -I "$(ProjectDir)\" --keep-empty --case-convention legacy -c -j "$(ProjectDir)../interfaces" -o "$(ProjectDir)../interfaces/json" "%(FullPath)" --force + python "$(ToolPath)\JsonGenerator\JsonGenerator.py" -I "$(FrameworkPath)\" -I "$(ProjectDir)\" --keep-empty --case-convention legacy -c -j "$(ProjectDir)../interfaces" -o "$(ProjectDir)../interfaces/json" "%(FullPath)" --force + python "$(ToolPath)\JsonGenerator\JsonGenerator.py" -I "$(FrameworkPath)\" -I "$(ProjectDir)\" --keep-empty --case-convention legacy -c -j "$(ProjectDir)../interfaces" -o "$(ProjectDir)../interfaces/json" "%(FullPath)" --force + $(ProjectDir)../interfaces/json/JPower.h + ClInclude + $(ProjectDir)../interfaces/json/JPower.h + ClInclude + $(ProjectDir)../interfaces/json/JPower.h + ClInclude + $(ProjectDir)../interfaces/json/JPower.h + ClInclude + + + ClInclude + ClInclude + ClInclude + ClInclude + $(ProjectDir)../interfaces/json/JWifiControl.h + $(ProjectDir)../interfaces/json/JWifiControl.h + $(ProjectDir)../interfaces/json/JWifiControl.h + $(ProjectDir)../interfaces/json/JWifiControl.h + + + python "$(ToolPath)\JsonGenerator\JsonGenerator.py" -I "$(FrameworkPath)\" -I "$(ProjectDir)\" --keep-empty --case-convention legacy -c -j "$(ProjectDir)../interfaces" -o "$(ProjectDir)../interfaces/json" "%(FullPath)" --force + ClInclude + python "$(ToolPath)\JsonGenerator\JsonGenerator.py" -I "$(FrameworkPath)\" -I "$(ProjectDir)\" --keep-empty --case-convention legacy -c -j "$(ProjectDir)../interfaces" -o "$(ProjectDir)../interfaces/json" "%(FullPath)" --force + ClInclude + python "$(ToolPath)\JsonGenerator\JsonGenerator.py" -I "$(FrameworkPath)\" -I "$(ProjectDir)\" --keep-empty --case-convention legacy -c -j "$(ProjectDir)../interfaces" -o "$(ProjectDir)../interfaces/json" "%(FullPath)" --force + ClInclude + python "$(ToolPath)\JsonGenerator\JsonGenerator.py" -I "$(FrameworkPath)\" -I "$(ProjectDir)\" --keep-empty --case-convention legacy -c -j "$(ProjectDir)../interfaces" -o "$(ProjectDir)../interfaces/json" "%(FullPath)" --force + ClInclude + $(ProjectDir)../interfaces/json/JSystemCommands.h + $(ProjectDir)../interfaces/json/JSystemCommands.h + $(ProjectDir)../interfaces/json/JSystemCommands.h + $(ProjectDir)../interfaces/json/JSystemCommands.h + + + ClInclude + ClInclude + ClInclude + ClInclude + python "$(ToolPath)\JsonGenerator\JsonGenerator.py" -I "$(FrameworkPath)\" -I "$(ProjectDir)\" --keep-empty --case-convention legacy -c -j "$(ProjectDir)../interfaces" -o "$(ProjectDir)../interfaces/json" "%(FullPath)" --force + python "$(ToolPath)\JsonGenerator\JsonGenerator.py" -I "$(FrameworkPath)\" -I "$(ProjectDir)\" --keep-empty --case-convention legacy -c -j "$(ProjectDir)../interfaces" -o "$(ProjectDir)../interfaces/json" "%(FullPath)" --force + python "$(ToolPath)\JsonGenerator\JsonGenerator.py" -I "$(FrameworkPath)\" -I "$(ProjectDir)\" --keep-empty --case-convention legacy -c -j "$(ProjectDir)../interfaces" -o "$(ProjectDir)../interfaces/json" "%(FullPath)" --force + python "$(ToolPath)\JsonGenerator\JsonGenerator.py" -I "$(FrameworkPath)\" -I "$(ProjectDir)\" --keep-empty --case-convention legacy -c -j "$(ProjectDir)../interfaces" -o "$(ProjectDir)../interfaces/json" "%(FullPath)" --force + $(ProjectDir)../interfaces/json/JIOConnector.h + $(ProjectDir)../interfaces/json/JIOConnector.h + $(ProjectDir)../interfaces/json/JIOConnector.h + $(ProjectDir)../interfaces/json/JIOConnector.h + + + ClInclude + ClInclude + ClInclude + ClInclude + python "$(ToolPath)\JsonGenerator\JsonGenerator.py" -I "$(FrameworkPath)\" -I "$(ProjectDir)\" --keep-empty --case-convention legacy -c -j "$(ProjectDir)../interfaces" -o "$(ProjectDir)../interfaces/json" "%(FullPath)" --force + python "$(ToolPath)\JsonGenerator\JsonGenerator.py" -I "$(FrameworkPath)\" -I "$(ProjectDir)\" --keep-empty --case-convention legacy -c -j "$(ProjectDir)../interfaces" -o "$(ProjectDir)../interfaces/json" "%(FullPath)" --force + python "$(ToolPath)\JsonGenerator\JsonGenerator.py" -I "$(FrameworkPath)\" -I "$(ProjectDir)\" --keep-empty --case-convention legacy -c -j "$(ProjectDir)../interfaces" -o "$(ProjectDir)../interfaces/json" "%(FullPath)" --force + python "$(ToolPath)\JsonGenerator\JsonGenerator.py" -I "$(FrameworkPath)\" -I "$(ProjectDir)\" --keep-empty --case-convention legacy -c -j "$(ProjectDir)../interfaces" -o "$(ProjectDir)../interfaces/json" "%(FullPath)" --force + $(ProjectDir)../interfaces/json/JSubsystemControl.h + $(ProjectDir)../interfaces/json/JSubsystemControl.h + $(ProjectDir)../interfaces/json/JSubsystemControl.h + $(ProjectDir)../interfaces/json/JSubsystemControl.h + + + $(ProjectDir)../interfaces/json/JPluginAsyncStateControl.h + python "$(ToolPath)\JsonGenerator\JsonGenerator.py" -I "$(FrameworkPath)\" -I "$(ProjectDir)\" --keep-empty --case-convention legacy -c -j "$(ProjectDir)../interfaces" -o "$(ProjectDir)../interfaces/json" "%(FullPath)" --force + ClInclude + python "$(ToolPath)\JsonGenerator\JsonGenerator.py" -I "$(FrameworkPath)\" -I "$(ProjectDir)\" --keep-empty --case-convention legacy -c -j "$(ProjectDir)../interfaces" -o "$(ProjectDir)../interfaces/json" "%(FullPath)" --force + $(ProjectDir)../interfaces/json/JPluginAsyncStateControl.h + $(ProjectDir)../interfaces/json/JPluginAsyncStateControl.h + $(ProjectDir)../interfaces/json/JPluginAsyncStateControl.h + python "$(ToolPath)\JsonGenerator\JsonGenerator.py" -I "$(FrameworkPath)\" -I "$(ProjectDir)\" --keep-empty --case-convention legacy -c -j "$(ProjectDir)../interfaces" -o "$(ProjectDir)../interfaces/json" "%(FullPath)" --force + python "$(ToolPath)\JsonGenerator\JsonGenerator.py" -I "$(FrameworkPath)\" -I "$(ProjectDir)\" --keep-empty --case-convention legacy -c -j "$(ProjectDir)../interfaces" -o "$(ProjectDir)../interfaces/json" "%(FullPath)" --force + ClInclude + ClInclude + ClInclude + $(ProjectDir)../interfaces/json/JMath.h @@ -326,9 +413,6 @@ Document - - Document - Document @@ -341,9 +425,6 @@ Document - - Document - Document @@ -359,15 +440,6 @@ Document - - Document - - - Document - - - Document - diff --git a/definitions/Definitions.vcxproj.filters b/definitions/Definitions.vcxproj.filters index 25236887..b7cf283f 100644 --- a/definitions/Definitions.vcxproj.filters +++ b/definitions/Definitions.vcxproj.filters @@ -1,32 +1,9 @@  - - - {6975244d-cb23-4d09-a334-80cf1e1b4845} - - - {3c5d92bc-9901-475e-bb35-643cd2f2296b} - - - {c5ebb452-1dd1-4410-9a69-da3188dc9cd5} - - - {832f72b9-f988-4a91-98b6-0a6e62b7ca87} - - - {cd531e85-d48e-4490-989c-8353fa16792e} - - Source Files - - Generated Files - - - Generated Files - Generated Files @@ -75,10 +52,13 @@ Generated Files - + Generated Files - + + Generated Files + + Generated Files @@ -87,12 +67,16 @@ Generated Files + Generated Files - + Generated Files - + + Generated Files + + Generated Files @@ -107,9 +91,6 @@ Generated Files - - Generated Files - Generated Files @@ -119,12 +100,6 @@ Generated Files - - Generated Files - - - Generated Files - Generated Files @@ -137,161 +112,173 @@ Generated Files - - Generated Files - - + Generated Files - - Generated Files - - + Generated Files - Header Files + Source Files - Header Files + Source Files - Header Files + Source Files - - - Contracts - - - Contracts - - - Contracts + JSON Files - Contracts + JSON Files - Contracts + JSON Files - Contracts + JSON Files - Contracts + JSON Files - Contracts + JSON Files - Contracts + JSON Files - Contracts + JSON Files - Contracts - - - Contracts + JSON Files - - Contracts + + Interface Files - - Contracts + + Interface Files - - Contracts + + Interface Files - - Contracts + + Interface Files - - Contracts + + Interface Files - - Contracts + + Interface Files - - Contracts + + Interface Files - - Contracts + + Interface Files - - Contracts + + Interface Files - - Contracts + + Interface Files - - Contracts + + Interface Files - - Contracts + + Interface Files - - Contracts + + Interface Files - - Contracts + + Interface Files - - Contracts + + Interface Files - - Interfaces + + Interface Files - Interfaces + Interface Files - - Interfaces + + JSON Files - - Interfaces + + JSON Files - - Interfaces + + JSON Files - - Interfaces + + JSON Files - - Interfaces + + JSON Files - - Interfaces + + JSON Files - - Interfaces + + JSON Files - - Interfaces + + JSON Files - - Interfaces + + JSON Files - - Interfaces + + JSON Files - - Interfaces + + JSON Files - - Interfaces + + Interface Files - - Interfaces + + Interface Files - - Interfaces + + Interface Files + + + + Interface Files + + Interface Files + + + + + JSON Files + + + JSON Files + + + + + {5083385d-c0f4-4e2b-838a-f4aa51d2a951} + + + {81d0a068-8151-4a4b-95df-340981e3e0b3} + + + {dbf3aff7-6d8c-4b9d-81db-40120a86bec7} + + + {59dae841-dc89-457c-b9f5-7f097f7f7906} + \ No newline at end of file diff --git a/example_interfaces/CMakeLists.txt b/example_interfaces/CMakeLists.txt new file mode 100644 index 00000000..3087d0d1 --- /dev/null +++ b/example_interfaces/CMakeLists.txt @@ -0,0 +1,81 @@ +# If not stated otherwise in this file or this component's LICENSE file the +# following copyright and licenses apply: +# +# Copyright 2024 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. + +cmake_minimum_required(VERSION 3.15) + +project(ExampleMarshalling + VERSION 5.0.0 + DESCRIPTION "Component that abstracts the logic to transfer and receive COM-RPC objects" + LANGUAGES CXX) + +find_package(Thunder) + +find_package(CompileSettingsDebug REQUIRED) +find_package(ProxyStubGenerator REQUIRED) +find_package(${NAMESPACE}Core REQUIRED) +find_package(${NAMESPACE}COM REQUIRED) + +set(Target ${NAMESPACE}${PROJECT_NAME}) + +if(NOT GENERATOR_SEARCH_PATH) + set(GENERATOR_SEARCH_PATH ${CMAKE_SYSROOT}${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}/${NAMESPACE}) +endif() + +separate_arguments(INTERFACES_PATTERNS) +file(GLOB EXAMPLE_INTERFACES_HEADERS ${INTERFACES_PATTERNS}) + +ProxyStubGenerator(NAMESPACE "Thunder::Example" INPUT "${EXAMPLE_INTERFACE_HEADERS}" OUTDIR "${CMAKE_CURRENT_BINARY_DIR}/example_generated" INCLUDE_PATH ${GENERATOR_SEARCH_PATH}) + +list(APPEND EXAMPLE_INTERFACES_HEADERS Module.h ExampleIds.h) + +file(GLOB EXAMPLE_PROXY_STUB_SOURCES "${CMAKE_CURRENT_BINARY_DIR}/example_generated/ProxyStubs*.cpp") +add_library(${Target} SHARED + Module.cpp + ${EXAMPLE_PROXY_STUB_SOURCES} + ) + +target_include_directories(${Target} PRIVATE $ $/..) + +target_link_libraries(${Target} + PRIVATE + ${NAMESPACE}Core::${NAMESPACE}Core + ${NAMESPACE}COM::${NAMESPACE}COM + CompileSettingsDebug::CompileSettingsDebug + ) + +set_target_properties(${Target} PROPERTIES + CXX_STANDARD 11 + CXX_STANDARD_REQUIRED YES + FRAMEWORK FALSE + SOVERSION ${PROJECT_VERSION_MAJOR} + ) + +if(HUMAN_VERSIONED_BINARIES) +set_target_properties(${Target} PROPERTIES VERSION ${PROJECT_VERSION}) +endif() + +string(TOLOWER ${NAMESPACE} NAMESPACE_LIB) + +install( + TARGETS ${Target} EXPORT ${Target}Targets + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/${NAMESPACE_LIB}/proxystubs COMPONENT ${NAMESPACE}_Test NAMELINK_COMPONENT ${NAMESPACE}_Example_Development +) + +install( + FILES ${EXAMPLE_INTERFACES_HEADERS} + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${NAMESPACE}/example_interfaces COMPONENT ${NAMESPACE}_Example_Development +) diff --git a/example_interfaces/ExampleIds.h b/example_interfaces/ExampleIds.h new file mode 100644 index 00000000..19ade9c0 --- /dev/null +++ b/example_interfaces/ExampleIds.h @@ -0,0 +1,71 @@ +/* + * 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 + +// This file holds all the identifiers (uint32_t) used to identify a EXAMPLE interface. From this +// identifier, the comrpc framework can find the proper proxy/stub in case of communicating +// over a process boundary. +// Some users do not "fully" rebuild the system in case of changes. If this means that the +// Proxy/Stub code is not always rebuild in case of new releases, the identifier associated +// with an interface becomes as important as the interface syntax and as interfaces are not +// allowed to be changed, the ID associated with the interface should also not be changed +// and thus should be "fixed". + +// So if you extend this file by defining a new EXAMPLE interface ID make sure it is defined (has +// an actual value) and once the enum label has a value, never change it again. + +// As some interfaces might be grouped, the first ID of the group is assigned a value, the +// other interfaces belonging to this group use the enum value of label that has an assigned +// value and just increment that label by the proper amount. + +// Using this system, all interfaces will have an assigned number. If numbers overlap, the +// compiler, your best friend, will start complaining. Time to reassign the value, before we +// deploy. + +// NOTE: Default the gap between each group of interface is 16. If you need more and the new +// addition is add the end, write a comment with your interface that you might need more +// than 16 interface in that group so that the next ID is indeed elevated (and rounded +// up to a multiple of 16) if the next entry is made in the future. + +// @insert + +namespace Thunder { + +namespace Example { + + enum IDS : uint32_t { + + ID_SIMPLEASYNC = RPC::IDS::ID_EXTERNAL_EXAMPLE_INTERFACE_OFFSET + 0x010, + ID_CALLBACK = ID_SIMPLEASYNC + 1, + ID_ASYNC_NOTIFICATION = ID_SIMPLEASYNC + 2, + ID_BIND_NOTIFICATION = ID_SIMPLEASYNC + 3, + + + ID_SIMPLEINSTANCEOBJECTS = RPC::IDS::ID_EXTERNAL_EXAMPLE_INTERFACE_OFFSET + 0x020, + ID_DEVICE = ID_SIMPLEINSTANCEOBJECTS + 1, + ID_INSTANCE_NOTIFICATION = ID_SIMPLEINSTANCEOBJECTS + 2, + + ID_SIMPLECUSTOMOBJECTS = RPC::IDS::ID_EXTERNAL_EXAMPLE_INTERFACE_OFFSET + 0x030, + ID_ACCESSORY = ID_SIMPLECUSTOMOBJECTS + 1, + ID_CUSTOM_NOTIFICATION = ID_SIMPLECUSTOMOBJECTS + 2, + + }; +} +} diff --git a/example_interfaces/ISimpleAsync.h b/example_interfaces/ISimpleAsync.h new file mode 100644 index 00000000..ffe71216 --- /dev/null +++ b/example_interfaces/ISimpleAsync.h @@ -0,0 +1,199 @@ +/* + * If not stated otherwise in this file or this component's LICENSE file the + * following copyright and licenses apply: + * + * Copyright 2024 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" + +// @insert + +namespace Thunder { + +namespace Example { + + // @json 1.0.0 + struct ISimpleAsync : public virtual Core::IUnknown { + + enum { ID = ID_SIMPLEASYNC }; + + enum state : uint8_t { + DISCONNECTED, + CONNECTING, + CONNECTED, + CONNECTING_FAILED, + CONNECTING_TIMED_OUT, + CONNECTING_ABORTED + }; + + struct ICallback : public virtual Core::IUnknown { + + enum { ID = ID_CALLBACK }; + + // Generator will create its implementation of this interface + // and supply the object to the called async method. The + // implementation of the completion method will issue a JSON-RPC + // event. + // + // @brief Signals completion of the Connect method + // @param address Device address (e.g. aa:bb:cc:dd:ee:ff) + // @param state Result of pairing operation (e.g. CONNECTING_ABORTED) + virtual void Complete(const Core::OptionalType>& address /* @encode:mac @restrict:6..6 */, const state state) = 0; + }; + + // @async + // + // Asynchronous method. Its result will be delivered via notification. + // It is expected that async method has one input interface parameter + // and this interface has a single method that will be used to signal + // completion. The prototype or name of the signalling method is not + // predefined. On JSON-RPC level the interface parameter will be replaced + // with client ID string, that will allow the client to match the call + // with the async result. It is required that the callback is eventually + // always called, whether it's success, failure or timeout. + // + // @brief Connects to a server + // @param address Device address (e.g. aa:bb:cc:dd:ee:ff) + // @param timeout Maximum time allowed for connecting in milliseconds + // @retval ERROR_INPROGRESS Currently connecting + // @retval ERROR_ALREADY_CONNECTED Already connected to server + virtual Core::hresult Connect(const Core::OptionalType>& address /* @encode:mac @restrict:6..6 */, const Core::OptionalType& timeout /* @default:1000 */, ICallback* const cb) = 0; + + // @brief Aborts connecting to a server + // @retval ERROR_ILLEGAL_STATE There is no ongoing connection + virtual Core::hresult Abort() = 0; + + // @brief Disconnects from the server + // @retval ERROR_INPROGRESS Connecting in progress, abort first + // @retval ERROR_ALREADY_RELEASED Not connected to server + virtual Core::hresult Disconnect() = 0; + + // @property + // @brief Connection status + // @param address Device address (e.g. 11:22:33:44:55:66) + virtual Core::hresult Connected(const std::vector& address /* @index @encode:mac @restrict:6..6 */, bool& result /* @out */) const = 0; + + + // BY ARRAY ----------- + + // @brief Links a device + // @param address Device address (e.g. 11:22:33:44:55:66) + virtual Core::hresult Link(const uint8_t address[6] /* @encode:base64 */) = 0; + + // @brief Unlinks a device + // @param address Device address (e.g. 11:22:33:44:55:66) + virtual Core::hresult Unlink(const uint8_t address[6] /* @encode:base64 */) = 0; + + // @property + // @brief Linked device + // @param address Device address (e.g. 11:22:33:44:55:66) + virtual Core::hresult LinkedDevice(uint8_t address[6] /* @encode:base64 @out */) const = 0; + + // @event + struct INotification : public virtual Core::IUnknown { + + enum { ID = ID_ASYNC_NOTIFICATION }; + + // @brief Signals completion of the Connect method + // @param address Device address (e.g. [11,22] ) + // @param linked Denotes if device is linked + virtual void StatusChanged(const uint8_t address[6], const bool linked) = 0; + }; + + virtual Core::hresult Register(INotification* const notification) = 0; + virtual Core::hresult Unregister(const INotification* const notification) = 0; + + // @property + // @brief Device metadata + // @param address Device address (e.g. 11:22:33:44:55:66) + virtual Core::hresult Metadata(const uint8_t address[6] /* @index @encode:base64 */, const string& metadata) = 0; + virtual Core::hresult Metadata(const uint8_t address[6] /* @index @encode:base64 */, string& metadata /* @out */) const = 0; + + // BY MACADDRESS ------------------------- + + // @brief Binds a device + // @param address Device address (e.g. 11:22:33:44:55:66) + virtual Core::hresult Bind(const Core::MACAddress& address) = 0; + + // @brief Unlinks a device + // @param address Device address (e.g. 11:22:33:44:55:66) + virtual Core::hresult Unbind(const Core::MACAddress& address) = 0; + + // @property + virtual Core::hresult BoundDevice(Core::MACAddress& address /* @out */) const = 0; + + // @property + // @brief Device metadata + // @param address Device address (e.g. 11:22:33:44:55:66) + virtual Core::hresult Type(const Core::MACAddress& address /* @index */, const string& value) = 0; + virtual Core::hresult Type(const Core::MACAddress& address /* @index */, string& value /* @out */) const = 0; + + // @event + struct IBindNotification : public virtual Core::IUnknown { + + enum { ID = ID_BIND_NOTIFICATION }; + + // @brief Signals completion of the Connect method + // @param address Device address (e.g. [11,22] ) + // @param linked Denotes if device is linked + virtual void BindingChanged(const Core::MACAddress& address/* @index */, const bool bound) = 0; + }; + + virtual Core::hresult Register(IBindNotification* const notification) = 0; + virtual Core::hresult Unregister(const IBindNotification* const notification) = 0; + + + // Vector, iterator + + struct SmallRecord { + string param0; + bool param1; + }; + + struct Record { + string param0; + std::vector param1 /* @restrict:10 */; + std::vector param2 /* @restrict:10 */; + Core::OptionalType> param3 /* @restrict:10 */; + Core::OptionalType> param4 /* @restrict:10 */; + SmallRecord param5; + Core::OptionalType param6; + }; + + struct Record2 { + Core::OptionalType> param3 /* @restrict:10 */; + Core::OptionalType> param4 /* @restrict:10 */; + }; + + virtual Core::hresult Tables(const bool fill, std::vector& stringTables /* @out @restrict:10 */) = 0; + virtual Core::hresult Tables2(const bool fill, std::vector& stringTables /* @out @restrict:10 */, std::vector& intTables /* @out @restrict:10 */) = 0; + virtual Core::hresult Tables3(const bool fill, Core::OptionalType>& stringTables /* @out @restrict:10 */) = 0; + virtual Core::hresult Tables4(const bool fill, RPC::IStringIterator*& stringTables /* @out */) = 0; + virtual Core::hresult Tables5(const bool fill, RPC::IStringIterator*& stringTables /* @out */, RPC::IValueIterator*& intTables /* @out */) = 0; + virtual Core::hresult Tables6(const bool fill, Record& pod /* @out */) = 0; + virtual Core::hresult Tables7(const bool fill, Core::OptionalType& pod /* @out */) = 0; + virtual Core::hresult Tables8(const bool fill, Core::OptionalType& pod /* @out */) = 0; + virtual Core::hresult Tables9(const bool fill, Record2& pod /* @out */) = 0; + + virtual Core::hresult OptionalResult(const bool fill, Core::OptionalType& result /* @out */) = 0; + + }; + +} // namespace Example + +} diff --git a/example_interfaces/ISimpleCustomObjects.h b/example_interfaces/ISimpleCustomObjects.h new file mode 100644 index 00000000..9637f05a --- /dev/null +++ b/example_interfaces/ISimpleCustomObjects.h @@ -0,0 +1,91 @@ +/* + * If not stated otherwise in this file or this component's LICENSE file the + * following copyright and licenses apply: + * + * Copyright 2025 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 Example { + + // @json 1.0.0 + struct ISimpleCustomObjects : virtual public Core::IUnknown { + + enum { ID = ID_SIMPLECUSTOMOBJECTS }; + + // @json @encode:lookup + struct IAccessory: virtual public Core::IUnknown { + + enum { ID = ID_ACCESSORY }; + + // @event + struct INotification : public Core::IUnknown { + + enum { ID = ID_CUSTOM_NOTIFICATION }; + + // @statuslistener + // @brief Signals addition of a accessory + // @param name Name of the accessory (e.g. "mouse") + virtual void NameChanged(const string& name) = 0; + }; + + virtual Core::hresult Register(INotification* const notification) = 0; + virtual Core::hresult Unregister(const INotification* const notification) = 0; + + // @property + // @brief Name of the accessory + // @param name Name of the accessory (e.g. "mouse") + virtual Core::hresult Name(string& name /* @out */) const = 0; + virtual Core::hresult Name(const string& name) = 0; + + // @property + // @brief Pin state + virtual Core::hresult Pin(const uint8_t pin /* @index */, const bool value) = 0; + virtual Core::hresult Pin(const uint8_t pin /* @index */, bool& value /* @out */) const = 0; + }; + + // @event + struct INotification : public Core::IUnknown { + + enum { ID = ID_CUSTOM_NOTIFICATION }; + + // @statuslistener + // @brief Signals addition of a accessory + // @param accessory Accessory instance + virtual void Added(IAccessory* const accessory) = 0; + + // @brief Signals removal of a accessory + // @param accessory Accessory instance + virtual void Removed(IAccessory* const accessory) = 0; + }; + + virtual Core::hresult Register(INotification* const notification) = 0; + virtual Core::hresult Unregister(const INotification* const notification) = 0; + + // @property + // @brief Accessory by name + // @param name Name of the accessory to look for (e.g. "mouse") + // @param accessory Accessory instance + virtual Core::hresult Accessory(const string& name /* @index */, IAccessory*& accessory /* @out */) const = 0; + }; + +} // namespace Example + +} diff --git a/example_interfaces/ISimpleInstanceObjects.h b/example_interfaces/ISimpleInstanceObjects.h new file mode 100644 index 00000000..53616899 --- /dev/null +++ b/example_interfaces/ISimpleInstanceObjects.h @@ -0,0 +1,102 @@ +/* + * If not stated otherwise in this file or this component's LICENSE file the + * following copyright and licenses apply: + * + * Copyright 2024 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 Example { + + // @json 1.0.0 + struct ISimpleInstanceObjects : virtual public Core::IUnknown { + + enum { ID = ID_SIMPLEINSTANCEOBJECTS }; + + enum state : uint8_t { + ENABLED, + DISABLED + }; + + // @json @encode:autolookup + struct IDevice : virtual public Core::IUnknown { + + enum { ID = ID_DEVICE }; + + // @event + // A notification per instance of device + struct INotification : virtual public Core::IUnknown { + + enum { ID = ID_INSTANCE_NOTIFICATION }; + + // @brief Signals device name changes + // @param state New name of the device + virtual void NameChanged(const string& state) = 0; + + // @statuslistener + // @brief Signals device state changes + // @param state New state of the device + virtual void StateChanged(const state state) = 0; + + // @statuslistener + // @brief Signals pin state changes + virtual void PinChanged(const uint8_t pin /* @index */, const bool high) = 0; + }; + + virtual Core::hresult Register(INotification* const notification) = 0; + virtual Core::hresult Unregister(const INotification* const notificaiton) = 0; + + // @property + // @brief Name of the device + // @param name Name of the device (e.g. "usb") + virtual Core::hresult Name(string& name /* @out */) const = 0; + virtual Core::hresult Name(const string& name) = 0; + + // @brief Enable the device + // @retval ERROR_ALREADY_CONNECTED The device is already enabled + virtual Core::hresult Enable() = 0; + + // @brief Disable the device + // @retval ERROR_ALREADY_RELEASED The device is not enabled + virtual Core::hresult Disable() = 0; + + // @property + // @brief A pin + // @param pin Pin number + // @retval ERROR_UNAVAILABLE Unknown pin number + virtual Core::hresult Pin(const uint8_t pin /* @index */ , const bool high) = 0; + virtual Core::hresult Pin(const uint8_t pin /* @index */, bool& high /* @out */) const = 0; + }; + + // @brief Acquires a device + // @param name Name of the device to acquire (e.g. "usb") + // @param device Instance of the acquired device + // @retval ERROR_UNAVAILABLE The device is not available + virtual Core::hresult Acquire(const string& name, IDevice*& device /* @out */) = 0; + + // @brief Relinquishes a device + // @param device Device instance to relinquish + // @retval ERROR_UNKNOWN_KEY The device is not acquired + virtual Core::hresult Relinquish(IDevice* const device) = 0; + }; + +} // namespace Example + +} diff --git a/example_interfaces/Module.cpp b/example_interfaces/Module.cpp new file mode 100644 index 00000000..bf440b59 --- /dev/null +++ b/example_interfaces/Module.cpp @@ -0,0 +1,30 @@ + /* + * If not stated otherwise in this file or this component's LICENSE file the + * following copyright and licenses apply: + * + * Copyright 2024 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. + */ + +#include "Module.h" + +#ifdef __WINDOWS__ + +// ProxyStub code needs the definitions on windows for the default +// Contstructor/Destructor implementations, generated EXTERNAL. +#include + +#endif + +MODULE_NAME_DECLARATION(BUILD_REFERENCE) diff --git a/example_interfaces/Module.h b/example_interfaces/Module.h new file mode 100644 index 00000000..0af0f067 --- /dev/null +++ b/example_interfaces/Module.h @@ -0,0 +1,33 @@ +/* + * If not stated otherwise in this file or this component's LICENSE file the + * following copyright and licenses apply: + * + * Copyright 2024 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 + +#ifndef MODULE_NAME +#define MODULE_NAME example_interfaces +#endif + +#include + +#include +#include +#include +#include + +#include "ExampleIds.h" diff --git a/example_interfaces/definitions.h b/example_interfaces/definitions.h new file mode 100644 index 00000000..dd805d1f --- /dev/null +++ b/example_interfaces/definitions.h @@ -0,0 +1,24 @@ +/* + * If not stated otherwise in this file or this component's LICENSE file the + * following copyright and licenses apply: + * + * Copyright 2024 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" + +// To satisfy the generated code.. diff --git a/interfaces/IButler.h b/interfaces/IButler.h index c530a6e6..e600c165 100644 --- a/interfaces/IButler.h +++ b/interfaces/IButler.h @@ -23,7 +23,7 @@ #include #include -// @stubgen:include +// @stubgen:include namespace Thunder { namespace Exchange { diff --git a/interfaces/IContentDecryption.h b/interfaces/IContentDecryption.h index 9c2b7b49..6ca1b509 100644 --- a/interfaces/IContentDecryption.h +++ b/interfaces/IContentDecryption.h @@ -22,6 +22,8 @@ #include "Module.h" #include "IDRM.h" +// @insert + namespace Thunder { namespace Exchange { diff --git a/interfaces/IContentProtection.h b/interfaces/IContentProtection.h index 83724133..720aa323 100644 --- a/interfaces/IContentProtection.h +++ b/interfaces/IContentProtection.h @@ -55,16 +55,22 @@ namespace Exchange { FAILED = 4 /* @text:FAILED */, }; + // (e.g. NOT_REQUIRED) State state; - // @brief same as that returned by the SecManager + // @brief same as that returned by the SecManager. + // For other cases greater than 20000 (e.g. 2) + // @text failureReason int32_t failureReason; }; // @alt onWatermarkStatusChanged // @param sessionId session id for the content protection session + // (e.g. 930762523) // @param appId application that should receive the notification - virtual void WatermarkStatusChanged(uint32_t sessionId, - const string& appId, const Status& status) + virtual void WatermarkStatusChanged( + uint32_t sessionId /* @text:sessionId */, + const string& appId /* @text:appId */, + const Status& status) = 0; }; @@ -73,53 +79,119 @@ namespace Exchange { // @alt openDrmSession // @param clientId client that establishes the playback session + // (e.g. "com.comcast.vipa:1") // @param appId application requesting the new watermarking session // @param licenseRequest base64-encoded DRM license request // @param initData video platform specific init data + // (e.g. "{\"sessionConfiguration\":{\"distributedTraceId\":\"...\"},\"accessToken\":\"...\",\"contentMetadata\":\"...\"}") // @param sessionId generated by SecManager to track sessions + // (e.g. 930762523) // @param response video platform specific response data - virtual uint32_t OpenDrmSession(const string& clientId, - const string& appId, - KeySystem keySystem, const string& licenseRequest, - const string& initData /* @opaque */, - uint32_t& sessionId /* @out */, - string& response /* @text:openSessionResponse @opaque @out */) + // (e.g. "{\"license\":\"...\",\"refreshDuration\":0}") + // @retval 21003 Invalid key system + // @retval 21004 Invalid license request + // @retval 21005 Invalid content metadata + // @retval 21006 Invalid media usage + // @retval 21007 Invalid access token + // @retval 21008 Invalid access attributes + // @retval 21009 Invalid session id + // @retval 21012 Invalid client id + // @retval 21014 Invalid watermarking system + // @retval 21015 Invalid content attributes + // @retval 22001 DRM general failure + // @retval 22003 DRM license timeout + // @retval 22004 DRM license network failure + // @retval 22008 DRM access token expired + // @retval 22011 DRM MAC token not provisioned + // @retval 22012 DRM memory allocation error + // @retval 22013 DRM SecAPI usage failure + // @retval 22016 DRM entitlement error + // @retval 23001 Watermark general failure + // @retval 23003 Watermark request timeout + // @retval 23012 Watermark memory allocation error + virtual uint32_t OpenDrmSession( + const string& clientId /* @text:clientId */, + const string& appId /* @text:appId */, + KeySystem keySystem /* @text:keySystem */, + const string& licenseRequest /* @text:licenseRequest */, + const string& initData /* @text:initData */, + uint32_t& sessionId /* @text:sessionId @out */, + string& response /* @text:openSessionResponse @out */) = 0; // @alt setDrmSessionState // @param sessionId sec manager generated playback session id - virtual uint32_t SetDrmSessionState(uint32_t sessionId, - State sessionState) + // (e.g. 930762523) + // @retval 21009 Invalid session id + virtual uint32_t SetDrmSessionState( + uint32_t sessionId /* @text:sessionId */, + State sessionState /* @text:sessionState */) = 0; // @alt updateDrmSession // @param sessionId sec manager generated playback session id + // (e.g. 930762523) // @param licenseRequest base64-encoded DRM license request // @param initData video platform specific init data + // (e.g. "{\"sessionConfiguration\":{\"distributedTraceId\":\"...\"},\"accessToken\":\"...\",\"contentMetadata\":\"...\"}") // @param response video platform specific response data - virtual uint32_t UpdateDrmSession(uint32_t sessionId, - const string& licenseRequest, - const string& initData /* @opaque */, - string& response /* @text:updateSessionResponse @opaque @out */) + // (e.g. "{\"license\":\"...\",\"refreshDuration\":0}") + // @retval 21003 Invalid key system + // @retval 21004 Invalid license request + // @retval 21005 Invalid content metadata + // @retval 21006 Invalid media usage + // @retval 21007 Invalid access token + // @retval 21008 Invalid access attributes + // @retval 21009 Invalid session id + // @retval 21012 Invalid client id + // @retval 21014 Invalid watermarking system + // @retval 21015 Invalid content attributes + // @retval 22001 DRM general failure + // @retval 22003 DRM license timeout + // @retval 22004 DRM license network failure + // @retval 22008 DRM access token expired + // @retval 22011 DRM MAC token not provisioned + // @retval 22012 DRM memory allocation error + // @retval 22013 DRM SecAPI usage failure + // @retval 22016 DRM entitlement error + // @retval 23001 Watermark general failure + // @retval 23003 Watermark request timeout + // @retval 23012 Watermark memory allocation error + virtual uint32_t UpdateDrmSession( + uint32_t sessionId /* @text:sessionId */, + const string& licenseRequest /* @text:licenseRequest */, + const string& initData /* @text:initData */, + string& response /* @text:updateSessionResponse @out */) = 0; // @alt closeDrmSession // @param sessionId sec manager generated playback session id - virtual uint32_t CloseDrmSession(uint32_t sessionId) = 0; + // (e.g. 930762523) + // @param response video platform specific response data + // @retval 21009 Invalid session id + // @retval 21012 Invalid client id + virtual uint32_t CloseDrmSession( + uint32_t sessionId /* @text:sessionId */, + string& response /* @text:closeSessionResponse @out */) + = 0; // @alt showWatermark // @param sessionId id returned on a call to openDrmSession + // (e.g. 930762523) // @param show true when watermark has to be presented - virtual uint32_t ShowWatermark(uint32_t sessionId, + virtual uint32_t ShowWatermark( + uint32_t sessionId /* @text:sessionId */, bool show, - const uint8_t opacityLevel /* @restrict:0..100 */) + const uint8_t opacityLevel /* @text:opacityLevel @restrict:0..100 */) = 0; // @alt setPlaybackPosition // @param sessionId sec manager generated playback session id + // (e.g. 930762523) // @param speed current playback speed // @param position current playback position - virtual uint32_t SetPlaybackPosition(uint32_t sessionId, + virtual uint32_t SetPlaybackPosition( + uint32_t sessionId /* @text:sessionId */, int32_t speed, long position) = 0; }; diff --git a/interfaces/ICompositionBuffer.h b/interfaces/IGraphicsBuffer.h similarity index 90% rename from interfaces/ICompositionBuffer.h rename to interfaces/IGraphicsBuffer.h index e7d42ec8..88668718 100644 --- a/interfaces/ICompositionBuffer.h +++ b/interfaces/IGraphicsBuffer.h @@ -24,30 +24,30 @@ namespace Thunder { namespace Exchange { - // The ICompositionBuffer is an interface definition to communicate across + // The IGraphicsBuffer is an interface definition to communicate across // process boundaries between two actors, the Client and the Compositor. // Client: Producing content in the buffer // Compositor: Consuming the content (move to another Buffer) // // From a Client perspective: - // 1) ICompositionBuffer::Acquire(50) + // 1) IGraphicsBuffer::Acquire(50) // Locks the planes so the Compositor can not and will not use this // buffer in the process of creating a new composition. // 2) IIterator::Plane::Accessor() // Write anything the client likes onto the buffer - // 3) ICompositionBuffer::Relinquish() + // 3) IGraphicsBuffer::Relinquish() // Unlock the planes, the Compositor can use/consume what is on the // buffer and move it to wherever the compositor likes. // // From a Compositor perspective: // 1) a screen update is requested, iterate over all Buffers available - // in the Compositor and call ICompositionBuffer::Acquire(0), no need + // in the Compositor and call IGraphicsBuffer::Acquire(0), no need // to wait cause if the producer (Client) is working on the buffer we // do not want to consume it. // 2) IIterator::Plane::Accessor() // Read anything from the buffer the client has written on it and move it // to a new buffer. - // 3) ICompositionBuffer::Relinquish() + // 3) IGraphicsBuffer::Relinquish() // Unlock the planes, the Client can use/produce new contents on the // buffer. The content how it was is now copied to a new location. @@ -58,8 +58,8 @@ namespace Exchange { // to enforce the best performance! // @stubgen:omit - struct EXTERNAL ICompositionBuffer { - virtual ~ICompositionBuffer() = default; + struct EXTERNAL IGraphicsBuffer { + virtual ~IGraphicsBuffer() = default; /** * @brief frame buffer interface with hardware optimisation in mind @@ -88,6 +88,7 @@ namespace Exchange { // agnostic) can now not access the planes, they have to // wait till they become availabe again..... virtual IIterator* Acquire(const uint32_t timeoutMs) = 0; + // Relinquish (unlock) the Planes. End lifetime of the IIterator // received from Planes() virtual void Relinquish() = 0; @@ -98,7 +99,7 @@ namespace Exchange { virtual uint64_t Modifier() const = 0; // Pixel arrangement in the buffer, used to optimize for hardware virtual DataType Type() const = 0; - }; // struct IPlainBuffer + }; // struct IGraphicsBuffer } // namespace Exchange diff --git a/interfaces/IIOConnector.h b/interfaces/IIOConnector.h new file mode 100644 index 00000000..240f1cc9 --- /dev/null +++ b/interfaces/IIOConnector.h @@ -0,0 +1,60 @@ +/* +* If not stated otherwise in this file or this component's LICENSE file the +* following copyright and licenses apply: +* +* Copyright 2021 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 Exchange { + + // @json 1.0.0 @text:legacy_lowercase + struct EXTERNAL IIOConnector : virtual public Core::IUnknown { + + enum { ID = ID_IOCONNECTOR }; + + // @event + struct EXTERNAL INotification : virtual public Core::IUnknown { + + enum { ID = ID_IOCONNECTOR_NOTIFICATION }; + + // @brief Notifies about GPIO pin activity + // @description Register to this event to be notified about pin value changes + // @param id: pin ID (e.g. 189) + // @param value: value of the pin (e.g. 1) + virtual void Activity(const uint16_t id /* @index */, const int32_t value) = 0; + }; + + virtual Core::hresult Register(const uint16_t id, INotification* const notification) = 0; + virtual Core::hresult Unregister(const uint16_t id, const INotification* const notification) = 0; + + // @property + // @brief GPIO pin value + // @param id: pin ID (e.g. 189) + // @param value: value of the pin (e.g. 1) + // @retval ERROR_UNKNOWN_KEY Unknown pin ID given + virtual Core::hresult Pin(const uint16_t id /* @index */, const int32_t value) = 0; + virtual Core::hresult Pin(const uint16_t id /* @index */, int32_t& value /* @out */) const = 0; + + }; + +} // namespace Exchange + +} diff --git a/interfaces/IInputSwitch.h b/interfaces/IInputSwitch.h index e9aa3e91..c48df090 100644 --- a/interfaces/IInputSwitch.h +++ b/interfaces/IInputSwitch.h @@ -20,6 +20,8 @@ #pragma once #include "Module.h" +// @insert + namespace Thunder { namespace Exchange { diff --git a/interfaces/IPluginAsyncStateControl.h b/interfaces/IPluginAsyncStateControl.h new file mode 100644 index 00000000..72826db1 --- /dev/null +++ b/interfaces/IPluginAsyncStateControl.h @@ -0,0 +1,64 @@ +/* + * If not stated otherwise in this file or this component's LICENSE file the + * following copyright and licenses apply: + * + * Copyright 2025 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 Exchange { + + struct EXTERNAL IPluginAsyncStateControl : virtual public Core::IUnknown { + + enum { ID = ID_PLUGINASYNCSTATECONTROL }; + + ~IPluginAsyncStateControl() override = default; + + struct EXTERNAL IActivationCallback : virtual public Core::IUnknown { + enum { ID = ID_PLUGINASYNCSTATECONTROL_ACTIVATIONCALLBACK }; + ~IActivationCallback() override = default; + + enum class state : uint8_t { + SUCCESS, + FAILURE, + ABORTED + }; + + // @brief callback called when an activation request has finished. Note this can be called while the Activate call has not yet returned + // @param state result state of the activation request (ABORTED when AbortActivate was called AND the plugin did not reach activated state yet before the request was aborted, otherwise SUCCESS will be reported as a result of an AbortActivate request) + // @param numberofretries Number of retries that happened the moment this callback was called + virtual void Finished(const string& callsign, const state state, const uint8_t numberofretries) = 0; + }; + + // @brief Activate a plugin. Passed callbcak will be called on failure or success + // @param callsign: callsign of plugin to activate + // @param maxnumberretries: maximum number of retries to initialize the plugin (default used when not specified) + // @param delay: delay to be used (in ms) between initialization retries (default used when not specified) + // @param cb: callback interface called on success or failure + // @retval ERROR_INPROGRESS Activation request is already in progress for this callsign + // @retval ERROR_ILLEGAL_STATE Plugin with this callsign is in an invalid state for it to be able to be started (e.g. DESTROYED or UNAVAILABLE) + // @retval ERROR_NOT_EXIST Plugin is unknown to Thunder (at this moment in case of Dynamic plugins) + virtual Core::hresult Activate(const string& callsign, const Core::OptionalType& maxnumberretries, const Core::OptionalType& delay, IActivationCallback* const cb) = 0; + + // @brief Abort a previously started Activate request + // @retval ERROR_NOT_EXIST There is no ongoing activation request + virtual Core::hresult AbortActivate(const string& callsign) = 0; + + }; +} +} diff --git a/interfaces/IPower.h b/interfaces/IPower.h index 275faaee..d6cefaba 100644 --- a/interfaces/IPower.h +++ b/interfaces/IPower.h @@ -18,14 +18,19 @@ */ #pragma once + #include "Module.h" namespace Thunder { + namespace Exchange { + // @json 1.0.0 @text:legacy_lowercase struct EXTERNAL IPower : virtual public Core::IUnknown { + enum { ID = ID_POWER }; + // @text:keep enum PCState : uint8_t { On = 1, // S0. ActiveStandby = 2, // S1. @@ -40,19 +45,42 @@ namespace Exchange { After = 2 }; + // @event struct EXTERNAL INotification : virtual public Core::IUnknown { + enum { ID = ID_POWER_NOTIFICATION }; - virtual void StateChange(const PCState origin, const PCState destination, const PCPhase phase) = 0; + // @brief Signals a change in the power state + // @param origin: The state the device is transitioning from (e.g. ActiveStandby) + // @param destination: The state the device is transitioning to (e.g. SuspendToRAM) + // @param phase: The phase of the transition (e.g. After) + virtual Core::hresult StateChange(const PCState origin, const PCState destination, const PCPhase phase) = 0; }; - virtual void Register(IPower::INotification* sink) = 0; - virtual void Unregister(IPower::INotification* sink) = 0; + virtual Core::hresult Register(INotification* const sink) = 0; + virtual Core::hresult Unregister(const INotification* const sink) = 0; + + // @property + // @alt:deprecated state + // @brief Get the current power state + // @param state: The current power state (e.g. PassiveStandby) + virtual Core::hresult GetState(PCState& state /* @out */) const = 0; - virtual PCState GetState() const = 0; - virtual uint32_t SetState(const PCState, const uint32_t) = 0; + // @brief Set the power state + // @alt:deprecated set + // @param state: The power state to set (e.g. Hibernate) + // @param waitTime: The time to wait for the power state to be set in seconds (e.g. 10) + // @retval ERROR_GENERAL: General failure + // @retval ERROR_DUPLICATE_KEY: Trying to set the same power mode + // @retval ERROR_ILLEGAL_STATE: Power state is not supported + // @retval ERROR_BAD_REQUEST: Invalid Power state or Bad JSON param data format + virtual Core::hresult SetState(const PCState& state, const uint32_t waitTime) = 0; + + // @json:omit virtual void PowerKey() = 0; }; -} + +} // namespace Exchange + } diff --git a/interfaces/IProvisioning.h b/interfaces/IProvisioning.h index fda20c40..4c86af7c 100644 --- a/interfaces/IProvisioning.h +++ b/interfaces/IProvisioning.h @@ -20,6 +20,8 @@ #pragma once #include "Module.h" +// @insert + namespace Thunder { namespace Exchange { diff --git a/interfaces/ISecurityAgent.h b/interfaces/ISecurityAgent.h index be9b04dd..3bc12283 100644 --- a/interfaces/ISecurityAgent.h +++ b/interfaces/ISecurityAgent.h @@ -32,11 +32,11 @@ namespace Exchange { // @brief Validates a token // @description Checks whether the token is valid and properly signed - // @param Token that will be validated (e.g. eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9) - // @param Tells whether token's signature is correct + // @param token Token that will be validated (e.g. eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9) + // @param valid Tells whether token's signature is correct virtual Core::hresult Validate(const string& token, bool& valid /* @out */) const = 0; }; } // namespace Exchange -} \ No newline at end of file +} diff --git a/interfaces/IStream.h b/interfaces/IStream.h index 37df8030..915c82d4 100644 --- a/interfaces/IStream.h +++ b/interfaces/IStream.h @@ -20,6 +20,8 @@ #pragma once #include "Module.h" +// @insert + #define WPEPLAYER_PROCESS_NODE_ID "/tmp/player" namespace Thunder { diff --git a/interfaces/ISubsystemControl.h b/interfaces/ISubsystemControl.h new file mode 100644 index 00000000..49154479 --- /dev/null +++ b/interfaces/ISubsystemControl.h @@ -0,0 +1,46 @@ +/* +* If not stated otherwise in this file or this component's LICENSE file the +* following copyright and licenses apply: +* +* Copyright 2021 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" + +// @stubgen:include + +namespace Thunder { + +namespace Exchange { + + // @json 1.0.0 @text:legacy_lowercase + struct EXTERNAL ISubsystemControl : virtual public Core::IUnknown { + + enum { ID = ID_SUBSYSTEM_CONTROL }; + + // @brief Activates a subsystem + // @description This method allows a subsystem to be activated from the outside. This is usefull in case Thunder can not determine the availability of a subsystem but it needs to be triggered from the outside. + // @param subsystem: Subsystem to activate (e.g. network) + // @param configuration: A JSON string that holds the information applicable to the subsystem to be activated + // @retval ERROR_BAD_REQUEST: Setting a subsystem to disabled is not supported + virtual Core::hresult Activate(const PluginHost::ISubSystem::subsystem subsystem, const Core::OptionalType& configuration /* @opaque */) = 0; + + }; + +} // namespace Exchange + +} \ No newline at end of file diff --git a/interfaces/ISystemCommands.h b/interfaces/ISystemCommands.h index 0b39ab9f..a3e2d0f0 100644 --- a/interfaces/ISystemCommands.h +++ b/interfaces/ISystemCommands.h @@ -18,17 +18,24 @@ */ #pragma once -#include "Module.h" +#include "Module.h" namespace Thunder { + namespace Exchange { - // @stubgen:omit + // @json 1.0.0 @text:legacy_lowercase struct EXTERNAL ISystemCommands : virtual public Core::IUnknown { + enum { ID = ID_SYSTEMCOMMAND }; - virtual uint32_t USBReset(const string& device) = 0; + // @brief Resets a USB device + // @description With this method a USB device can be reset using USBFS_RESET ioctl command + // @param device: USB device to reset (e.g. /dev/usb/001) + // @retval ERROR_GENERAL Failed to reset USB device + // @retval ERROR_UNAVAILABLE Unknown USB device + virtual Core::hresult USBReset(const string& device) = 0; }; } } diff --git a/interfaces/ITextToSpeech.h b/interfaces/ITextToSpeech.h index 3768af21..c509d0be 100644 --- a/interfaces/ITextToSpeech.h +++ b/interfaces/ITextToSpeech.h @@ -1,6 +1,8 @@ #ifndef __ITEXTTOSPEECH_H #define __ITEXTTOSPEECH_H +// @insert + #include "Module.h" namespace Thunder { diff --git a/interfaces/ITimeSync.h b/interfaces/ITimeSync.h index 3c98bae1..2ba12966 100644 --- a/interfaces/ITimeSync.h +++ b/interfaces/ITimeSync.h @@ -18,32 +18,82 @@ */ #pragma once -#include "Module.h" +#include "Module.h" namespace Thunder { + namespace Exchange { - // @stubgen:omit - // This interface gives direct access to a time synchronize / update + // @json 1.0.0 @text:legacy_lowercase struct EXTERNAL ITimeSync : virtual public Core::IUnknown { + + // This interface gives direct access to a time synchronize / update + struct EXTERNAL ISource : virtual public Core::IUnknown { + + enum { ID = ID_TIMESYNC_ISOURCE }; + + struct EXTERNAL INotification : virtual public Core::IUnknown { + + enum { ID = ID_TIMESYNC_ISOURCE_NOTIFICATION }; + + // Some change happened with respect to the Network.. + virtual void Completed() = 0; + }; + + virtual void Register(INotification* notification) = 0; + virtual void Unregister(INotification* notification) = 0; + + virtual uint32_t Synchronize() = 0; + virtual void Cancel() = 0; + virtual string Source() const = 0; + virtual uint64_t SyncTime() const = 0; + }; + enum { ID = ID_TIMESYNC }; + struct TimeInfo { + Core::Time time /* @brief Synchronized time (in ISO8601 format); empty string if the time has never been synchronized (e.g. 2019-05-07T07:20:26Z) */; + Core::OptionalType source /* @brief The synchronization source like an NTP server (e.g. ntp://example.com) */; + }; + + // @event struct EXTERNAL INotification : virtual public Core::IUnknown { + enum { ID = ID_TIMESYNC_NOTIFICATION }; - // Some change happened with respect to the Network.. - virtual void Completed() = 0; + // @brief Signals a time change + // @alt:deprecated timechange + // @description Some change happened with respect to the Network + virtual void TimeChanged() = 0; }; - virtual void Register(INotification* notification) = 0; - virtual void Unregister(INotification* notification) = 0; + virtual Core::hresult Register(INotification* const notification) = 0; + virtual Core::hresult Unregister(const INotification* const notification) = 0; + + // @brief Synchronizes time + // @deprecated + // @description Use this method to synchronize the system time with the currently configured time source. If automatic time synchronization is initially disabled or canceled, it will be restarted + // @retval ERROR_INPROGRESS: Returned when the method is called while previously triggered synchronization is in progress + // @retval ERROR_INCOMPLETE_CONFIG: Returned when the source configuration is missing or invalid + DEPRECATED virtual Core::hresult Synchronize() = 0; + + // @property + // @brief Time of the most recent synchronization + // @retval ERROR_UNAVAILABLE: There has not been any successful time synchronization yet + virtual Core::hresult SyncTime(TimeInfo& info /* @out */) const = 0; + + // @property + // @brief Current system time + // @description Upon setting this property automatic time synchronization will be stopped. Usage of this property is deprecated and the SubSystem control plugin can be used as an alternative to achieve the same + // @param time: System time in ISO8601 format (e.g. 2019-05-07T07:20:26Z) + // @retval ERROR_BAD_REQUEST: The time is invalid + virtual Core::hresult Time(Core::Time& time /* @out */) const = 0; + // @deprecated + DEPRECATED virtual Core::hresult Time(const Core::Time& time) = 0; - virtual uint32_t Synchronize() = 0; - virtual void Cancel() = 0; - virtual string Source() const = 0; - virtual uint64_t SyncTime() const = 0; }; } // namespace Exchange -} // namespace Thunder + +} diff --git a/interfaces/IWifiControl.h b/interfaces/IWifiControl.h index 40302c30..99fc1bdb 100644 --- a/interfaces/IWifiControl.h +++ b/interfaces/IWifiControl.h @@ -54,28 +54,28 @@ namespace Exchange { }; Security method /* @brief Security method */; - Key keys /* @encode:bitmask @brief Security Keys */; + Core::OptionalType keys /* @encode:bitmask @brief Security Keys */; }; using ISecurityIterator = RPC::IIteratorType; struct NetworkInfo { - string ssid /* @brief SSID of the network */; - uint64_t bssid /* @brief BSSID of the network */; - uint32_t frequency /* @brief Frequency used */; - int32_t signal /* @brief Signal strength */; - Security security /* @encode:bitmask @brief Security method */; + Core::OptionalType ssid /* @brief SSID of the network */; + uint64_t bssid /* @brief BSSID of the network */; + uint32_t frequency /* @brief Frequency used */; + int32_t signal /* @brief Signal strength */; + Security security /* @encode:bitmask @brief Security method */; }; using INetworkInfoIterator = RPC::IIteratorType; using IStringIterator = RPC::IIteratorType; struct ConfigInfo { - bool hidden /* @brief Visibility of the router (hidden or visible) */; - bool accesspoint /* @brief Accesspoint or not */; - string ssid /* @brief SSID of the router/ap */; - string secret /* @brief Secret key used */; - string identity /* @brief Identity */; - Security method /* @brief Security method */; - SecurityInfo::Key key /* @brief Security Info: method and keys */; + bool hidden /* @brief Visibility of the router (hidden or visible) */; + bool accesspoint /* @brief Accesspoint or not */; + Core::OptionalType ssid /* @brief SSID of the router/ap */; + Core::OptionalType secret /* @brief Secret key used */; + Core::OptionalType identity /* @brief Identity */; + Security method /* @brief Security method */; + Core::OptionalType key /* @brief Security Info: method and keys */; }; // @event diff --git a/interfaces/Ids.h b/interfaces/Ids.h index 07949489..3ff8beb2 100644 --- a/interfaces/Ids.h +++ b/interfaces/Ids.h @@ -103,6 +103,8 @@ namespace Exchange { ID_TIMESYNC = RPC::IDS::ID_EXTERNAL_INTERFACE_OFFSET + 0x0D0, ID_TIMESYNC_NOTIFICATION = ID_TIMESYNC + 1, + ID_TIMESYNC_ISOURCE = ID_TIMESYNC + 2, + ID_TIMESYNC_ISOURCE_NOTIFICATION = ID_TIMESYNC + 3, ID_IPNETWORK = RPC::IDS::ID_EXTERNAL_INTERFACE_OFFSET + 0x0E0, ID_IPNETWORK_DNSSERVER = ID_IPNETWORK + 1, @@ -312,98 +314,108 @@ namespace Exchange { ID_STORE = RPC::IDS::ID_EXTERNAL_INTERFACE_OFFSET + 0x440, ID_STORE_NOTIFICATION = ID_STORE + 1, - ID_STORE_CACHE = ID_STORE + 2, - ID_STORE2 = ID_STORE + 3, - ID_STORE2_NOTIFICATION = ID_STORE + 4, - ID_STORE_INSPECTOR = ID_STORE + 5, - ID_STORE_INSPECTOR_NAMESPACE_SIZE_ITERATOR = ID_STORE + 6, - ID_STORE_LIMIT = ID_STORE + 7, - - ID_LISA = RPC::IDS::ID_EXTERNAL_INTERFACE_OFFSET + 0x450, - ID_LISA_NOTIFICATION = ID_LISA + 1, - ID_LISA_APP_VERSION = ID_LISA + 2, - ID_LISA_APP_VERSION_ITERATOR = ID_LISA + 3, - ID_LISA_APP = ID_LISA + 4, - ID_LISA_APP_ITERATOR = ID_LISA + 5, - ID_LISA_APPS_PAYLOAD = ID_LISA + 6, - ID_LISA_STORAGE = ID_LISA + 7, - ID_LISA_STORAGE_PAYLOAD = ID_LISA + 8, - ID_LISA_PROGRESS = ID_LISA + 9, - ID_LISA_KEY_VALUE = ID_LISA + 10, - ID_LISA_KEY_VALUE_ITERATOR = ID_LISA + 11, - ID_LISA_METADATA_PAYLOAD = ID_LISA + 12, - ID_LISA_LOCK_INFO = ID_LISA + 13, - ID_LISA_HANDLE_RESULT = ID_LISA + 14, - - ID_PACKAGEMANAGER = RPC::IDS::ID_EXTERNAL_INTERFACE_OFFSET + 0x460, - ID_PACKAGEMANAGER_KEY_VALUE_ITERATOR = ID_PACKAGEMANAGER + 1, - ID_PACKAGEMANAGER_NOTIFICATION = ID_PACKAGEMANAGER + 2, - ID_PACKAGEMANAGER_PACKAGE_KEY_ITERATOR = ID_PACKAGEMANAGER + 3, - ID_PACKAGEMANAGER_BROKER = ID_PACKAGEMANAGER + 4, - ID_PACKAGEMANAGER_CALLBACK = ID_PACKAGEMANAGER + 5, - - ID_RUST_BRIDGE = RPC::IDS::ID_EXTERNAL_INTERFACE_OFFSET + 0x470, - ID_RUST_BRIDGE_NOTIFICATION = ID_RUST_BRIDGE + 1, - - ID_WIFICONTROL = RPC::IDS::ID_EXTERNAL_INTERFACE_OFFSET + 0x480, - ID_WIFICONTROL_NOTIFICATION = ID_WIFICONTROL + 1, - ID_WIFICONTROL_NETWORK_INFO_ITERATOR = ID_WIFICONTROL + 2, - ID_WIFICONTROL_SECURITY_INFO_ITERATOR = ID_WIFICONTROL + 3, - - ID_NETWORKCONTROL = RPC::IDS::ID_EXTERNAL_INTERFACE_OFFSET + 0x490, - ID_NETWORKCONTROL_NOTIFICATION = ID_NETWORKCONTROL + 1, - ID_NETWORKCONTROL_NETWORK_INFO_ITERATOR = ID_NETWORKCONTROL + 2, - - ID_WATCHDOG = RPC::IDS::ID_EXTERNAL_INTERFACE_OFFSET + 0x4A0, - - ID_SCRIPT_ENGINE = RPC::IDS::ID_EXTERNAL_INTERFACE_OFFSET + 0x4B0, - ID_SCRIPT_ENGINE_NOTIFICATION = ID_SCRIPT_ENGINE + 1, - - ID_TEXT_TO_SPEECH = RPC::IDS::ID_EXTERNAL_INTERFACE_OFFSET + 0x4C0, - ID_TEXT_TO_SPEECH_NOTIFICATION = ID_TEXT_TO_SPEECH + 1, - - ID_CRYPTOGRAPHY = RPC::IDS::ID_EXTERNAL_INTERFACE_OFFSET + 0x4D0, - ID_CRYPTOGRAPHY_VAULT = ID_CRYPTOGRAPHY + 1, - ID_CRYPTOGRAPHY_HASH = ID_CRYPTOGRAPHY + 2, - ID_CRYPTOGRAPHY_CIPHER = ID_CRYPTOGRAPHY + 3, - ID_CRYPTOGRAPHY_DIFFIEHELLMAN = ID_CRYPTOGRAPHY + 4, - ID_CRYPTOGRAPHY_PERSISTENT = ID_CRYPTOGRAPHY + 5, - ID_CRYPTOGRAPHY_RANDOM = ID_CRYPTOGRAPHY + 6, - ID_CRYPTOGRAPHY_DEVICEOBJECTS = ID_CRYPTOGRAPHY + 7, - - ID_DNS_SERVER = RPC::IDS::ID_EXTERNAL_INTERFACE_OFFSET + 0x4E0, - ID_DNS_ZONE = ID_DNS_SERVER + 1, - ID_DNS_RECORD = ID_DNS_SERVER + 2, - - ID_USB_HUB = RPC::IDS::ID_EXTERNAL_INTERFACE_OFFSET + 0x4F0, - ID_USB_HUB_NOTIFICATION = ID_USB_HUB + 1, - ID_USB_DEVICE = ID_USB_HUB + 2, - - ID_TESTAUTOMATIONMEMORY = RPC::IDS::ID_EXTERNAL_INTERFACE_OFFSET + 0x9F0, - ID_TESTAUTOMATIONCOMRPC = ID_TESTAUTOMATIONMEMORY + 1, - ID_TESTAUTOMATIONCOMRPCINTERNAL = ID_TESTAUTOMATIONMEMORY + 2, - - ID_CONTENTPROTECTION = RPC::IDS::ID_EXTERNAL_INTERFACE_OFFSET + 0x500, - ID_CONTENTPROTECTION_NOTIFICATION = ID_CONTENTPROTECTION + 1, - - ID_WATERMARK = RPC::IDS::ID_EXTERNAL_INTERFACE_OFFSET + 0x510, - ID_WATERMARK_NOTIFICATION = ID_WATERMARK + 2, - - ID_SYSTEMAUDIOPLAYER = RPC::IDS::ID_EXTERNAL_INTERFACE_OFFSET + 0x520, - ID_SYSTEMAUDIOPLAYER_NOTIFICATION = ID_SYSTEMAUDIOPLAYER + 1, - - ID_BLUETOOTHREMOTECONTROL = RPC::IDS::ID_EXTERNAL_INTERFACE_OFFSET + 0x530, - ID_BLUETOOTHREMOTECONTROL_NOTIFICATION = ID_BLUETOOTHREMOTECONTROL + 1, - - ID_DEVICEIDENTIFICATION = RPC::IDS::ID_EXTERNAL_INTERFACE_OFFSET + 0x540, - - ID_SECURITYAGENT = RPC::IDS::ID_EXTERNAL_INTERFACE_OFFSET + 0x550, - - ID_LOCATIONSYNC = RPC::IDS::ID_EXTERNAL_INTERFACE_OFFSET + 0x560, - ID_LOCATIONSYNC_NOTIFICATION = ID_LOCATIONSYNC + 1, - - ID_MEMORY_MONITOR = RPC::IDS::ID_EXTERNAL_INTERFACE_OFFSET + 0x570, - ID_MEMORY_MONITOR_NOTIFICATION = ID_MEMORY_MONITOR + 1 + ID_STORE_CACHE = ID_STORE + 2, + ID_STORE2 = ID_STORE + 3, + ID_STORE2_NOTIFICATION = ID_STORE + 4, + ID_STORE_INSPECTOR = ID_STORE + 5, + ID_STORE_INSPECTOR_NAMESPACE_SIZE_ITERATOR = ID_STORE + 6, + ID_STORE_LIMIT = ID_STORE + 7, + + ID_LISA = RPC::IDS::ID_EXTERNAL_INTERFACE_OFFSET + 0x450, + ID_LISA_NOTIFICATION = ID_LISA + 1, + ID_LISA_APP_VERSION = ID_LISA + 2, + ID_LISA_APP_VERSION_ITERATOR = ID_LISA + 3, + ID_LISA_APP = ID_LISA + 4, + ID_LISA_APP_ITERATOR = ID_LISA + 5, + ID_LISA_APPS_PAYLOAD = ID_LISA + 6, + ID_LISA_STORAGE = ID_LISA + 7, + ID_LISA_STORAGE_PAYLOAD = ID_LISA + 8, + ID_LISA_PROGRESS = ID_LISA + 9, + ID_LISA_KEY_VALUE = ID_LISA + 10, + ID_LISA_KEY_VALUE_ITERATOR = ID_LISA + 11, + ID_LISA_METADATA_PAYLOAD = ID_LISA + 12, + ID_LISA_LOCK_INFO = ID_LISA + 13, + ID_LISA_HANDLE_RESULT = ID_LISA + 14, + + ID_PACKAGEMANAGER = RPC::IDS::ID_EXTERNAL_INTERFACE_OFFSET + 0x460, + ID_PACKAGEMANAGER_KEY_VALUE_ITERATOR = ID_PACKAGEMANAGER + 1, + ID_PACKAGEMANAGER_NOTIFICATION = ID_PACKAGEMANAGER + 2, + ID_PACKAGEMANAGER_PACKAGE_KEY_ITERATOR = ID_PACKAGEMANAGER + 3, + ID_PACKAGEMANAGER_BROKER = ID_PACKAGEMANAGER + 4, + ID_PACKAGEMANAGER_CALLBACK = ID_PACKAGEMANAGER + 5, + + ID_RUST_BRIDGE = RPC::IDS::ID_EXTERNAL_INTERFACE_OFFSET + 0x470, + ID_RUST_BRIDGE_NOTIFICATION = ID_RUST_BRIDGE + 1, + + ID_WIFICONTROL = RPC::IDS::ID_EXTERNAL_INTERFACE_OFFSET + 0x480, + ID_WIFICONTROL_NOTIFICATION = ID_WIFICONTROL + 1, + ID_WIFICONTROL_NETWORK_INFO_ITERATOR = ID_WIFICONTROL + 2, + ID_WIFICONTROL_SECURITY_INFO_ITERATOR = ID_WIFICONTROL + 3, + + ID_NETWORKCONTROL = RPC::IDS::ID_EXTERNAL_INTERFACE_OFFSET + 0x490, + ID_NETWORKCONTROL_NOTIFICATION = ID_NETWORKCONTROL + 1, + ID_NETWORKCONTROL_NETWORK_INFO_ITERATOR = ID_NETWORKCONTROL + 2, + + ID_WATCHDOG = RPC::IDS::ID_EXTERNAL_INTERFACE_OFFSET + 0x4A0, + + ID_SCRIPT_ENGINE = RPC::IDS::ID_EXTERNAL_INTERFACE_OFFSET + 0x4B0, + ID_SCRIPT_ENGINE_NOTIFICATION = ID_SCRIPT_ENGINE + 1, + + ID_TEXT_TO_SPEECH = RPC::IDS::ID_EXTERNAL_INTERFACE_OFFSET + 0x4C0, + ID_TEXT_TO_SPEECH_NOTIFICATION = ID_TEXT_TO_SPEECH + 1, + + ID_CRYPTOGRAPHY = RPC::IDS::ID_EXTERNAL_INTERFACE_OFFSET + 0x4D0, + ID_CRYPTOGRAPHY_VAULT = ID_CRYPTOGRAPHY + 1, + ID_CRYPTOGRAPHY_HASH = ID_CRYPTOGRAPHY + 2, + ID_CRYPTOGRAPHY_CIPHER = ID_CRYPTOGRAPHY + 3, + ID_CRYPTOGRAPHY_DIFFIEHELLMAN = ID_CRYPTOGRAPHY + 4, + ID_CRYPTOGRAPHY_PERSISTENT = ID_CRYPTOGRAPHY + 5, + ID_CRYPTOGRAPHY_RANDOM = ID_CRYPTOGRAPHY + 6, + ID_CRYPTOGRAPHY_DEVICEOBJECTS = ID_CRYPTOGRAPHY + 7, + + ID_DNS_SERVER = RPC::IDS::ID_EXTERNAL_INTERFACE_OFFSET + 0x4E0, + ID_DNS_ZONE = ID_DNS_SERVER + 1, + ID_DNS_RECORD = ID_DNS_SERVER + 2, + + ID_USB_HUB = RPC::IDS::ID_EXTERNAL_INTERFACE_OFFSET + 0x4F0, + ID_USB_HUB_NOTIFICATION = ID_USB_HUB + 1, + ID_USB_DEVICE = ID_USB_HUB + 2, + + ID_TESTAUTOMATIONMEMORY = RPC::IDS::ID_EXTERNAL_INTERFACE_OFFSET + 0x9F0, + ID_TESTAUTOMATIONCOMRPC = ID_TESTAUTOMATIONMEMORY + 1, + ID_TESTAUTOMATIONCOMRPCINTERNAL = ID_TESTAUTOMATIONMEMORY + 2, + + ID_CONTENTPROTECTION = RPC::IDS::ID_EXTERNAL_INTERFACE_OFFSET + 0x500, + ID_CONTENTPROTECTION_NOTIFICATION = ID_CONTENTPROTECTION + 1, + + ID_WATERMARK = RPC::IDS::ID_EXTERNAL_INTERFACE_OFFSET + 0x510, + ID_WATERMARK_NOTIFICATION = ID_WATERMARK + 2, + + ID_SYSTEMAUDIOPLAYER = RPC::IDS::ID_EXTERNAL_INTERFACE_OFFSET + 0x520, + ID_SYSTEMAUDIOPLAYER_NOTIFICATION = ID_SYSTEMAUDIOPLAYER + 1, + + ID_BLUETOOTHREMOTECONTROL = RPC::IDS::ID_EXTERNAL_INTERFACE_OFFSET + 0x530, + ID_BLUETOOTHREMOTECONTROL_NOTIFICATION = ID_BLUETOOTHREMOTECONTROL + 1, + + ID_DEVICEIDENTIFICATION = RPC::IDS::ID_EXTERNAL_INTERFACE_OFFSET + 0x540, + + ID_SECURITYAGENT = RPC::IDS::ID_EXTERNAL_INTERFACE_OFFSET + 0x550, + + ID_LOCATIONSYNC = RPC::IDS::ID_EXTERNAL_INTERFACE_OFFSET + 0x560, + ID_LOCATIONSYNC_NOTIFICATION = ID_LOCATIONSYNC + 1, + ID_SAMPLEITERATOR = ID_LOCATIONSYNC + 2, + ID_SAMPLEITERATOR2 = ID_LOCATIONSYNC + 3, + + ID_MEMORY_MONITOR = RPC::IDS::ID_EXTERNAL_INTERFACE_OFFSET + 0x570, + ID_MEMORY_MONITOR_NOTIFICATION = ID_MEMORY_MONITOR + 1, + + ID_IOCONNECTOR = RPC::IDS::ID_EXTERNAL_INTERFACE_OFFSET + 0x580, + ID_IOCONNECTOR_NOTIFICATION = ID_IOCONNECTOR + 1, + + ID_SUBSYSTEM_CONTROL = RPC::IDS::ID_EXTERNAL_INTERFACE_OFFSET + 0x590, + + ID_PLUGINASYNCSTATECONTROL = RPC::IDS::ID_EXTERNAL_INTERFACE_OFFSET + 0x5A0, + ID_PLUGINASYNCSTATECONTROL_ACTIVATIONCALLBACK = ID_PLUGINASYNCSTATECONTROL + 1 }; } } diff --git a/interfaces/Interfaces.vcxproj b/interfaces/Interfaces.vcxproj index fd1b924e..487190f6 100644 --- a/interfaces/Interfaces.vcxproj +++ b/interfaces/Interfaces.vcxproj @@ -69,6 +69,7 @@ + @@ -125,6 +126,7 @@ + @@ -140,6 +142,7 @@ + @@ -150,6 +153,7 @@ + @@ -386,4 +390,13 @@ + + + + + + + + + \ No newline at end of file diff --git a/interfaces/Interfaces.vcxproj.filters b/interfaces/Interfaces.vcxproj.filters index 6e81a224..75d6ce4d 100644 --- a/interfaces/Interfaces.vcxproj.filters +++ b/interfaces/Interfaces.vcxproj.filters @@ -1,436 +1,150 @@  - - Source Files - - - Generated Files - - - Generated Files - - - Generated Files - - - Generated Files - - - Generated Files - - - Generated Files - - - Generated Files - - - Generated Files - - - Generated Files - - - Generated Files - - - Generated Files - - - Generated Files - - - Generated Files - - - Generated Files - - - Generated Files - - - Generated Files - - - Generated Files - - - Generated Files - - - Generated Files - - - Generated Files - - - Generated Files - - - Generated Files - - - Generated Files - - - Generated Files - - - Generated Files - - - Generated Files - - - Generated Files - - - Generated Files - - - Generated Files - - - Generated Files - - - Generated Files - - - Generated Files - - - Generated Files - - - Generated Files - - - Generated Files - - - Generated Files - - - Generated Files - - - Generated Files - - - Generated Files - - - Generated Files - - - Generated Files - - - Generated Files - - - Generated Files - - - Generated Files - - - Generated Files - - - Generated Files - - - Generated Files - - - Generated Files - - - Generated Files - - - Generated Files - - - Generated Files - - - Generated Files - - - Generated Files - - - Generated Files - - - Generated Files - - - Generated Files - - - Generated Files - - - Generated Files - - - Generated Files - - - Generated Files - - - Generated Files - - - Generated Files - - - Generated Files - - - Generated Files - - - Generated Files - - - Generated Files - - - Generated Files - - - Generated Files - - - Generated Files - - - Generated Files - - - Generated Files - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - {08108e2f-1ffd-48e0-89d9-23f5409dc0eb} - - - {4ee0c8e4-3ba3-4683-8c6f-23463d09d9d7} - - - {379b5f39-b7a5-466c-bd91-4f42b78a78bb} - - - {94509df5-c439-4303-be5b-8d14fd112d48} - - - - - Header Files - - - Interface Files - - - Interface Files - - - Interface Files - - - Interface Files - - - Interface Files - - - Interface Files - - - Interface Files - - - Interface Files - - - Interface Files - - - Interface Files - - - Interface Files - - - Interface Files - - - Interface Files - - - Interface Files - - - Interface Files - - - Interface Files - - - Interface Files - - - Interface Files - - - Interface Files - - - Interface Files - - - Interface Files - - - Interface Files - - - Interface Files - - - Interface Files - - - Interface Files - - - Interface Files - - - Interface Files - - - Interface Files - - - Interface Files - - - Header Files - - - Interface Files - - - Interface Files - - - Interface Files - - - Interface Files - - - Interface Files - - - Interface Files - - - Interface Files - - - Interface Files - - - Interface Files - - - Interface Files - - - Interface Files - - - Interface Files - - - Interface Files - - - Interface Files - - - Interface Files - - - Interface Files - - - Interface Files - - - Interface Files - - - Interface Files - - - Interface Files - - - Interface Files - - - Interface Files - - - Interface Files - - - Interface Files - - - Interface Files - - - Interface Files - - - Interface Files - - - Interface Files - - - Interface Files - - - Interface Files - - - Interface Files - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - Interface Files - - - Interface Files - - - Interface Files - - - Interface Files - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/jsonrpc/IOConnector.json b/jsonrpc/IOConnector.json deleted file mode 100644 index 0a27fea3..00000000 --- a/jsonrpc/IOConnector.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "$schema": "interface.schema.json", - "jsonrpc": "2.0", - "info": { - "version": "1.0.0", - "title": "IO Connector API", - "class": "IOConnector", - "format": "uncompliant-extended", - "description": "IO Connector JSON-RPC interface" - }, - "common": { - "$ref": "common.json" - }, - "definitions": { - "pinvalue": { - "type": "number", - "signed": true, - "description": "Value of the pin", - "example": "1" - } - }, - "properties": { - "pin": { - "summary": "GPIO pin value", - "events": [ - "activity" - ], - "index": { - "name": "pin ID", - "example": "189" - }, - "params": { - "$ref": "#/definitions/pinvalue" - }, - "errors": [ - { - "description": "Unknown pin ID given", - "$ref": "#/common/errors/unknownkey" - } - ] - } - }, - "events": { - "activity": { - "summary": "Notifies about GPIO pin activity", - "description": "Register to this event to be notified about pin value changes", - "id": { - "name": "pin ID", - "example": "189" - }, - "params": { - "type": "object", - "properties": { - "value": { - "$ref": "#/definitions/pinvalue" - } - } - } - } - } -} diff --git a/jsonrpc/Power.json b/jsonrpc/Power.json deleted file mode 100644 index e94c6c03..00000000 --- a/jsonrpc/Power.json +++ /dev/null @@ -1,93 +0,0 @@ -{ - "$schema": "interface.schema.json", - "jsonrpc": "2.0", - "info": { - "version": "1.0.0", - "title": "Power API", - "class": "Power", - "description": "Power JSON-RPC interface" - }, - "common": { - "$ref": "common.json" - }, - "definitions": { - "state":{ - "type": "string", - "enum": [ - "on", - "activestandby", - "passivestandby", - "suspendtoram", - "hibernate", - "poweroff" - ], - "enumvalues": [ - 1, - 2, - 3, - 4, - 5, - 6 - ], - "enumtyped": false, - "description": "Power state", - "example": "on" - }, - "power":{ - "type": "object", - "properties": { - "powerstate": { - "$ref": "#/definitions/state" - }, - "timeout": { - "description": "Time to wait for power state change", - "type": "number", - "size": 32, - "example": 0 - } - }, - "required": [ - "powerstate", - "timeout" - ] - } - }, - "properties": { - "state": { - "summary": "Power state", - "readonly": true, - "params": { - "$ref": "#/definitions/state" - } - } - }, - "methods": { - "set": { - "summary": "Sets power state", - "params": { - "$ref": "#/definitions/power" - }, - "result": { - "$ref": "#/common/results/void" - }, - "errors": [ - { - "description": "General failure", - "$ref": "#/common/errors/general" - }, - { - "description": "Trying to set the same power mode", - "$ref": "#/common/errors/duplicatekey" - }, - { - "description": "Power state is not supported", - "$ref": "#/common/errors/illegalstate" - }, - { - "description": "Invalid Power state or Bad JSON param data format", - "$ref": "#/common/errors/badrequest" - } - ] - } - } -} diff --git a/jsonrpc/SubsystemControl.json b/jsonrpc/SubsystemControl.json deleted file mode 100644 index e3d28961..00000000 --- a/jsonrpc/SubsystemControl.json +++ /dev/null @@ -1,76 +0,0 @@ -{ - "$schema": "interface.schema.json", - "jsonrpc": "2.0", - "info": { - "version": "1.0.0", - "title": "Subsystem Control API", - "class": "SubsystemControl", - "format": "uncompliant-collapsed", - "description": "SubsystemControl JSON-RPC interface" - }, - "common": { - "$ref": "common.json" - }, - "definitions": { - "subsystem": { - "type": "string", - "enum": [ - "platform", - "network", - "internet", - "time", - "security", - "location", - "identifier", - "provisioning", - "decryption", - "bluetooth", - "websource", - "graphics", - "streaming", - "cryptography", - "installation" - ], - "description": "The subsystem that needs to be controller", - "example": "network" - } - }, - "methods": { - "activate": { - "summary": "Activates a subsystem", - "description": "This method allows a subsystem to be activated from the outside. This is usefull in case Thunder can not determine the availability of a subsystem but it needs to be triggered from the outside.", - "params": { - "type": "object", - "properties": { - "system": { - "description": "Subsystem to activate", - "$ref": "#/definitions/subsystem" - }, - "configuration": { - "type": "string", - "description": "A JSON string that holds the information applicable to the subsystem to be activated" - } - }, - "required": [ - "system" - ] - }, - "result": { - "type": "number", - "description": "The result of the activating anythin unequal to 0 means somthing failed", - "size": 32 - } - }, - "deactivate": { - "summary": "Deactivates a subsystem", - "description": "This method allows a subsystem to be deactivated from the outside. This is usefull in case Thunder can not determine the availability of a subsystem but it needs to be triggered from the outside.", - "params": { - "description": "Subsystem to deactivate", - "$ref": "#/definitions/subsystem" - }, - "result": { - "$ref": "#/common/results/void" - } - } - } -} diff --git a/jsonrpc/SystemCommands.json b/jsonrpc/SystemCommands.json deleted file mode 100644 index f0d32cc1..00000000 --- a/jsonrpc/SystemCommands.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "$schema": "interface.schema.json", - "jsonrpc": "2.0", - "info": { - "version": "1.0.0", - "title": "System Commands API", - "class": "SystemCommands", - "description": "System Commands JSON-RPC interface" - }, - "common": { - "$ref": "common.json" - }, - "methods": { - "usbreset": { - "summary": "Resets a USB device", - "description": "With this method a USB device can be reset using USBFS_RESET ioctl command.", - "params": { - "type": "object", - "properties": { - "device": { - "description": "USB device to reset", - "type": "string", - "default": "/dev/usb/001" - } - } - }, - "result": { - "$ref": "#/common/results/void" - }, - "errors": [ - { - "description": "Failed to reset the USB device", - "$ref": "#/common/errors/general" - }, - { - "description": "Unknown USB device", - "$ref": "#/common/errors/unavailable" - } - ] - } - } -} diff --git a/jsonrpc/TimeSync.json b/jsonrpc/TimeSync.json deleted file mode 100644 index 41e57dc5..00000000 --- a/jsonrpc/TimeSync.json +++ /dev/null @@ -1,77 +0,0 @@ -{ - "$schema": "interface.schema.json", - "jsonrpc": "2.0", - "info": { - "version": "1.0.0", - "title": "Time Sync API", - "class": "TimeSync", - "format": "uncompliant-extended", - "description": "TimeSync JSON-RPC interface" - }, - "common": { - "$ref": "common.json" - }, - "methods": { - "synchronize": { - "summary": "Synchronizes time", - "description": "Use this method to synchronize the system time with the currently configured time source. If automatic time synchronization is initially disabled or stopped, it will be restarted.", - "result": { - "$ref": "#/common/results/void" - }, - "errors": [ - { - "description": "Returned when the method is called while previously triggered synchronization is in progress.", - "$ref": "#/common/errors/inprogress" - }, - { - "description": "Returned when the source configuration is missing or invalid.", - "$ref": "#/common/errors/incompleteconfig" - } - ] - } - }, - "properties": { - "synctime": { - "summary": "Most recent synchronized time", - "readonly": true, - "params": { - "type": "object", - "properties": { - "time": { - "description": "Synchronized time (in ISO8601 format); empty string if the time has never been synchronized", - "example": "2019-05-07T07:20:26Z", - "type": "string" - }, - "source": { - "description": "The synchronization source e.g. an NTP server", - "example": "ntp://example.com", - "type": "string" - } - }, - "required": [ - "time" - ] - } - }, - "time": { - "summary": "Current system time", - "description": "Upon setting this property automatic time synchronization will be stopped. Usage of this property is deprecated and the SubSystem control plugin can be used as an alternative to achieve the same", - "params": { - "description": "System time (in ISO8601 format)", - "example": "2019-05-07T07:20:26Z", - "type": "string" - }, - "errors": [ - { - "description": "The time is invalid", - "$ref": "#/common/errors/badrequest" - } - ] - } - }, - "events": { - "timechange": { - "summary": "Signals a time change" - } - } -}