-
Notifications
You must be signed in to change notification settings - Fork 17
RDKEMW-999 : Add COM-RPC support to ResourceManager plugin #718
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
naveen-0206
wants to merge
2
commits into
develop
Choose a base branch
from
feature/jan_23_interface
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,86 @@ | ||
| /* | ||
| * If not stated otherwise in this file or this component's LICENSE file the | ||
| * following copyright and licenses apply: | ||
| * | ||
| * Copyright 2026 RDK Management | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
|
Check failure on line 7 in apis/ResourceManager/IResourceManager.h
|
||
| * 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 <com/IIteratorType.h> | ||
|
|
||
| namespace WPEFramework | ||
| { | ||
| namespace Exchange | ||
| { | ||
| /* @json 1.0.0 @text:keep */ | ||
| struct EXTERNAL IResourceManager : virtual public Core::IUnknown | ||
| { | ||
| enum { ID = ID_RESOURCEMANAGER }; | ||
|
|
||
| // @brief Define custom iterators for ResourceManager | ||
| using IClientIterator = RPC::IIteratorType<string, ID_RESOURCEMANAGER_CLIENT_ITERATOR>; | ||
| using IAppIdIterator = RPC::IIteratorType<string, ID_RESOURCEMANAGER_APPID_ITERATOR>; | ||
|
|
||
| // @brief Result struct for TTS operations | ||
| struct EXTERNAL TTSResult { | ||
| bool success /* @text success */ /* @brief Indicates whether the TTS operation was successful */; | ||
| }; | ||
|
|
||
| /**********************setAVBlocked() - start****************************/ | ||
| // @text setAVBlocked | ||
| // @brief Sets AV blocking status for an application | ||
| // @param appId: The unique identifier of the application | ||
| // @param blocked: Boolean flag indicating whether to block (true) or unblock (false) AV access | ||
| // @param message: Status or error message describing the result of the operation | ||
| // @param success: Boolean flag indicating whether the operation was successful | ||
| // @retval ERROR_NONE: Operation completed successfully | ||
| // @retval ERROR_GENERAL: Operation failed | ||
| virtual Core::hresult SetAVBlocked(const string& appId /* @text appId */, const bool blocked /* @text blocked */, string& message /* @out */, bool& success /* @out */) = 0; | ||
| /**********************setAVBlocked() - end******************************/ | ||
|
|
||
| /**********************getBlockedAVApplications() - start***************/ | ||
| // @text getBlockedAVApplications | ||
| // @brief Gets list of applications with blocked AV access | ||
| // @param clients: Iterator containing the list of application identifiers that have blocked AV access | ||
| // @param success: Boolean flag indicating whether the operation was successful | ||
| // @retval ERROR_NONE: Operation completed successfully | ||
| // @retval ERROR_GENERAL: Operation failed | ||
| virtual Core::hresult GetBlockedAVApplications(IClientIterator*& clients /* @out */, bool& success /* @out */) const = 0; | ||
| /**********************getBlockedAVApplications() - end*****************/ | ||
|
|
||
| /**********************reserveTTSResource() - start*********************/ | ||
| // @text reserveTTSResource | ||
| // @brief Reserves TTS resource for a single application | ||
| // @param appId: The unique identifier of the application requesting TTS resource reservation | ||
| // @param ttsResult: Structure containing the result of the TTS resource reservation operation | ||
| // @retval ERROR_NONE: Operation completed successfully | ||
| // @retval ERROR_GENERAL: Operation failed | ||
| virtual Core::hresult ReserveTTSResource(const string& appId /* @text appId */, TTSResult& ttsResult /* @out */) = 0; | ||
| /**********************reserveTTSResource() - end***********************/ | ||
|
|
||
| /**********************reserveTTSResourceForApps() - start***************/ | ||
| // @text reserveTTSResourceForApps | ||
| // @brief Reserves TTS resource for multiple applications | ||
| // @param appIds: Iterator containing the list of application identifiers requesting TTS resource reservation | ||
| // @param ttsResult: Structure containing the result of the TTS resource reservation operation | ||
| // @retval ERROR_NONE: Operation completed successfully | ||
| // @retval ERROR_GENERAL: Operation failed | ||
| virtual Core::hresult ReserveTTSResourceForApps(IAppIdIterator* const appIds /* @text appIds */, TTSResult& ttsResult /* @out */) = 0; | ||
| /**********************reserveTTSResourceForApps() - end*****************/ | ||
| }; | ||
| } // namespace Exchange | ||
| } // namespace WPEFramework | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,274 @@ | ||
| <!-- Generated automatically, DO NOT EDIT! --> | ||
| <a id="ResourceManager_Plugin"></a> | ||
| # ResourceManager Plugin | ||
|
|
||
| **Version: [1.0.0](https://github.com/rdkcentral/entservices-apis/tree/main/apis/ResourceManager/IResourceManager.h)** | ||
|
|
||
| A ResourceManager plugin for Thunder framework. | ||
|
|
||
| ### Table of Contents | ||
|
|
||
| - [Abbreviation, Acronyms and Terms](#abbreviation-acronyms-and-terms) | ||
| - [Description](#Description) | ||
| - [Configuration](#Configuration) | ||
| - [Methods](#Methods) | ||
|
|
||
| <a id="abbreviation-acronyms-and-terms"></a> | ||
| # Abbreviation, Acronyms and Terms | ||
|
|
||
| [[Refer to this link](overview/aat.md)] | ||
|
|
||
| <a id="Description"></a> | ||
| # Description | ||
|
|
||
| The `ResourceManager` plugin provides an interface for ResourceManager. | ||
|
|
||
| The plugin is designed to be loaded and executed within the Thunder framework. For more information about the framework refer to [[Thunder](https://rdkcentral.github.io/Thunder/)]. | ||
|
|
||
| <a id="Configuration"></a> | ||
| # Configuration | ||
|
|
||
| The table below lists configuration options of the plugin. | ||
|
|
||
| | Name | Type | Description | | ||
| | :-------- | :-------- | :-------- | | ||
| | callsign | string | Plugin instance name (default: org.rdk.ResourceManager) | | ||
| | classname | string | Class name: *ResourceManager* | | ||
| | locator | string | Library name: *libWPEFrameworkResourceManager.so* | | ||
| | autostart | boolean | Determines if the plugin shall be started automatically along with the framework | | ||
|
|
||
| <a id="Methods"></a> | ||
| # Methods | ||
|
|
||
| The following methods are provided by the ResourceManager plugin: | ||
|
|
||
| ResourceManager interface methods: | ||
|
|
||
| | Method | Description | | ||
| | :-------- | :-------- | | ||
| | [getBlockedAVApplications](#getBlockedAVApplications) | Gets list of applications with blocked AV access | | ||
| | [reserveTTSResource](#reserveTTSResource) | Reserves TTS resource for a single application | | ||
| | [reserveTTSResourceForApps](#reserveTTSResourceForApps) | Reserves TTS resource for multiple applications | | ||
| | [setAVBlocked](#setAVBlocked) | Sets AV blocking status for an application | | ||
|
|
||
| <a id="getBlockedAVApplications"></a> | ||
| ## *getBlockedAVApplications* | ||
|
|
||
| Gets list of applications with blocked AV access | ||
|
|
||
| ### Events | ||
| Event details will be updated soon. | ||
| ### Parameters | ||
| This method takes no parameters. | ||
| ### Results | ||
| | Name | Type | Description | | ||
| | :-------- | :-------- | :-------- | | ||
| | result | object | | | ||
| | result.clients | IClientIterator | Iterator containing the list of application identifiers that have blocked AV access | | ||
| | result.clients[#] | string | | | ||
| | result.success | bool | Indicates whether the TTS operation was successful | | ||
|
|
||
| ### Examples | ||
|
|
||
|
|
||
| #### Request | ||
|
|
||
| ```json | ||
| { | ||
| "jsonrpc": 2.0, | ||
| "id": 0, | ||
| "method": "org.rdk.ResourceManager.getBlockedAVApplications" | ||
| } | ||
| ``` | ||
|
|
||
|
|
||
| #### CURL Command | ||
|
|
||
| ```curl | ||
| curl -H 'content-type:text/plain;' --data-binary '{"jsonrpc": 2.0, "id": 0, "method": "org.rdk.ResourceManager.getBlockedAVApplications"}' http://127.0.0.1:9998/jsonrpc | ||
| ``` | ||
|
|
||
|
|
||
| #### Response | ||
|
|
||
| ```json | ||
| { | ||
| "jsonrpc": 2.0, | ||
| "id": 0, | ||
| "result": { | ||
| "clients": [ | ||
| "" | ||
| ], | ||
| "success": true | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| <a id="reserveTTSResource"></a> | ||
| ## *reserveTTSResource* | ||
|
|
||
| Reserves TTS resource for a single application | ||
|
|
||
| ### Events | ||
| Event details will be updated soon. | ||
| ### Parameters | ||
| | Name | Type | Description | | ||
| | :-------- | :-------- | :-------- | | ||
| | params | object | | | ||
| | params.appId | string | The unique identifier of the application | | ||
| ### Results | ||
| | Name | Type | Description | | ||
| | :-------- | :-------- | :-------- | | ||
| | result | object | | | ||
| | result.success | bool | Indicates whether the TTS operation was successful | | ||
|
|
||
| ### Examples | ||
|
|
||
|
|
||
| #### Request | ||
|
|
||
| ```json | ||
| { | ||
| "jsonrpc": 2.0, | ||
| "id": 1, | ||
| "method": "org.rdk.ResourceManager.reserveTTSResource", | ||
| "params": { | ||
| "appId": "" | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
|
|
||
| #### CURL Command | ||
|
|
||
| ```curl | ||
| curl -H 'content-type:text/plain;' --data-binary '{"jsonrpc": 2.0, "id": 1, "method": "org.rdk.ResourceManager.reserveTTSResource", "params": {"appId": ""}}' http://127.0.0.1:9998/jsonrpc | ||
| ``` | ||
|
|
||
|
|
||
| #### Response | ||
|
|
||
| ```json | ||
| { | ||
| "jsonrpc": 2.0, | ||
| "id": 1, | ||
| "result": { | ||
| "success": true | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| <a id="reserveTTSResourceForApps"></a> | ||
| ## *reserveTTSResourceForApps* | ||
|
|
||
| Reserves TTS resource for multiple applications | ||
|
|
||
| ### Events | ||
| Event details will be updated soon. | ||
| ### Parameters | ||
| | Name | Type | Description | | ||
| | :-------- | :-------- | :-------- | | ||
| | params | object | | | ||
| | params.appIds | IAppIdIterator | Iterator containing the list of application identifiers requesting TTS resource reservation | | ||
| | params.appIds[#] | string | | | ||
| ### Results | ||
| | Name | Type | Description | | ||
| | :-------- | :-------- | :-------- | | ||
| | result | object | | | ||
| | result.success | bool | Indicates whether the TTS operation was successful | | ||
|
|
||
| ### Examples | ||
|
|
||
|
|
||
| #### Request | ||
|
|
||
| ```json | ||
| { | ||
| "jsonrpc": 2.0, | ||
| "id": 2, | ||
| "method": "org.rdk.ResourceManager.reserveTTSResourceForApps", | ||
| "params": [ | ||
| "" | ||
| ] | ||
| } | ||
| ``` | ||
|
|
||
|
|
||
| #### CURL Command | ||
|
|
||
| ```curl | ||
| curl -H 'content-type:text/plain;' --data-binary '{"jsonrpc": 2.0, "id": 2, "method": "org.rdk.ResourceManager.reserveTTSResourceForApps", "params": [""]}' http://127.0.0.1:9998/jsonrpc | ||
| ``` | ||
|
|
||
|
|
||
| #### Response | ||
|
|
||
| ```json | ||
| { | ||
| "jsonrpc": 2.0, | ||
| "id": 2, | ||
| "result": { | ||
| "success": true | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| <a id="setAVBlocked"></a> | ||
| ## *setAVBlocked* | ||
|
|
||
| Sets AV blocking status for an application | ||
|
|
||
| ### Events | ||
| Event details will be updated soon. | ||
| ### Parameters | ||
| | Name | Type | Description | | ||
| | :-------- | :-------- | :-------- | | ||
| | params | object | | | ||
| | params.appId | string | The unique identifier of the application | | ||
| | params.blocked | bool | Boolean flag indicating whether to block (true) or unblock (false) AV access | | ||
| ### Results | ||
| | Name | Type | Description | | ||
| | :-------- | :-------- | :-------- | | ||
| | result | object | | | ||
| | result.message | string | Status or error message describing the result of the operation | | ||
| | result.success | bool | Indicates whether the TTS operation was successful | | ||
|
|
||
| ### Examples | ||
|
|
||
|
|
||
| #### Request | ||
|
|
||
| ```json | ||
| { | ||
| "jsonrpc": 2.0, | ||
| "id": 3, | ||
| "method": "org.rdk.ResourceManager.setAVBlocked", | ||
| "params": { | ||
| "appId": "", | ||
| "blocked": true | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
|
|
||
| #### CURL Command | ||
|
|
||
| ```curl | ||
| curl -H 'content-type:text/plain;' --data-binary '{"jsonrpc": 2.0, "id": 3, "method": "org.rdk.ResourceManager.setAVBlocked", "params": {"appId": "", "blocked": true}}' http://127.0.0.1:9998/jsonrpc | ||
| ``` | ||
|
|
||
|
|
||
| #### Response | ||
|
|
||
| ```json | ||
| { | ||
| "jsonrpc": 2.0, | ||
| "id": 3, | ||
| "result": { | ||
| "message": "", | ||
| "success": true | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
|
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.