-
Notifications
You must be signed in to change notification settings - Fork 17
RDKEMW-1000 : Add COM-RPC support to UnifiedCASManagement plugin #719
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
3
commits into
develop
Choose a base branch
from
feature/unified_apis_jan_27
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
3 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,114 @@ | ||
| /* | ||
| * 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/UnifiedCASManagement/IUnifiedCASManagement.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 IUnifiedCASManagement : virtual public Core::IUnknown | ||
| { | ||
| enum { ID = ID_UNIFIEDCASMANAGEMENT }; | ||
|
|
||
| // @text tunemode | ||
| enum TuneMode : uint8_t { | ||
| MODE_NONE = 0, | ||
| MODE_LIVE = 1, | ||
| MODE_RECORD = 2, | ||
| MODE_PLAYBACK = 3 | ||
| }; | ||
|
|
||
| // @text managementtype | ||
| enum ManagementType : uint8_t { | ||
| MANAGE_FULL = 0, | ||
| MANAGE_NO_PSI = 1, | ||
| MANAGE_NO_TUNER = 2 | ||
| }; | ||
|
|
||
| // @text datasource | ||
| enum DataSource : uint8_t { | ||
| PUBLIC = 0, | ||
| PRIVATE = 1 | ||
| }; | ||
|
|
||
| // @event | ||
| struct EXTERNAL INotification : virtual public Core::IUnknown | ||
| { | ||
| enum { ID = ID_UNIFIEDCASMANAGEMENT_NOTIFICATION }; | ||
|
|
||
| // @text onDataReceived | ||
| // @alt data | ||
| // @brief Sent when the CAS needs to send data to the caller | ||
| // @param payload Data to transfer. Can be base64 coded if required | ||
| // @param source Origin of the data | ||
| virtual void OnDataReceived(const string& payload, const DataSource& source) {} | ||
| }; | ||
|
|
||
| // @brief Register a notification callback | ||
| // @param notification: The notification callback object | ||
| // @retval Core::ERROR_NONE: Registration successful | ||
| // @retval Core::ERROR_ALREADY_CONNECTED: Callback already registered | ||
| virtual Core::hresult Register(IUnifiedCASManagement::INotification* notification) = 0; | ||
|
|
||
| // @brief Unregister a notification callback | ||
| // @param notification: The notification callback object to remove | ||
| // @retval Core::ERROR_NONE: Unregistration successful | ||
| // @retval Core::ERROR_UNKNOWN_KEY: Callback not found | ||
| virtual Core::hresult Unregister(IUnifiedCASManagement::INotification* notification) = 0; | ||
|
|
||
| // @text manage | ||
| // @brief Manage a well-known CAS (setup CAS management session) | ||
| // @param mediaurl The URL to tune to (tune://, ocap://, http://, https://) | ||
| // @param mode The use of the tune request | ||
| // @param managementType Type of CAS management | ||
| // @param casinitdata CAS specific initdata for the selected media | ||
| // @param casocdmid The well-known OCDM ID of the CAS to use | ||
| // @param success Returns true if the operation succeeded, false otherwise | ||
| // @retval Core::ERROR_NONE: Operation successful | ||
| // @retval Core::ERROR_GENERAL: Operation failed | ||
| virtual Core::hresult Manage(const string& mediaurl, | ||
| const TuneMode& mode, | ||
| const ManagementType& managementType, | ||
| const string& casinitdata, | ||
| const string& casocdmid, | ||
naveen-0206 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| bool& success /* @out */) = 0; | ||
|
|
||
| // @text unmanage | ||
| // @brief Destroy a management session | ||
| // @param success Returns true if the operation succeeded, false otherwise | ||
| // @retval Core::ERROR_NONE: Operation successful | ||
| // @retval Core::ERROR_GENERAL: Operation failed | ||
| virtual Core::hresult Unmanage(bool& success /* @out */) = 0; | ||
|
|
||
| // @text send | ||
| // @brief Sends data to the remote CAS | ||
| // @param payload Data to transfer. Can be base64 coded if required | ||
| // @param source Origin of the data | ||
| // @param success Returns true if the operation succeeded, false otherwise | ||
| // @retval Core::ERROR_NONE: Operation successful | ||
| // @retval Core::ERROR_GENERAL: Operation failed | ||
| virtual Core::hresult Send(const string& payload, const DataSource& source, bool& success /* @out */) = 0; | ||
| }; | ||
| } // 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,259 @@ | ||
| <!-- Generated automatically, DO NOT EDIT! --> | ||
| <a id="UnifiedCASManagement_Plugin"></a> | ||
| # UnifiedCASManagement Plugin | ||
|
|
||
| **Version: [1.0.0](https://github.com/rdkcentral/entservices-apis/tree/main/apis/UnifiedCASManagement/IUnifiedCASManagement.h)** | ||
|
|
||
| A UnifiedCASManagement plugin for Thunder framework. | ||
|
|
||
| ### Table of Contents | ||
|
|
||
| - [Abbreviation, Acronyms and Terms](#abbreviation-acronyms-and-terms) | ||
| - [Description](#Description) | ||
| - [Configuration](#Configuration) | ||
| - [Methods](#Methods) | ||
| - [Notifications](#Notifications) | ||
|
|
||
| <a id="abbreviation-acronyms-and-terms"></a> | ||
| # Abbreviation, Acronyms and Terms | ||
|
|
||
| [[Refer to this link](overview/aat.md)] | ||
|
|
||
| <a id="Description"></a> | ||
| # Description | ||
|
|
||
| The `UnifiedCASManagement` plugin provides an interface for UnifiedCASManagement. | ||
|
|
||
| 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.UnifiedCASManagement) | | ||
| | classname | string | Class name: *UnifiedCASManagement* | | ||
| | locator | string | Library name: *libWPEFrameworkUnifiedCASManagement.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 UnifiedCASManagement plugin: | ||
|
|
||
| UnifiedCASManagement interface methods: | ||
|
|
||
| | Method | Description | | ||
| | :-------- | :-------- | | ||
| | [manage](#manage) | Manage a well-known CAS (setup CAS management session) | | ||
| | [send](#send) | Sends data to the remote CAS | | ||
| | [unmanage](#unmanage) | Destroy a management session | | ||
|
|
||
| <a id="manage"></a> | ||
| ## *manage* | ||
|
|
||
| Manage a well-known CAS (setup CAS management session) | ||
|
|
||
| ### Events | ||
| Event details will be updated soon. | ||
| ### Parameters | ||
| | Name | Type | Description | | ||
| | :-------- | :-------- | :-------- | | ||
| | params | object | | | ||
| | params.mediaurl | string | The URL to tune to (tune://, ocap://, http://, https://) | | ||
| | params.mode | string | The use of the tune request | | ||
| | params.managementType | string | Type of CAS management | | ||
| | params.casinitdata | string | CAS specific initdata for the selected media | | ||
| | params.casocdmid | string | The well-known OCDM ID of the CAS to use | | ||
| ### Results | ||
| | Name | Type | Description | | ||
| | :-------- | :-------- | :-------- | | ||
| | result | object | | | ||
| | result.success | bool | Returns true if the operation succeeded, false otherwise @retval Core::ERROR_NONE: Operation successful @retval Core::ERROR_GENERAL: Operation failed | | ||
|
|
||
| ### Examples | ||
|
|
||
|
|
||
| #### Request | ||
|
|
||
| ```json | ||
| { | ||
| "jsonrpc": 2.0, | ||
| "id": 0, | ||
| "method": "org.rdk.UnifiedCASManagement.manage", | ||
| "params": { | ||
| "mediaurl": "", | ||
| "mode": "MODE_NONE", | ||
| "managementType": "MANAGE_FULL", | ||
| "casinitdata": "", | ||
| "casocdmid": "" | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
|
|
||
| #### CURL Command | ||
|
|
||
| ```curl | ||
| curl -H 'content-type:text/plain;' --data-binary '{"jsonrpc": 2.0, "id": 0, "method": "org.rdk.UnifiedCASManagement.manage", "params": {"mediaurl": "", "mode": "MODE_NONE", "managementType": "MANAGE_FULL", "casinitdata": "", "casocdmid": ""}}' http://127.0.0.1:9998/jsonrpc | ||
| ``` | ||
|
|
||
|
|
||
| #### Response | ||
|
|
||
| ```json | ||
| { | ||
| "jsonrpc": 2.0, | ||
| "id": 0, | ||
| "result": { | ||
| "success": true | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| <a id="send"></a> | ||
| ## *send* | ||
|
|
||
| Sends data to the remote CAS | ||
|
|
||
| ### Events | ||
| Event details will be updated soon. | ||
| ### Parameters | ||
| | Name | Type | Description | | ||
| | :-------- | :-------- | :-------- | | ||
| | params | object | | | ||
| | params.payload | string | Data to transfer. Can be base64 coded if required | | ||
| | params.source | string | Origin of the data | | ||
| ### Results | ||
| | Name | Type | Description | | ||
| | :-------- | :-------- | :-------- | | ||
| | result | object | | | ||
| | result.success | bool | Returns true if the operation succeeded, false otherwise @retval Core::ERROR_NONE: Operation successful @retval Core::ERROR_GENERAL: Operation failed | | ||
|
|
||
| ### Examples | ||
|
|
||
|
|
||
| #### Request | ||
|
|
||
| ```json | ||
| { | ||
| "jsonrpc": 2.0, | ||
| "id": 1, | ||
| "method": "org.rdk.UnifiedCASManagement.send", | ||
| "params": { | ||
| "payload": "", | ||
| "source": "PUBLIC" | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
|
|
||
| #### CURL Command | ||
|
|
||
| ```curl | ||
| curl -H 'content-type:text/plain;' --data-binary '{"jsonrpc": 2.0, "id": 1, "method": "org.rdk.UnifiedCASManagement.send", "params": {"payload": "", "source": "PUBLIC"}}' http://127.0.0.1:9998/jsonrpc | ||
| ``` | ||
|
|
||
|
|
||
| #### Response | ||
|
|
||
| ```json | ||
| { | ||
| "jsonrpc": 2.0, | ||
| "id": 1, | ||
| "result": { | ||
| "success": true | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| <a id="unmanage"></a> | ||
| ## *unmanage* | ||
|
|
||
| Destroy a management session | ||
|
|
||
| ### Events | ||
| Event details will be updated soon. | ||
| ### Parameters | ||
| This method takes no parameters. | ||
| ### Results | ||
| | Name | Type | Description | | ||
| | :-------- | :-------- | :-------- | | ||
| | result | object | | | ||
| | result.success | bool | Returns true if the operation succeeded, false otherwise @retval Core::ERROR_NONE: Operation successful @retval Core::ERROR_GENERAL: Operation failed | | ||
|
|
||
| ### Examples | ||
|
|
||
|
|
||
| #### Request | ||
|
|
||
| ```json | ||
| { | ||
| "jsonrpc": 2.0, | ||
| "id": 2, | ||
| "method": "org.rdk.UnifiedCASManagement.unmanage" | ||
| } | ||
| ``` | ||
|
|
||
|
|
||
| #### CURL Command | ||
|
|
||
| ```curl | ||
| curl -H 'content-type:text/plain;' --data-binary '{"jsonrpc": 2.0, "id": 2, "method": "org.rdk.UnifiedCASManagement.unmanage"}' http://127.0.0.1:9998/jsonrpc | ||
| ``` | ||
|
|
||
|
|
||
| #### Response | ||
|
|
||
| ```json | ||
| { | ||
| "jsonrpc": 2.0, | ||
| "id": 2, | ||
| "result": { | ||
| "success": true | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
|
|
||
|
|
||
| <a id="Notifications"></a> | ||
| # Notifications | ||
|
|
||
| Notifications are autonomous events, triggered by the internals of the implementation, and broadcasted via JSON-RPC to all registered observers. Refer to [[Thunder](https://rdkcentral.github.io/Thunder/)] for information on how to register for a notification. | ||
|
|
||
| The following events are provided by the UnifiedCASManagement plugin: | ||
|
|
||
| UnifiedCASManagement interface events: | ||
|
|
||
| | Event | Description | | ||
| | :-------- | :-------- | | ||
| | [data](#data) | Sent when the CAS needs to send data to the caller | | ||
|
|
||
| <a id="onDataReceived"></a> | ||
| ## *onDataReceived* | ||
|
|
||
| Sent when the CAS needs to send data to the caller | ||
|
|
||
| ### Parameters | ||
| | Name | Type | Description | | ||
| | :-------- | :-------- | :-------- | | ||
| | params | object | | | ||
| | params.payload | string | Data to transfer. Can be base64 coded if required | | ||
| | params.source | string | Origin of the data | | ||
|
|
||
| ### Examples | ||
|
|
||
| ```json | ||
| { | ||
| "jsonrpc": 2.0, | ||
| "id": 3, | ||
| "method": "org.rdk.UnifiedCASManagement.onDataReceived", | ||
| "params": { | ||
| "payload": "", | ||
| "source": "PUBLIC" | ||
| } | ||
| } | ||
| ``` |
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.