From f3d4cc6e4e9e722519195aea97d08b94b8148adf Mon Sep 17 00:00:00 2001 From: naveen-0206 Date: Tue, 27 Jan 2026 16:09:33 +0530 Subject: [PATCH 1/2] RDKEMW-1000 : Add COM-RPC support to UnifiedCASManagement plugin Reason For Change: Adding UnifiedCASManagement interface header Changes Test procedure : Test UnifiedCASManagement Priority: P1 Signed-off-by: naveen-0206 --- apis/Ids.h | 4 + .../IUnifiedCASManagement.h | 114 ++++++++++++++++++ 2 files changed, 118 insertions(+) create mode 100644 apis/UnifiedCASManagement/IUnifiedCASManagement.h diff --git a/apis/Ids.h b/apis/Ids.h index 67ca0898..ce334296 100755 --- a/apis/Ids.h +++ b/apis/Ids.h @@ -345,6 +345,10 @@ namespace Exchange { ID_GOOGLE_CAST_RM_DELEGATE_NOTIFICATION = ID_GOOGLE_CAST + 3, ID_RESOURCEMANAGER = ID_ENTOS_OFFSET + 0x480, + + ID_UNIFIEDCASMANAGEMENT = ID_ENTOS_OFFSET + 0x490, + ID_UNIFIEDCASMANAGEMENT_NOTIFICATION = ID_UNIFIEDCASMANAGEMENT + 1, + }; // enum IDS } // namespace Exchange diff --git a/apis/UnifiedCASManagement/IUnifiedCASManagement.h b/apis/UnifiedCASManagement/IUnifiedCASManagement.h new file mode 100644 index 00000000..d513ba4b --- /dev/null +++ b/apis/UnifiedCASManagement/IUnifiedCASManagement.h @@ -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"); + * 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 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, + 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 From 2daf18f283e2b51c3ed20abeb17b0fd038762184 Mon Sep 17 00:00:00 2001 From: RDKCM <187267378+rdkcm-rdke@users.noreply.github.com> Date: Wed, 18 Feb 2026 09:39:21 +0000 Subject: [PATCH 2/2] Auto-generate documentation from interface changes --- docs/_sidebar.md | 1 + docs/apis/UnifiedCASManagement.md | 259 ++++++++++++++++++++++++++++++ 2 files changed, 260 insertions(+) create mode 100644 docs/apis/UnifiedCASManagement.md diff --git a/docs/_sidebar.md b/docs/_sidebar.md index 48978778..20263597 100755 --- a/docs/_sidebar.md +++ b/docs/_sidebar.md @@ -56,6 +56,7 @@ - [Telemetry](apis/Telemetry.md) - [TextToSpeech@](apis/TextToSpeechPlugin.md) - [TextTrack](apis/TextTrack.md) + - [UnifiedCASManagement](apis/UnifiedCASManagement.md) - [USBDevice](apis/USBDevice.md) - [USBMassStorage](apis/USBMassStorage.md) - [UserSettings](apis/UserSettings.md) diff --git a/docs/apis/UnifiedCASManagement.md b/docs/apis/UnifiedCASManagement.md new file mode 100644 index 00000000..5fd6e1c7 --- /dev/null +++ b/docs/apis/UnifiedCASManagement.md @@ -0,0 +1,259 @@ + + +# 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) + + +# Abbreviation, Acronyms and Terms + +[[Refer to this link](overview/aat.md)] + + +# 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/)]. + + +# 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 | + + +# 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 | + + +## *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 + } +} +``` + + +## *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 + } +} +``` + + +## *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 + } +} +``` + + + + +# 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 | + + +## *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" + } +} +```