diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 00000000..64e1b46f Binary files /dev/null and b/.DS_Store differ diff --git a/README.md b/README.md index aeba542c..328a6d62 100644 --- a/README.md +++ b/README.md @@ -59,21 +59,16 @@ TO BE UPDATED!! - By default, the APIs are defined / described using header file so COMRPC is inherently supported by default (Refer entservices-apis/apis//.h for example) -- When the implementation of a given Ent Service is expected to support JSONRPC in addition to COMRPC, then the tool available under tools/json_generator/generate_json.py SHALL be used to generate the required JSON Schema files from the headerfile defined for COMRPC. +- API documentation is generated directly from the API header files themselves. This ensures a single-source-of-truth, as opposed to creating a JSON for documentation. Using JSON to generate documentation has been deprecated. -- When the implementation of a given Ent Service is expected to support only JSONRPC, the APIs are described using [JSON Schema](https://json-schema.org/). In this case, the required JSON schema files SHALL be created manually as per the details provided below. +- To generate documentation, the header files should have doxygen comments and descriptions as specified in this [README](./tools/md_from_h_generator/README.md). The README also contains information on running the tool locally. The IFrameRate.h and IUSBMassStorage.h plugin header files are examples of supported Doxygen tagging. - - JSON Schema provides a standard approach for describing APIs and ensures consistency across all APIs. There are two schemas that are used to describe a service: - - - * [plugin.schema.json](https://github.com/rdkcentral/entservices-apis/blob/main/tools/md_generator/json2md/schemas/plugin.schema.json): A schema for defining a service. - - * [interface.schema.json](https://github.com/rdkcentral/entservices-apis/blob/main/tools/md_generator/json2md/schemas/interface.schema.json): A schema for defining the properties, methods, and events of a service. - -Markdown files are generated from the header file / JSON definitions using the md_generator tool (`tools/md_generator/generate_md.py`). +- Markdown files are generated from the header file definitions using the md_from_h_generator tool (tools/md_from_h_generator/generate_md_from_header.py). +- The tool The generator tool requires: -* Python 3.5 or higher -* The jsonref library +* Python 3.8.10 or higher Verify your Python version: @@ -81,12 +76,6 @@ Verify your Python version: python --version ``` -Install jsonref if it is not already installed: - -```shell -pip install jsonref -``` - ### Generating Markdown for a Single Service ### To generate markdown for a single service: diff --git a/apis/FrameRate/IFrameRate.h b/apis/FrameRate/IFrameRate.h index b848ad52..555ab734 100644 --- a/apis/FrameRate/IFrameRate.h +++ b/apis/FrameRate/IFrameRate.h @@ -27,6 +27,7 @@ namespace WPEFramework namespace Exchange { /* @json 1.0.0 @text:keep */ + // @plugindescription This plugin allows to collect FPS related data on TV profile stack. struct EXTERNAL IFrameRate : virtual public Core::IUnknown { enum { ID = ID_FRAMERATE }; @@ -37,79 +38,94 @@ namespace WPEFramework enum { ID = ID_FRAMERATE_NOTIFICATION }; // @text onFpsEvent - // @brief Triggered by callback from FrameRate after onFpsEvent - // @param average - in - int - // @param min - in - int - // @param max - in - int - virtual void OnFpsEvent(const int average, const int min, const int max) {}; + // @details Triggered at the end of each interval as defined by the `setCollectionFrequency` method + // after `startFpsCollection` method and once after the `stopFpsCollection` method is invoked + // @param average: The average FPS e.g. "60" + // @param min: The minimum FPS e.g. "30" + // @param max: The maximum FPS e.g. "120" + virtual void OnFpsEvent(const int average /* @in */, const int min /* @in */, const int max /* @in */) {}; // @text onDisplayFrameRateChanging - // @brief Triggered when the framerate changes started - // @param displayFrameRate - in - string - virtual void OnDisplayFrameRateChanging(const string& displayFrameRate) {}; + // @details This event is triggered when the display frame rate is about to change + // and represented as "WIDTHxHEIGHTxFPS". + // @param displayFrameRate: The new display frame rate e.g. "1920x1080x60" + virtual void OnDisplayFrameRateChanging(const string& displayFrameRate /* @in */) {}; // @text onDisplayFrameRateChanged - // @brief Triggered when the framerate changed. - // @param displayFrameRate - in - string - virtual void OnDisplayFrameRateChanged(const string& displayFrameRate) {}; + // @details This event is triggered after the display frame rate has changed + // and represented as "WIDTHxHEIGHTxFPS". + // @param displayFrameRate: The new display frame rate e.g. "1920x1080x60" + virtual void OnDisplayFrameRateChanged(const string& displayFrameRate /* @in */) {}; }; + // @omit virtual Core::hresult Register(IFrameRate::INotification* notification) = 0; + // @omit virtual Core::hresult Unregister(IFrameRate::INotification* notification) = 0; /** Gets the Display Frame Rate*/ // @text getDisplayFrameRate - // @brief Gets the current display frame rate values. - // @param framerate - out - string - // @param success - out - boolean + // @details Retrieves the current display frame rate as a string in the format "WIDTHxHEIGHTpxFPS" + // @param framerate: The current display frame rate. e.g. "3840x2160px60" + // @param success: Indicates if the operation was successful e.g. "True" + // @returns Core::hresult virtual Core::hresult GetDisplayFrameRate(string& framerate /* @out */, bool& success /* @out */) = 0; /** Gets framerate mode */ // @text getFrmMode - // @brief Gets the current auto framerate mode. - // @param frmmode - out - int - // @param success - out - boolean + // @details Retrieves the current auto framerate mode as an integer. Expeted values are 0 or 1. + // @param framerateMode: The current auto framerate mode. e.g. 1 + // @param success: Indicates if the operation was successful. e.g. "True" + // @returns Core::hresult virtual Core::hresult GetFrmMode(int &framerateMode /* @out @text:auto-frm-mode */, bool& success /* @out */) = 0; /** Sets the FPS data collection interval */ // @text setCollectionFrequency - // @brief Sets the FPS data collection interval. - // @param frequency - in - int - // @param success - out - boolean - virtual Core::hresult SetCollectionFrequency(const int frequency, bool& success /* @out */) = 0; + // @details Sets the interval for FPS data collection in milliseconds. Default is 10000ms and min is 100ms + // @param frequency: The collection frequency in ms. e.g. "1000" + // @param success: Indicates if the operation was successful. e.g. "True" + // @returns Core::hresult + virtual Core::hresult SetCollectionFrequency(const int frequency /* @in */, bool& success /* @out */) = 0; /** Sets the display framerate values */ // @text setDisplayFrameRate - // @brief Sets the display framerate values. - // @param framerate - in - string - // @param success - out - boolean - virtual Core::hresult SetDisplayFrameRate(const string& framerate, bool& success /* @out */) = 0; + // @details Sets the display framerate to the specified value in the format "WIDTHxHEIGHTpxFPS". + // @param framerate: The display framerate to set. e.g. "3840px2160px30" + // @param success: Indicates if the operation was successful. e.g. "True" + // @returns Core::hresult + virtual Core::hresult SetDisplayFrameRate(const string& framerate /* @in */, bool& success /* @out */) = 0; /** Sets the auto framerate mode */ // @text setFrmMode - // @brief Set the Frm mode. - // @param frmmode - in - int - // @param success - out - boolean + // @details Sets the auto framerate mode to the specified value. Expected values are 0(disable) or 1(enable). + // @param frmmode: The framerate mode to set. e.g. "1" + // @param success: Indicates if the operation was successful. e.g. "True" + // @returns Core::hresult virtual Core::hresult SetFrmMode(const int frmmode /* @in */, bool& success /* @out */) = 0; /** Starts the FPS data collection */ // @text startFpsCollection - // @brief Starts the FPS data collection. Starts the FPS data collection - // @param success - out - boolean + // @details Starts collecting FPS data at the configured interval set by the method `SetCollectionFrequency`. + // @see onFpsEvent + // @param success: Indicates if the operation was successful. e.g. "True" + // @returns Core::hresult virtual Core::hresult StartFpsCollection(bool& success /* @out */) = 0; /** Stops the FPS data collection */ // @text stopFpsCollection - // @brief Stops the FPS data collection - // @param success - out - boolean + // @details Stops the FPS data collection. + // @param success: Indicates if the operation was successful. e.g. "True" + // @returns Core::hresult virtual Core::hresult StopFpsCollection(bool& success /* @out */) = 0; /** Update the FPS value */ // @text updateFps - // @brief Update the FPS value - // @param newFpsValue - in - int - // @param success - out - boolean - virtual Core::hresult UpdateFps(const int newFpsValue, bool& success /* @out */) = 0; + // @details Updates the current FPS value to the specified value represented as integer. + // @see onFpsEvent + // @param newFpsValue: The new FPS value. e.g. "60" + // @param success: Indicates if the operation was successful. e.g. "True" + // @returns Core::hresult + virtual Core::hresult UpdateFps(const int newFpsValue /* @in */, bool& success /* @out */) = 0; }; } // namespace Exchange } // namespace WPEFramework diff --git a/apis/USBMassStorage/IUSBMassStorage.h b/apis/USBMassStorage/IUSBMassStorage.h index 72fd660a..2bc43aa0 100644 --- a/apis/USBMassStorage/IUSBMassStorage.h +++ b/apis/USBMassStorage/IUSBMassStorage.h @@ -26,6 +26,7 @@ namespace WPEFramework { namespace Exchange { /* @json 1.0.0 @text:keep */ +// @plugindescription The `USBMassStorage` plugin is using For mounting the file system on mass storage and enumeration of mount points. struct EXTERNAL IUSBMassStorage : virtual public Core::IUnknown { enum { ID = ID_USB_MASS_STORAGE }; @@ -47,17 +48,17 @@ struct EXTERNAL IUSBMassStorage : virtual public Core::IUnknown struct USBStorageDeviceInfo { - string devicePath /* @brief Device path in the file system (sysfs) */; - string deviceName /* @brief Device name identifying the device */; + string devicePath /* @brief Device path in the file system (sysfs) e.g. "/dev/sda" */; + string deviceName /* @brief Device name identifying the device e.g. "001/006"*/; }; using IUSBStorageDeviceInfoIterator = RPC::IIteratorType; struct USBStorageMountInfo { - string partitionName /* @brief name of the partition */; - USBStorageMountFlags mountFlags /* @brief Mount flags used for mounting the device / partition */; - string mountPath /* @brief path at which the partition is mounted on */; + string partitionName /* @brief name of the partition e.g. "/dev/sda1" */; + USBStorageMountFlags mountFlags /* @brief Mount flags used for mounting the device / partition e.g. "READ_ONLY"*/; + string mountPath /* @brief path at which the partition is mounted on e.g. "/tmp/media/usb2" */; USBStorageFileSystem fileSystem /* @brief file system of the partition */; }; @@ -65,14 +66,14 @@ struct EXTERNAL IUSBMassStorage : virtual public Core::IUnknown struct USBStoragePartitionInfo { - USBStorageFileSystem fileSystem /* file system of the partition */; - uint32_t size /* total size of the partition in MB */; - uint64_t startSector /* start sector of the partition */; - uint64_t numSectors /* number of sectors in the partition */; - uint32_t sectorSize /* size of the sector in the partition in bytes */; - uint32_t totalSpace /* total space of the partition in MB */; - uint32_t usedSpace /* used space in the partition in MB */; - uint32_t availableSpace /* available space in the partition in MB */; + USBStorageFileSystem fileSystem; // file system of the partition e.g. "VFAT" + uint32_t size /* total size of the partition in MB e.g. "1024" */; + uint64_t startSector /* start sector of the partition e.g. "2048" */; + uint64_t numSectors /* number of sectors in the partition e.g. "4096" */; + uint32_t sectorSize /* size of the sector in the partition in bytes e.g. "512" */; + uint32_t totalSpace /* total space of the partition in MB e.g. "1024" */; + uint32_t usedSpace /* used space in the partition in MB e.g. "512" */; + uint32_t availableSpace /* available space in the partition in MB e.g. "512" */; }; diff --git a/batch_bash.sh b/batch_bash.sh new file mode 100755 index 00000000..0602ffaf --- /dev/null +++ b/batch_bash.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +# filepath: /path/to/script.sh + +# Directory containing the input files +INPUT_DIR="apis" + +# Path to your Python script +PYTHON_SCRIPT="./tools/md_from_h_generator/generate_md_from_header.py" + +# Loop through all files in the input directory +for FOLDER in "$INPUT_DIR"/*; do + for FILE in "$FOLDER"/*.h; do + if [ -f "$FILE" ]; then + python3 "$PYTHON_SCRIPT" "$FILE" + echo "Processed $FILE" + fi + done +done \ No newline at end of file diff --git a/docs/.DS_Store b/docs/.DS_Store new file mode 100644 index 00000000..4f783786 Binary files /dev/null and b/docs/.DS_Store differ diff --git a/docs/apis/AmazonPrimePlugin.md b/docs/apis/AmazonPrimePlugin.md new file mode 100644 index 00000000..cdf4d78f --- /dev/null +++ b/docs/apis/AmazonPrimePlugin.md @@ -0,0 +1,253 @@ + + +# AmazonPrime Plugin + +**Version: [1.0.0](https://github.com/rdkcentral/rdkservices/blob/main/AmazonPrime/CHANGELOG.md)** + +A AmazonPrime plugin for Thunder framework. + +### Table of Contents + +- [Abbreviation, Acronyms and Terms](#head.Abbreviation,_Acronyms_and_Terms) +- [Description](#head.Description) +- [Configuration](#head.Configuration) +- [Methods](#head.Methods) + + +# Abbreviation, Acronyms and Terms + +[[Refer to this link](userguide/aat.md)] + + +# Description + +The `AmazonPrime` plugin provides an interface for AmazonPrime. + +The plugin is designed to be loaded and executed within the Thunder framework. For more information about the framework refer to [[Thunder](#ref.Thunder)]. + + +# Configuration + +The table below lists configuration options of the plugin. + +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| callsign | string | Plugin instance name (default: org.rdk.AmazonPrime) | +| classname | string | Class name: *AmazonPrime* | +| locator | string | Library name: *libWPEFrameworkAmazonPrime.so* | +| autostart | boolean | Determines if the plugin shall be started automatically along with the framework | + + +# Methods + +The following methods are provided by the AmazonPrime plugin: + +AmazonPrime interface methods: + +| Method | Description | +| :-------- | :-------- | +| [factoryResetRequest](#method.factoryResetRequest) | Factory reset amazon prime app data | +| [personalInfoRequest](#method.personalInfoRequest) | Request for personal access token to amazon prime app | +| [setDeepLink](#method.setDeepLink) | Set the deeplink command for amazon prime | +| [setLaunchReason](#method.setLaunchReason) | Set launch reason for amazon prime app | +| [stateChange](#method.stateChange) | Triggered whenever the App state changes | + + +## *factoryResetRequest [method](#head.Methods)* + +Factory reset amazon prime app data + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 0, + "method": "org.rdk.AmazonPrime.factoryResetRequest" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 0, + "result": null +} +``` + + +## *personalInfoRequest [method](#head.Methods)* + +Request for personal access token to amazon prime app + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 1, + "method": "org.rdk.AmazonPrime.personalInfoRequest" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 1, + "result": null +} +``` + + +## *setDeepLink [method](#head.Methods)* + +Set the deeplink command for amazon prime + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.command | string | app Deeplink command | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 2, + "method": "org.rdk.AmazonPrime.setDeepLink", + "params": { + "command": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 2, + "result": null +} +``` + + +## *setLaunchReason [method](#head.Methods)* + +Set launch reason for amazon prime app + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.command | string | app Deeplink command | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 3, + "method": "org.rdk.AmazonPrime.setLaunchReason", + "params": { + "command": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 3, + "result": null +} +``` + + +## *stateChange [method](#head.Methods)* + +Triggered whenever the App state changes + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.state | IAmazon::State | current state of amazon prime | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 4, + "method": "org.rdk.AmazonPrime.stateChange", + "params": { + "state": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 4, + "result": null +} +``` + + diff --git a/docs/apis/AnalyticsPlugin.md b/docs/apis/AnalyticsPlugin.md index e0f75ed7..39a8d987 100644 --- a/docs/apis/AnalyticsPlugin.md +++ b/docs/apis/AnalyticsPlugin.md @@ -1,125 +1,112 @@ - + # Analytics Plugin -**Version: [1.0.0]()** +**Version: [1.0.0](https://github.com/rdkcentral/rdkservices/blob/main/Analytics/CHANGELOG.md)** -A org.rdk.Analytics plugin for Thunder framework. +A Analytics plugin for Thunder framework. ### Table of Contents -- [Abbreviation, Acronyms and Terms](#Abbreviation,_Acronyms_and_Terms) -- [Description](#Description) -- [Configuration](#Configuration) -- [Methods](#Methods) +- [Abbreviation, Acronyms and Terms](#head.Abbreviation,_Acronyms_and_Terms) +- [Description](#head.Description) +- [Configuration](#head.Configuration) +- [Methods](#head.Methods) - + # Abbreviation, Acronyms and Terms -[[Refer to this link](overview/aat.md)] +[[Refer to this link](userguide/aat.md)] - + # Description -The `Analytics` plugin allows to send analytics events to dedicated backends. +The `Analytics` plugin provides an interface for Analytics. -The plugin is designed to be loaded and executed within the Thunder framework. For more information about the framework refer to [[Thunder](#Thunder)]. +The plugin is designed to be loaded and executed within the Thunder framework. For more information about the framework refer to [[Thunder](#ref.Thunder)]. - + # Configuration The table below lists configuration options of the plugin. | Name | Type | Description | | :-------- | :-------- | :-------- | -| callsign | string | Plugin instance name (default: *org.rdk.Analytics*) | -| classname | string | Class name: *org.rdk.Analytics* | +| callsign | string | Plugin instance name (default: org.rdk.Analytics) | +| classname | string | Class name: *Analytics* | | locator | string | Library name: *libWPEFrameworkAnalytics.so* | | autostart | boolean | Determines if the plugin shall be started automatically along with the framework | -| configuration | object | | -| configuration.loggername | string | Logger name used by backend | -| configuration.loggerversion | string | Logger version used by backend | -| configuration?.eventsmap | string | *(optional)* Optional path to json file with array of mapped events name | -| configuration.backendlib | string | Name of backend library | - + # Methods -The following methods are provided by the org.rdk.Analytics plugin: +The following methods are provided by the Analytics plugin: Analytics interface methods: | Method | Description | | :-------- | :-------- | -| [sendEvent](#sendEvent) | Enqueue an event to be sent to the SIFT analytics backend | +| [sendEvent](#method.sendEvent) | Send an event to the analytics server | + +## *sendEvent [method](#head.Methods)* - -## *sendEvent* - -Enqueue an event to be sent to the SIFT analytics backend. +Send an event to the analytics server ### Events - -No Events - +No events are associated with this method. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | | params.eventName | string | Name of the event | -| params?.eventVersion | string | *(optional)* Version number of event schema | -| params.eventSource | string | Name of the component that originates the event (Durable App ID if an App) | -| params.eventSourceVersion | string | Version number for the component that originates the event | -| params.cetList | array | An array of Capability Exclusion Tags to be included on the report. Each CET will exclude the event from being processed for the specified process, any may result in the event being dropped. May be an array of length zero | -| params.cetList[#] | string | | -| params?.epochTimestamp | integer | *(optional)* Timestamp for the START of this event, epoch time, in ms UTC | -| params?.uptimeTimestamp | integer | *(optional)* Timestamp for the START of this event, uptime of the device, in ms. ONLY to be used when Time quality is not good | -| params?.appId | string | *(optional)* Durable App ID string | -| params.eventPayload | object | Custom payload of the event in JSON format. User defined colection of objects and keys. May be an empty object | -| params.eventPayload.keyOrObject | string | User defined custom key or object | - -### Result +| params.eventVersion | string | Version of the event | +| params.eventSource | string | Source of the event | +| params.eventSourceVersion | string | Version of the event source | +| params.cetList | IStringIterator | List of CETs | +| params.cetList[#] | string | - | +| params.epochTimestamp | uint64_t | Epoch timestamp of the event | +| params.uptimeTimestamp | uint64_t | Uptime timestamp of the event | +| params.appId | string | Durable App Id string | +| params.eventPayload | string | Payload of the event | +### Results +This method returns no results. -| Name | Type | Description | -| :-------- | :-------- | :-------- | -| result | string | On success null will be returned | +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 0, "method": "org.rdk.Analytics.sendEvent", "params": { - "eventName": "app_summary", - "eventVersion": "1.0.0", - "eventSource": "epg", - "eventSourceVersion": "1.0.0", + "eventName": "", + "eventVersion": "", + "eventSource": "", + "eventSourceVersion": "", "cetList": [ - "cet1" + "" ], - "epochTimestamp": 1721906631000, - "uptimeTimestamp": 35000, - "appId": "app-id-app1", - "eventPayload": { - "keyOrObject": "value1" - } + "epochTimestamp": 0, + "uptimeTimestamp": 0, + "appId": "", + "eventPayload": "" } } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, - "result": "null" + "jsonrpc": 2.0, + "id": 0, + "result": null } ``` + diff --git a/docs/apis/AppManagerPlugin.md b/docs/apis/AppManagerPlugin.md new file mode 100644 index 00000000..f66fa4cb --- /dev/null +++ b/docs/apis/AppManagerPlugin.md @@ -0,0 +1,1064 @@ + + +# AppManager Plugin + +**Version: [1.0.0](https://github.com/rdkcentral/rdkservices/blob/main/AppManager/CHANGELOG.md)** + +A AppManager plugin for Thunder framework. + +### Table of Contents + +- [Abbreviation, Acronyms and Terms](#head.Abbreviation,_Acronyms_and_Terms) +- [Description](#head.Description) +- [Configuration](#head.Configuration) +- [Methods](#head.Methods) +- [Properties](#head.Properties) +- [Notifications](#head.Notifications) + + +# Abbreviation, Acronyms and Terms + +[[Refer to this link](userguide/aat.md)] + + +# Description + +The `AppManager` plugin provides an interface for AppManager. + +The plugin is designed to be loaded and executed within the Thunder framework. For more information about the framework refer to [[Thunder](#ref.Thunder)]. + + +# Configuration + +The table below lists configuration options of the plugin. + +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| callsign | string | Plugin instance name (default: org.rdk.AppManager) | +| classname | string | Class name: *AppManager* | +| locator | string | Library name: *libWPEFrameworkAppManager.so* | +| autostart | boolean | Determines if the plugin shall be started automatically along with the framework | + + +# Methods + +The following methods are provided by the AppManager plugin: + +AppManager interface methods: + +| Method | Description | +| :-------- | :-------- | +| [clearAllAppData](#method.clearAllAppData) | Clears all persistent data for all apps. | +| [clearAppData](#method.clearAppData) | Clears all persistent data for a given appId. | +| [closeApp](#method.closeApp) | closeApp moves the state from Active to Running state | +| [getAppMetadata](#method.getAppMetadata) | Retrieves meta data about an installed app | +| [getAppProperty](#method.getAppProperty) | Gets a property for a given app. | +| [getInstalledApps](#method.getInstalledApps) | Function fetches the details of all applications currently installed | +| [getLoadedApps](#method.getLoadedApps) | Retrieves a list of applications currently loaded on the system. | +| [isInstalled](#method.isInstalled) | check whether the Application is installed or not | +| [killApp](#method.killApp) | killApp will terminate forcefully | +| [launchApp](#method.launchApp) | Launch an Application and app will be in ACTIVE state. | +| [preloadApp](#method.preloadApp) | Preloads an Application and app will be in the RUNNING state (hidden). | +| [sendIntent](#method.sendIntent) | Sends an intent to a loaded app. | +| [setAppProperty](#method.setAppProperty) | Sets a property for a given app | +| [startSystemApp](#method.startSystemApp) | Start the System Application | +| [stopSystemApp](#method.stopSystemApp) | Stop the System Application | +| [terminateApp](#method.terminateApp) | TerminateApp will terminate gracefully | + + +## *clearAllAppData [method](#head.Methods)* + +Clears all persistent data for all apps. + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 0, + "method": "org.rdk.AppManager.clearAllAppData" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 0, + "result": null +} +``` + + +## *clearAppData [method](#head.Methods)* + +Clears all persistent data for a given appId. + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.appId | string | App identifier for the application. | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 1, + "method": "org.rdk.AppManager.clearAppData", + "params": { + "appId": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 1, + "result": null +} +``` + + +## *closeApp [method](#head.Methods)* + +closeApp moves the state from Active to Running state + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.appId | string | App identifier for the application. | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 2, + "method": "org.rdk.AppManager.closeApp", + "params": { + "appId": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 2, + "result": null +} +``` + + +## *getAppMetadata [method](#head.Methods)* + +Retrieves meta data about an installed app + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.appId | string | App identifier for the application. | +| params.metaData | string | the name of the meta-data | +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result.result | string | string holding json formatted app metadata | + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 3, + "method": "org.rdk.AppManager.getAppMetadata", + "params": { + "appId": "", + "metaData": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 3, + "result": "" +} +``` + + +## *getAppProperty [method](#head.Methods)* + +Gets a property for a given app. + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.appId | string | App identifier for the application. | +| params.key | string | the name of the property to get | +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result.value | string | the value of the key | + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 4, + "method": "org.rdk.AppManager.getAppProperty", + "params": { + "appId": "", + "key": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 4, + "result": "" +} +``` + + +## *getInstalledApps [method](#head.Methods)* + +Function fetches the details of all applications currently installed + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result.apps | string | A list containing the details of installed applications. | + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 5, + "method": "org.rdk.AppManager.getInstalledApps" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 5, + "result": "" +} +``` + + +## *getLoadedApps [method](#head.Methods)* + +Retrieves a list of applications currently loaded on the system. + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result.apps | string | A list containing the details of installed applications. | + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 6, + "method": "org.rdk.AppManager.getLoadedApps" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 6, + "result": "" +} +``` + + +## *isInstalled [method](#head.Methods)* + +check whether the Application is installed or not + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.appId | string | App identifier for the application. | +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result.installed | bool | if it is installed then return true otherwise false | + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 7, + "method": "org.rdk.AppManager.isInstalled", + "params": { + "appId": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 7, + "result": true +} +``` + + +## *killApp [method](#head.Methods)* + +killApp will terminate forcefully + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.appId | string | App identifier for the application. | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 8, + "method": "org.rdk.AppManager.killApp", + "params": { + "appId": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 8, + "result": null +} +``` + + +## *launchApp [method](#head.Methods)* + +Launch an Application and app will be in ACTIVE state. + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.appId | string | App identifier for the application. | +| params?.intent | string | (optional)A reference to the intent string that specifies the action or request to be processed. | +| params?.launchArgs | string | (optional)Additional parameters passed to the application. | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 9, + "method": "org.rdk.AppManager.launchApp", + "params": { + "appId": "", + "intent": "", + "launchArgs": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 9, + "result": null +} +``` + + +## *preloadApp [method](#head.Methods)* + +Preloads an Application and app will be in the RUNNING state (hidden). + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.appId | string | App identifier for the application. | +| params?.launchArgs | string | (optional)Additional parameters passed to the application. | +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result.error | string | if success = false it holds the appropriate error reason. | + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 10, + "method": "org.rdk.AppManager.preloadApp", + "params": { + "appId": "", + "launchArgs": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 10, + "result": "" +} +``` + + +## *sendIntent [method](#head.Methods)* + +Sends an intent to a loaded app. + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.appId | string | App identifier for the application. | +| params.intent | string | A reference to the intent string that specifies the action or request to be processed. | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 11, + "method": "org.rdk.AppManager.sendIntent", + "params": { + "appId": "", + "intent": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 11, + "result": null +} +``` + + +## *setAppProperty [method](#head.Methods)* + +Sets a property for a given app + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.appId | string | App identifier for the application. | +| params.key | string | the name of the property to get | +| params.value | string | the value of the key | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 12, + "method": "org.rdk.AppManager.setAppProperty", + "params": { + "appId": "", + "key": "", + "value": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 12, + "result": null +} +``` + + +## *startSystemApp [method](#head.Methods)* + +Start the System Application + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.appId | string | App identifier for the application. | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 13, + "method": "org.rdk.AppManager.startSystemApp", + "params": { + "appId": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 13, + "result": null +} +``` + + +## *stopSystemApp [method](#head.Methods)* + +Stop the System Application + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.appId | string | App identifier for the application. | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 14, + "method": "org.rdk.AppManager.stopSystemApp", + "params": { + "appId": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 14, + "result": null +} +``` + + +## *terminateApp [method](#head.Methods)* + +TerminateApp will terminate gracefully + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.appId | string | App identifier for the application. | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 15, + "method": "org.rdk.AppManager.terminateApp", + "params": { + "appId": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 15, + "result": null +} +``` + + + +# Properties +The following properties are provided by the AppManager plugin: + +AppManager interface properties: + +| Method | Description | +| :-------- | :-------- | +| [GetMaxHibernatedApps](#property.GetMaxHibernatedApps)RO | Get the maximum number of apps to maintain in the hibernated state | +| [GetMaxHibernatedFlashUsage](#property.GetMaxHibernatedFlashUsage)RO | Gets the max size of flash to use for hibernated apps (in mebibytes) | +| [GetMaxInactiveRamUsage](#property.GetMaxInactiveRamUsage)RO | Gets the max amount of ram available for inactive apps (in mebibytes) | +| [GetMaxRunningApps](#property.GetMaxRunningApps)RO | Gets the maximum number of apps to maintain in the running or suspended state | + + +## *GetMaxHibernatedApps [property](#head.Properties)* + +Get the maximum number of apps to maintain in the hibernated state + +> This property is read-only. +### Events +No events are associated with this method. +### Values +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| (property).maxHibernatedApps | int32_t | max number of apps to maintain in the hibernated state | + +### Examples + + +#### Get Request + +```json +{ + "jsonrpc": 2.0, + "id": 21, + "method": "org.rdk.AppManager.getMaxHibernatedApps" +} +``` + + +#### Get Response + +```json +{ + "jsonrpc": 2.0, + "id": 21, + "result": 0 +} +``` + + +## *GetMaxHibernatedFlashUsage [property](#head.Properties)* + +Gets the max size of flash to use for hibernated apps (in mebibytes) + +> This property is read-only. +### Events +No events are associated with this method. +### Values +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| (property).maxHibernatedFlashUsage | int32_t | max size of flash to use for hibernated apps (in mebibytes) | + +### Examples + + +#### Get Request + +```json +{ + "jsonrpc": 2.0, + "id": 22, + "method": "org.rdk.AppManager.getMaxHibernatedFlashUsage" +} +``` + + +#### Get Response + +```json +{ + "jsonrpc": 2.0, + "id": 22, + "result": 0 +} +``` + + +## *GetMaxInactiveRamUsage [property](#head.Properties)* + +Gets the max amount of ram available for inactive apps (in mebibytes) + +> This property is read-only. +### Events +No events are associated with this method. +### Values +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| (property).maxInactiveRamUsage | int32_t | max ram available for inactive apps (in mebibytes) | + +### Examples + + +#### Get Request + +```json +{ + "jsonrpc": 2.0, + "id": 23, + "method": "org.rdk.AppManager.getMaxInactiveRamUsage" +} +``` + + +#### Get Response + +```json +{ + "jsonrpc": 2.0, + "id": 23, + "result": 0 +} +``` + + +## *GetMaxRunningApps [property](#head.Properties)* + +Gets the maximum number of apps to maintain in the running or suspended state + +> This property is read-only. +### Events +No events are associated with this method. +### Values +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| (property).maxRunningApps | int32_t | max number of apps to maintain in the running or suspended state | + +### Examples + + +#### Get Request + +```json +{ + "jsonrpc": 2.0, + "id": 24, + "method": "org.rdk.AppManager.getMaxRunningApps" +} +``` + + +#### Get Response + +```json +{ + "jsonrpc": 2.0, + "id": 24, + "result": 0 +} +``` + + + +# Notifications + +Notifications are autonomous events, triggered by the internals of the implementation, and broadcasted via JSON-RPC to all registered observers. Refer to [[Thunder](#ref.Thunder)] for information on how to register for a notification. + +The following events are provided by the AppManager plugin: + +AppManager interface events: + +| Event | Description | +| :-------- | :-------- | +| [onAppInstalled](#event.onAppInstalled) | Triggered whenever the App is installed. | +| [onAppLaunchRequest](#event.onAppLaunchRequest) | Triggered whenever there is a request for App Launch. | +| [onAppLifecycleStateChanged](#event.onAppLifecycleStateChanged) | Triggered whenever there is a change in the lifecycle state of a running app. | +| [onAppUninstalled](#event.onAppUninstalled) | Triggered whenever the App is uninstalled. | +| [onAppUnloaded](#event.onAppUnloaded) | Triggered whenever the App is unloaded(terminated). | + + +## *onAppInstalled [event](#head.Notifications)* + +Triggered whenever the App is installed. + +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.appId | string | App identifier for the application. | +| params.version | string | The version number of the application in string format | + +### Examples + +```json +{ + "jsonrpc": 2.0, + "id": 16, + "method": "org.rdk.AppManager.onAppInstalled", + "params": { + "appId": "", + "version": "" + } +} +``` + + +## *onAppLaunchRequest [event](#head.Notifications)* + +Triggered whenever there is a request for App Launch. + +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.appId | string | App identifier for the application. | +| params.intent | string | A reference to the intent string that specifies the action or request to be processed. | +| params.source | string | A string indicating the source of the intent | + +### Examples + +```json +{ + "jsonrpc": 2.0, + "id": 17, + "method": "org.rdk.AppManager.onAppLaunchRequest", + "params": { + "appId": "", + "intent": "", + "source": "" + } +} +``` + + +## *onAppLifecycleStateChanged [event](#head.Notifications)* + +Triggered whenever there is a change in the lifecycle state of a running app. + +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.appId | string | App identifier for the application. | +| params.appInstanceId | string | A numerical identifier for a specific instance of the application. | +| params.newState | AppLifecycleState | The new state to transition the application. | +| params.oldState | AppLifecycleState | The previous state of the application instance before the update. | +| params.errorReason | AppErrorReason | The reason for any error encountered during the state transition | + +### Examples + +```json +{ + "jsonrpc": 2.0, + "id": 18, + "method": "org.rdk.AppManager.onAppLifecycleStateChanged", + "params": { + "appId": "", + "appInstanceId": "", + "newState": "APP_STATE_UNKNOWN", + "oldState": "APP_STATE_UNKNOWN", + "errorReason": "APP_ERROR_NONE" + } +} +``` + + +## *onAppUninstalled [event](#head.Notifications)* + +Triggered whenever the App is uninstalled. + +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.appId | string | App identifier for the application. | + +### Examples + +```json +{ + "jsonrpc": 2.0, + "id": 19, + "method": "org.rdk.AppManager.onAppUninstalled", + "params": { + "appId": "" + } +} +``` + + +## *onAppUnloaded [event](#head.Notifications)* + +Triggered whenever the App is unloaded(terminated). + +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.appId | string | App identifier for the application. | +| params.appInstanceId | string | A numerical identifier for a specific instance of the application. | + +### Examples + +```json +{ + "jsonrpc": 2.0, + "id": 20, + "method": "org.rdk.AppManager.onAppUnloaded", + "params": { + "appId": "", + "appInstanceId": "" + } +} +``` diff --git a/docs/apis/ApplicationPlugin.md b/docs/apis/ApplicationPlugin.md new file mode 100644 index 00000000..10b18a79 --- /dev/null +++ b/docs/apis/ApplicationPlugin.md @@ -0,0 +1,406 @@ + + +# Application Plugin + +**Version: [1.0.0](https://github.com/rdkcentral/rdkservices/blob/main/Application/CHANGELOG.md)** + +A Application plugin for Thunder framework. + +### Table of Contents + +- [Abbreviation, Acronyms and Terms](#head.Abbreviation,_Acronyms_and_Terms) +- [Description](#head.Description) +- [Configuration](#head.Configuration) +- [Methods](#head.Methods) +- [Properties](#head.Properties) +- [Notifications](#head.Notifications) + + +# Abbreviation, Acronyms and Terms + +[[Refer to this link](userguide/aat.md)] + + +# Description + +The `Application` plugin provides an interface for Application. + +The plugin is designed to be loaded and executed within the Thunder framework. For more information about the framework refer to [[Thunder](#ref.Thunder)]. + + +# Configuration + +The table below lists configuration options of the plugin. + +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| callsign | string | Plugin instance name (default: org.rdk.Application) | +| classname | string | Class name: *Application* | +| locator | string | Library name: *libWPEFrameworkApplication.so* | +| autostart | boolean | Determines if the plugin shall be started automatically along with the framework | + + +# Methods + +The following methods are provided by the Application plugin: + +Application interface methods: + +| Method | Description | +| :-------- | :-------- | +| [reset](#method.reset) | Resets application data | + + +## *reset [method](#head.Methods)* + +Resets application data + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.type | resettype | Type of reset to perform | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 0, + "method": "org.rdk.Application.reset", + "params": { + "type": "FACTORY" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 0, + "result": null +} +``` + + + +# Properties +The following properties are provided by the Application plugin: + +Application interface properties: + +| Method | Description | +| :-------- | :-------- | +| [ContentLink](#property.ContentLink)WO | URI of the associated application-specific content | +| [Identifier](#property.Identifier)RO | Application-specific identification string | +| [Language](#property.Language) | Current application user interface language | +| [LaunchPoint](#property.LaunchPoint) | Application launching point | +| [Visible](#property.Visible) | Current application visibility | + + +## *ContentLink [property](#head.Properties)* + +URI of the associated application-specific content + +> This property is write-only. +### Events +No events are associated with this method. +### Values +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| (property).link | string | Content URI (e.g. https://youtube.com) | + +### Examples + + +#### Set Request + +```json +{ + "jsonrpc": 2.0, + "id": 2, + "method": "org.rdk.Application.contentLink", + "params": { + "link": "" + } +} +``` + + +#### Set Response + +```json +{ + "jsonrpc": 2.0, + "id": 2, + "result": null +} +``` + + +## *Identifier [property](#head.Properties)* + +Application-specific identification string + +> This property is read-only. +### Events +No events are associated with this method. +### Values +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| (property).id | string | Identifier string | + +### Examples + + +#### Get Request + +```json +{ + "jsonrpc": 2.0, + "id": 3, + "method": "org.rdk.Application.identifier" +} +``` + + +#### Get Response + +```json +{ + "jsonrpc": 2.0, + "id": 3, + "result": "" +} +``` + + +## *Language [property](#head.Properties)* + +Current application user interface language + +### Events +No events are associated with this method. +### Values +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| (property).language | string | Language string as per RFC5646 (e.g. en) | + +### Examples + + +#### Get Request + +```json +{ + "jsonrpc": 2.0, + "id": 4, + "method": "org.rdk.Application.language" +} +``` + + +#### Get Response + +```json +{ + "jsonrpc": 2.0, + "id": 4, + "result": "" +} +``` + + +#### Set Request + +```json +{ + "jsonrpc": 2.0, + "id": 4, + "method": "org.rdk.Application.language", + "params": { + "language": "" + } +} +``` + + +#### Set Response + +```json +{ + "jsonrpc": 2.0, + "id": 4, + "result": null +} +``` + + +## *LaunchPoint [property](#head.Properties)* + +Application launching point + +### Events +No events are associated with this method. +### Values +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| (property).point | launchpointtype | | + +### Examples + + +#### Get Request + +```json +{ + "jsonrpc": 2.0, + "id": 5, + "method": "org.rdk.Application.launchPoint" +} +``` + + +#### Get Response + +```json +{ + "jsonrpc": 2.0, + "id": 5, + "result": "UNDEFINED" +} +``` + + +#### Set Request + +```json +{ + "jsonrpc": 2.0, + "id": 5, + "method": "org.rdk.Application.launchPoint", + "params": { + "point": "UNDEFINED" + } +} +``` + + +#### Set Response + +```json +{ + "jsonrpc": 2.0, + "id": 5, + "result": null +} +``` + + +## *Visible [property](#head.Properties)* + +Current application visibility + +### Events +No events are associated with this method. +### Values +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| (property).visiblity | bool | | + +### Examples + + +#### Get Request + +```json +{ + "jsonrpc": 2.0, + "id": 6, + "method": "org.rdk.Application.visible" +} +``` + + +#### Get Response + +```json +{ + "jsonrpc": 2.0, + "id": 6, + "result": true +} +``` + + +#### Set Request + +```json +{ + "jsonrpc": 2.0, + "id": 6, + "method": "org.rdk.Application.visible", + "params": { + "visiblity": true + } +} +``` + + +#### Set Response + +```json +{ + "jsonrpc": 2.0, + "id": 6, + "result": null +} +``` + + + +# Notifications + +Notifications are autonomous events, triggered by the internals of the implementation, and broadcasted via JSON-RPC to all registered observers. Refer to [[Thunder](#ref.Thunder)] for information on how to register for a notification. + +The following events are provided by the Application plugin: + +Application interface events: + +| Event | Description | +| :-------- | :-------- | +| [visibilityChange](#event.visibilityChange) | Application visibility changes | + + +## *visibilityChange [event](#head.Notifications)* + +Application visibility changes + +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.hidden | bool | Denotes if application is currently hidden | + +### Examples + +```json +{ + "jsonrpc": 2.0, + "id": 1, + "method": "org.rdk.Application.visibilityChange", + "params": { + "hidden": true + } +} +``` diff --git a/docs/apis/BrowserPlugin.md b/docs/apis/BrowserPlugin.md new file mode 100644 index 00000000..fb1e09c0 --- /dev/null +++ b/docs/apis/BrowserPlugin.md @@ -0,0 +1,1474 @@ + + +# Browser Plugin + +**Version: [1.0.0](https://github.com/rdkcentral/rdkservices/blob/main/Browser/CHANGELOG.md)** + +A Browser plugin for Thunder framework. + +### Table of Contents + +- [Abbreviation, Acronyms and Terms](#head.Abbreviation,_Acronyms_and_Terms) +- [Description](#head.Description) +- [Configuration](#head.Configuration) +- [Methods](#head.Methods) +- [Properties](#head.Properties) +- [Notifications](#head.Notifications) + + +# Abbreviation, Acronyms and Terms + +[[Refer to this link](userguide/aat.md)] + + +# Description + +The `Browser` plugin provides an interface for Browser. + +The plugin is designed to be loaded and executed within the Thunder framework. For more information about the framework refer to [[Thunder](#ref.Thunder)]. + + +# Configuration + +The table below lists configuration options of the plugin. + +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| callsign | string | Plugin instance name (default: org.rdk.Browser) | +| classname | string | Class name: *Browser* | +| locator | string | Library name: *libWPEFrameworkBrowser.so* | +| autostart | boolean | Determines if the plugin shall be started automatically along with the framework | + + +# Methods + +The following methods are provided by the Browser plugin: + +Browser interface methods: + +| Method | Description | +| :-------- | :-------- | +| [addUserScript](#method.addUserScript) | Add user script to be executed at document start. | +| [collectGarbage](#method.collectGarbage) | Initiate garbage collection | +| [cookieJar](#method.cookieJar) | | +| [cookieJarChanged](#method.cookieJarChanged) | Notifies that cookies were added, removed or modified. | +| [getFPS](#method.getFPS) | | +| [getURL](#method.getURL) | | +| [hide](#method.hide) | | +| [loadFailed](#method.loadFailed) | Browser failed to load page | +| [loadFinished](#method.loadFinished) | Initial HTML document has been completely loaded and parsed | +| [pageClosure](#method.pageClosure) | Notifies that the web page requests to close its window | +| [removeAllUserScripts](#method.removeAllUserScripts) | Remove all user scripts. | +| [runJavaScript](#method.runJavaScript) | Run javascript in main frame. | +| [setURL](#method.setURL) | | +| [uRLChange](#method.uRLChange) | Signals a URL change in the browser | +| [visibilityChange](#method.visibilityChange) | Signals a visibility change of the browser | + + +## *addUserScript [method](#head.Methods)* + +Add user script to be executed at document start. + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.script | string | Utf8 encoded JS code string. | +| params.topFrameOnly | bool | - | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 0, + "method": "org.rdk.Browser.addUserScript", + "params": { + "script": "", + "topFrameOnly": true + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 0, + "result": null +} +``` + + +## *collectGarbage [method](#head.Methods)* + +Initiate garbage collection + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 1, + "method": "org.rdk.Browser.collectGarbage" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 1, + "result": null +} +``` + + +## *cookieJar [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.version | uint32_t | - | +| params.checksum | uint32_t | - | +| params.payload | string | base64 encoded JSON string response to be delivered to $badger.callback | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 2, + "method": "org.rdk.Browser.cookieJar", + "params": { + "version": 0, + "checksum": 0, + "payload": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 2, + "result": null +} +``` + + +## *cookieJarChanged [method](#head.Methods)* + +Notifies that cookies were added, removed or modified. + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 3, + "method": "org.rdk.Browser.cookieJarChanged" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 3, + "result": null +} +``` + + +## *getFPS [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 4, + "method": "org.rdk.Browser.getFPS" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 4, + "result": null +} +``` + + +## *getURL [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 5, + "method": "org.rdk.Browser.getURL" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 5, + "result": null +} +``` + + +## *hide [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.hidden | bool | hidden (true) or visible (false) | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 6, + "method": "org.rdk.Browser.hide", + "params": { + "hidden": true + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 6, + "result": null +} +``` + + +## *loadFailed [method](#head.Methods)* + +Browser failed to load page + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.URL | string | The URL that has been loaded (e.g. https://example.com) | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 7, + "method": "org.rdk.Browser.loadFailed", + "params": { + "URL": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 7, + "result": null +} +``` + + +## *loadFinished [method](#head.Methods)* + +Initial HTML document has been completely loaded and parsed + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.URL | string | The URL that has been loaded (e.g. https://example.com) | +| params.httpstatus | int32_t | The response code of main resource request (e.g. 200) | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 8, + "method": "org.rdk.Browser.loadFinished", + "params": { + "URL": "", + "httpstatus": 0 + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 8, + "result": null +} +``` + + +## *pageClosure [method](#head.Methods)* + +Notifies that the web page requests to close its window + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 9, + "method": "org.rdk.Browser.pageClosure" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 9, + "result": null +} +``` + + +## *removeAllUserScripts [method](#head.Methods)* + +Remove all user scripts. + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 10, + "method": "org.rdk.Browser.removeAllUserScripts" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 10, + "result": null +} +``` + + +## *runJavaScript [method](#head.Methods)* + +Run javascript in main frame. + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.script | string | Utf8 encoded JS code string. | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 11, + "method": "org.rdk.Browser.runJavaScript", + "params": { + "script": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 11, + "result": null +} +``` + + +## *setURL [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.URL | string | The URL that has been loaded (e.g. https://example.com) | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 12, + "method": "org.rdk.Browser.setURL", + "params": { + "URL": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 12, + "result": null +} +``` + + +## *uRLChange [method](#head.Methods)* + +Signals a URL change in the browser + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.URL | string | The URL that has been loaded (e.g. https://example.com) | +| params.loaded | bool | loaded (true) or not (false) | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 13, + "method": "org.rdk.Browser.uRLChange", + "params": { + "URL": "", + "loaded": true + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 13, + "result": null +} +``` + + +## *visibilityChange [method](#head.Methods)* + +Signals a visibility change of the browser + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.hidden | bool | hidden (true) or visible (false) | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 14, + "method": "org.rdk.Browser.visibilityChange", + "params": { + "hidden": true + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 14, + "result": null +} +``` + + + +# Properties +The following properties are provided by the Browser plugin: + +Browser interface properties: + +| Method | Description | +| :-------- | :-------- | +| [BridgeEvent](#property.BridgeEvent)WO | Send legacy $badger event. | +| [BridgeReply](#property.BridgeReply)WO | Response for legacy $badger. | +| [FPS](#property.FPS)RO | Current framerate the browser is rendering at | +| [HTTPCookieAcceptPolicy](#property.HTTPCookieAcceptPolicy) | HTTP cookies accept policy | +| [LocalStorageEnabled](#property.LocalStorageEnabled) | Controls the local storage availability | +| [MixedContentPolicy](#property.MixedContentPolicy) | Mixed content policy | +| [SecurityProfile](#property.SecurityProfile) | Security profile for secure connections | +| [URL](#property.URL) | Page loaded in the browser | +| [UserAgent](#property.UserAgent) | UserAgent string used by the browser | +| [UserScripts](#property.UserScripts) | User scripts used by the browser | +| [UserStyleSheets](#property.UserStyleSheets) | User style sheets used by the browser | +| [Visibility](#property.Visibility) | Browser window visibility state | + + +## *BridgeEvent [property](#head.Properties)* + +Send legacy $badger event. + +> This property is write-only. +### Events +No events are associated with this method. +### Values +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| (property).payload | string | base64 encoded JSON string response to be delivered to $badger.callback | + +### Examples + + +#### Set Request + +```json +{ + "jsonrpc": 2.0, + "id": 19, + "method": "org.rdk.Browser.bridgeEvent", + "params": { + "payload": "" + } +} +``` + + +#### Set Response + +```json +{ + "jsonrpc": 2.0, + "id": 19, + "result": null +} +``` + + +## *BridgeReply [property](#head.Properties)* + +Response for legacy $badger. + +> This property is write-only. +### Events +No events are associated with this method. +### Values +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| (property).payload | string | base64 encoded JSON string response to be delivered to $badger.callback | + +### Examples + + +#### Set Request + +```json +{ + "jsonrpc": 2.0, + "id": 20, + "method": "org.rdk.Browser.bridgeReply", + "params": { + "payload": "" + } +} +``` + + +#### Set Response + +```json +{ + "jsonrpc": 2.0, + "id": 20, + "result": null +} +``` + + +## *FPS [property](#head.Properties)* + +Current framerate the browser is rendering at + +> This property is read-only. +### Events +No events are associated with this method. +### Values +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| (property).fps | uint8_t | Current FPS | + +### Examples + + +#### Get Request + +```json +{ + "jsonrpc": 2.0, + "id": 21, + "method": "org.rdk.Browser.fPS" +} +``` + + +#### Get Response + +```json +{ + "jsonrpc": 2.0, + "id": 21, + "result": "" +} +``` + + +## *HTTPCookieAcceptPolicy [property](#head.Properties)* + +HTTP cookies accept policy + +### Events +No events are associated with this method. +### Values +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| (property).policy | HTTPCookieAcceptPolicyType | HTTP Cookie Accept Policy Type (e.g. always) | + +### Examples + + +#### Get Request + +```json +{ + "jsonrpc": 2.0, + "id": 22, + "method": "org.rdk.Browser.hTTPCookieAcceptPolicy" +} +``` + + +#### Get Response + +```json +{ + "jsonrpc": 2.0, + "id": 22, + "result": "ALWAYS" +} +``` + + +#### Set Request + +```json +{ + "jsonrpc": 2.0, + "id": 22, + "method": "org.rdk.Browser.hTTPCookieAcceptPolicy", + "params": { + "policy": "ALWAYS" + } +} +``` + + +#### Set Response + +```json +{ + "jsonrpc": 2.0, + "id": 22, + "result": null +} +``` + + +## *LocalStorageEnabled [property](#head.Properties)* + +Controls the local storage availability + +### Events +No events are associated with this method. +### Values +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| (property).enabled | bool | | + +### Examples + + +#### Get Request + +```json +{ + "jsonrpc": 2.0, + "id": 23, + "method": "org.rdk.Browser.localStorageEnabled" +} +``` + + +#### Get Response + +```json +{ + "jsonrpc": 2.0, + "id": 23, + "result": true +} +``` + + +#### Set Request + +```json +{ + "jsonrpc": 2.0, + "id": 23, + "method": "org.rdk.Browser.localStorageEnabled", + "params": { + "enabled": true + } +} +``` + + +#### Set Response + +```json +{ + "jsonrpc": 2.0, + "id": 23, + "result": null +} +``` + + +## *MixedContentPolicy [property](#head.Properties)* + +Mixed content policy + +### Events +No events are associated with this method. +### Values +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| (property).policy | MixedContentPolicyType | Mixed content policy type | + +### Examples + + +#### Get Request + +```json +{ + "jsonrpc": 2.0, + "id": 24, + "method": "org.rdk.Browser.mixedContentPolicy" +} +``` + + +#### Get Response + +```json +{ + "jsonrpc": 2.0, + "id": 24, + "result": "ALLOWED" +} +``` + + +#### Set Request + +```json +{ + "jsonrpc": 2.0, + "id": 24, + "method": "org.rdk.Browser.mixedContentPolicy", + "params": { + "policy": "ALLOWED" + } +} +``` + + +#### Set Response + +```json +{ + "jsonrpc": 2.0, + "id": 24, + "result": null +} +``` + + +## *SecurityProfile [property](#head.Properties)* + +Security profile for secure connections + +### Events +No events are associated with this method. +### Values +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| (property).profile | string | Security profile for secure connections (e.g. compatible) | + +### Examples + + +#### Get Request + +```json +{ + "jsonrpc": 2.0, + "id": 25, + "method": "org.rdk.Browser.securityProfile" +} +``` + + +#### Get Response + +```json +{ + "jsonrpc": 2.0, + "id": 25, + "result": "" +} +``` + + +#### Set Request + +```json +{ + "jsonrpc": 2.0, + "id": 25, + "method": "org.rdk.Browser.securityProfile", + "params": { + "profile": "" + } +} +``` + + +#### Set Response + +```json +{ + "jsonrpc": 2.0, + "id": 25, + "result": null +} +``` + + +## *URL [property](#head.Properties)* + +Page loaded in the browser + +### Events +No events are associated with this method. +### Values +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| (property).url | string | Loaded URL (e.g. https://example.com) | + +### Examples + + +#### Get Request + +```json +{ + "jsonrpc": 2.0, + "id": 26, + "method": "org.rdk.Browser.uRL" +} +``` + + +#### Get Response + +```json +{ + "jsonrpc": 2.0, + "id": 26, + "result": "" +} +``` + + +#### Set Request + +```json +{ + "jsonrpc": 2.0, + "id": 26, + "method": "org.rdk.Browser.uRL", + "params": { + "url": "" + } +} +``` + + +#### Set Response + +```json +{ + "jsonrpc": 2.0, + "id": 26, + "result": null +} +``` + + +## *UserAgent [property](#head.Properties)* + +UserAgent string used by the browser + +### Events +No events are associated with this method. +### Values +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| (property).useragent | string | UserAgent value (e.g. Mozilla/5.0 (Linux; x86_64 GNU/Linux) AppleWebKit/601.1 (KHTML, like Gecko) Version/8.0 Safari/601.1 WP) | + +### Examples + + +#### Get Request + +```json +{ + "jsonrpc": 2.0, + "id": 27, + "method": "org.rdk.Browser.userAgent" +} +``` + + +#### Get Response + +```json +{ + "jsonrpc": 2.0, + "id": 27, + "result": "" +} +``` + + +#### Set Request + +```json +{ + "jsonrpc": 2.0, + "id": 27, + "method": "org.rdk.Browser.userAgent", + "params": { + "useragent": "" + } +} +``` + + +#### Set Response + +```json +{ + "jsonrpc": 2.0, + "id": 27, + "result": null +} +``` + + +## *UserScripts [property](#head.Properties)* + +User scripts used by the browser + +### Events +No events are associated with this method. +### Values +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| (property).uris | IStringIterator | JSON array containing URIs pointing to user scripts, supported protocols: file:// | +| (property).uris[#] | string | | + +### Examples + + +#### Get Request + +```json +{ + "jsonrpc": 2.0, + "id": 28, + "method": "org.rdk.Browser.userScripts" +} +``` + + +#### Get Response + +```json +{ + "jsonrpc": 2.0, + "id": 28, + "result": [ + "" + ] +} +``` + + +#### Set Request + +```json +{ + "jsonrpc": 2.0, + "id": 28, + "method": "org.rdk.Browser.userScripts", + "params": { + "uris": [ + "" + ] + } +} +``` + + +#### Set Response + +```json +{ + "jsonrpc": 2.0, + "id": 28, + "result": null +} +``` + + +## *UserStyleSheets [property](#head.Properties)* + +User style sheets used by the browser + +### Events +No events are associated with this method. +### Values +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| (property).uris | IStringIterator | JSON array containing URIs pointing to user scripts, supported protocols: file:// | +| (property).uris[#] | string | | + +### Examples + + +#### Get Request + +```json +{ + "jsonrpc": 2.0, + "id": 29, + "method": "org.rdk.Browser.userStyleSheets" +} +``` + + +#### Get Response + +```json +{ + "jsonrpc": 2.0, + "id": 29, + "result": [ + "" + ] +} +``` + + +#### Set Request + +```json +{ + "jsonrpc": 2.0, + "id": 29, + "method": "org.rdk.Browser.userStyleSheets", + "params": { + "uris": [ + "" + ] + } +} +``` + + +#### Set Response + +```json +{ + "jsonrpc": 2.0, + "id": 29, + "result": null +} +``` + + +## *Visibility [property](#head.Properties)* + +Browser window visibility state + +### Events +No events are associated with this method. +### Values +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| (property).visible | VisibilityType | Visiblity state (e.g. ) | + +### Examples + + +#### Get Request + +```json +{ + "jsonrpc": 2.0, + "id": 30, + "method": "org.rdk.Browser.visibility" +} +``` + + +#### Get Response + +```json +{ + "jsonrpc": 2.0, + "id": 30, + "result": "HIDDEN" +} +``` + + +#### Set Request + +```json +{ + "jsonrpc": 2.0, + "id": 30, + "method": "org.rdk.Browser.visibility", + "params": { + "visible": "HIDDEN" + } +} +``` + + +#### Set Response + +```json +{ + "jsonrpc": 2.0, + "id": 30, + "result": null +} +``` + + + +# Notifications + +Notifications are autonomous events, triggered by the internals of the implementation, and broadcasted via JSON-RPC to all registered observers. Refer to [[Thunder](#ref.Thunder)] for information on how to register for a notification. + +The following events are provided by the Browser plugin: + +Browser interface events: + +| Event | Description | +| :-------- | :-------- | +| [closure](#event.closure) | | +| [hidden](#event.hidden) | | +| [loadFinished](#event.loadFinished) | | +| [uRLChanged](#event.uRLChanged) | | + + +## *closure [event](#head.Notifications)* + + + +### Parameters +This method takes no parameters. + +### Examples + +```json +{ + "jsonrpc": 2.0, + "id": 15, + "method": "org.rdk.Browser.closure" +} +``` + + +## *hidden [event](#head.Notifications)* + + + +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.hidden | bool | hidden (true) or visible (false) | + +### Examples + +```json +{ + "jsonrpc": 2.0, + "id": 16, + "method": "org.rdk.Browser.hidden", + "params": { + "hidden": true + } +} +``` + + +## *loadFinished [event](#head.Notifications)* + + + +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.URL | string | The URL that has been loaded (e.g. https://example.com) | + +### Examples + +```json +{ + "jsonrpc": 2.0, + "id": 17, + "method": "org.rdk.Browser.loadFinished", + "params": { + "URL": "" + } +} +``` + + +## *uRLChanged [event](#head.Notifications)* + + + +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.URL | string | The URL that has been loaded (e.g. https://example.com) | + +### Examples + +```json +{ + "jsonrpc": 2.0, + "id": 18, + "method": "org.rdk.Browser.uRLChanged", + "params": { + "URL": "" + } +} +``` diff --git a/docs/apis/CapturePlugin.md b/docs/apis/CapturePlugin.md new file mode 100644 index 00000000..4d5acef0 --- /dev/null +++ b/docs/apis/CapturePlugin.md @@ -0,0 +1,138 @@ + + +# Capture Plugin + +**Version: [1.0.0](https://github.com/rdkcentral/rdkservices/blob/main/Capture/CHANGELOG.md)** + +A Capture plugin for Thunder framework. + +### Table of Contents + +- [Abbreviation, Acronyms and Terms](#head.Abbreviation,_Acronyms_and_Terms) +- [Description](#head.Description) +- [Configuration](#head.Configuration) +- [Methods](#head.Methods) + + +# Abbreviation, Acronyms and Terms + +[[Refer to this link](userguide/aat.md)] + + +# Description + +The `Capture` plugin provides an interface for Capture. + +The plugin is designed to be loaded and executed within the Thunder framework. For more information about the framework refer to [[Thunder](#ref.Thunder)]. + + +# Configuration + +The table below lists configuration options of the plugin. + +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| callsign | string | Plugin instance name (default: org.rdk.Capture) | +| classname | string | Class name: *Capture* | +| locator | string | Library name: *libWPEFrameworkCapture.so* | +| autostart | boolean | Determines if the plugin shall be started automatically along with the framework | + + +# Methods + +The following methods are provided by the Capture plugin: + +Capture interface methods: + +| Method | Description | +| :-------- | :-------- | +| [capture](#method.capture) | | +| [r8_G8_B8_A8](#method.r8_G8_B8_A8) | | + + +## *capture [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.storer | ICapture::IStore | - | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 0, + "method": "org.rdk.Capture.capture", + "params": { + "storer": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 0, + "result": null +} +``` + + +## *r8_G8_B8_A8 [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.char | unsigned | - | +| params.int | unsigned | - | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 1, + "method": "org.rdk.Capture.r8_G8_B8_A8", + "params": { + "char": "", + "int": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 1, + "result": null +} +``` + + diff --git a/docs/apis/CompositionBufferPlugin.md b/docs/apis/CompositionBufferPlugin.md new file mode 100644 index 00000000..5c5f6148 --- /dev/null +++ b/docs/apis/CompositionBufferPlugin.md @@ -0,0 +1,648 @@ + + +# CompositionBuffer Plugin + +**Version: [1.0.0](https://github.com/rdkcentral/rdkservices/blob/main/CompositionBuffer/CHANGELOG.md)** + +A CompositionBuffer plugin for Thunder framework. + +### Table of Contents + +- [Abbreviation, Acronyms and Terms](#head.Abbreviation,_Acronyms_and_Terms) +- [Description](#head.Description) +- [Configuration](#head.Configuration) +- [Methods](#head.Methods) + + +# Abbreviation, Acronyms and Terms + +[[Refer to this link](userguide/aat.md)] + + +# Description + +The `CompositionBuffer` plugin provides an interface for CompositionBuffer. + +The plugin is designed to be loaded and executed within the Thunder framework. For more information about the framework refer to [[Thunder](#ref.Thunder)]. + + +# Configuration + +The table below lists configuration options of the plugin. + +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| callsign | string | Plugin instance name (default: org.rdk.CompositionBuffer) | +| classname | string | Class name: *CompositionBuffer* | +| locator | string | Library name: *libWPEFrameworkCompositionBuffer.so* | +| autostart | boolean | Determines if the plugin shall be started automatically along with the framework | + + +# Methods + +The following methods are provided by the CompositionBuffer plugin: + +CompositionBuffer interface methods: + +| Method | Description | +| :-------- | :-------- | +| [accessor](#method.accessor) | frame buffer interface with hardware optimisation in mind | +| [addRef](#method.addRef) | | +| [completed](#method.completed) | | +| [format](#method.format) | | +| [height](#method.height) | | +| [identifier](#method.identifier) | | +| [isValid](#method.isValid) | | +| [modifier](#method.modifier) | | +| [next](#method.next) | | +| [offset](#method.offset) | | +| [release](#method.release) | | +| [render](#method.render) | | +| [reset](#method.reset) | | +| [stride](#method.stride) | | +| [type](#method.type) | | +| [width](#method.width) | | + + +## *accessor [method](#head.Methods)* + +frame buffer interface with hardware optimisation in mind + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 0, + "method": "org.rdk.CompositionBuffer.accessor" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 0, + "result": null +} +``` + + +## *addRef [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 1, + "method": "org.rdk.CompositionBuffer.addRef" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 1, + "result": null +} +``` + + +## *completed [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.dirty | bool | - | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 2, + "method": "org.rdk.CompositionBuffer.completed", + "params": { + "dirty": true + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 2, + "result": null +} +``` + + +## *format [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 3, + "method": "org.rdk.CompositionBuffer.format" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 3, + "result": null +} +``` + + +## *height [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 4, + "method": "org.rdk.CompositionBuffer.height" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 4, + "result": null +} +``` + + +## *identifier [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 5, + "method": "org.rdk.CompositionBuffer.identifier" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 5, + "result": null +} +``` + + +## *isValid [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 6, + "method": "org.rdk.CompositionBuffer.isValid" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 6, + "result": null +} +``` + + +## *modifier [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 7, + "method": "org.rdk.CompositionBuffer.modifier" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 7, + "result": null +} +``` + + +## *next [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 8, + "method": "org.rdk.CompositionBuffer.next" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 8, + "result": null +} +``` + + +## *offset [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 9, + "method": "org.rdk.CompositionBuffer.offset" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 9, + "result": null +} +``` + + +## *release [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 10, + "method": "org.rdk.CompositionBuffer.release" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 10, + "result": null +} +``` + + +## *render [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 11, + "method": "org.rdk.CompositionBuffer.render" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 11, + "result": null +} +``` + + +## *reset [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 12, + "method": "org.rdk.CompositionBuffer.reset" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 12, + "result": null +} +``` + + +## *stride [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 13, + "method": "org.rdk.CompositionBuffer.stride" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 13, + "result": null +} +``` + + +## *type [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 14, + "method": "org.rdk.CompositionBuffer.type" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 14, + "result": null +} +``` + + +## *width [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 15, + "method": "org.rdk.CompositionBuffer.width" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 15, + "result": null +} +``` + + diff --git a/docs/apis/CompositionPlugin.md b/docs/apis/CompositionPlugin.md new file mode 100644 index 00000000..9090e945 --- /dev/null +++ b/docs/apis/CompositionPlugin.md @@ -0,0 +1,725 @@ + + +# Composition Plugin + +**Version: [1.0.0](https://github.com/rdkcentral/rdkservices/blob/main/Composition/CHANGELOG.md)** + +A Composition plugin for Thunder framework. + +### Table of Contents + +- [Abbreviation, Acronyms and Terms](#head.Abbreviation,_Acronyms_and_Terms) +- [Description](#head.Description) +- [Configuration](#head.Configuration) +- [Methods](#head.Methods) +- [Notifications](#head.Notifications) + + +# Abbreviation, Acronyms and Terms + +[[Refer to this link](userguide/aat.md)] + + +# Description + +The `Composition` plugin provides an interface for Composition. + +The plugin is designed to be loaded and executed within the Thunder framework. For more information about the framework refer to [[Thunder](#ref.Thunder)]. + + +# Configuration + +The table below lists configuration options of the plugin. + +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| callsign | string | Plugin instance name (default: org.rdk.Composition) | +| classname | string | Class name: *Composition* | +| locator | string | Library name: *libWPEFrameworkComposition.so* | +| autostart | boolean | Determines if the plugin shall be started automatically along with the framework | + + +# Methods + +The following methods are provided by the Composition plugin: + +Composition interface methods: + +| Method | Description | +| :-------- | :-------- | +| [configure](#method.configure) | | +| [format](#method.format) | | +| [geometry](#method.geometry) | | +| [modifier](#method.modifier) | | +| [name](#method.name) | | +| [native](#method.native) | | +| [offset](#method.offset) | | +| [opacity](#method.opacity) | | +| [port](#method.port) | | +| [postScanOut](#method.postScanOut) | | +| [preScanOut](#method.preScanOut) | | +| [resolution](#method.resolution) | | +| [scanOut](#method.scanOut) | | +| [sdrToHdrGraphicsBrightness](#method.sdrToHdrGraphicsBrightness) | | +| [stride](#method.stride) | Gets the refresh rate from a IComposition::ScreenResolution. | +| [zOrder](#method.zOrder) | | + + +## *configure [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.service | PluginHost::IShell | - | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 0, + "method": "org.rdk.Composition.configure", + "params": { + "service": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 0, + "result": null +} +``` + + +## *format [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 1, + "method": "org.rdk.Composition.format" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 1, + "result": null +} +``` + + +## *geometry [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 2, + "method": "org.rdk.Composition.geometry" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 2, + "result": null +} +``` + + +## *modifier [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 3, + "method": "org.rdk.Composition.modifier" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 3, + "result": null +} +``` + + +## *name [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 4, + "method": "org.rdk.Composition.name" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 4, + "result": null +} +``` + + +## *native [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 5, + "method": "org.rdk.Composition.native" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 5, + "result": null +} +``` + + +## *offset [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 6, + "method": "org.rdk.Composition.offset" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 6, + "result": null +} +``` + + +## *opacity [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.value | uint32_t | - | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 7, + "method": "org.rdk.Composition.opacity", + "params": { + "value": 0 + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 7, + "result": null +} +``` + + +## *port [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 8, + "method": "org.rdk.Composition.port" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 8, + "result": null +} +``` + + +## *postScanOut [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 9, + "method": "org.rdk.Composition.postScanOut" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 9, + "result": null +} +``` + + +## *preScanOut [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 10, + "method": "org.rdk.Composition.preScanOut" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 10, + "result": null +} +``` + + +## *resolution [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 11, + "method": "org.rdk.Composition.resolution" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 11, + "result": null +} +``` + + +## *scanOut [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 12, + "method": "org.rdk.Composition.scanOut" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 12, + "result": null +} +``` + + +## *sdrToHdrGraphicsBrightness [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.brightness | Brightness | - | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 13, + "method": "org.rdk.Composition.sdrToHdrGraphicsBrightness", + "params": { + "brightness": "SdrToHdrGraphicsBrightness_Default" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 13, + "result": null +} +``` + + +## *stride [method](#head.Methods)* + +Gets the refresh rate from a IComposition::ScreenResolution. + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 14, + "method": "org.rdk.Composition.stride" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 14, + "result": null +} +``` + + +## *zOrder [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 15, + "method": "org.rdk.Composition.zOrder" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 15, + "result": null +} +``` + + + + +# Notifications + +Notifications are autonomous events, triggered by the internals of the implementation, and broadcasted via JSON-RPC to all registered observers. Refer to [[Thunder](#ref.Thunder)] for information on how to register for a notification. + +The following events are provided by the Composition plugin: + +Composition interface events: + +| Event | Description | +| :-------- | :-------- | +| [attached](#event.attached) | | +| [detached](#event.detached) | | + + +## *attached [event](#head.Notifications)* + + + +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.name | string | - | +| params.client | IClient | - | + +### Examples + +```json +{ + "jsonrpc": 2.0, + "id": 16, + "method": "org.rdk.Composition.attached", + "params": { + "name": "", + "client": "" + } +} +``` + + +## *detached [event](#head.Notifications)* + + + +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.name | string | - | + +### Examples + +```json +{ + "jsonrpc": 2.0, + "id": 17, + "method": "org.rdk.Composition.detached", + "params": { + "name": "" + } +} +``` diff --git a/docs/apis/ConfigurationPlugin.md b/docs/apis/ConfigurationPlugin.md new file mode 100644 index 00000000..8baecb8a --- /dev/null +++ b/docs/apis/ConfigurationPlugin.md @@ -0,0 +1,93 @@ + + +# Configuration Plugin + +**Version: [1.0.0](https://github.com/rdkcentral/rdkservices/blob/main/Configuration/CHANGELOG.md)** + +A Configuration plugin for Thunder framework. + +### Table of Contents + +- [Abbreviation, Acronyms and Terms](#head.Abbreviation,_Acronyms_and_Terms) +- [Description](#head.Description) +- [Configuration](#head.Configuration) +- [Methods](#head.Methods) + + +# Abbreviation, Acronyms and Terms + +[[Refer to this link](userguide/aat.md)] + + +# Description + +The `Configuration` plugin provides an interface for Configuration. + +The plugin is designed to be loaded and executed within the Thunder framework. For more information about the framework refer to [[Thunder](#ref.Thunder)]. + + +# Configuration + +The table below lists configuration options of the plugin. + +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| callsign | string | Plugin instance name (default: org.rdk.Configuration) | +| classname | string | Class name: *Configuration* | +| locator | string | Library name: *libWPEFrameworkConfiguration.so* | +| autostart | boolean | Determines if the plugin shall be started automatically along with the framework | + + +# Methods + +The following methods are provided by the Configuration plugin: + +Configuration interface methods: + +| Method | Description | +| :-------- | :-------- | +| [configure](#method.configure) | | + + +## *configure [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.framework | PluginHost::IShell | - | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 0, + "method": "org.rdk.Configuration.configure", + "params": { + "framework": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 0, + "result": null +} +``` + + diff --git a/docs/apis/ContentDecryptionPlugin.md b/docs/apis/ContentDecryptionPlugin.md new file mode 100644 index 00000000..bdcafe5f --- /dev/null +++ b/docs/apis/ContentDecryptionPlugin.md @@ -0,0 +1,213 @@ + + +# ContentDecryption Plugin + +**Version: [1.0.0](https://github.com/rdkcentral/rdkservices/blob/main/ContentDecryption/CHANGELOG.md)** + +A ContentDecryption plugin for Thunder framework. + +### Table of Contents + +- [Abbreviation, Acronyms and Terms](#head.Abbreviation,_Acronyms_and_Terms) +- [Description](#head.Description) +- [Configuration](#head.Configuration) +- [Methods](#head.Methods) +- [Notifications](#head.Notifications) + + +# Abbreviation, Acronyms and Terms + +[[Refer to this link](userguide/aat.md)] + + +# Description + +The `ContentDecryption` plugin provides an interface for ContentDecryption. + +The plugin is designed to be loaded and executed within the Thunder framework. For more information about the framework refer to [[Thunder](#ref.Thunder)]. + + +# Configuration + +The table below lists configuration options of the plugin. + +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| callsign | string | Plugin instance name (default: org.rdk.ContentDecryption) | +| classname | string | Class name: *ContentDecryption* | +| locator | string | Library name: *libWPEFrameworkContentDecryption.so* | +| autostart | boolean | Determines if the plugin shall be started automatically along with the framework | + + +# Methods + +The following methods are provided by the ContentDecryption plugin: + +ContentDecryption interface methods: + +| Method | Description | +| :-------- | :-------- | +| [deinitialize](#method.deinitialize) | | +| [initialize](#method.initialize) | | +| [reset](#method.reset) | | + + +## *deinitialize [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.service | PluginHost::IShell | - | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 0, + "method": "org.rdk.ContentDecryption.deinitialize", + "params": { + "service": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 0, + "result": null +} +``` + + +## *initialize [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.service | PluginHost::IShell | - | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 1, + "method": "org.rdk.ContentDecryption.initialize", + "params": { + "service": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 1, + "result": null +} +``` + + +## *reset [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 2, + "method": "org.rdk.ContentDecryption.reset" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 2, + "result": null +} +``` + + + + +# Notifications + +Notifications are autonomous events, triggered by the internals of the implementation, and broadcasted via JSON-RPC to all registered observers. Refer to [[Thunder](#ref.Thunder)] for information on how to register for a notification. + +The following events are provided by the ContentDecryption plugin: + +ContentDecryption interface events: + +| Event | Description | +| :-------- | :-------- | +| [initializationStatus](#event.initializationStatus) | initialization status. | + + +## *initializationStatus [event](#head.Notifications)* + +initialization status. + +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.drm | std::string | - | +| params.status | Status | - | + +### Examples + +```json +{ + "jsonrpc": 2.0, + "id": 3, + "method": "org.rdk.ContentDecryption.initializationStatus", + "params": { + "drm": "", + "status": "BUSY" + } +} +``` diff --git a/docs/apis/CryptographyPlugin.md b/docs/apis/CryptographyPlugin.md new file mode 100644 index 00000000..20c5ca0f --- /dev/null +++ b/docs/apis/CryptographyPlugin.md @@ -0,0 +1,790 @@ + + +# Cryptography Plugin + +**Version: [1.0.0](https://github.com/rdkcentral/rdkservices/blob/main/Cryptography/CHANGELOG.md)** + +A Cryptography plugin for Thunder framework. + +### Table of Contents + +- [Abbreviation, Acronyms and Terms](#head.Abbreviation,_Acronyms_and_Terms) +- [Description](#head.Description) +- [Configuration](#head.Configuration) +- [Methods](#head.Methods) + + +# Abbreviation, Acronyms and Terms + +[[Refer to this link](userguide/aat.md)] + + +# Description + +The `Cryptography` plugin provides an interface for Cryptography. + +The plugin is designed to be loaded and executed within the Thunder framework. For more information about the framework refer to [[Thunder](#ref.Thunder)]. + + +# Configuration + +The table below lists configuration options of the plugin. + +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| callsign | string | Plugin instance name (default: org.rdk.Cryptography) | +| classname | string | Class name: *Cryptography* | +| locator | string | Library name: *libWPEFrameworkCryptography.so* | +| autostart | boolean | Determines if the plugin shall be started automatically along with the framework | + + +# Methods + +The following methods are provided by the Cryptography plugin: + +Cryptography interface methods: + +| Method | Description | +| :-------- | :-------- | +| [calculate](#method.calculate) | | +| [create](#method.create) | | +| [decrypt](#method.decrypt) | | +| [delete](#method.delete) | | +| [derive](#method.derive) | | +| [encrypt](#method.encrypt) | | +| [exists](#method.exists) | | +| [export](#method.export) | | +| [flush](#method.flush) | | +| [generate](#method.generate) | | +| [get](#method.get) | | +| [import](#method.import) | | +| [ingest](#method.ingest) | | +| [load](#method.load) | | +| [set](#method.set) | | +| [size](#method.size) | | + + +## *calculate [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.maxLength | uint8_t | - | +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result.data[] | uint8_t | - | + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 0, + "method": "org.rdk.Cryptography.calculate", + "params": { + "maxLength": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 0, + "result": "" +} +``` + + +## *create [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.locator | string | - | +| params.keyType | keytype | - | +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result.id | uint32_t | - | + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 1, + "method": "org.rdk.Cryptography.create", + "params": { + "locator": "", + "keyType": "AES128" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 1, + "result": 0 +} +``` + + +## *decrypt [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.ivLength | uint8_t | - | +| params.iv[] | uint8_t | - | +| params.inputLength | uint32_t | - | +| params.input[] | uint8_t | - | +| params.maxOutputLength | uint32_t | - | +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result.output[] | uint8_t | - | + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 2, + "method": "org.rdk.Cryptography.decrypt", + "params": { + "ivLength": "", + "iv[]": "", + "inputLength": 0, + "input[]": "", + "maxOutputLength": 0 + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 2, + "result": "" +} +``` + + +## *delete [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.id | uint32_t | - | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 3, + "method": "org.rdk.Cryptography.delete", + "params": { + "id": 0 + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 3, + "result": null +} +``` + + +## *derive [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.privateKey | uint32_t | - | +| params.peerPublicKeyId | uint32_t | - | +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result.secretId | uint32_t | - | + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 4, + "method": "org.rdk.Cryptography.derive", + "params": { + "privateKey": 0, + "peerPublicKeyId": 0 + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 4, + "result": 0 +} +``` + + +## *encrypt [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.ivLength | uint8_t | - | +| params.iv[] | uint8_t | - | +| params.inputLength | uint32_t | - | +| params.input[] | uint8_t | - | +| params.maxOutputLength | uint32_t | - | +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result.output[] | uint8_t | - | + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 5, + "method": "org.rdk.Cryptography.encrypt", + "params": { + "ivLength": "", + "iv[]": "", + "inputLength": 0, + "input[]": "", + "maxOutputLength": 0 + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 5, + "result": "" +} +``` + + +## *exists [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.locator | string | - | +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result.result | bool | - | + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 6, + "method": "org.rdk.Cryptography.exists", + "params": { + "locator": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 6, + "result": true +} +``` + + +## *export [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.id | uint32_t | - | +| params.maxLength | uint16_t | - | +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result.blob[] | uint8_t | - | + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 7, + "method": "org.rdk.Cryptography.export", + "params": { + "id": 0, + "maxLength": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 7, + "result": "" +} +``` + + +## *flush [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 8, + "method": "org.rdk.Cryptography.flush" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 8, + "result": null +} +``` + + +## *generate [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.generator | uint8_t | - | +| params.modulusSize | uint16_t | - | +| params.modulus[] | uint8_t | - | +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result.privKeyId | uint32_t | - | +| result.pubKeyId | uint32_t | - | + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 9, + "method": "org.rdk.Cryptography.generate", + "params": { + "generator": "", + "modulusSize": "", + "modulus[]": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 9, + "result": { + "privKeyId": 0, + "pubKeyId": 0 + } +} +``` + + +## *get [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.id | uint32_t | - | +| params.maxLength | uint16_t | - | +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result.blob[] | uint8_t | - | + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 10, + "method": "org.rdk.Cryptography.get", + "params": { + "id": 0, + "maxLength": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 10, + "result": "" +} +``` + + +## *import [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.length | uint16_t | - | +| params.blob[] | uint8_t | - | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 11, + "method": "org.rdk.Cryptography.import", + "params": { + "length": "", + "blob[]": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 11, + "result": null +} +``` + + +## *ingest [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.length | uint32_t | - | +| params.data[] | uint8_t | - | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 12, + "method": "org.rdk.Cryptography.ingest", + "params": { + "length": 0, + "data[]": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 12, + "result": null +} +``` + + +## *load [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.locator | string | - | +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result.id | uint32_t | - | + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 13, + "method": "org.rdk.Cryptography.load", + "params": { + "locator": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 13, + "result": 0 +} +``` + + +## *set [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.length | uint16_t | - | +| params.blob[] | uint8_t | - | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 14, + "method": "org.rdk.Cryptography.set", + "params": { + "length": "", + "blob[]": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 14, + "result": null +} +``` + + +## *size [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.id | uint32_t | - | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 15, + "method": "org.rdk.Cryptography.size", + "params": { + "id": 0 + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 15, + "result": null +} +``` + + diff --git a/docs/apis/DRMPlugin.md b/docs/apis/DRMPlugin.md new file mode 100644 index 00000000..0343d126 --- /dev/null +++ b/docs/apis/DRMPlugin.md @@ -0,0 +1,1197 @@ + + +# DRM Plugin + +**Version: [1.0.0](https://github.com/rdkcentral/rdkservices/blob/main/DRM/CHANGELOG.md)** + +A DRM plugin for Thunder framework. + +### Table of Contents + +- [Abbreviation, Acronyms and Terms](#head.Abbreviation,_Acronyms_and_Terms) +- [Description](#head.Description) +- [Configuration](#head.Configuration) +- [Methods](#head.Methods) + + +# Abbreviation, Acronyms and Terms + +[[Refer to this link](userguide/aat.md)] + + +# Description + +The `DRM` plugin provides an interface for DRM. + +The plugin is designed to be loaded and executed within the Thunder framework. For more information about the framework refer to [[Thunder](#ref.Thunder)]. + + +# Configuration + +The table below lists configuration options of the plugin. + +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| callsign | string | Plugin instance name (default: org.rdk.DRM) | +| classname | string | Class name: *DRM* | +| locator | string | Library name: *libWPEFrameworkDRM.so* | +| autostart | boolean | Determines if the plugin shall be started automatically along with the framework | + + +# Methods + +The following methods are provided by the DRM plugin: + +DRM interface methods: + +| Method | Description | +| :-------- | :-------- | +| [cancelChallengeDataExt](#method.cancelChallengeDataExt) | | +| [cleanDecryptContext](#method.cleanDecryptContext) | | +| [close](#method.close) | | +| [deinitialize](#method.deinitialize) | | +| [deleteKeyStore](#method.deleteKeyStore) | | +| [deleteSecureStore](#method.deleteSecureStore) | | +| [disable](#method.disable) | | +| [enable](#method.enable) | | +| [enableSecureStop](#method.enableSecureStop) | | +| [getChallengeDataExt](#method.getChallengeDataExt) | | +| [getDrmSystemTime](#method.getDrmSystemTime) | | +| [getHeight](#method.getHeight) | | +| [getLdlSessionLimit](#method.getLdlSessionLimit) | | +| [getMediaType](#method.getMediaType) | | +| [getSessionIdExt](#method.getSessionIdExt) | | +| [getVersionExt](#method.getVersionExt) | | +| [getWidth](#method.getWidth) | | +| [initLength](#method.initLength) | | +| [initialize](#method.initialize) | | +| [isSecureStopEnabled](#method.isSecureStopEnabled) | | +| [load](#method.load) | | +| [metrics](#method.metrics) | | +| [onKeyStatusUpdate](#method.onKeyStatusUpdate) | | +| [onKeyStatusesUpdated](#method.onKeyStatusesUpdated) | | +| [remove](#method.remove) | | +| [resetSecureStops](#method.resetSecureStops) | | +| [selectKeyId](#method.selectKeyId) | | +| [setDrmHeader](#method.setDrmHeader) | | +| [storeLicenseData](#method.storeLicenseData) | | + + +## *cancelChallengeDataExt [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 0, + "method": "org.rdk.DRM.cancelChallengeDataExt" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 0, + "result": null +} +``` + + +## *cleanDecryptContext [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 1, + "method": "org.rdk.DRM.cleanDecryptContext" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 1, + "result": null +} +``` + + +## *close [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 2, + "method": "org.rdk.DRM.close" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 2, + "result": null +} +``` + + +## *deinitialize [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.shell | WPEFramework::PluginHost::IShell | - | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 3, + "method": "org.rdk.DRM.deinitialize", + "params": { + "shell": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 3, + "result": null +} +``` + + +## *deleteKeyStore [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 4, + "method": "org.rdk.DRM.deleteKeyStore" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 4, + "result": null +} +``` + + +## *deleteSecureStore [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 5, + "method": "org.rdk.DRM.deleteSecureStore" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 5, + "result": null +} +``` + + +## *disable [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 6, + "method": "org.rdk.DRM.disable" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 6, + "result": null +} +``` + + +## *enable [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 7, + "method": "org.rdk.DRM.enable" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 7, + "result": null +} +``` + + +## *enableSecureStop [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.enable | bool | - | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 8, + "method": "org.rdk.DRM.enableSecureStop", + "params": { + "enable": true + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 8, + "result": null +} +``` + + +## *getChallengeDataExt [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.challenge | uint8_t | - | +| params.challengeSize | uint32_t | - | +| params.isLDL | uint32_t | - | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 9, + "method": "org.rdk.DRM.getChallengeDataExt", + "params": { + "challenge": "", + "challengeSize": 0, + "isLDL": 0 + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 9, + "result": null +} +``` + + +## *getDrmSystemTime [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 10, + "method": "org.rdk.DRM.getDrmSystemTime" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 10, + "result": null +} +``` + + +## *getHeight [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 11, + "method": "org.rdk.DRM.getHeight" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 11, + "result": null +} +``` + + +## *getLdlSessionLimit [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 12, + "method": "org.rdk.DRM.getLdlSessionLimit" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 12, + "result": null +} +``` + + +## *getMediaType [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 13, + "method": "org.rdk.DRM.getMediaType" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 13, + "result": null +} +``` + + +## *getSessionIdExt [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 14, + "method": "org.rdk.DRM.getSessionIdExt" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 14, + "result": null +} +``` + + +## *getVersionExt [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 15, + "method": "org.rdk.DRM.getVersionExt" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 15, + "result": null +} +``` + + +## *getWidth [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 16, + "method": "org.rdk.DRM.getWidth" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 16, + "result": null +} +``` + + +## *initLength [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 17, + "method": "org.rdk.DRM.initLength" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 17, + "result": null +} +``` + + +## *initialize [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.shell | WPEFramework::PluginHost::IShell | - | +| params.configline | std::string | - | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 18, + "method": "org.rdk.DRM.initialize", + "params": { + "shell": "", + "configline": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 18, + "result": null +} +``` + + +## *isSecureStopEnabled [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 19, + "method": "org.rdk.DRM.isSecureStopEnabled" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 19, + "result": null +} +``` + + +## *load [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 20, + "method": "org.rdk.DRM.load" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 20, + "result": null +} +``` + + +## *metrics [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.bufferLength | uint32_t | - | +| params.buffer[] | uint8_t | - | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 21, + "method": "org.rdk.DRM.metrics", + "params": { + "bufferLength": 0, + "buffer[]": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 21, + "result": null +} +``` + + +## *onKeyStatusUpdate [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.keyMessage | char | - | +| params.buffer | uint8_t | - | +| params.length | uint8_t | - | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 22, + "method": "org.rdk.DRM.onKeyStatusUpdate", + "params": { + "keyMessage": "a", + "buffer": "", + "length": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 22, + "result": null +} +``` + + +## *onKeyStatusesUpdated [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 23, + "method": "org.rdk.DRM.onKeyStatusesUpdated" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 23, + "result": null +} +``` + + +## *remove [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 24, + "method": "org.rdk.DRM.remove" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 24, + "result": null +} +``` + + +## *resetSecureStops [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 25, + "method": "org.rdk.DRM.resetSecureStops" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 25, + "result": null +} +``` + + +## *selectKeyId [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.keyLength | uint8_t | - | +| params.keyId[] | uint8_t | - | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 26, + "method": "org.rdk.DRM.selectKeyId", + "params": { + "keyLength": "", + "keyId[]": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 26, + "result": null +} +``` + + +## *setDrmHeader [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.drmHeader[] | uint8_t | - | +| params.drmHeaderLength | uint32_t | - | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 27, + "method": "org.rdk.DRM.setDrmHeader", + "params": { + "drmHeader[]": "", + "drmHeaderLength": 0 + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 27, + "result": null +} +``` + + +## *storeLicenseData [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.licenseData[] | uint8_t | - | +| params.licenseDataSize | uint32_t | - | +| params.secureStopId | uint8_t | - | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 28, + "method": "org.rdk.DRM.storeLicenseData", + "params": { + "licenseData[]": "", + "licenseDataSize": 0, + "secureStopId": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 28, + "result": null +} +``` + + diff --git a/docs/apis/DeviceDiagnosticsPlugin.md b/docs/apis/DeviceDiagnosticsPlugin.md index e0092d99..19338dd0 100644 --- a/docs/apis/DeviceDiagnosticsPlugin.md +++ b/docs/apis/DeviceDiagnosticsPlugin.md @@ -1,114 +1,149 @@ - + # DeviceDiagnostics Plugin -**Version: [1.0.0]()** +**Version: [1.0.0](https://github.com/rdkcentral/rdkservices/blob/main/DeviceDiagnostics/CHANGELOG.md)** -A org.rdk.DeviceDiagnostics plugin for Thunder framework. +A DeviceDiagnostics 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](#head.Abbreviation,_Acronyms_and_Terms) +- [Description](#head.Description) +- [Configuration](#head.Configuration) +- [Methods](#head.Methods) +- [Notifications](#head.Notifications) - + # Abbreviation, Acronyms and Terms -[[Refer to this link](overview/aat.md)] +[[Refer to this link](userguide/aat.md)] - + # Description -The `DeviceDiagnostics` plugin provides additional diagnostics information which includes device configuration and AV decoder status. +The `DeviceDiagnostics` plugin provides an interface for DeviceDiagnostics. -The plugin is designed to be loaded and executed within the Thunder framework. For more information about the framework refer to [[Thunder](#Thunder)]. +The plugin is designed to be loaded and executed within the Thunder framework. For more information about the framework refer to [[Thunder](#ref.Thunder)]. - + # Configuration The table below lists configuration options of the plugin. | Name | Type | Description | | :-------- | :-------- | :-------- | -| callsign | string | Plugin instance name (default: *org.rdk.DeviceDiagnostics*) | -| classname | string | Class name: *org.rdk.DeviceDiagnostics* | +| callsign | string | Plugin instance name (default: org.rdk.DeviceDiagnostics) | +| classname | string | Class name: *DeviceDiagnostics* | | locator | string | Library name: *libWPEFrameworkDeviceDiagnostics.so* | | autostart | boolean | Determines if the plugin shall be started automatically along with the framework | - + # Methods -The following methods are provided by the org.rdk.DeviceDiagnostics plugin: +The following methods are provided by the DeviceDiagnostics plugin: DeviceDiagnostics interface methods: | Method | Description | | :-------- | :-------- | -| [getConfiguration](#getConfiguration) | Gets the values associated with the corresponding property names | -| [getMilestones](#getMilestones) | Returns the list of milestones | -| [logMilestone](#logMilestone) | Log marker string to rdk milestones log | -| [getAVDecoderStatus](#getAVDecoderStatus) | Gets the most active status of audio/video decoder/pipeline | +| [getAVDecoderStatus](#method.getAVDecoderStatus) | Gets the most active status of audio/video decoder/pipeline | +| [getConfiguration](#method.getConfiguration) | Gets the values associated with the corresponding property names | +| [getMilestones](#method.getMilestones) | Returns the list of milestones | +| [logMilestone](#method.logMilestone) | Log marker string to rdk milestones log | + +## *getAVDecoderStatus [method](#head.Methods)* - -## *getConfiguration* - -Gets the values associated with the corresponding property names. +Gets the most active status of audio/video decoder/pipeline ### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result.AVDecoderStatus | AvDecoderStatusResult | - out | +| result.AVDecoderStatus.avDecoderStatus | string | - | -No Events +### Examples -### Parameters +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 0, + "method": "org.rdk.DeviceDiagnostics.getAVDecoderStatus" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 0, + "result": { + "avDecoderStatus": "" + } +} +``` + + +## *getConfiguration [method](#head.Methods)* + +Gets the values associated with the corresponding property names + +### Events +No events are associated with this method. +### Parameters | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.names | array | String array of property names | -| params.names[#] | string | Property names as represented in the data model like `Device.X_CISCO_COM_LED.RedPwm`, `Device.DeviceInfo.Manufacturer`, `Device.DeviceInfo.UpTime`, `Device.DeviceInfo.ProcessStatus.CPUUsage`, etc | - -### Result - +| params.names | IStringIterator | - in - String array of property names | +| params.names[#] | string | - | +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | object | | -| result.paramList | array | An array of JSON objects with the specified properties and their values | -| result.paramList[#] | object | | -| result.paramList[#].name | string | The property name; Empty, if the property name is not supported | -| result.paramList[#].value | string | The property value; Empty, if the property name is not supported | -| result.success | boolean | Whether the request succeeded | +| result.paramList | IDeviceDiagnosticsParamListIterator | - out - specified properties and their values | +| result.paramList[#].name | string | name | +| result.paramList[#].value | string | value | +| result.success | bool | - out - boolean | + +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 1, "method": "org.rdk.DeviceDiagnostics.getConfiguration", "params": { "names": [ - "Device.X_CISCO_COM_LED.RedPwm" + "" ] } } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 1, "result": { "paramList": [ { - "name": "Device.X_CISCO_COM_LED.RedPwm", - "value": "123" + "name": "", + "value": "" } ], "success": true @@ -116,187 +151,130 @@ No Events } ``` - -## *getMilestones* + +## *getMilestones [method](#head.Methods)* -Returns the list of milestones. +Returns the list of milestones ### Events - -No Events - +No events are associated with this method. ### Parameters - This method takes no parameters. - -### Result - +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | object | | -| result.milestones | array | A string [] of milestones | -| result.milestones[#] | string | | -| result.success | boolean | Whether the request succeeded | +| result.milestones | IStringIterator | - out - A string [] of milestones | +| result.milestones[#] | string | - | +| result.success | bool | - out - boolean | + +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 2, "method": "org.rdk.DeviceDiagnostics.getMilestones" } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 2, "result": { "milestones": [ - "2020 Jan 28 08:24:06.762355 abcdpq1 systemd[1]: Starting Log RDK Started Service..." + "" ], "success": true } } ``` - -## *logMilestone* + +## *logMilestone [method](#head.Methods)* -Log marker string to rdk milestones log. +Log marker string to rdk milestones log ### Events - -No Events - +No events are associated with this method. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.marker | string | Milestone marker string | - -### Result - +| params.marker | string | - in - string | +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | boolean | Whether the request succeeded | - -### Errors +| result.success | bool | - out - boolean | -| Code | Message | Description | -| :-------- | :-------- | :-------- | -| 1 | ```ERROR_GENERAL``` | General error | +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 3, "method": "org.rdk.DeviceDiagnostics.logMilestone", "params": { - "marker": "..." + "marker": "" } } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 3, "result": true } ``` - -## *getAVDecoderStatus* - -Gets the most active status of audio/video decoder/pipeline. This API doesn't track individual pipelines. It will aggregate and report the pipeline status, and the pipeline states are prioritized from High to Low (`ACTIVE`, `PAUSED`, and `IDLE`). Therefore, if any of the pipelines is in active state, then `getAVDecoderStatus` will return `ACTIVE`. If none of the pipelines are active but one is in a paused state, then `getAVDecoderStatus` will return `PAUSED`, and if all the pipelines are idle only then, `IDLE` will be returned. - -### Events - -No Events - -### Parameters - -This method takes no parameters. - -### Result -| Name | Type | Description | -| :-------- | :-------- | :-------- | -| result | object | | -| result.avDecoderStatus | string | The status. If AV decoder status is not supported, the default state will always be IDLE. (must be one of the following: *ACTIVE*, *PAUSED*, *IDLE*) | -### Example - -#### Request - -```json -{ - "jsonrpc": "2.0", - "id": 42, - "method": "org.rdk.DeviceDiagnostics.getAVDecoderStatus" -} -``` - -#### Response - -```json -{ - "jsonrpc": "2.0", - "id": 42, - "result": { - "avDecoderStatus": "ACTIVE" - } -} -``` - - + # Notifications -Notifications are autonomous events, triggered by the internals of the implementation, and broadcasted via JSON-RPC to all registered observers. Refer to [[Thunder](#Thunder)] for information on how to register for a notification. +Notifications are autonomous events, triggered by the internals of the implementation, and broadcasted via JSON-RPC to all registered observers. Refer to [[Thunder](#ref.Thunder)] for information on how to register for a notification. -The following events are provided by the org.rdk.DeviceDiagnostics plugin: +The following events are provided by the DeviceDiagnostics plugin: DeviceDiagnostics interface events: | Event | Description | | :-------- | :-------- | -| [onAVDecoderStatusChanged](#onAVDecoderStatusChanged) | Triggered when the most active status of audio/video decoder/pipeline changes | - +| [onAVDecoderStatusChanged](#event.onAVDecoderStatusChanged) | Triggered when the most active status of audio/video decoder/pipeline changes | - -## *onAVDecoderStatusChanged* + +## *onAVDecoderStatusChanged [event](#head.Notifications)* -Triggered when the most active status of audio/video decoder/pipeline changes. +Triggered when the most active status of audio/video decoder/pipeline changes ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.avDecoderStatusChange | string | The status. If AV decoder status is not supported, the default state will always be IDLE. (must be one of the following: *ACTIVE*, *PAUSED*, *IDLE*) | +| params.avDecoderStatusChange | string | - in - string | -### Example +### Examples ```json { - "jsonrpc": "2.0", - "method": "client.events.onAVDecoderStatusChanged", + "jsonrpc": 2.0, + "id": 4, + "method": "org.rdk.DeviceDiagnostics.onAVDecoderStatusChanged", "params": { - "avDecoderStatusChange": "ACTIVE" + "avDecoderStatusChange": "" } } ``` - diff --git a/docs/apis/DeviceInfoPlugin.md b/docs/apis/DeviceInfoPlugin.md index d492dd46..c34c0be6 100644 --- a/docs/apis/DeviceInfoPlugin.md +++ b/docs/apis/DeviceInfoPlugin.md @@ -1,44 +1,43 @@ - + # DeviceInfo Plugin -**Version: [1.1.0](https://github.com/rdkcentral/rdkservices/blob/main/DeviceInfo/CHANGELOG.md)** +**Version: [1.0.0](https://github.com/rdkcentral/rdkservices/blob/main/DeviceInfo/CHANGELOG.md)** A DeviceInfo plugin for Thunder framework. ### Table of Contents -- [Abbreviation, Acronyms and Terms](#Abbreviation,_Acronyms_and_Terms) -- [Description](#Description) -- [Configuration](#Configuration) -- [Methods](#Methods) -- [Properties](#Properties) +- [Abbreviation, Acronyms and Terms](#head.Abbreviation,_Acronyms_and_Terms) +- [Description](#head.Description) +- [Configuration](#head.Configuration) +- [Methods](#head.Methods) - + # Abbreviation, Acronyms and Terms [[Refer to this link](userguide/aat.md)] - + # Description -The `DeviceInfo` plugin allows retrieving of various device-related information. +The `DeviceInfo` plugin provides an interface for DeviceInfo. -The plugin is designed to be loaded and executed within the Thunder framework. For more information about the framework refer to [[Thunder](#Thunder)]. +The plugin is designed to be loaded and executed within the Thunder framework. For more information about the framework refer to [[Thunder](#ref.Thunder)]. - + # Configuration The table below lists configuration options of the plugin. | Name | Type | Description | | :-------- | :-------- | :-------- | -| callsign | string | Plugin instance name (default: *DeviceInfo*) | +| callsign | string | Plugin instance name (default: org.rdk.DeviceInfo) | | classname | string | Class name: *DeviceInfo* | | locator | string | Library name: *libWPEFrameworkDeviceInfo.so* | | autostart | boolean | Determines if the plugin shall be started automatically along with the framework | - + # Methods The following methods are provided by the DeviceInfo plugin: @@ -47,1195 +46,800 @@ DeviceInfo interface methods: | Method | Description | | :-------- | :-------- | -| [supportedresolutions](#supportedresolutions) | Supported resolutions on the selected video display port | -| [defaultresolution](#defaultresolution) | Default resolution on the selected video display port | -| [supportedhdcp](#supportedhdcp) | Supported hdcp version on the selected video display port | -| [audiocapabilities](#audiocapabilities) | Audio capabilities for the specified audio port | -| [ms12capabilities](#ms12capabilities) | MS12 audio capabilities for the specified audio port | -| [supportedms12audioprofiles](#supportedms12audioprofiles) | Supported MS12 audio profiles for the specified audio port | +| [audioCapabilities](#method.audioCapabilities) | | +| [brand](#method.brand) | | +| [chipSet](#method.chipSet) | | +| [defaultResolution](#method.defaultResolution) | | +| [deviceType](#method.deviceType) | | +| [distributorId](#method.distributorId) | | +| [hostEDID](#method.hostEDID) | | +| [mS12Capabilities](#method.mS12Capabilities) | | +| [make](#method.make) | | +| [model](#method.model) | | +| [releaseVersion](#method.releaseVersion) | | +| [serialNumber](#method.serialNumber) | | +| [sku](#method.sku) | | +| [socName](#method.socName) | | +| [supportedAudioPorts](#method.supportedAudioPorts) | | +| [supportedHdcp](#method.supportedHdcp) | | +| [supportedMS12AudioProfiles](#method.supportedMS12AudioProfiles) | | +| [supportedResolutions](#method.supportedResolutions) | | +| [supportedVideoDisplays](#method.supportedVideoDisplays) | | + + +## *audioCapabilities [method](#head.Methods)* - -## *supportedresolutions* - -Supported resolutions on the selected video display port. ### Events - -No Events - +No events are associated with this method. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.videoDisplay | string | Video display port name | - -### Result - +| params.audioPort | string | - | +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | object | | -| result.supportedResolutions | array | | -| result.supportedResolutions[#] | string | Resolution supported by the device (must be one of the following: *unknown*, *480i*, *480p*, *576i*, *576p*, *576p50*, *720p*, *720p50*, *1080i*, *1080i25*, *1080i50*, *1080p*, *1080p24*, *1080p25*, *1080p30*, *1080p50*, *1080p60*, *2160p30*, *2160p50*, *2160p60*, *4320p30*, *4320p60*) | - -### Errors +| result.audioCapabilities | IAudioCapabilityIterator | - | +| result.audioCapabilities[#] | string | - | -| Code | Message | Description | -| :-------- | :-------- | :-------- | -| 1 | ```ERROR_GENERAL``` | General error | +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "DeviceInfo.supportedresolutions", + "jsonrpc": 2.0, + "id": 0, + "method": "org.rdk.DeviceInfo.audioCapabilities", "params": { - "videoDisplay": "HDMI0" + "audioPort": "" } } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, - "result": { - "supportedResolutions": [ - "1080p" - ] - } + "jsonrpc": 2.0, + "id": 0, + "result": [ + "AUDIOCAPABILITY_NONE" + ] } ``` - -## *defaultresolution* + +## *brand [method](#head.Methods)* -Default resolution on the selected video display port. -### Events - -No Events +### Events +No events are associated with this method. ### Parameters - -| Name | Type | Description | -| :-------- | :-------- | :-------- | -| params | object | | -| params.videoDisplay | string | Video display port name | - -### Result - +This method takes no parameters. +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | object | | -| result.defaultResolution | string | Resolution supported by the device (must be one of the following: *unknown*, *480i*, *480p*, *576i*, *576p*, *576p50*, *720p*, *720p50*, *1080i*, *1080i25*, *1080i50*, *1080p*, *1080p24*, *1080p25*, *1080p30*, *1080p50*, *1080p60*, *2160p30*, *2160p50*, *2160p60*, *4320p30*, *4320p60*) | +| result.brand | string | - | -### Errors +### Examples -| Code | Message | Description | -| :-------- | :-------- | :-------- | -| 1 | ```ERROR_GENERAL``` | General error | - -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "DeviceInfo.defaultresolution", - "params": { - "videoDisplay": "HDMI0" - } + "jsonrpc": 2.0, + "id": 1, + "method": "org.rdk.DeviceInfo.brand" } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, - "result": { - "defaultResolution": "1080p" - } + "jsonrpc": 2.0, + "id": 1, + "result": "" } ``` - -## *supportedhdcp* + +## *chipSet [method](#head.Methods)* -Supported hdcp version on the selected video display port. - -### Events -No Events +### Events +No events are associated with this method. ### Parameters - +This method takes no parameters. +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| params | object | | -| params.videoDisplay | string | Video display port name | +| result.chipSet | string | - | -### Result - -| Name | Type | Description | -| :-------- | :-------- | :-------- | -| result | object | | -| result.supportedHDCPVersion | string | HDCP support (must be one of the following: *unavailable*, *1.4*, *2.0*, *2.1*, *2.2*) | - -### Errors - -| Code | Message | Description | -| :-------- | :-------- | :-------- | -| 1 | ```ERROR_GENERAL``` | General error | +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "DeviceInfo.supportedhdcp", - "params": { - "videoDisplay": "HDMI0" - } + "jsonrpc": 2.0, + "id": 2, + "method": "org.rdk.DeviceInfo.chipSet" } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, - "result": { - "supportedHDCPVersion": "hdcp_20" - } + "jsonrpc": 2.0, + "id": 2, + "result": "" } ``` - -## *audiocapabilities* - -Audio capabilities for the specified audio port. + +## *defaultResolution [method](#head.Methods)* -### Events -No Events +### Events +No events are associated with this method. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.audioPort | string | Audio port name | - -### Result - +| params.videoDisplay | string | - | +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | object | | -| result.AudioCapabilities | array | An array of audio capabilities | -| result.AudioCapabilities[#] | string | Audio capability (must be one of the following: *none*, *ATMOS*, *DOLBY DIGITAL*, *DOLBY DIGITAL PLUS*, *Dual Audio Decode*, *DAPv2*, *MS12*) | +| result.defaultResolution | string | - | -### Errors +### Examples -| Code | Message | Description | -| :-------- | :-------- | :-------- | -| 1 | ```ERROR_GENERAL``` | General error | - -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "DeviceInfo.audiocapabilities", + "jsonrpc": 2.0, + "id": 3, + "method": "org.rdk.DeviceInfo.defaultResolution", "params": { - "audioPort": "HDMI0" + "videoDisplay": "" } } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, - "result": { - "AudioCapabilities": [ - "none" - ] - } + "jsonrpc": 2.0, + "id": 3, + "result": "" } ``` - -## *ms12capabilities* + +## *deviceType [method](#head.Methods)* -MS12 audio capabilities for the specified audio port. -### Events - -No Events +### Events +No events are associated with this method. ### Parameters - -| Name | Type | Description | -| :-------- | :-------- | :-------- | -| params | object | | -| params.audioPort | string | Audio port name | - -### Result - +This method takes no parameters. +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | object | | -| result.MS12Capabilities | array | An array of MS12 audio capabilities | -| result.MS12Capabilities[#] | string | MS12 audio capability (must be one of the following: *none*, *Dolby Volume*, *Inteligent Equalizer*, *Dialogue Enhancer*) | - -### Errors +| result.deviceType | string | - | -| Code | Message | Description | -| :-------- | :-------- | :-------- | -| 1 | ```ERROR_GENERAL``` | General error | +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "DeviceInfo.ms12capabilities", - "params": { - "audioPort": "HDMI0" - } + "jsonrpc": 2.0, + "id": 4, + "method": "org.rdk.DeviceInfo.deviceType" } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, - "result": { - "MS12Capabilities": [ - "Dolby Volume" - ] - } + "jsonrpc": 2.0, + "id": 4, + "result": "" } ``` - -## *supportedms12audioprofiles* + +## *distributorId [method](#head.Methods)* -Supported MS12 audio profiles for the specified audio port. -### Events - -No Events +### Events +No events are associated with this method. ### Parameters - +This method takes no parameters. +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| params | object | | -| params.audioPort | string | Audio port name | +| result.distributorId | string | - | -### Result +### Examples -| Name | Type | Description | -| :-------- | :-------- | :-------- | -| result | object | | -| result.supportedMS12AudioProfiles | array | An array of MS12 audio profiles | -| result.supportedMS12AudioProfiles[#] | string | | - -### Errors - -| Code | Message | Description | -| :-------- | :-------- | :-------- | -| 1 | ```ERROR_GENERAL``` | General error | - -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "DeviceInfo.supportedms12audioprofiles", - "params": { - "audioPort": "HDMI0" - } + "jsonrpc": 2.0, + "id": 5, + "method": "org.rdk.DeviceInfo.distributorId" } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, - "result": { - "supportedMS12AudioProfiles": [ - "Movie" - ] - } + "jsonrpc": 2.0, + "id": 5, + "result": "" } ``` - -# Properties - -The following properties are provided by the DeviceInfo plugin: + +## *hostEDID [method](#head.Methods)* -DeviceInfo interface properties: -| Property | Description | -| :-------- | :-------- | -| [systeminfo](#systeminfo) RO | System general information | -| [addresses](#addresses) RO | Network interface addresses | -| [socketinfo](#socketinfo) RO | Socket information | -| [firmwareversion](#firmwareversion) RO | Versions maintained in version | -| [serialnumber](#serialnumber) RO | Serial number set by manufacturer | -| [releaseversion](#releaseversion) RO | Release version of Image | -| [chipset](#chipset) RO | Chipset used for this device | -| [modelid](#modelid) RO | Device model number or SKU | -| [make](#make) RO | Device manufacturer | -| [modelname](#modelname) RO | Friendly device model name | -| [devicetype](#devicetype) RO | Device type | -| [socname](#socname) RO | SOC Name | -| [distributorid](#distributorid) RO | Partner ID or distributor ID for device | -| [supportedaudioports](#supportedaudioports) RO | Audio ports supported on the device (all ports that are physically present) | -| [supportedvideodisplays](#supportedvideodisplays) RO | Video ports supported on the device (all ports that are physically present) | -| [hostedid](#hostedid) RO | EDID of the host | - - - -## *systeminfo* - -Provides access to the system general information. - -> This property is **read-only**. ### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result.edid | string | - | -No Events +### Examples -### Value -| Name | Type | Description | -| :-------- | :-------- | :-------- | -| (property) | object | System general information | -| (property).version | string | Software version (in form *version#hashtag*) | -| (property).uptime | number | System uptime (in seconds) | -| (property).totalram | number | Total installed system RAM memory (in bytes) | -| (property).freeram | number | Free system RAM memory (in bytes) | -| (property).totalswap | number | Total swap space (in bytes) | -| (property).freeswap | number | Swap space still available (in bytes) | -| (property).devicename | string | Host name | -| (property).cpuload | string | Current CPU load (percentage) | -| (property).cpuloadavg | object | CPU load average | -| (property).cpuloadavg.avg1min | number | 1min cpuload average | -| (property).cpuloadavg.avg5min | number | 5min cpuload average | -| (property).cpuloadavg.avg15min | number | 15min cpuload average | -| (property).serialnumber | string | Device serial number | -| (property).time | string | Current system date and time | - -### Example - -#### Get Request +#### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "DeviceInfo.systeminfo" + "jsonrpc": 2.0, + "id": 6, + "method": "org.rdk.DeviceInfo.hostEDID" } ``` -#### Get Response + +#### Response ```json { - "jsonrpc": "2.0", - "id": 42, - "result": { - "version": "1.0#14452f612c3747645d54974255d11b8f3b4faa54", - "uptime": 120, - "totalram": 655757312, - "freeram": 563015680, - "totalswap": 789132680, - "freeswap": 789132680, - "devicename": "buildroot", - "cpuload": "2", - "cpuloadavg": { - "avg1min": 789132680, - "avg5min": 789132680, - "avg15min": 789132680 - }, - "serialnumber": "aplhanumerical string", - "time": "Mon, 11 Mar 2019 14:38:18" - } + "jsonrpc": 2.0, + "id": 6, + "result": "" } ``` - -## *addresses* + +## *mS12Capabilities [method](#head.Methods)* -Provides access to the network interface addresses. -> This property is **read-only**. ### Events - -No Events - -### Value - +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.audioPort | string | - | +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| (property) | array | Network interface addresses | -| (property)[#] | object | | -| (property)[#].name | string | Interface name | -| (property)[#].mac | string | Interface MAC address | -| (property)[#]?.ip | array | *(optional)* | -| (property)[#]?.ip[#] | string | *(optional)* Interface IP address | +| result.ms12Capabilities | IMS12CapabilityIterator | - | +| result.ms12Capabilities[#] | string | - | -### Example +### Examples -#### Get Request + +#### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "DeviceInfo.addresses" + "jsonrpc": 2.0, + "id": 7, + "method": "org.rdk.DeviceInfo.mS12Capabilities", + "params": { + "audioPort": "" + } } ``` -#### Get Response + +#### Response ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 7, "result": [ - { - "name": "lo", - "mac": "00:00:00:00:00", - "ip": [ - "127.0.0.1" - ] - } + "MS12CAPABILITY_NONE" ] } ``` - -## *socketinfo* + +## *make [method](#head.Methods)* -Provides access to the socket information. -> This property is **read-only**. ### Events - -No Events - -### Value - +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| (property) | object | Socket information | -| (property)?.total | number | *(optional)* | -| (property)?.open | number | *(optional)* | -| (property)?.link | number | *(optional)* | -| (property)?.exception | number | *(optional)* | -| (property)?.shutdown | number | *(optional)* | -| (property).runs | number | Number of runs | +| result.make | string | - | -### Example +### Examples -#### Get Request + +#### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "DeviceInfo.socketinfo" + "jsonrpc": 2.0, + "id": 8, + "method": "org.rdk.DeviceInfo.make" } ``` -#### Get Response + +#### Response ```json { - "jsonrpc": "2.0", - "id": 42, - "result": { - "total": 0, - "open": 0, - "link": 0, - "exception": 0, - "shutdown": 0, - "runs": 1 - } + "jsonrpc": 2.0, + "id": 8, + "result": "" } ``` - -## *firmwareversion* + +## *model [method](#head.Methods)* -Provides access to the versions maintained in version.txt. -> This property is **read-only**. ### Events - -No Events - -### Value - +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| (property) | object | Versions maintained in version.txt | -| (property).imagename | string | | -| (property)?.sdk | string | *(optional)* | -| (property)?.mediarite | string | *(optional)* | -| (property)?.yocto | string | *(optional)* Yocto version (must be one of the following: *kirkstone*, *dunfell*, *morty*, *daisy*) | +| result.model | string | - | -### Errors +### Examples -| Code | Message | Description | -| :-------- | :-------- | :-------- | -| 1 | ```ERROR_GENERAL``` | General error | - -### Example -#### Get Request +#### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "DeviceInfo.firmwareversion" + "jsonrpc": 2.0, + "id": 9, + "method": "org.rdk.DeviceInfo.model" } ``` -#### Get Response + +#### Response ```json { - "jsonrpc": "2.0", - "id": 42, - "result": { - "imagename": "alphanumerical string", - "sdk": "17.3", - "mediarite": "8.3.53", - "yocto": "dunfell" - } + "jsonrpc": 2.0, + "id": 9, + "result": "" } ``` - -## *serialnumber* + +## *releaseVersion [method](#head.Methods)* -Provides access to the serial number set by manufacturer. -> This property is **read-only**. ### Events - -No Events - -### Value - +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| (property) | object | Serial number set by manufacturer | -| (property).serialnumber | string | | +| result.releaseVersion | string | - | -### Errors +### Examples -| Code | Message | Description | -| :-------- | :-------- | :-------- | -| 1 | ```ERROR_GENERAL``` | General error | - -### Example -#### Get Request +#### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "DeviceInfo.serialnumber" + "jsonrpc": 2.0, + "id": 10, + "method": "org.rdk.DeviceInfo.releaseVersion" } ``` -#### Get Response + +#### Response ```json { - "jsonrpc": "2.0", - "id": 42, - "result": { - "serialnumber": "alphanumerical string" - } + "jsonrpc": 2.0, + "id": 10, + "result": "" } ``` - -## *releaseversion* + +## *serialNumber [method](#head.Methods)* -Provides access to the release version of Image. If unable to find the Release version default value is 99.99.0.0. -> This property is **read-only**. ### Events - -No Events - -### Value - +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| (property) | object | Release version of Image. If unable to find the Release version default value is 99.99.0.0 | -| (property).releaseversion | string | | - -### Errors +| result.serialNumber | string | - | -| Code | Message | Description | -| :-------- | :-------- | :-------- | -| 1 | ```ERROR_GENERAL``` | General error | +### Examples -### Example -#### Get Request +#### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "DeviceInfo.releaseversion" + "jsonrpc": 2.0, + "id": 11, + "method": "org.rdk.DeviceInfo.serialNumber" } ``` -#### Get Response + +#### Response ```json { - "jsonrpc": "2.0", - "id": 42, - "result": { - "releaseversion": "8.2.0.0" - } + "jsonrpc": 2.0, + "id": 11, + "result": "" } ``` - -## *chipset* + +## *sku [method](#head.Methods)* -Provides access to the chipset used for this device. -> This property is **read-only**. ### Events - -No Events - -### Value - +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| (property) | object | Chipset used for this device | -| (property).chipset | string | | +| result.sku | string | - | -### Errors - -| Code | Message | Description | -| :-------- | :-------- | :-------- | -| 1 | ```ERROR_GENERAL``` | General error | +### Examples -### Example -#### Get Request +#### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "DeviceInfo.chipset" + "jsonrpc": 2.0, + "id": 12, + "method": "org.rdk.DeviceInfo.sku" } ``` -#### Get Response + +#### Response ```json { - "jsonrpc": "2.0", - "id": 42, - "result": { - "chipset": "T962X3" - } + "jsonrpc": 2.0, + "id": 12, + "result": "" } ``` - -## *modelid* + +## *socName [method](#head.Methods)* -Provides access to the device model number or SKU. -> This property is **read-only**. ### Events - -No Events - -### Value - +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| (property) | object | Device model number or SKU | -| (property).sku | string | Device model number or SKU | +| result.socName | string | - | -### Errors - -| Code | Message | Description | -| :-------- | :-------- | :-------- | -| 1 | ```ERROR_GENERAL``` | General error | +### Examples -### Example -#### Get Request +#### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "DeviceInfo.modelid" + "jsonrpc": 2.0, + "id": 13, + "method": "org.rdk.DeviceInfo.socName" } ``` -#### Get Response + +#### Response ```json { - "jsonrpc": "2.0", - "id": 42, - "result": { - "sku": "alphanumerical string" - } + "jsonrpc": 2.0, + "id": 13, + "result": "" } ``` - -## *make* + +## *supportedAudioPorts [method](#head.Methods)* -Provides access to the device manufacturer. -> This property is **read-only**. ### Events - -No Events - -### Value - +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| (property) | object | Device manufacturer | -| (property).make | string | Device manufacturer | - -### Errors +| result.supportedAudioPorts | RPC::IStringIterator | - | +| result.supportedAudioPorts[#] | string | - | -| Code | Message | Description | -| :-------- | :-------- | :-------- | -| 1 | ```ERROR_GENERAL``` | General error | +### Examples -### Example -#### Get Request +#### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "DeviceInfo.make" + "jsonrpc": 2.0, + "id": 14, + "method": "org.rdk.DeviceInfo.supportedAudioPorts" } ``` -#### Get Response + +#### Response ```json { - "jsonrpc": "2.0", - "id": 42, - "result": { - "make": "alphanumerical string" - } + "jsonrpc": 2.0, + "id": 14, + "result": [ + "" + ] } ``` - -## *modelname* + +## *supportedHdcp [method](#head.Methods)* -Provides access to the friendly device model name. -> This property is **read-only**. ### Events - -No Events - -### Value - +No events are associated with this method. +### Parameters | Name | Type | Description | | :-------- | :-------- | :-------- | -| (property) | object | Friendly device model name | -| (property).model | string | | - -### Errors - -| Code | Message | Description | +| params | object | | +| params.videoDisplay | string | - | +### Results +| Name | Type | Description | | :-------- | :-------- | :-------- | -| 1 | ```ERROR_GENERAL``` | General error | +| result.supportedHDCPVersion | CopyProtection | - | -### Example +### Examples -#### Get Request - -```json -{ - "jsonrpc": "2.0", - "id": 42, - "method": "DeviceInfo.modelname" -} -``` -#### Get Response +#### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "result": { - "model": "alphanumerical string" + "jsonrpc": 2.0, + "id": 15, + "method": "org.rdk.DeviceInfo.supportedHdcp", + "params": { + "videoDisplay": "" } } ``` - -## *devicetype* - -Provides access to the device type. - -> This property is **read-only**. - -### Events - -No Events - -### Value - -| Name | Type | Description | -| :-------- | :-------- | :-------- | -| (property) | object | Device type | -| (property).devicetype | string | Device type (must be one of the following: *tv*, *IpStb*, *QamIpStb*) | - -### Errors - -| Code | Message | Description | -| :-------- | :-------- | :-------- | -| 1 | ```ERROR_GENERAL``` | General error | - -### Example - -#### Get Request - -```json -{ - "jsonrpc": "2.0", - "id": 42, - "method": "DeviceInfo.devicetype" -} -``` -#### Get Response +#### Response ```json { - "jsonrpc": "2.0", - "id": 42, - "result": { - "devicetype": "IpStb" - } + "jsonrpc": 2.0, + "id": 15, + "result": "HDCP_UNAVAILABLE" } ``` - -## *socname* + +## *supportedMS12AudioProfiles [method](#head.Methods)* -Provides access to the SOC Name. -> This property is **read-only**. ### Events - -No Events - -### Value - +No events are associated with this method. +### Parameters | Name | Type | Description | | :-------- | :-------- | :-------- | -| (property) | object | SOC Name | -| (property).socname | string | SOC Name | - -### Errors - -| Code | Message | Description | +| params | object | | +| params.audioPort | string | - | +### Results +| Name | Type | Description | | :-------- | :-------- | :-------- | -| 1 | ```ERROR_GENERAL``` | General error | +| result.supportedMS12AudioProfiles | RPC::IStringIterator | - | +| result.supportedMS12AudioProfiles[#] | string | - | -### Example +### Examples -#### Get Request -```json -{ - "jsonrpc": "2.0", - "id": 42, - "method": "DeviceInfo.socname" -} -``` - -#### Get Response +#### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "result": { - "socname": "alphanumerical string" + "jsonrpc": 2.0, + "id": 16, + "method": "org.rdk.DeviceInfo.supportedMS12AudioProfiles", + "params": { + "audioPort": "" } } ``` - -## *distributorid* - -Provides access to the partner ID or distributor ID for device. - -> This property is **read-only**. - -### Events - -No Events - -### Value - -| Name | Type | Description | -| :-------- | :-------- | :-------- | -| (property) | object | Partner ID or distributor ID for device | -| (property).distributorid | string | Partner ID or distributor ID for device | - -### Errors - -| Code | Message | Description | -| :-------- | :-------- | :-------- | -| 1 | ```ERROR_GENERAL``` | General error | - -### Example - -#### Get Request - -```json -{ - "jsonrpc": "2.0", - "id": 42, - "method": "DeviceInfo.distributorid" -} -``` -#### Get Response +#### Response ```json { - "jsonrpc": "2.0", - "id": 42, - "result": { - "distributorid": "aplhanumerical string" - } + "jsonrpc": 2.0, + "id": 16, + "result": [ + "" + ] } ``` - -## *supportedaudioports* + +## *supportedResolutions [method](#head.Methods)* -Provides access to the audio ports supported on the device (all ports that are physically present). -> This property is **read-only**. ### Events - -No Events - -### Value - +No events are associated with this method. +### Parameters | Name | Type | Description | | :-------- | :-------- | :-------- | -| (property) | object | Audio ports supported on the device (all ports that are physically present) | -| (property).supportedAudioPorts | array | | -| (property).supportedAudioPorts[#] | string | | - -### Errors - -| Code | Message | Description | +| params | object | | +| params.videoDisplay | string | - | +### Results +| Name | Type | Description | | :-------- | :-------- | :-------- | -| 1 | ```ERROR_GENERAL``` | General error | +| result.supportedResolutions | RPC::IStringIterator | - | +| result.supportedResolutions[#] | string | - | -### Example +### Examples -#### Get Request -```json -{ - "jsonrpc": "2.0", - "id": 42, - "method": "DeviceInfo.supportedaudioports" -} -``` - -#### Get Response +#### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "result": { - "supportedAudioPorts": [ - "HDMI0" - ] + "jsonrpc": 2.0, + "id": 17, + "method": "org.rdk.DeviceInfo.supportedResolutions", + "params": { + "videoDisplay": "" } } ``` - -## *supportedvideodisplays* - -Provides access to the video ports supported on the device (all ports that are physically present). - -> This property is **read-only**. - -### Events - -No Events - -### Value - -| Name | Type | Description | -| :-------- | :-------- | :-------- | -| (property) | object | Video ports supported on the device (all ports that are physically present) | -| (property).supportedVideoDisplays | array | | -| (property).supportedVideoDisplays[#] | string | | -### Errors - -| Code | Message | Description | -| :-------- | :-------- | :-------- | -| 1 | ```ERROR_GENERAL``` | General error | - -### Example - -#### Get Request - -```json -{ - "jsonrpc": "2.0", - "id": 42, - "method": "DeviceInfo.supportedvideodisplays" -} -``` - -#### Get Response +#### Response ```json { - "jsonrpc": "2.0", - "id": 42, - "result": { - "supportedVideoDisplays": [ - "HDMI0" - ] - } + "jsonrpc": 2.0, + "id": 17, + "result": [ + "" + ] } ``` - -## *hostedid* + +## *supportedVideoDisplays [method](#head.Methods)* -Provides access to the EDID of the host. -> This property is **read-only**. ### Events - -No Events - -### Value - +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| (property) | object | EDID of the host | -| (property).EDID | string | A base64 encoded byte array string representing the EDID | +| result.supportedVideoDisplays | RPC::IStringIterator | - | +| result.supportedVideoDisplays[#] | string | - | -### Errors +### Examples -| Code | Message | Description | -| :-------- | :-------- | :-------- | -| 1 | ```ERROR_GENERAL``` | General error | - -### Example -#### Get Request +#### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "DeviceInfo.hostedid" + "jsonrpc": 2.0, + "id": 18, + "method": "org.rdk.DeviceInfo.supportedVideoDisplays" } ``` -#### Get Response + +#### Response ```json { - "jsonrpc": "2.0", - "id": 42, - "result": { - "EDID": "AP///////wAQrMLQVEJTMQUdAQOANR546q11qVRNnSYPUFSlSwCBALMA0QBxT6lAgYDRwAEBVl4AoKCgKVAwIDUADighAAAaAAAA/wBNWTNORDkxVjFTQlQKAAAA/ABERUxMIFAyNDE4RAogAAAA/QAxVh1xHAAKICAgICAgARsCAxuxUJAFBAMCBxYBBhESFRMUHyBlAwwAEAACOoAYcTgtQFgsRQAOKCEAAB4BHYAYcRwWIFgsJQAOKCEAAJ6/FgCggDgTQDAgOgAOKCEAABp+OQCggDgfQDAgOgAOKCEAABoAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA2A" - } + "jsonrpc": 2.0, + "id": 18, + "result": [ + "" + ] } ``` + diff --git a/docs/apis/DeviceOptimizeStateActivatorPlugin.md b/docs/apis/DeviceOptimizeStateActivatorPlugin.md new file mode 100644 index 00000000..5f9ae803 --- /dev/null +++ b/docs/apis/DeviceOptimizeStateActivatorPlugin.md @@ -0,0 +1,93 @@ + + +# DeviceOptimizeStateActivator Plugin + +**Version: [1.0.0](https://github.com/rdkcentral/rdkservices/blob/main/DeviceOptimizeStateActivator/CHANGELOG.md)** + +A DeviceOptimizeStateActivator plugin for Thunder framework. + +### Table of Contents + +- [Abbreviation, Acronyms and Terms](#head.Abbreviation,_Acronyms_and_Terms) +- [Description](#head.Description) +- [Configuration](#head.Configuration) +- [Methods](#head.Methods) + + +# Abbreviation, Acronyms and Terms + +[[Refer to this link](userguide/aat.md)] + + +# Description + +The `DeviceOptimizeStateActivator` plugin provides an interface for DeviceOptimizeStateActivator. + +The plugin is designed to be loaded and executed within the Thunder framework. For more information about the framework refer to [[Thunder](#ref.Thunder)]. + + +# Configuration + +The table below lists configuration options of the plugin. + +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| callsign | string | Plugin instance name (default: org.rdk.DeviceOptimizeStateActivator) | +| classname | string | Class name: *DeviceOptimizeStateActivator* | +| locator | string | Library name: *libWPEFrameworkDeviceOptimizeStateActivator.so* | +| autostart | boolean | Determines if the plugin shall be started automatically along with the framework | + + +# Methods + +The following methods are provided by the DeviceOptimizeStateActivator plugin: + +DeviceOptimizeStateActivator interface methods: + +| Method | Description | +| :-------- | :-------- | +| [request](#method.request) | | + + +## *request [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.newState | string | - | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 0, + "method": "org.rdk.DeviceOptimizeStateActivator.request", + "params": { + "newState": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 0, + "result": null +} +``` + + diff --git a/docs/apis/DictionaryPlugin.md b/docs/apis/DictionaryPlugin.md new file mode 100644 index 00000000..f71d1835 --- /dev/null +++ b/docs/apis/DictionaryPlugin.md @@ -0,0 +1,297 @@ + + +# Dictionary Plugin + +**Version: [1.0.0](https://github.com/rdkcentral/rdkservices/blob/main/Dictionary/CHANGELOG.md)** + +A Dictionary plugin for Thunder framework. + +### Table of Contents + +- [Abbreviation, Acronyms and Terms](#head.Abbreviation,_Acronyms_and_Terms) +- [Description](#head.Description) +- [Configuration](#head.Configuration) +- [Methods](#head.Methods) +- [Notifications](#head.Notifications) + + +# Abbreviation, Acronyms and Terms + +[[Refer to this link](userguide/aat.md)] + + +# Description + +The `Dictionary` plugin provides an interface for Dictionary. + +The plugin is designed to be loaded and executed within the Thunder framework. For more information about the framework refer to [[Thunder](#ref.Thunder)]. + + +# Configuration + +The table below lists configuration options of the plugin. + +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| callsign | string | Plugin instance name (default: org.rdk.Dictionary) | +| classname | string | Class name: *Dictionary* | +| locator | string | Library name: *libWPEFrameworkDictionary.so* | +| autostart | boolean | Determines if the plugin shall be started automatically along with the framework | + + +# Methods + +The following methods are provided by the Dictionary plugin: + +Dictionary interface methods: + +| Method | Description | +| :-------- | :-------- | +| [get](#method.get) | | +| [isValid](#method.isValid) | | +| [next](#method.next) | | +| [reset](#method.reset) | | +| [set](#method.set) | | + + +## *get [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.nameSpace | string | - | +| params.key | string | - | +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result.value | string | - | + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 0, + "method": "org.rdk.Dictionary.get", + "params": { + "nameSpace": "", + "key": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 0, + "result": "" +} +``` + + +## *isValid [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 1, + "method": "org.rdk.Dictionary.isValid" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 1, + "result": null +} +``` + + +## *next [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 2, + "method": "org.rdk.Dictionary.next" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 2, + "result": null +} +``` + + +## *reset [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 3, + "method": "org.rdk.Dictionary.reset" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 3, + "result": null +} +``` + + +## *set [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.nameSpace | string | - | +| params.key | string | - | +| params.value | string | - | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 4, + "method": "org.rdk.Dictionary.set", + "params": { + "nameSpace": "", + "key": "", + "value": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 4, + "result": null +} +``` + + + + +# Notifications + +Notifications are autonomous events, triggered by the internals of the implementation, and broadcasted via JSON-RPC to all registered observers. Refer to [[Thunder](#ref.Thunder)] for information on how to register for a notification. + +The following events are provided by the Dictionary plugin: + +Dictionary interface events: + +| Event | Description | +| :-------- | :-------- | +| [modified](#event.modified) | | + + +## *modified [event](#head.Notifications)* + + + +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.nameSpace | string | - | +| params.key | string | - | +| params.value | string | - | + +### Examples + +```json +{ + "jsonrpc": 2.0, + "id": 5, + "method": "org.rdk.Dictionary.modified", + "params": { + "nameSpace": "", + "key": "", + "value": "" + } +} +``` diff --git a/docs/apis/DisplayInfoPlugin.md b/docs/apis/DisplayInfoPlugin.md index e48cd1c7..cd1ee9fd 100644 --- a/docs/apis/DisplayInfoPlugin.md +++ b/docs/apis/DisplayInfoPlugin.md @@ -1,45 +1,45 @@ - + # DisplayInfo Plugin -**Version: [1.0.0]()** +**Version: [1.0.0](https://github.com/rdkcentral/rdkservices/blob/main/DisplayInfo/CHANGELOG.md)** A DisplayInfo plugin for Thunder framework. ### Table of Contents -- [Abbreviation, Acronyms and Terms](#Abbreviation,_Acronyms_and_Terms) -- [Description](#Description) -- [Configuration](#Configuration) -- [Methods](#Methods) -- [Properties](#Properties) -- [Notifications](#Notifications) +- [Abbreviation, Acronyms and Terms](#head.Abbreviation,_Acronyms_and_Terms) +- [Description](#head.Description) +- [Configuration](#head.Configuration) +- [Methods](#head.Methods) +- [Properties](#head.Properties) +- [Notifications](#head.Notifications) - + # Abbreviation, Acronyms and Terms -[[Refer to this link](overview/aat.md)] +[[Refer to this link](userguide/aat.md)] - + # Description -The `DisplayInfo` plugin allows you to retrieve various display-related information. +The `DisplayInfo` plugin provides an interface for DisplayInfo. -The plugin is designed to be loaded and executed within the Thunder framework. For more information about the framework refer to [[Thunder](#Thunder)]. +The plugin is designed to be loaded and executed within the Thunder framework. For more information about the framework refer to [[Thunder](#ref.Thunder)]. - + # Configuration The table below lists configuration options of the plugin. | Name | Type | Description | | :-------- | :-------- | :-------- | -| callsign | string | Plugin instance name (default: *DisplayInfo*) | +| callsign | string | Plugin instance name (default: org.rdk.DisplayInfo) | | classname | string | Class name: *DisplayInfo* | | locator | string | Library name: *libWPEFrameworkDisplayInfo.so* | | autostart | boolean | Determines if the plugin shall be started automatically along with the framework | - + # Methods The following methods are provided by the DisplayInfo plugin: @@ -48,880 +48,863 @@ DisplayInfo interface methods: | Method | Description | | :-------- | :-------- | -| [edid](#edid) | Returns the TV's Extended Display Identification Data (EDID) | -| [widthincentimeters](#widthincentimeters) | Horizontal size in centimeters | -| [heightincentimeters](#heightincentimeters) | Vertical size in centimeters | +| [eDID](#method.eDID) | TV's Extended Display Identification Data | +| [heightInCentimeters](#method.heightInCentimeters) | Vertical size in centimeters | +| [widthInCentimeters](#method.widthInCentimeters) | Horizontal size in centimeters | + +## *eDID [method](#head.Methods)* - -## *edid* - -Returns the TV's Extended Display Identification Data (EDID). +TV's Extended Display Identification Data ### Events - -No Events - +No events are associated with this method. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.length | integer | The EDID length | - -### Result - +| params.length | uint16_t | - | +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | object | | -| result.length | integer | The EDID length | -| result.data | string | The EDID data | +| result.length | uint16_t | - | +| result.data[] | uint8_t | - | + +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "DisplayInfo.edid", + "jsonrpc": 2.0, + "id": 0, + "method": "org.rdk.DisplayInfo.eDID", "params": { - "length": 0 + "length": "" } } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, - "result": { - "length": 0, - "data": "..." - } + "jsonrpc": 2.0, + "id": 0, + "result": "" } ``` - -## *widthincentimeters* + +## *heightInCentimeters [method](#head.Methods)* -Horizontal size in centimeters. +Vertical size in centimeters ### Events - -No Events - +No events are associated with this method. ### Parameters - This method takes no parameters. - -### Result - +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | integer | | +| result.height | uint8_t | - | + +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "DisplayInfo.widthincentimeters" + "jsonrpc": 2.0, + "id": 1, + "method": "org.rdk.DisplayInfo.heightInCentimeters" } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, - "result": 0 + "jsonrpc": 2.0, + "id": 1, + "result": "" } ``` - -## *heightincentimeters* + +## *widthInCentimeters [method](#head.Methods)* -Vertical size in centimeters. +Horizontal size in centimeters ### Events - -No Events - +No events are associated with this method. ### Parameters - This method takes no parameters. - -### Result - +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | integer | | +| result.width | uint8_t | width in cm | + +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "DisplayInfo.heightincentimeters" + "jsonrpc": 2.0, + "id": 2, + "method": "org.rdk.DisplayInfo.widthInCentimeters" } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, - "result": 0 + "jsonrpc": 2.0, + "id": 2, + "result": "" } ``` - -# Properties + +# Properties The following properties are provided by the DisplayInfo plugin: DisplayInfo interface properties: -| Property | Description | +| Method | Description | | :-------- | :-------- | -| [totalgpuram](#totalgpuram) RO | Total GPU DRAM memory (in bytes) | -| [freegpuram](#freegpuram) RO | Free GPU DRAM memory (in bytes) | -| [isaudiopassthrough](#isaudiopassthrough) RO | Current audio passthrough status on HDMI | -| [connected](#connected) RO | Current HDMI connection status | -| [width](#width) RO | Horizontal resolution of the TV | -| [height](#height) RO | Vertical resolution of the TV | -| [verticalfreq](#verticalfreq) RO | Vertical Frequency | -| [hdcpprotection](#hdcpprotection) RO | HDCP protocol used for transmission | -| [portname](#portname) RO | Video output port on the STB used for connecting to the TV | -| [tvcapabilities](#tvcapabilities) RO | HDR formats supported by the TV | -| [stbcapabilities](#stbcapabilities) RO | HDR formats supported by the STB | -| [hdrsetting](#hdrsetting) RO | HDR format in use | -| [colorspace](#colorspace) RO | Display color space (chroma subsampling format) | -| [framerate](#framerate) RO | Display frame rate | -| [colourdepth](#colourdepth) RO | Display colour depth | -| [quantizationrange](#quantizationrange) RO | Display quantization range | -| [colorimetry](#colorimetry) RO | Display colorimetry | -| [eotf](#eotf) RO | Display Electro Optical Transfer Function (EOTF) | - - - -## *totalgpuram* - -Provides access to the total GPU DRAM memory (in bytes). - -> This property is **read-only**. - +| [ColorSpace](#property.ColorSpace)RO | Provides access to the display's Colour space (chroma subsampling format) | +| [Colorimetry](#property.Colorimetry)RO | Provides access to display's colorimetry | +| [ColourDepth](#property.ColourDepth)RO | Provides access to display's colour Depth | +| [Connected](#property.Connected)RO | Current HDMI connection status | +| [EOTF](#property.EOTF)RO | Provides access to display's Electro optical transfer function | +| [FrameRate](#property.FrameRate)RO | Provides access to Frame Rate | +| [FreeGpuRam](#property.FreeGpuRam)RO | Free GPU DRAM memory (in bytes) | +| [HDCPProtection](#property.HDCPProtection) | HDCP protocol used for transmission | +| [HDRSetting](#property.HDRSetting)RO | HDR format in use | +| [Height](#property.Height)RO | Vertical resolution of TV | +| [IsAudioPassthrough](#property.IsAudioPassthrough)RO | Current audio passthrough status on HDMI | +| [PortName](#property.PortName)RO | Video output port on the STB used for connection to TV | +| [QuantizationRange](#property.QuantizationRange)RO | Provides access to display's Qauntization Range | +| [STBCapabilities](#property.STBCapabilities)RO | HDR formats supported by STB | +| [TVCapabilities](#property.TVCapabilities)RO | HDR formats supported by TV | +| [TotalGpuRam](#property.TotalGpuRam)RO | Total GPU DRAM memory (in bytes) | +| [VerticalFreq](#property.VerticalFreq)RO | Vertical Frequency | +| [Width](#property.Width)RO | Horizontal resolution of TV | + + +## *ColorSpace [property](#head.Properties)* + +Provides access to the display's Colour space (chroma subsampling format) + +> This property is read-only. ### Events - -No Events - -### Value - +No events are associated with this method. +### Values | Name | Type | Description | | :-------- | :-------- | :-------- | -| (property) | integer | Total GPU DRAM memory (in bytes) | +| (property).cs | ColourSpaceType | colour space | + +### Examples -### Example #### Get Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "DisplayInfo.totalgpuram" + "jsonrpc": 2.0, + "id": 4, + "method": "org.rdk.DisplayInfo.colorSpace" } ``` + #### Get Response ```json { - "jsonrpc": "2.0", - "id": 42, - "result": 381681664 + "jsonrpc": 2.0, + "id": 4, + "result": "FORMAT_UNKNOWN" } ``` - -## *freegpuram* - -Provides access to the free GPU DRAM memory (in bytes). + +## *Colorimetry [property](#head.Properties)* -> This property is **read-only**. +Provides access to display's colorimetry +> This property is read-only. ### Events - -No Events - -### Value - +No events are associated with this method. +### Values | Name | Type | Description | | :-------- | :-------- | :-------- | -| (property) | integer | Free GPU DRAM memory (in bytes) | +| (property).colorimetry | IColorimetryIterator | display colorimetry | +| (property).colorimetry[#] | string | | + +### Examples -### Example #### Get Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "DisplayInfo.freegpuram" + "jsonrpc": 2.0, + "id": 5, + "method": "org.rdk.DisplayInfo.colorimetry" } ``` + #### Get Response ```json { - "jsonrpc": "2.0", - "id": 42, - "result": 358612992 + "jsonrpc": 2.0, + "id": 5, + "result": [ + "COLORIMETRY_UNKNOWN" + ] } ``` - -## *isaudiopassthrough* - -Provides access to the current audio passthrough status on HDMI. + +## *ColourDepth [property](#head.Properties)* -> This property is **read-only**. +Provides access to display's colour Depth +> This property is read-only. ### Events - -No Events - -### Value - +No events are associated with this method. +### Values | Name | Type | Description | | :-------- | :-------- | :-------- | -| (property) | boolean | Current audio passthrough status on HDMI | +| (property).colour | ColourDepthType | colour depth | + +### Examples -### Example #### Get Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "DisplayInfo.isaudiopassthrough" + "jsonrpc": 2.0, + "id": 6, + "method": "org.rdk.DisplayInfo.colourDepth" } ``` + #### Get Response ```json { - "jsonrpc": "2.0", - "id": 42, - "result": false + "jsonrpc": 2.0, + "id": 6, + "result": "COLORDEPTH_UNKNOWN" } ``` - -## *connected* - -Provides access to the current HDMI connection status. + +## *Connected [property](#head.Properties)* -> This property is **read-only**. +Current HDMI connection status +> This property is read-only. ### Events - -No Events - -### Value - +No events are associated with this method. +### Values | Name | Type | Description | | :-------- | :-------- | :-------- | -| (property) | boolean | Current HDMI connection status | +| (property).isconnected | bool | connected/disconnected | + +### Examples -### Example #### Get Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "DisplayInfo.connected" + "jsonrpc": 2.0, + "id": 7, + "method": "org.rdk.DisplayInfo.connected" } ``` + #### Get Response ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 7, "result": true } ``` - -## *width* + +## *EOTF [property](#head.Properties)* -Provides access to the horizontal resolution of the TV. - -> This property is **read-only**. +Provides access to display's Electro optical transfer function +> This property is read-only. ### Events - -No Events - -### Value - +No events are associated with this method. +### Values | Name | Type | Description | | :-------- | :-------- | :-------- | -| (property) | integer | Horizontal resolution of the TV | +| (property).eotf | EotfType | display's EOTF | + +### Examples -### Example #### Get Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "DisplayInfo.width" + "jsonrpc": 2.0, + "id": 8, + "method": "org.rdk.DisplayInfo.eOTF" } ``` + #### Get Response ```json { - "jsonrpc": "2.0", - "id": 42, - "result": 1280 + "jsonrpc": 2.0, + "id": 8, + "result": "EOTF_UNKNOWN" } ``` - -## *height* - -Provides access to the vertical resolution of the TV. + +## *FrameRate [property](#head.Properties)* -> This property is **read-only**. +Provides access to Frame Rate +> This property is read-only. ### Events - -No Events - -### Value - +No events are associated with this method. +### Values | Name | Type | Description | | :-------- | :-------- | :-------- | -| (property) | integer | Vertical resolution of the TV | +| (property).rate | FrameRateType | frame rate | + +### Examples -### Example #### Get Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "DisplayInfo.height" + "jsonrpc": 2.0, + "id": 9, + "method": "org.rdk.DisplayInfo.frameRate" } ``` + #### Get Response ```json { - "jsonrpc": "2.0", - "id": 42, - "result": 720 + "jsonrpc": 2.0, + "id": 9, + "result": "FRAMERATE_UNKNOWN" } ``` - -## *verticalfreq* + +## *FreeGpuRam [property](#head.Properties)* -Provides access to the vertical Frequency. - -> This property is **read-only**. +Free GPU DRAM memory (in bytes) +> This property is read-only. ### Events - -No Events - -### Value - +No events are associated with this method. +### Values | Name | Type | Description | | :-------- | :-------- | :-------- | -| (property) | integer | Vertical Frequency | +| (property).free | uint64_t | | + +### Examples -### Example #### Get Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "DisplayInfo.verticalfreq" + "jsonrpc": 2.0, + "id": 10, + "method": "org.rdk.DisplayInfo.freeGpuRam" } ``` + #### Get Response ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 10, "result": 0 } ``` - -## *hdcpprotection* - -Provides access to the HDCP protocol used for transmission. + +## *HDCPProtection [property](#head.Properties)* -> This property is **read-only**. +HDCP protocol used for transmission ### Events - -No Events - -### Value - +No events are associated with this method. +### Values | Name | Type | Description | | :-------- | :-------- | :-------- | -| (property) | string | HDCP protocol used for transmission (must be one of the following: *HdcpUnencrypted*, *Hdcp1x*, *Hdcp2x*, *HdcpAuto*) | +| (property).value | HDCPProtectionType | protocol | + +### Examples -### Example #### Get Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "DisplayInfo.hdcpprotection" + "jsonrpc": 2.0, + "id": 11, + "method": "org.rdk.DisplayInfo.hDCPProtection" } ``` + #### Get Response ```json { - "jsonrpc": "2.0", - "id": 42, - "result": "Hdcp1x" + "jsonrpc": 2.0, + "id": 11, + "result": "HDCP_Unencrypted" } ``` - -## *portname* -Provides access to the video output port on the STB used for connecting to the TV. +#### Set Request + +```json +{ + "jsonrpc": 2.0, + "id": 11, + "method": "org.rdk.DisplayInfo.hDCPProtection", + "params": { + "value": "HDCP_Unencrypted" + } +} +``` + -> This property is **read-only**. +#### Set Response -### Events +```json +{ + "jsonrpc": 2.0, + "id": 11, + "result": null +} +``` -No Events + +## *HDRSetting [property](#head.Properties)* -### Value +HDR format in use +> This property is read-only. +### Events +No events are associated with this method. +### Values | Name | Type | Description | | :-------- | :-------- | :-------- | -| (property) | string | Video output port on the STB used for connecting to the TV | +| (property).type | HDRType | HDR format | + +### Examples -### Example #### Get Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "DisplayInfo.portname" + "jsonrpc": 2.0, + "id": 12, + "method": "org.rdk.DisplayInfo.hDRSetting" } ``` + #### Get Response ```json { - "jsonrpc": "2.0", - "id": 42, - "result": "hdmi" + "jsonrpc": 2.0, + "id": 12, + "result": "HDR_OFF" } ``` - -## *tvcapabilities* - -Provides access to the HDR formats supported by the TV. + +## *Height [property](#head.Properties)* -> This property is **read-only**. +Vertical resolution of TV +> This property is read-only. ### Events - -No Events - -### Value - +No events are associated with this method. +### Values | Name | Type | Description | | :-------- | :-------- | :-------- | -| (property) | string | HDR formats supported by the TV (must be one of the following: *HdrOff*, *Hdr10*, *Hdr10Plus*, *HdrHlg*, *HdrDolbyvision*, *HdrTechnicolor*, *HdrSdr*) | +| (property).height | uint32_t | height of TV in pixels | + +### Examples -### Example #### Get Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "DisplayInfo.tvcapabilities" + "jsonrpc": 2.0, + "id": 13, + "method": "org.rdk.DisplayInfo.height" } ``` + #### Get Response ```json { - "jsonrpc": "2.0", - "id": 42, - "result": "HdrOff" + "jsonrpc": 2.0, + "id": 13, + "result": 0 } ``` - -## *stbcapabilities* - -Provides access to the HDR formats supported by the STB. + +## *IsAudioPassthrough [property](#head.Properties)* -> This property is **read-only**. +Current audio passthrough status on HDMI +> This property is read-only. ### Events - -No Events - -### Value - +No events are associated with this method. +### Values | Name | Type | Description | | :-------- | :-------- | :-------- | -| (property) | string | HDR formats supported by the STB (must be one of the following: *HdrOff*, *Hdr10*, *Hdr10Plus*, *HdrHlg*, *HdrDolbyvision*, *HdrTechnicolor*) | +| (property).passthru | bool | enabled/disabled | + +### Examples -### Example #### Get Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "DisplayInfo.stbcapabilities" + "jsonrpc": 2.0, + "id": 14, + "method": "org.rdk.DisplayInfo.isAudioPassthrough" } ``` + #### Get Response ```json { - "jsonrpc": "2.0", - "id": 42, - "result": "HdrOff" + "jsonrpc": 2.0, + "id": 14, + "result": true } ``` - -## *hdrsetting* + +## *PortName [property](#head.Properties)* -Provides access to the HDR format in use. - -> This property is **read-only**. +Video output port on the STB used for connection to TV +> This property is read-only. ### Events - -No Events - -### Value - +No events are associated with this method. +### Values | Name | Type | Description | | :-------- | :-------- | :-------- | -| (property) | string | HDR format in use (must be one of the following: *HdrOff*, *Hdr10*, *Hdr10Plus*, *HdrHlg*, *HdrDolbyvision*, *HdrTechnicolor*) | +| (property).name | string | video output port name | + +### Examples -### Example #### Get Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "DisplayInfo.hdrsetting" + "jsonrpc": 2.0, + "id": 15, + "method": "org.rdk.DisplayInfo.portName" } ``` + #### Get Response ```json { - "jsonrpc": "2.0", - "id": 42, - "result": "HdrOff" + "jsonrpc": 2.0, + "id": 15, + "result": "" } ``` - -## *colorspace* - -Provides access to the display color space (chroma subsampling format). + +## *QuantizationRange [property](#head.Properties)* -> This property is **read-only**. +Provides access to display's Qauntization Range +> This property is read-only. ### Events - -No Events - -### Value - +No events are associated with this method. +### Values | Name | Type | Description | | :-------- | :-------- | :-------- | -| (property) | string | Display color space (chroma subsampling format) (must be one of the following: *FORMAT_UNKNOWN*, *FORMAT_OTHER*, *FORMAT_RGB_444*, *FORMAT_YCBCR_444*, *FORMAT_YCBCR_422*, *FORMAT_YCBCR_420*) | +| (property).qr | QuantizationRangeType | quantization range | + +### Examples -### Example #### Get Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "DisplayInfo.colorspace" + "jsonrpc": 2.0, + "id": 16, + "method": "org.rdk.DisplayInfo.quantizationRange" } ``` + #### Get Response ```json { - "jsonrpc": "2.0", - "id": 42, - "result": "FORMAT_RGB_444" + "jsonrpc": 2.0, + "id": 16, + "result": "QUANTIZATIONRANGE_UNKNOWN" } ``` - -## *framerate* - -Provides access to the display frame rate. + +## *STBCapabilities [property](#head.Properties)* -> This property is **read-only**. +HDR formats supported by STB +> This property is read-only. ### Events - -No Events - -### Value - +No events are associated with this method. +### Values | Name | Type | Description | | :-------- | :-------- | :-------- | -| (property) | string | Display frame rate (must be one of the following: *FRAMERATE_UNKNOWN*, *FRAMERATE_23_976*, *FRAMERATE_24*, *FRAMERATE_25*, *FRAMERATE_29_97*, *FRAMERATE_30*, *FRAMERATE_47_952*, *FRAMERATE_48*, *FRAMERATE_50*, *FRAMERATE_59_94*, *FRAMERATE_60*, *FRAMERATE_119_88*, *FRAMERATE_120*, *FRAMERATE_144*) | +| (property).type | IHDRIterator | | +| (property).type[#] | string | | + +### Examples -### Example #### Get Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "DisplayInfo.framerate" + "jsonrpc": 2.0, + "id": 17, + "method": "org.rdk.DisplayInfo.sTBCapabilities" } ``` + #### Get Response ```json { - "jsonrpc": "2.0", - "id": 42, - "result": "FRAMERATE_60" + "jsonrpc": 2.0, + "id": 17, + "result": [ + "HDR_OFF" + ] } ``` - -## *colourdepth* + +## *TVCapabilities [property](#head.Properties)* -Provides access to the display colour depth. - -> This property is **read-only**. +HDR formats supported by TV +> This property is read-only. ### Events - -No Events - -### Value - +No events are associated with this method. +### Values | Name | Type | Description | | :-------- | :-------- | :-------- | -| (property) | string | Display colour depth (must be one of the following: *COLORDEPTH_UNKNOWN*, *COLORDEPTH_8_BIT*, *COLORDEPTH_10_BIT*, *COLORDEPTH_12_BIT*) | +| (property).type | IHDRIterator | | +| (property).type[#] | string | | + +### Examples -### Example #### Get Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "DisplayInfo.colourdepth" + "jsonrpc": 2.0, + "id": 18, + "method": "org.rdk.DisplayInfo.tVCapabilities" } ``` + #### Get Response ```json { - "jsonrpc": "2.0", - "id": 42, - "result": "COLORDEPTH_8_BIT" + "jsonrpc": 2.0, + "id": 18, + "result": [ + "HDR_OFF" + ] } ``` - -## *quantizationrange* - -Provides access to the display quantization range. + +## *TotalGpuRam [property](#head.Properties)* -> This property is **read-only**. +Total GPU DRAM memory (in bytes) +> This property is read-only. ### Events - -No Events - -### Value - +No events are associated with this method. +### Values | Name | Type | Description | | :-------- | :-------- | :-------- | -| (property) | string | Display quantization range (must be one of the following: *QUANTIZATIONRANGE_UNKNOWN*, *QUANTIZATIONRANGE_LIMITED*, *QUANTIZATIONRANGE_FULL*) | +| (property).total | uint64_t | | + +### Examples -### Example #### Get Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "DisplayInfo.quantizationrange" + "jsonrpc": 2.0, + "id": 19, + "method": "org.rdk.DisplayInfo.totalGpuRam" } ``` + #### Get Response ```json { - "jsonrpc": "2.0", - "id": 42, - "result": "QUANTIZATIONRANGE_UNKNOWN" + "jsonrpc": 2.0, + "id": 19, + "result": 0 } ``` - -## *colorimetry* - -Provides access to the display colorimetry. + +## *VerticalFreq [property](#head.Properties)* -> This property is **read-only**. +Vertical Frequency +> This property is read-only. ### Events - -No Events - -### Value - +No events are associated with this method. +### Values | Name | Type | Description | | :-------- | :-------- | :-------- | -| (property) | string | Display colorimetry (must be one of the following: *COLORIMETRY_UNKNOWN*, *COLORIMETRY_OTHER*, *COLORIMETRY_SMPTE170M*, *COLORIMETRY_BT709*, *COLORIMETRY_XVYCC601*, *COLORIMETRY_XVYCC709*, *COLORIMETRY_SYCC601*, *COLORIMETRY_OPYCC601*, *COLORIMETRY_OPRGB*, *COLORIMETRY_BT2020YCCBCBRC*, *COLORIMETRY_BT2020RGB_YCBCR*) | +| (property).vf | uint32_t | vertical freq | + +### Examples -### Example #### Get Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "DisplayInfo.colorimetry" + "jsonrpc": 2.0, + "id": 20, + "method": "org.rdk.DisplayInfo.verticalFreq" } ``` + #### Get Response ```json { - "jsonrpc": "2.0", - "id": 42, - "result": "COLORIMETRY_OTHER" + "jsonrpc": 2.0, + "id": 20, + "result": 0 } ``` - -## *eotf* - -Provides access to the display Electro Optical Transfer Function (EOTF). + +## *Width [property](#head.Properties)* -> This property is **read-only**. +Horizontal resolution of TV +> This property is read-only. ### Events - -No Events - -### Value - +No events are associated with this method. +### Values | Name | Type | Description | | :-------- | :-------- | :-------- | -| (property) | string | Display Electro Optical Transfer Function (EOTF) (must be one of the following: *EOTF_UNKNOWN*, *EOTF_OTHER*, *EOTF_BT1886*, *EOTF_BT2100*, *EOTF_SMPTE_ST_2084*) | +| (property).width | uint32_t | width of TV in pixels | + +### Examples -### Example #### Get Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "DisplayInfo.eotf" + "jsonrpc": 2.0, + "id": 21, + "method": "org.rdk.DisplayInfo.width" } ``` + #### Get Response ```json { - "jsonrpc": "2.0", - "id": 42, - "result": "EOTF_SMPTE_ST_2084" + "jsonrpc": 2.0, + "id": 21, + "result": 0 } ``` - + + # Notifications -Notifications are autonomous events, triggered by the internals of the implementation, and broadcasted via JSON-RPC to all registered observers. Refer to [[Thunder](#Thunder)] for information on how to register for a notification. +Notifications are autonomous events, triggered by the internals of the implementation, and broadcasted via JSON-RPC to all registered observers. Refer to [[Thunder](#ref.Thunder)] for information on how to register for a notification. The following events are provided by the DisplayInfo plugin: @@ -929,30 +912,28 @@ DisplayInfo interface events: | Event | Description | | :-------- | :-------- | -| [updated](#updated) | Triggered when the connection changes or is updated | +| [updated](#event.updated) | | + +## *updated [event](#head.Notifications)* - -## *updated* -Triggered when the connection changes or is updated. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.event | string | The type of change (must be one of the following: *PreResolutionChange*, *PostResolutionChange*, *HdmiChange*, *HdcpChange*) | +| params.event | Source | - | -### Example +### Examples ```json { - "jsonrpc": "2.0", - "method": "client.events.updated", + "jsonrpc": 2.0, + "id": 3, + "method": "org.rdk.DisplayInfo.updated", "params": { - "event": "HdmiChange" + "event": "PRE_RESOLUTION_CHANGE" } } ``` - diff --git a/docs/apis/DolbyPlugin.md b/docs/apis/DolbyPlugin.md new file mode 100644 index 00000000..b6f1c504 --- /dev/null +++ b/docs/apis/DolbyPlugin.md @@ -0,0 +1,268 @@ + + +# Dolby Plugin + +**Version: [1.0.0](https://github.com/rdkcentral/rdkservices/blob/main/Dolby/CHANGELOG.md)** + +A Dolby plugin for Thunder framework. + +### Table of Contents + +- [Abbreviation, Acronyms and Terms](#head.Abbreviation,_Acronyms_and_Terms) +- [Description](#head.Description) +- [Configuration](#head.Configuration) +- [Properties](#head.Properties) +- [Notifications](#head.Notifications) + + +# Abbreviation, Acronyms and Terms + +[[Refer to this link](userguide/aat.md)] + + +# Description + +The `Dolby` plugin provides an interface for Dolby. + +The plugin is designed to be loaded and executed within the Thunder framework. For more information about the framework refer to [[Thunder](#ref.Thunder)]. + + +# Configuration + +The table below lists configuration options of the plugin. + +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| callsign | string | Plugin instance name (default: org.rdk.Dolby) | +| classname | string | Class name: *Dolby* | +| locator | string | Library name: *libWPEFrameworkDolby.so* | +| autostart | boolean | Determines if the plugin shall be started automatically along with the framework | + + + +# Properties +The following properties are provided by the Dolby plugin: + +Dolby interface properties: + +| Method | Description | +| :-------- | :-------- | +| [AtmosMetadata](#property.AtmosMetadata)RO | Atmos capabilities of Sink | +| [EnableAtmosOutput](#property.EnableAtmosOutput)WO | Enable Atmos Audio Output | +| [Mode](#property.Mode) | Dolby Mode | +| [SoundMode](#property.SoundMode)RO | Sound Mode - Mono/Stereo/Surround | + + +## *AtmosMetadata [property](#head.Properties)* + +Atmos capabilities of Sink + +> This property is read-only. +### Events +No events are associated with this method. +### Values +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| (property).supported | bool | | + +### Examples + + +#### Get Request + +```json +{ + "jsonrpc": 2.0, + "id": 1, + "method": "org.rdk.Dolby.atmosMetadata" +} +``` + + +#### Get Response + +```json +{ + "jsonrpc": 2.0, + "id": 1, + "result": true +} +``` + + +## *EnableAtmosOutput [property](#head.Properties)* + +Enable Atmos Audio Output + +> This property is write-only. +### Events +No events are associated with this method. +### Values +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| (property).enable | bool | enable/disable | + +### Examples + + +#### Set Request + +```json +{ + "jsonrpc": 2.0, + "id": 2, + "method": "org.rdk.Dolby.enableAtmosOutput", + "params": { + "enable": true + } +} +``` + + +#### Set Response + +```json +{ + "jsonrpc": 2.0, + "id": 2, + "result": null +} +``` + + +## *Mode [property](#head.Properties)* + +Dolby Mode + +### Events +No events are associated with this method. +### Values +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| (property).mode | Dolby::IOutput::Type | dolby mode type | + +### Examples + + +#### Get Request + +```json +{ + "jsonrpc": 2.0, + "id": 3, + "method": "org.rdk.Dolby.mode" +} +``` + + +#### Get Response + +```json +{ + "jsonrpc": 2.0, + "id": 3, + "result": null +} +``` + + +#### Set Request + +```json +{ + "jsonrpc": 2.0, + "id": 3, + "method": "org.rdk.Dolby.mode", + "params": { + "mode": "" + } +} +``` + + +#### Set Response + +```json +{ + "jsonrpc": 2.0, + "id": 3, + "result": null +} +``` + + +## *SoundMode [property](#head.Properties)* + +Sound Mode - Mono/Stereo/Surround + +> This property is read-only. +### Events +No events are associated with this method. +### Values +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| (property).mode | Dolby::IOutput::SoundModes | | + +### Examples + + +#### Get Request + +```json +{ + "jsonrpc": 2.0, + "id": 4, + "method": "org.rdk.Dolby.soundMode" +} +``` + + +#### Get Response + +```json +{ + "jsonrpc": 2.0, + "id": 4, + "result": "" +} +``` + + + +# Notifications + +Notifications are autonomous events, triggered by the internals of the implementation, and broadcasted via JSON-RPC to all registered observers. Refer to [[Thunder](#ref.Thunder)] for information on how to register for a notification. + +The following events are provided by the Dolby plugin: + +Dolby interface events: + +| Event | Description | +| :-------- | :-------- | +| [audioModeChanged](#event.audioModeChanged) | | + + +## *audioModeChanged [event](#head.Notifications)* + + + +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.mode | Dolby::IOutput::SoundModes | - | +| params.enabled | bool | - | + +### Examples + +```json +{ + "jsonrpc": 2.0, + "id": 0, + "method": "org.rdk.Dolby.audioModeChanged", + "params": { + "mode": "", + "enabled": true + } +} +``` diff --git a/docs/apis/FirmwareUpdatePlugin.md b/docs/apis/FirmwareUpdatePlugin.md index 97ed8767..3021d655 100644 --- a/docs/apis/FirmwareUpdatePlugin.md +++ b/docs/apis/FirmwareUpdatePlugin.md @@ -1,213 +1,209 @@ - -# Firmware Update Plugin + +# FirmwareUpdate Plugin -**Version: [1.0.0]()** +**Version: [1.0.0](https://github.com/rdkcentral/rdkservices/blob/main/FirmwareUpdate/CHANGELOG.md)** -A org.rdk.FirmwareUpdate plugin for Thunder framework. +A FirmwareUpdate 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](#head.Abbreviation,_Acronyms_and_Terms) +- [Description](#head.Description) +- [Configuration](#head.Configuration) +- [Methods](#head.Methods) +- [Notifications](#head.Notifications) - + # Abbreviation, Acronyms and Terms -[[Refer to this link](overview/aat.md)] +[[Refer to this link](userguide/aat.md)] - + # Description -The `FirmwareUpdate` plugin provides APIs to update (i.e., flash) the device with already downloaded and locally kept firmware image. +The `FirmwareUpdate` plugin provides an interface for FirmwareUpdate. -The plugin is designed to be loaded and executed within the Thunder framework. For more information about the framework refer to [[Thunder](#Thunder)]. +The plugin is designed to be loaded and executed within the Thunder framework. For more information about the framework refer to [[Thunder](#ref.Thunder)]. - + # Configuration The table below lists configuration options of the plugin. | Name | Type | Description | | :-------- | :-------- | :-------- | -| callsign | string | Plugin instance name (default: *org.rdk.FirmwareUpdate*) | -| classname | string | Class name: *org.rdk.FirmwareUpdate* | +| callsign | string | Plugin instance name (default: org.rdk.FirmwareUpdate) | +| classname | string | Class name: *FirmwareUpdate* | | locator | string | Library name: *libWPEFrameworkFirmwareUpdate.so* | | autostart | boolean | Determines if the plugin shall be started automatically along with the framework | - + # Methods -The following methods are provided by the org.rdk.FirmwareUpdate plugin: +The following methods are provided by the FirmwareUpdate plugin: -org.rdk.FirmwareUpdate interface methods: +FirmwareUpdate interface methods: | Method | Description | | :-------- | :-------- | -| [updateFirmware](#updateFirmware) | Update the device firmware with a previously downloaded image (using methods provided by components outside of this plugin) or with an image present in the attached USB mass storage device | -| [getUpdateState](#getUpdateState) | Firmware update consists of 2 major steps: 1 | +| [getUpdateState](#method.getUpdateState) | Firmware update consists of 2 major steps: 1. Firmware Validation, and 2. Firmware Flashing. This method returns the "status" of these steps in the firmware update process that was triggered by updateFirmware method. | +| [updateFirmware](#method.updateFirmware) | Initiates a firmware update. | + +## *getUpdateState [method](#head.Methods)* - -## *updateFirmware* - -Update the device firmware with a previously downloaded image (using methods provided by components outside of this plugin) or with an image present in the attached USB mass storage device. FirmwareUpdate is an asynchronous process. Status of the firmware update would be notified through onUpdateStateChange notification. +Firmware update consists of 2 major steps: 1. Firmware Validation, and 2. Firmware Flashing. This method returns the "status" of these steps in the firmware update process that was triggered by updateFirmware method. ### Events - -No Events - +No events are associated with this method. ### Parameters - +This method takes no parameters. +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| params | object | | -| params.firmwareFilepath | string | The complete path with firmware file to which the device needs to be updated | -| params.firmwareType | string | Type of firmware(must be one of the following: PCI,DRI) | +| result.getUpdateStateResult | GetUpdateStateResult | - | +| result.getUpdateStateResult.state | State | state | +| result.getUpdateStateResult.substate | SubState | substate | -### Result +### Examples -| Name | Type | Description | -| :-------- | :-------- | :-------- | -| result | null | Always null | - -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "org.rdk.FirmwareUpdate.updateFirmware", - "params": { - "firmwareFilepath": "/tmp/usbmnt/sda1/firmware/HSTP11MWR_4.11p5s1_VBN_sdy.bin", - "firmwareType": "PCI" - } + "jsonrpc": 2.0, + "id": 0, + "method": "org.rdk.FirmwareUpdate.getUpdateState" } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, - "result": null + "jsonrpc": 2.0, + "id": 0, + "result": { + "state": "VALIDATION_FAILED", + "substate": "NOT_APPLICABLE" + } } ``` - -## *getUpdateState* + +## *updateFirmware [method](#head.Methods)* -Firmware update consists of 2 major steps: 1. Firmware Validation, and 2. Firmware Flashing. This method returns the status of these steps in the firmware update process that was triggered by updateFirmware +Initiates a firmware update. ### Events - -No Events - +No events are associated with this method. ### Parameters - -This method takes no parameters. - -### Result - | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | object | | -| result.state | string | Status of the firmware update process.(must be one of the following: VALIDATION_FAILED/FLASHING_STARTED/FLASHING_FAILED/FLASHING_SUCCEEDED/FLASHING_SUCCEEDED | -| result.substate | string | Sub Status of the firmware update process(must be one of the following: FIRMWARE_NOT_FOUND/FIRMWARE_INVALID/FIRMWARE_OUTDATED/FIRMWARE_UPTODATE/FIRMWARE_INCOMPATIBLE/PREWRITE_SIGNATURE_CHECK_FAILED/FLASH_WRITE_FAILED/POSTWRITE_FIRMWARE_CHECK_FAILED/POSTWRITE_SIGNATURE_CHECK_FAILED) | +| params | object | | +| params.firmwareFilepath | string | The complete path of the firmware file to which the device needs to be updated to. | +| params.firmwareType | string | Type of firmware. One of the following (PCI,DRI) | +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result.result | Result | - | +| result.result.success | bool | success | + +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "org.rdk.FirmwareUpdate.getUpdateState" + "jsonrpc": 2.0, + "id": 1, + "method": "org.rdk.FirmwareUpdate.updateFirmware", + "params": { + "firmwareFilepath": "", + "firmwareType": "" + } } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 1, "result": { - "state": "FLASHING_SUCCEEDED", - "substate": "FIRMWARE_NOT_FOUND" + "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](#Thunder)] for information on how to register for a notification. +Notifications are autonomous events, triggered by the internals of the implementation, and broadcasted via JSON-RPC to all registered observers. Refer to [[Thunder](#ref.Thunder)] for information on how to register for a notification. -The following events are provided by the org.rdk.FirmwareUpdate plugin: +The following events are provided by the FirmwareUpdate plugin: -org.rdk.FirmwareUpdate interface events: +FirmwareUpdate interface events: | Event | Description | | :-------- | :-------- | -| [onUpdateStateChange](#onUpdateStateChange) | Raised either in response to updateFirmware method being invoked by the apps or when the device initiates the firmware download process on its own based on the scheduled firmware update in the server) | -| [onFlashingStateChange](#onFlashingStateChange) | This notification is raised between flashing started state and flashing succeeded (or flashing failed) state of firmware update, indicating the progress made on the flashing process | +| [onFlashingStateChange](#event.onFlashingStateChange) | This notification is raised between flashing started state and flashing succeeded/failed. | +| [onUpdateStateChange](#event.onUpdateStateChange) | notify Firmware update state change. | + +## *onFlashingStateChange [event](#head.Notifications)* - -## *onUpdateStateChange* - -Raised either in response to updateFirmware method being invoked by the apps or when the device initiates the firmware download process on its own based on the scheduled firmware update in the server). +This notification is raised between flashing started state and flashing succeeded/failed. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.state | string | Status of the firmware update process.(must be one of the following: VALIDATION_FAILED/FLASHING_STARTED/FLASHING_FAILED/FLASHING_SUCCEEDED/FLASHING_SUCCEEDED | -| params.substate | string | Sub Status of the firmware update process(must be one of the following: FIRMWARE_NOT_FOUND/FIRMWARE_INVALID/FIRMWARE_OUTDATED/FIRMWARE_UPTODATE/FIRMWARE_INCOMPATIBLE/PREWRITE_SIGNATURE_CHECK_FAILED/FLASH_WRITE_FAILED/POSTWRITE_FIRMWARE_CHECK_FAILED/POSTWRITE_SIGNATURE_CHECK_FAILED) | +| params.percentageComplete | uint32_t | Number between 0 and 100 indicating the "percentage complete" of the flashing process. | -### Example +### Examples ```json { - "jsonrpc": "2.0", - "method": "client.events.onUpdateStateChange", + "jsonrpc": 2.0, + "id": 2, + "method": "org.rdk.FirmwareUpdate.onFlashingStateChange", "params": { - "state": "FLASHING_SUCCEEDED", - "substate": "FIRMWARE_NOT_FOUND" + "percentageComplete": 0 } } ``` - -## *onFlashingStateChange* + +## *onUpdateStateChange [event](#head.Notifications)* -This notification is raised between flashing started state and flashing succeeded (or flashing failed) state of firmware update, indicating the progress made on the flashing process. +notify Firmware update state change. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.percentageComplete | number | Number between 0 and 100 indicating the percentage complete of the flashing process | +| params.state | State | state | +| params.substate | SubState | substate | -### Example +### Examples ```json { - "jsonrpc": "2.0", - "method": "client.events.onFlashingStateChange", + "jsonrpc": 2.0, + "id": 3, + "method": "org.rdk.FirmwareUpdate.onUpdateStateChange", "params": { - "percentageComplete": 100 + "state": "VALIDATION_FAILED", + "substate": "NOT_APPLICABLE" } } ``` - diff --git a/docs/apis/FirmwareVersionPlugin.md b/docs/apis/FirmwareVersionPlugin.md new file mode 100644 index 00000000..8277cdb1 --- /dev/null +++ b/docs/apis/FirmwareVersionPlugin.md @@ -0,0 +1,206 @@ + + +# FirmwareVersion Plugin + +**Version: [1.0.0](https://github.com/rdkcentral/rdkservices/blob/main/FirmwareVersion/CHANGELOG.md)** + +A FirmwareVersion plugin for Thunder framework. + +### Table of Contents + +- [Abbreviation, Acronyms and Terms](#head.Abbreviation,_Acronyms_and_Terms) +- [Description](#head.Description) +- [Configuration](#head.Configuration) +- [Methods](#head.Methods) + + +# Abbreviation, Acronyms and Terms + +[[Refer to this link](userguide/aat.md)] + + +# Description + +The `FirmwareVersion` plugin provides an interface for FirmwareVersion. + +The plugin is designed to be loaded and executed within the Thunder framework. For more information about the framework refer to [[Thunder](#ref.Thunder)]. + + +# Configuration + +The table below lists configuration options of the plugin. + +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| callsign | string | Plugin instance name (default: org.rdk.FirmwareVersion) | +| classname | string | Class name: *FirmwareVersion* | +| locator | string | Library name: *libWPEFrameworkFirmwareVersion.so* | +| autostart | boolean | Determines if the plugin shall be started automatically along with the framework | + + +# Methods + +The following methods are provided by the FirmwareVersion plugin: + +FirmwareVersion interface methods: + +| Method | Description | +| :-------- | :-------- | +| [imagename](#method.imagename) | | +| [mediarite](#method.mediarite) | | +| [sdk](#method.sdk) | | +| [yocto](#method.yocto) | | + + +## *imagename [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result.imagename | string | - | + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 0, + "method": "org.rdk.FirmwareVersion.imagename" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 0, + "result": "" +} +``` + + +## *mediarite [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result.mediarite | string | - | + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 1, + "method": "org.rdk.FirmwareVersion.mediarite" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 1, + "result": "" +} +``` + + +## *sdk [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result.sdk | string | - | + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 2, + "method": "org.rdk.FirmwareVersion.sdk" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 2, + "result": "" +} +``` + + +## *yocto [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result.yocto | string | - | + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 3, + "method": "org.rdk.FirmwareVersion.yocto" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 3, + "result": "" +} +``` + + diff --git a/docs/apis/FocusPlugin.md b/docs/apis/FocusPlugin.md new file mode 100644 index 00000000..7a77768e --- /dev/null +++ b/docs/apis/FocusPlugin.md @@ -0,0 +1,93 @@ + + +# Focus Plugin + +**Version: [1.0.0](https://github.com/rdkcentral/rdkservices/blob/main/Focus/CHANGELOG.md)** + +A Focus plugin for Thunder framework. + +### Table of Contents + +- [Abbreviation, Acronyms and Terms](#head.Abbreviation,_Acronyms_and_Terms) +- [Description](#head.Description) +- [Configuration](#head.Configuration) +- [Methods](#head.Methods) + + +# Abbreviation, Acronyms and Terms + +[[Refer to this link](userguide/aat.md)] + + +# Description + +The `Focus` plugin provides an interface for Focus. + +The plugin is designed to be loaded and executed within the Thunder framework. For more information about the framework refer to [[Thunder](#ref.Thunder)]. + + +# Configuration + +The table below lists configuration options of the plugin. + +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| callsign | string | Plugin instance name (default: org.rdk.Focus) | +| classname | string | Class name: *Focus* | +| locator | string | Library name: *libWPEFrameworkFocus.so* | +| autostart | boolean | Determines if the plugin shall be started automatically along with the framework | + + +# Methods + +The following methods are provided by the Focus plugin: + +Focus interface methods: + +| Method | Description | +| :-------- | :-------- | +| [focused](#method.focused) | focused state | + + +## *focused [method](#head.Methods)* + +focused state + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.focused | bool | - | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 0, + "method": "org.rdk.Focus.focused", + "params": { + "focused": true + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 0, + "result": null +} +``` + + diff --git a/docs/apis/FrameRatePlugin.md b/docs/apis/FrameRatePlugin.md index 68bc2c93..451f1f92 100644 --- a/docs/apis/FrameRatePlugin.md +++ b/docs/apis/FrameRatePlugin.md @@ -1,517 +1,486 @@ - - -# FrameRate Plugin - -**Version: [1.0.0]()** - -A org.rdk.FrameRate plugin for Thunder framework. - -### Table of Contents - -- [Abbreviation, Acronyms and Terms](#head.Abbreviation,_Acronyms_and_Terms) -- [Description](#head.Description) -- [Configuration](#head.Configuration) -- [Methods](#head.Methods) -- [Notifications](#head.Notifications) - - -# Abbreviation, Acronyms and Terms - -[[Refer to this link](overview/aat.md)] - - -# Description - -The `FrameRate` plugin allows you to collect FPS data. - -The plugin is designed to be loaded and executed within the Thunder framework. For more information about the framework refer to [[Thunder](#ref.Thunder)]. - - -# Configuration - -The table below lists configuration options of the plugin. - -| Name | Type | Description | -| :-------- | :-------- | :-------- | -| callsign | string | Plugin instance name (default: *org.rdk.FrameRate*) | -| classname | string | Class name: *org.rdk.FrameRate* | -| locator | string | Library name: *libWPEFrameworkFrameRate.so* | -| autostart | boolean | Determines if the plugin shall be started automatically along with the framework | - - -# Methods - -The following methods are provided by the org.rdk.FrameRate plugin: - -FrameRate interface methods: - -| Method | Description | -| :-------- | :-------- | -| [getDisplayFrameRate](#method.getDisplayFrameRate) | Returns the current display frame rate values | -| [getFrmMode](#method.getFrmMode) | Returns the current auto framerate mode | -| [setCollectionFrequency](#method.setCollectionFrequency) | Sets the FPS data collection interval | -| [setDisplayFrameRate](#method.setDisplayFrameRate) | Sets the display framerate values | -| [setFrmMode](#method.setFrmMode) | Sets the auto framerate mode | -| [startFpsCollection](#method.startFpsCollection) | Starts the FPS data collection | -| [stopFpsCollection](#method.stopFpsCollection) | Stops the FPS data collection | -| [updateFps](#method.updateFps) | Updates Fps values | - - - -## *getDisplayFrameRate [method](#head.Methods)* - -Returns the current display frame rate values. - -### Events - -No Events - -### Parameters - -This method takes no parameters. - -### Result - -| Name | Type | Description | -| :-------- | :-------- | :-------- | -| result | object | | -| result.framerate | string | The display framerate setting (width x height x framerate) | -| result.success | boolean | Indicates success | - -### Example - -#### Request - -```json -{ - "jsonrpc": "2.0", - "id": 42, - "method": "org.rdk.FrameRate.getDisplayFrameRate" -} -``` - -#### Response - -```json -{ - "jsonrpc": "2.0", - "id": 42, - "result": { - "framerate": "3840x2160px48", - "success": true - } -} -``` - - -## *getFrmMode [method](#head.Methods)* - -Returns the current auto framerate mode. - -### Events - -No Events - -### Parameters - -This method takes no parameters. - -### Result - -| Name | Type | Description | -| :-------- | :-------- | :-------- | -| result | object | | -| result.auto-frm-mode | integer | `0` for auto framerate mode disabled, `1` for auto framerate mode enabled (must be one of the following: *0*, *1*) | -| result.success | boolean | Indicates success | - -### Example - -#### Request - -```json -{ - "jsonrpc": "2.0", - "id": 42, - "method": "org.rdk.FrameRate.getFrmMode" -} -``` - -#### Response - -```json -{ - "jsonrpc": "2.0", - "id": 42, - "result": { - "auto-frm-mode": 0, - "success": true - } -} -``` - - -## *setCollectionFrequency [method](#head.Methods)* - -Sets the FPS data collection interval. - -### Events - -No Events - -### Parameters - -| Name | Type | Description | -| :-------- | :-------- | :-------- | -| params | object | | -| params.frequency | integer | The amount of time in milliseconds. The default frequency is 10000 milliseconds | - -### Result - -| Name | Type | Description | -| :-------- | :-------- | :-------- | -| result | boolean | Always true | - -### Example - -#### Request - -```json -{ - "jsonrpc": "2.0", - "id": 42, - "method": "org.rdk.FrameRate.setCollectionFrequency", - "params": { - "frequency": 1000 - } -} -``` - -#### Response - -```json -{ - "jsonrpc": "2.0", - "id": 42, - "result": true -} -``` - - -## *setDisplayFrameRate [method](#head.Methods)* - -Sets the display framerate values. - -### Events - -| Event | Description | -| :-------- | :-------- | -| [onDisplayFrameRateChanging](#event.onDisplayFrameRateChanging) | Triggered when the framerate changes started. | -| [onDisplayFrameRateChanged](#event.onDisplayFrameRateChanged) | Triggered when the framerate changed | -### Parameters - -| Name | Type | Description | -| :-------- | :-------- | :-------- | -| params | object | | -| params.framerate | string | The display framerate setting (width x height x framerate) | - -### Result - -| Name | Type | Description | -| :-------- | :-------- | :-------- | -| result | boolean | Always true | - -### Example - -#### Request - -```json -{ - "jsonrpc": "2.0", - "id": 42, - "method": "org.rdk.FrameRate.setDisplayFrameRate", - "params": { - "framerate": "3840x2160px48" - } -} -``` - -#### Response - -```json -{ - "jsonrpc": "2.0", - "id": 42, - "result": true -} -``` - - -## *setFrmMode [method](#head.Methods)* - -Sets the auto framerate mode. - -### Events - -No Events - -### Parameters - -| Name | Type | Description | -| :-------- | :-------- | :-------- | -| params | object | | -| params.frmmode | integer | `0` for auto framerate mode disabled, `1` for auto framerate mode enabled (must be one of the following: *0*, *1*) | - -### Result - -| Name | Type | Description | -| :-------- | :-------- | :-------- | -| result | boolean | Always true | - -### Example - -#### Request - -```json -{ - "jsonrpc": "2.0", - "id": 42, - "method": "org.rdk.FrameRate.setFrmMode", - "params": { - "frmmode": 0 - } -} -``` - -#### Response - -```json -{ - "jsonrpc": "2.0", - "id": 42, - "result": true -} -``` - - -## *startFpsCollection [method](#head.Methods)* - -Starts the FPS data collection. - -### Events - -| Event | Description | -| :-------- | :-------- | -| [onFpsEvent](#event.onFpsEvent) | Triggered at the end of each interval as defined by the setCollectionFrequency | -### Parameters - -This method takes no parameters. - -### Result - -| Name | Type | Description | -| :-------- | :-------- | :-------- | -| result | boolean | Always true | - -### Example - -#### Request - -```json -{ - "jsonrpc": "2.0", - "id": 42, - "method": "org.rdk.FrameRate.startFpsCollection" -} -``` - -#### Response - -```json -{ - "jsonrpc": "2.0", - "id": 42, - "result": true -} -``` - - -## *stopFpsCollection [method](#head.Methods)* - -Stops the FPS data collection. - -### Events - -| Event | Description | -| :-------- | :-------- | -| [onFpsEvent](#event.onFpsEvent) | Triggered once after the stopFpsCollection method is invoked. | -### Parameters - -This method takes no parameters. - -### Result - -| Name | Type | Description | -| :-------- | :-------- | :-------- | -| result | boolean | Always true | - -### Example - -#### Request - -```json -{ - "jsonrpc": "2.0", - "id": 42, - "method": "org.rdk.FrameRate.stopFpsCollection" -} -``` - -#### Response - -```json -{ - "jsonrpc": "2.0", - "id": 42, - "result": true -} -``` - - -## *updateFps [method](#head.Methods)* - -Updates Fps values. - -### Events - -No Events - -### Parameters - -| Name | Type | Description | -| :-------- | :-------- | :-------- | -| params | object | | -| params.newFpsValue | integer | New Frames per Second (Fps) value | - -### Result - -| Name | Type | Description | -| :-------- | :-------- | :-------- | -| result | boolean | Always true | - -### Example - -#### Request - -```json -{ - "jsonrpc": "2.0", - "id": 42, - "method": "org.rdk.FrameRate.updateFps", - "params": { - "newFpsValue": 60 - } -} -``` - -#### Response - -```json -{ - "jsonrpc": "2.0", - "id": 42, - "result": 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](#ref.Thunder)] for information on how to register for a notification. - -The following events are provided by the org.rdk.FrameRate plugin: - -FrameRate interface events: - -| Event | Description | -| :-------- | :-------- | -| [onDisplayFrameRateChanging](#event.onDisplayFrameRateChanging) | Triggered when the framerate changes started | -| [onDisplayFrameRateChanged](#event.onDisplayFrameRateChanged) | Triggered when the framerate changed | -| [onFpsEvent](#event.onFpsEvent) | Triggered at the end of each interval as defined by the `setCollectionFrequency` method and once after the `stopFpsCollection` method is invoked | - - - -## *onDisplayFrameRateChanging [event](#head.Notifications)* - -Triggered when the framerate changes started. - -### Parameters - -| Name | Type | Description | -| :-------- | :-------- | :-------- | -| params | object | | -| params.displayFrameRate | string | Video Display FrameRate changing | - -### Example - -```json -{ - "jsonrpc": "2.0", - "method": "client.events.onDisplayFrameRateChanging", - "params": { - "displayFrameRate": "1920x1080x60" - } -} -``` - - -## *onDisplayFrameRateChanged [event](#head.Notifications)* - -Triggered when the framerate changed. - -### Parameters - -| Name | Type | Description | -| :-------- | :-------- | :-------- | -| params | object | | -| params.displayFrameRate | string | Video Display FrameRate changed | - -### Example - -```json -{ - "jsonrpc": "2.0", - "method": "client.events.onDisplayFrameRateChanged", - "params": { - "displayFrameRate": "1920x1080x60" - } -} -``` - - -## *onFpsEvent [event](#head.Notifications)* - -Triggered at the end of each interval as defined by the `setCollectionFrequency` method and once after the `stopFpsCollection` method is invoked. - -### Parameters - -| Name | Type | Description | -| :-------- | :-------- | :-------- | -| params | object | | -| params.average | integer | The average FPS | -| params.min | integer | The minimum FPS | -| params.max | integer | The maximum FPS | - -### Example - -```json -{ - "jsonrpc": "2.0", - "method": "client.events.onFpsEvent", - "params": { - "average": 0, - "min": 0, - "max": 0 - } -} -``` - + + +# FrameRate Plugin + +**Version: [1.0.0](https://github.com/rdkcentral/rdkservices/blob/main/FrameRate/CHANGELOG.md)** + +A FrameRate plugin for Thunder framework. + +### Table of Contents + +- [Abbreviation, Acronyms and Terms](#head.Abbreviation,_Acronyms_and_Terms) +- [Description](#head.Description) +- [Configuration](#head.Configuration) +- [Methods](#head.Methods) +- [Notifications](#head.Notifications) + + +# Abbreviation, Acronyms and Terms + +[[Refer to this link](userguide/aat.md)] + + +# Description + +This plugin allows to collect FPS related data on TV profile stack. + +The plugin is designed to be loaded and executed within the Thunder framework. For more information about the framework refer to [[Thunder](#ref.Thunder)]. + + +# Configuration + +The table below lists configuration options of the plugin. + +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| callsign | string | Plugin instance name (default: org.rdk.FrameRate) | +| classname | string | Class name: *FrameRate* | +| locator | string | Library name: *libWPEFrameworkFrameRate.so* | +| autostart | boolean | Determines if the plugin shall be started automatically along with the framework | + + +# Methods + +The following methods are provided by the FrameRate plugin: + +FrameRate interface methods: + +| Method | Description | +| :-------- | :-------- | +| [getDisplayFrameRate](#method.getDisplayFrameRate) | Retrieves the current display frame rate as a string in the format "WIDTHxHEIGHTpxFPS" | +| [getFrmMode](#method.getFrmMode) | Retrieves the current auto framerate mode as an integer. Expeted values are 0 or 1. | +| [setCollectionFrequency](#method.setCollectionFrequency) | Sets the interval for FPS data collection in milliseconds. Default is 10000ms and min is 100ms | +| [setDisplayFrameRate](#method.setDisplayFrameRate) | Sets the display framerate to the specified value in the format "WIDTHxHEIGHTpxFPS". | +| [setFrmMode](#method.setFrmMode) | Sets the auto framerate mode to the specified value. Expected values are 0(disable) or 1(enable). | +| [startFpsCollection](#method.startFpsCollection) | Starts collecting FPS data at the configured interval set by the method `SetCollectionFrequency`. | +| [stopFpsCollection](#method.stopFpsCollection) | Stops the FPS data collection. | +| [updateFps](#method.updateFps) | Updates the current FPS value to the specified value represented as integer. | + + +## *getDisplayFrameRate [method](#head.Methods)* + +Retrieves the current display frame rate as a string in the format "WIDTHxHEIGHTpxFPS" + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result.framerate | string | The current display frame rate. | +| result.success | bool | Indicates if the operation was successful | + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 0, + "method": "org.rdk.FrameRate.getDisplayFrameRate" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 0, + "result": { + "framerate": "3840x2160px60", + "success": true + } +} +``` + + +## *getFrmMode [method](#head.Methods)* + +Retrieves the current auto framerate mode as an integer. Expeted values are 0 or 1. + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result.auto-frm-mode | int | The current auto framerate mode. e.g. 1 | +| result.success | bool | Indicates if the operation was successful | + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 1, + "method": "org.rdk.FrameRate.getFrmMode" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 1, + "result": { + "auto-frm-mode": 0, + "success": true + } +} +``` + + +## *setCollectionFrequency [method](#head.Methods)* + +Sets the interval for FPS data collection in milliseconds. Default is 10000ms and min is 100ms + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.frequency | int | The collection frequency in ms. | +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result.success | bool | Indicates if the operation was successful | + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 2, + "method": "org.rdk.FrameRate.setCollectionFrequency", + "params": { + "frequency": 1000 + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 2, + "result": true +} +``` + + +## *setDisplayFrameRate [method](#head.Methods)* + +Sets the display framerate to the specified value in the format "WIDTHxHEIGHTpxFPS". + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.framerate | string | The current display frame rate. | +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result.success | bool | Indicates if the operation was successful | + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 3, + "method": "org.rdk.FrameRate.setDisplayFrameRate", + "params": { + "framerate": "3840x2160px60" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 3, + "result": true +} +``` + + +## *setFrmMode [method](#head.Methods)* + +Sets the auto framerate mode to the specified value. Expected values are 0(disable) or 1(enable). + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.frmmode | int | The framerate mode to set. | +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result.success | bool | Indicates if the operation was successful | + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 4, + "method": "org.rdk.FrameRate.setFrmMode", + "params": { + "frmmode": 1 + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 4, + "result": true +} +``` + + +## *startFpsCollection [method](#head.Methods)* + +Starts collecting FPS data at the configured interval set by the method `SetCollectionFrequency`. + +### Events +- [onFpsEvent](#event.onFpsEvent) +### Parameters +This method takes no parameters. +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result.success | bool | Indicates if the operation was successful | + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 5, + "method": "org.rdk.FrameRate.startFpsCollection" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 5, + "result": true +} +``` + + +## *stopFpsCollection [method](#head.Methods)* + +Stops the FPS data collection. + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result.success | bool | Indicates if the operation was successful | + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 6, + "method": "org.rdk.FrameRate.stopFpsCollection" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 6, + "result": true +} +``` + + +## *updateFps [method](#head.Methods)* + +Updates the current FPS value to the specified value represented as integer. + +### Events +- [onFpsEvent](#event.onFpsEvent) +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.newFpsValue | int | The new FPS value. | +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result.success | bool | Indicates if the operation was successful | + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 7, + "method": "org.rdk.FrameRate.updateFps", + "params": { + "newFpsValue": 60 + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 7, + "result": 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](#ref.Thunder)] for information on how to register for a notification. + +The following events are provided by the FrameRate plugin: + +FrameRate interface events: + +| Event | Description | +| :-------- | :-------- | +| [onDisplayFrameRateChanged](#event.onDisplayFrameRateChanged) | This event is triggered after the display frame rate has changed and represented as "WIDTHxHEIGHTxFPS". | +| [onDisplayFrameRateChanging](#event.onDisplayFrameRateChanging) | This event is triggered when the display frame rate is about to change and represented as "WIDTHxHEIGHTxFPS". | +| [onFpsEvent](#event.onFpsEvent) | Triggered at the end of each interval as defined by the `setCollectionFrequency` method after `startFpsCollection` method and once after the `stopFpsCollection` method is invoked | + + +## *onDisplayFrameRateChanged [event](#head.Notifications)* + +This event is triggered after the display frame rate has changed and represented as "WIDTHxHEIGHTxFPS". + +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.displayFrameRate | string | The new display frame rate | + +### Examples + +```json +{ + "jsonrpc": 2.0, + "id": 8, + "method": "org.rdk.FrameRate.onDisplayFrameRateChanged", + "params": { + "displayFrameRate": "1920x1080x60" + } +} +``` + + +## *onDisplayFrameRateChanging [event](#head.Notifications)* + +This event is triggered when the display frame rate is about to change and represented as "WIDTHxHEIGHTxFPS". + +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.displayFrameRate | string | The new display frame rate | + +### Examples + +```json +{ + "jsonrpc": 2.0, + "id": 9, + "method": "org.rdk.FrameRate.onDisplayFrameRateChanging", + "params": { + "displayFrameRate": "1920x1080x60" + } +} +``` + + +## *onFpsEvent [event](#head.Notifications)* + +Triggered at the end of each interval as defined by the `setCollectionFrequency` method after `startFpsCollection` method and once after the `stopFpsCollection` method is invoked + +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.average | int | The average FPS | +| params.min | int | The minimum FPS | +| params.max | int | The maximum FPS | + +### Examples + +```json +{ + "jsonrpc": 2.0, + "id": 10, + "method": "org.rdk.FrameRate.onFpsEvent", + "params": { + "average": 60, + "min": 30, + "max": 120 + } +} +``` diff --git a/docs/apis/HdcpProfilePlugin.md b/docs/apis/HdcpProfilePlugin.md index 0ccf99b9..88fcd225 100644 --- a/docs/apis/HdcpProfilePlugin.md +++ b/docs/apis/HdcpProfilePlugin.md @@ -1,222 +1,206 @@ - + # HdcpProfile Plugin -**Version: [1.0.0]()** +**Version: [1.0.0](https://github.com/rdkcentral/rdkservices/blob/main/HdcpProfile/CHANGELOG.md)** -A org.rdk.HdcpProfile plugin for Thunder framework. +A HdcpProfile 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](#head.Abbreviation,_Acronyms_and_Terms) +- [Description](#head.Description) +- [Configuration](#head.Configuration) +- [Methods](#head.Methods) +- [Notifications](#head.Notifications) - + # Abbreviation, Acronyms and Terms -[[Refer to this link](overview/aat.md)] +[[Refer to this link](userguide/aat.md)] - + # Description -The HdcpProfile plugin provides an interface for HDCP-related data and events. +The `HdcpProfile` plugin provides an interface for HdcpProfile. -The plugin is designed to be loaded and executed within the Thunder framework. For more information about the framework refer to [[Thunder](#Thunder)]. +The plugin is designed to be loaded and executed within the Thunder framework. For more information about the framework refer to [[Thunder](#ref.Thunder)]. - + # Configuration The table below lists configuration options of the plugin. | Name | Type | Description | | :-------- | :-------- | :-------- | -| callsign | string | Plugin instance name (default: *org.rdk.HdcpProfile*) | -| classname | string | Class name: *org.rdk.HdcpProfile* | +| callsign | string | Plugin instance name (default: org.rdk.HdcpProfile) | +| classname | string | Class name: *HdcpProfile* | | locator | string | Library name: *libWPEFrameworkHdcpProfile.so* | | autostart | boolean | Determines if the plugin shall be started automatically along with the framework | - + # Methods -The following methods are provided by the org.rdk.HdcpProfile plugin: +The following methods are provided by the HdcpProfile plugin: HdcpProfile interface methods: | Method | Description | | :-------- | :-------- | -| [getHDCPStatus](#getHDCPStatus) | Returns HDCP-related data | -| [getSettopHDCPSupport](#getSettopHDCPSupport) | Returns which version of HDCP is supported by the STB | +| [getHDCPStatus](#method.getHDCPStatus) | Returns HDCP-related data. | +| [getSettopHDCPSupport](#method.getSettopHDCPSupport) | Returns which version of HDCP is supported by the STB. | + +## *getHDCPStatus [method](#head.Methods)* - -## *getHDCPStatus* - -Returns HDCP-related data. -**hdcpReason Argument Values** -* `0`: HDMI cable is not connected or rx sense status is `off` -* `1`: Rx device is connected with power ON state, and HDCP authentication is not initiated -* `2`: HDCP success -* `3`: HDCP authentication failed after multiple retries -* `4`: HDCP authentication in progress -* `5`: HDMI video port is disabled. +Returns HDCP-related data. ### Events - -No Events - +No events are associated with this method. ### Parameters - This method takes no parameters. - -### Result - +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | object | | -| result.HDCPStatus | object | Contains HDCP-related data as separate properties | -| result.HDCPStatus.isConnected | boolean | Indicates whether a display is connected | -| result.HDCPStatus.isHDCPCompliant | boolean | Indicates whether the display is HDCP compliant | -| result.HDCPStatus.isHDCPEnabled | boolean | Indicates whether content is protected | -| result.HDCPStatus.hdcpReason | integer | The HDCP status reason | -| result.HDCPStatus.supportedHDCPVersion | string | Supported HDCP protocol version by the host device | -| result.HDCPStatus.receiverHDCPVersion | string | Supported HDCP protocol version by the receiver device (display) | -| result.HDCPStatus.currentHDCPVersion | string | Currently used HDCP protocol version | -| result.success | boolean | Whether the request succeeded | - -### Example +| result.HDCPStatus | HDCPStatus | - | +| result.HDCPStatus.isConnected | bool | isConnected */ /* @brief Indicates whether a display is connected | +| result.HDCPStatus.isHDCPCompliant | bool | isHDCPCompliant */ /* @brief Indicates whether the display is HDCP compliant | +| result.HDCPStatus.isHDCPEnabled | bool | isHDCPEnabled *//* @brief Indicates whether content is protected | +| result.HDCPStatus.hdcpReason | uint32_t | hdcpReason *//* @brief The HDCP status reason | +| result.HDCPStatus.supportedHDCPVersion | string | supportedHDCPVersion */ /* @brief Supported HDCP protocol version by the host device | +| result.HDCPStatus.receiverHDCPVersion | string | receiverHDCPVersion */ /* @brief Supported HDCP protocol version by the receiver device (display) | +| result.HDCPStatus.currentHDCPVersion | string | currentHDCPVersion */ /* @brief Currently used HDCP protocol version | +| result.success | bool | Indicates whether the operation was successful | + +### Examples + #### Request ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 0, "method": "org.rdk.HdcpProfile.getHDCPStatus" } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 0, "result": { "HDCPStatus": { - "isConnected": false, - "isHDCPCompliant": false, - "isHDCPEnabled": false, - "hdcpReason": 1, - "supportedHDCPVersion": "2.2", - "receiverHDCPVersion": "1.4", - "currentHDCPVersion": "1.4" + "isConnected": true, + "isHDCPCompliant": true, + "isHDCPEnabled": true, + "hdcpReason": 0, + "supportedHDCPVersion": "", + "receiverHDCPVersion": "", + "currentHDCPVersion": "" }, "success": true } } ``` - -## *getSettopHDCPSupport* + +## *getSettopHDCPSupport [method](#head.Methods)* Returns which version of HDCP is supported by the STB. ### Events - -No Events - +No events are associated with this method. ### Parameters - This method takes no parameters. - -### Result - +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | object | | -| result.supportedHDCPVersion | string | Supported HDCP protocol version by the host device | -| result.isHDCPSupported | boolean | Indicates whether HDCP is supported by the STB | -| result.success | boolean | Whether the request succeeded | +| result.supportedHDCPVersion | string | supportedHDCPVersion */ /* @brief Supported HDCP protocol version by the host device | +| result.isHDCPSupported | bool | Indicates whether HDCP is supported by the STB | +| result.success | bool | Indicates whether the operation was successful | + +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 1, "method": "org.rdk.HdcpProfile.getSettopHDCPSupport" } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 1, "result": { - "supportedHDCPVersion": "2.2", + "supportedHDCPVersion": "", "isHDCPSupported": true, "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](#Thunder)] for information on how to register for a notification. +Notifications are autonomous events, triggered by the internals of the implementation, and broadcasted via JSON-RPC to all registered observers. Refer to [[Thunder](#ref.Thunder)] for information on how to register for a notification. -The following events are provided by the org.rdk.HdcpProfile plugin: +The following events are provided by the HdcpProfile plugin: HdcpProfile interface events: | Event | Description | | :-------- | :-------- | -| [onDisplayConnectionChanged](#onDisplayConnectionChanged) | Triggered if HDMI was connected or disconnected upon receiving `onHdmiOutputHotPlug` event | - +| [onDisplayConnectionChanged](#event.onDisplayConnectionChanged) | Triggered if HDMI was connected or disconnected upon receiving onHdmiOutputHotPlug | - -## *onDisplayConnectionChanged* + +## *onDisplayConnectionChanged [event](#head.Notifications)* -Triggered if HDMI was connected or disconnected upon receiving `onHdmiOutputHotPlug` +Triggered if HDMI was connected or disconnected upon receiving onHdmiOutputHotPlug ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.HDCPStatus | object | Contains HDCP-related data as separate properties | -| params.HDCPStatus.isConnected | boolean | Indicates whether a display is connected | -| params.HDCPStatus.isHDCPCompliant | boolean | Indicates whether the display is HDCP compliant | -| params.HDCPStatus.isHDCPEnabled | boolean | Indicates whether content is protected | -| params.HDCPStatus.hdcpReason | integer | The HDCP status reason | -| params.HDCPStatus.supportedHDCPVersion | string | Supported HDCP protocol version by the host device | -| params.HDCPStatus.receiverHDCPVersion | string | Supported HDCP protocol version by the receiver device (display) | -| params.HDCPStatus.currentHDCPVersion | string | Currently used HDCP protocol version | +| params.HDCPStatus | HDCPStatus | - | +| params.HDCPStatus.isConnected | bool | isConnected */ /* @brief Indicates whether a display is connected | +| params.HDCPStatus.isHDCPCompliant | bool | isHDCPCompliant */ /* @brief Indicates whether the display is HDCP compliant | +| params.HDCPStatus.isHDCPEnabled | bool | isHDCPEnabled *//* @brief Indicates whether content is protected | +| params.HDCPStatus.hdcpReason | uint32_t | hdcpReason *//* @brief The HDCP status reason | +| params.HDCPStatus.supportedHDCPVersion | string | supportedHDCPVersion */ /* @brief Supported HDCP protocol version by the host device | +| params.HDCPStatus.receiverHDCPVersion | string | receiverHDCPVersion */ /* @brief Supported HDCP protocol version by the receiver device (display) | +| params.HDCPStatus.currentHDCPVersion | string | currentHDCPVersion */ /* @brief Currently used HDCP protocol version | -### Example +### Examples ```json { - "jsonrpc": "2.0", - "method": "client.events.onDisplayConnectionChanged", + "jsonrpc": 2.0, + "id": 2, + "method": "org.rdk.HdcpProfile.onDisplayConnectionChanged", "params": { - "HDCPStatus": { - "isConnected": false, - "isHDCPCompliant": false, - "isHDCPEnabled": false, - "hdcpReason": 1, - "supportedHDCPVersion": "2.2", - "receiverHDCPVersion": "1.4", - "currentHDCPVersion": "1.4" + "hdcpStatus": { + "isConnected": true, + "isHDCPCompliant": true, + "isHDCPEnabled": true, + "hdcpReason": 0, + "supportedHDCPVersion": "", + "receiverHDCPVersion": "", + "currentHDCPVersion": "" } } } ``` - diff --git a/docs/apis/HdmiCecSinkPlugin.md b/docs/apis/HdmiCecSinkPlugin.md index 8cf0dd08..f0d6ad47 100644 --- a/docs/apis/HdmiCecSinkPlugin.md +++ b/docs/apis/HdmiCecSinkPlugin.md @@ -1,246 +1,232 @@ - -# HdmiCecSinkPlugin + +# HdmiCecSink Plugin -**Version: [1.0.0]()** +**Version: [1.0.0](https://github.com/rdkcentral/rdkservices/blob/main/HdmiCecSink/CHANGELOG.md)** -A org.rdk.HdmiCecSink plugin for Thunder framework. +A HdmiCecSink 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](#head.Abbreviation,_Acronyms_and_Terms) +- [Description](#head.Description) +- [Configuration](#head.Configuration) +- [Methods](#head.Methods) +- [Notifications](#head.Notifications) - + # Abbreviation, Acronyms and Terms -[[Refer to this link](overview/aat.md)] +[[Refer to this link](userguide/aat.md)] - + # Description -The `HdmiCecSink` plugin allows you to manage HDMI Consumer Electronics Control (CEC) sink for connected devices. +The `HdmiCecSink` plugin provides an interface for HdmiCecSink. -The plugin is designed to be loaded and executed within the Thunder framework. For more information about the framework refer to [[Thunder](#Thunder)]. +The plugin is designed to be loaded and executed within the Thunder framework. For more information about the framework refer to [[Thunder](#ref.Thunder)]. - + # Configuration The table below lists configuration options of the plugin. | Name | Type | Description | | :-------- | :-------- | :-------- | -| callsign | string | Plugin instance name (default: *org.rdk.HdmiCecSink*) | -| classname | string | Class name: *org.rdk.HdmiCecSink* | +| callsign | string | Plugin instance name (default: org.rdk.HdmiCecSink) | +| classname | string | Class name: *HdmiCecSink* | | locator | string | Library name: *libWPEFrameworkHdmiCecSink.so* | | autostart | boolean | Determines if the plugin shall be started automatically along with the framework | - + # Methods -The following methods are provided by the org.rdk.HdmiCecSink plugin: +The following methods are provided by the HdmiCecSink plugin: HdmiCecSink interface methods: | Method | Description | | :-------- | :-------- | -| [getActiveRoute](#getActiveRoute) | Gets details for the current route from the source to sink devices | -| [getActiveSource](#getActiveSource) | Gets details for the current active source | -| [getAudioDeviceConnectedStatus](#getAudioDeviceConnectedStatus) | Get status of audio device connection | -| [getDeviceList](#getDeviceList) | Gets the number of connected source devices and system information for each device | -| [getEnabled](#getEnabled) | Returns whether HDMI-CEC is enabled on platform or not | -| [getOSDName](#getOSDName) | Returns the OSD name used by host device | -| [getVendorId](#getVendorId) | Gets the current vendor ID used by host device | -| [printDeviceList](#printDeviceList) | This is a helper debug command for developers | -| [requestActiveSource](#requestActiveSource) | Requests the active source in the network | -| [requestShortAudioDescriptor](#requestShortAudioDescriptor) | Sends the CEC Request Short Audio Descriptor (SAD) message as an event | -| [sendAudioDevicePowerOnMessage](#sendAudioDevicePowerOnMessage) | This message is used to power on the connected audio device | -| [sendGetAudioStatusMessage](#sendGetAudioStatusMessage) | Sends the CEC \ message to request the audio status | -| [sendKeyPressEvent](#sendKeyPressEvent) | Sends the CEC \ message when TV remote key is pressed | -| [sendUserControlPressed](#sendUserControlPressed) | Sends the CEC \ message when TV remote key is pressed | -| [sendUserControlReleased](#sendUserControlReleased) | Sends the CEC \ message when TV remote key is released | -| [sendStandbyMessage](#sendStandbyMessage) | Sends a CEC \ message to the logical address of the device | -| [setActivePath](#setActivePath) | Sets the source device to active (`setStreamPath`) | -| [setActiveSource](#setActiveSource) | Sets the current active source as TV (physical address 0 | -| [setEnabled](#setEnabled) | Enables or disables HDMI-CEC support in the platform | -| [setMenuLanguage](#setMenuLanguage) | Updates the internal data structure with the new menu Language and also broadcasts the \ CEC message | -| [setOSDName](#setOSDName) | Sets the OSD Name used by host device | -| [setRoutingChange](#setRoutingChange) | Changes routing while switching between HDMI inputs and TV | -| [setupARCRouting](#setupARCRouting) | Enable (or disable) HDMI-CEC Audio Return Channel (ARC) routing | -| [setVendorId](#setVendorId) | Sets a vendor ID used by host device | -| [setLatencyInfo](#setLatencyInfo) | Sets the Current Latency Values such as Video Latency, Latency Flags,Audio Output Compensated value and Audio Output Delay by sending \ message for Dynamic Auto LipSync Feature | - - - -## *getActiveRoute* - -Gets details for the current route from the source to sink devices. This API is used for debugging the route. +| [getActiveRoute](#method.getActiveRoute) | Gets the Active Route(s) of the HDMI CEC Sink | +| [getActiveSource](#method.getActiveSource) | Gets the status of the current active source | +| [getAudioDeviceConnectedStatus](#method.getAudioDeviceConnectedStatus) | Gets audio device connected status | +| [getDeviceList](#method.getDeviceList) | Gets the list of devices connected to the HDMI CEC sink | +| [getEnabled](#method.getEnabled) | Gets the status of the HDMI CEC Sink | +| [getOSDName](#method.getOSDName) | Gets the OSD name of the HDMI CEC Sink | +| [getVendorId](#method.getVendorId) | Gets the vendor ID of the HDMI CEC Sink | +| [printDeviceList](#method.printDeviceList) | This is a helper debug command for developers. It prints the list of connected devices and properties of connected devices | +| [requestActiveSource](#method.requestActiveSource) | Request the active source in the network | +| [requestShortAudioDescriptor](#method.requestShortAudioDescriptor) | Sends the CEC Request Short Audio Descriptor (SAD) message as an | +| [sendAudioDevicePowerOnMessage](#method.sendAudioDevicePowerOnMessage) | This message is used to power on the connected audio device. Usually sent by the TV when it comes out of standby and detects audio device connected in the network. | +| [sendGetAudioStatusMessage](#method.sendGetAudioStatusMessage) | Sends the CEC message to request the audio status. | +| [sendKeyPressEvent](#method.sendKeyPressEvent) | Sends the CEC message when TV remote key is pressed. | +| [sendStandbyMessage](#method.sendStandbyMessage) | Sends the CEC message to another CEC device | +| [sendUserControlPressed](#method.sendUserControlPressed) | Sends the CEC message when TV remote key is pressed. | +| [sendUserControlReleased](#method.sendUserControlReleased) | Sends the CEC message when TV remote key is released. | +| [setActivePath](#method.setActivePath) | Sets the source device to active (setStreamPath). The source wakes from standby if it’s in the standby state. | +| [setActiveSource](#method.setActiveSource) | Sets the current active source as TV (physical address 0.0.0.0). This call needs to be made when the TV switches to internal tuner or any apps. | +| [setEnabled](#method.setEnabled) | Sets the status of the HDMI CEC Sink | +| [setLatencyInfo](#method.setLatencyInfo) | Sets the Current Latency Values such as Video Latency, Latency Flags,Audio Output Compensated value and Audio Output Delay by sending message for Dynamic Auto LipSync Feature. | +| [setMenuLanguage](#method.setMenuLanguage) | Updates the internal data structure with the new menu Language and also broadcasts the CEC message. | +| [setOSDName](#method.setOSDName) | Sets the OSD name of the HDMI CEC Sink | +| [setRoutingChange](#method.setRoutingChange) | Changes routing while switching between HDMI inputs and TV. | +| [setVendorId](#method.setVendorId) | Sets the vendor ID of the HDMI CEC Sink | +| [setupARCRouting](#method.setupARCRouting) | Enable (or disable) HDMI-CEC Audio Return Channel (ARC) routing. Upon enabling, triggers arcInitiationEvent and upon disabling, triggers arcTerminationEvent. | + + +## *getActiveRoute [method](#head.Methods)* + +Gets the Active Route(s) of the HDMI CEC Sink ### Events - -No Events - +No events are associated with this method. ### Parameters - This method takes no parameters. - -### Result - +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | object | | -| result.available | boolean | If `true`, then there is an active source available and source details are included in the result. If `false`, then there is no active source | -| result.length | integer | The number of devices in the path list | -| result.pathList | array | Object [] of information about each device in the active path | -| result.pathList[#] | object | | -| result.pathList[#].logicalAddress | integer | Logical address of the device | -| result.pathList[#].physicalAddress | string | Physical address of the device | -| result.pathList[#].deviceType | string | Type of the device | -| result.pathList[#].osdName | string | OSD name of the device if available | -| result.pathList[#].vendorID | string | Vendor ID of the device | -| result.ActiveRoute | string | Gives the route from source to sink with the device type and OSD name as an identifier | -| result.success | boolean | Whether the request succeeded | - -### Example +| result.available | bool | Is the active route available or not | +| result.length | uint8_t | Length of the active route | +| result.pathList | IHdmiCecSinkActivePathIterator | List of active path | +| result.pathList[#].logicalAddress | uint8_t | logical address | +| result.pathList[#].physicalAddress | string | physical address | +| result.pathList[#].deviceType | string | device type | +| result.pathList[#].vendorID | string | vendor id | +| result.pathList[#].osdName | string | osd name | +| result.ActiveRoute | string | Active route of the device | +| result.success | bool | Is the operation successful or not | + +### Examples + #### Request ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 0, "method": "org.rdk.HdmiCecSink.getActiveRoute" } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 0, "result": { "available": true, - "length": 1, + "length": "", "pathList": [ { - "logicalAddress": 4, - "physicalAddress": "1.0.0.0", - "deviceType": "Playback Device", - "osdName": "Fire TV Stick", - "vendorID": "0ce7" + "logicalAddress": "", + "physicalAddress": "", + "deviceType": "", + "vendorID": "", + "osdName": "" } ], - "ActiveRoute": "Playback Device 1(Fire TV Stick)-->HDMI0", + "ActiveRoute": "", "success": true } } ``` - -## *getActiveSource* + +## *getActiveSource [method](#head.Methods)* -Gets details for the current active source. +Gets the status of the current active source ### Events - -No Events - +No events are associated with this method. ### Parameters - This method takes no parameters. - -### Result - +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | object | | -| result.available | boolean | If `true`, then there is an active source available and source details are included in the result. If `false`, then there is no active source | -| result.logicalAddress | integer | Logical address of the device | -| result.physicalAddress | string | Physical address of the device | -| result.deviceType | string | Type of the device | -| result.cecVersion | string | CEC version supported | -| result.osdName | string | OSD name of the device if available | -| result.vendorID | string | Vendor ID of the device | -| result.powerStatus | string | Power status of the device | -| result.port | string | Port of the device | -| result.success | boolean | Whether the request succeeded | - -### Example +| result.available | bool | Is the active route available or not | +| result.logicalAddress | uint8_t | logical address | +| result.physicalAddress | string | physical address | +| result.deviceType | string | device type | +| result.cecVersion | string | cec version | +| result.osdName | string | osd name | +| result.vendorID | string | vendor id | +| result.powerStatus | string | power status | +| result.port | string | - | +| result.success | bool | Is the operation successful or not | + +### Examples + #### Request ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 1, "method": "org.rdk.HdmiCecSink.getActiveSource" } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 1, "result": { "available": true, - "logicalAddress": 4, - "physicalAddress": "1.0.0.0", - "deviceType": "Playback Device", - "cecVersion": "Version 1.4", - "osdName": "Fire TV Stick", - "vendorID": "0ce7", - "powerStatus": "Standby", - "port": "HDMI0", + "logicalAddress": "", + "physicalAddress": "", + "deviceType": "", + "cecVersion": "", + "osdName": "", + "vendorID": "", + "powerStatus": "", + "port": "", "success": true } } ``` - -## *getAudioDeviceConnectedStatus* + +## *getAudioDeviceConnectedStatus [method](#head.Methods)* -Get status of audio device connection. +Gets audio device connected status ### Events - -No Events - +No events are associated with this method. ### Parameters - This method takes no parameters. - -### Result - +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | object | | -| result.connected | boolean | `true` if an audio device is connected, otherwise `false` | -| result.success | boolean | Whether the request succeeded | +| result.connected | bool | Is the audio device connected or not | +| result.success | bool | Is the operation successful or not | + +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 2, "method": "org.rdk.HdmiCecSink.getAudioDeviceConnectedStatus" } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 2, "result": { "connected": true, "success": true @@ -248,67 +234,62 @@ This method takes no parameters. } ``` - -## *getDeviceList* + +## *getDeviceList [method](#head.Methods)* -Gets the number of connected source devices and system information for each device. The information includes device type, physical address, CEC version, vendor ID, power status and OSD name. +Gets the list of devices connected to the HDMI CEC sink ### Events - -No Events - +No events are associated with this method. ### Parameters - This method takes no parameters. - -### Result - +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | object | | -| result.numberofdevices | integer | number of devices in the `devicelist` array | -| result.deviceList | array | Object [] of information about each device | -| result.deviceList[#] | object | | -| result.deviceList[#].logicalAddress | integer | Logical address of the device | -| result.deviceList[#].physicalAddress | string | Physical address of the device | -| result.deviceList[#].deviceType | string | Type of the device | -| result.deviceList[#].cecVersion | string | CEC version supported | -| result.deviceList[#].osdName | string | OSD name of the device if available | -| result.deviceList[#].vendorID | string | Vendor ID of the device | -| result.deviceList[#].powerStatus | string | Power status of the device | -| result.deviceList[#].portNumber | integer | | -| result.success | boolean | Whether the request succeeded | - -### Example +| result.numberofdevices | uint32_t | Number of devices connected to the HDMI CEC sink | +| result.deviceList | IHdmiCecSinkDeviceListIterator | List of devices connected to the HDMI CEC sink | +| result.deviceList[#].logicalAddress | uint8_t | logical address | +| result.deviceList[#].physicalAddress | string | physical address | +| result.deviceList[#].deviceType | string | device type | +| result.deviceList[#].cecVersion | string | cec version | +| result.deviceList[#].osdName | string | osd name | +| result.deviceList[#].vendorID | string | vendor id | +| result.deviceList[#].powerStatus | string | power status | +| result.deviceList[#].portNumber | string | port number | +| result.success | bool | Is the operation successful or not | + +### Examples + #### Request ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 3, "method": "org.rdk.HdmiCecSink.getDeviceList" } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 3, "result": { - "numberofdevices": 1, + "numberofdevices": 0, "deviceList": [ { - "logicalAddress": 4, - "physicalAddress": "1.0.0.0", - "deviceType": "Playback Device", - "cecVersion": "Version 1.4", - "osdName": "Fire TV Stick", - "vendorID": "0ce7", - "powerStatus": "Standby", - "portNumber": 0 + "logicalAddress": "", + "physicalAddress": "", + "deviceType": "", + "cecVersion": "", + "osdName": "", + "vendorID": "", + "powerStatus": "", + "portNumber": "" } ], "success": true @@ -316,183 +297,167 @@ This method takes no parameters. } ``` - -## *getEnabled* + +## *getEnabled [method](#head.Methods)* -Returns whether HDMI-CEC is enabled on platform or not. +Gets the status of the HDMI CEC Sink ### Events - -No Events - +No events are associated with this method. ### Parameters - This method takes no parameters. - -### Result - +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | object | | -| result.enabled | boolean | Indicates whether HDMI-CEC is enabled (`true`) or disabled (`false`) in the platform | -| result.success | boolean | Whether the request succeeded | +| result.enabled | bool | Is the HDMI CEC Sink enabled or not | +| result.success | bool | Is the operation successful or not | + +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 4, "method": "org.rdk.HdmiCecSink.getEnabled" } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 4, "result": { - "enabled": false, + "enabled": true, "success": true } } ``` - -## *getOSDName* + +## *getOSDName [method](#head.Methods)* -Returns the OSD name used by host device. +Gets the OSD name of the HDMI CEC Sink ### Events - -No Events - +No events are associated with this method. ### Parameters - This method takes no parameters. - -### Result - +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | object | | -| result.name | string | The OSD Name | -| result.success | boolean | Whether the request succeeded | +| result.name | string | OSD name of the HDMI CEC Sink | +| result.success | bool | Is the operation successful or not | + +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 5, "method": "org.rdk.HdmiCecSink.getOSDName" } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 5, "result": { - "name": "Fire TV Stick", + "name": "", "success": true } } ``` - -## *getVendorId* + +## *getVendorId [method](#head.Methods)* -Gets the current vendor ID used by host device. +Gets the vendor ID of the HDMI CEC Sink ### Events - -No Events - +No events are associated with this method. ### Parameters - This method takes no parameters. - -### Result - +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | object | | -| result.vendorid | string | Vendor ID for this device. The ID can have a maximum of 6 characters | -| result.success | boolean | Whether the request succeeded | +| result.vendorid | string | Vendor ID of the HDMI CEC Sink | +| result.success | bool | Is the operation successful or not | + +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 6, "method": "org.rdk.HdmiCecSink.getVendorId" } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 6, "result": { - "vendorid": "0019fc", + "vendorid": "", "success": true } } ``` - -## *printDeviceList* + +## *printDeviceList [method](#head.Methods)* -This is a helper debug command for developers. It prints the list of connected devices and properties of connected devices like deviceType, VendorID, CEC version, PowerStatus, OSDName, PhysicalAddress etc. +This is a helper debug command for developers. It prints the list of connected devices and properties of connected devices ### Events - -No Events - +No events are associated with this method. ### Parameters - This method takes no parameters. - -### Result - +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | object | | -| result.printed | boolean | Whether device list is printed | -| result.success | boolean | Whether the request succeeded | +| result.printed | bool | Is the device list printed or not | +| result.success | bool | Is the operation successful or not | + +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 7, "method": "org.rdk.HdmiCecSink.printDeviceList" } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 7, "result": { "printed": true, "success": true @@ -500,1295 +465,1253 @@ This method takes no parameters. } ``` - -## *requestActiveSource* + +## *requestActiveSource [method](#head.Methods)* -Requests the active source in the network. +Request the active source in the network ### Events - -| Event | Description | -| :-------- | :-------- | -| [onActiveSourceChange](#onActiveSourceChange) | Triggered with the active source device changes. | -| [onDeviceAdded](#onDeviceAdded) | Triggered when an HDMI cable is physically connected to the HDMI port on a TV, or the power cable is connected to the source device. | -| [onDeviceInfoUpdated](#onDeviceInfoUpdated) | Triggered when device information changes (physicalAddress, deviceType, vendorID, osdName, cecVersion, powerStatus). | +No events are associated with this method. ### Parameters - This method takes no parameters. - -### Result - +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | object | | -| result.success | boolean | Whether the request succeeded | +| result.success | HdmiCecSinkSuccess | Is the operation successful or not | +| result.success.success | bool | - | + +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 8, "method": "org.rdk.HdmiCecSink.requestActiveSource" } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 8, "result": { "success": true } } ``` - -## *requestShortAudioDescriptor* + +## *requestShortAudioDescriptor [method](#head.Methods)* -Sends the CEC Request Short Audio Descriptor (SAD) message as an +Sends the CEC Request Short Audio Descriptor (SAD) message as an ### Events - -| Event | Description | -| :-------- | :-------- | -| [shortAudiodesciptorEvent](#shortAudiodesciptorEvent) | Triggered when SAD is received from the connected audio device. | +No events are associated with this method. ### Parameters - This method takes no parameters. - -### Result - +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | object | | -| result.success | boolean | Whether the request succeeded | +| result.success | HdmiCecSinkSuccess | Is the operation successful or not | +| result.success.success | bool | - | + +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 9, "method": "org.rdk.HdmiCecSink.requestShortAudioDescriptor" } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 9, "result": { "success": true } } ``` - -## *sendAudioDevicePowerOnMessage* + +## *sendAudioDevicePowerOnMessage [method](#head.Methods)* This message is used to power on the connected audio device. Usually sent by the TV when it comes out of standby and detects audio device connected in the network. ### Events - -| Event | Description | -| :-------- | :-------- | -| [setSystemAudioModeEvent](#setSystemAudioModeEvent) | Triggered when CEC message of device is received. | +No events are associated with this method. ### Parameters - This method takes no parameters. - -### Result - +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | object | | -| result.success | boolean | Whether the request succeeded | +| result.success | HdmiCecSinkSuccess | Is the operation successful or not | +| result.success.success | bool | - | + +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 10, "method": "org.rdk.HdmiCecSink.sendAudioDevicePowerOnMessage" } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 10, "result": { "success": true } } ``` - -## *sendGetAudioStatusMessage* + +## *sendGetAudioStatusMessage [method](#head.Methods)* -Sends the CEC \ message to request the audio status. +Sends the CEC message to request the audio status. ### Events - -| Event | Description | -| :-------- | :-------- | -| [reportAudioStatusEvent](#reportAudioStatusEvent) | Triggered when CEC message of device is received. | +No events are associated with this method. ### Parameters - This method takes no parameters. - -### Result - +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | object | | -| result.success | boolean | Whether the request succeeded | +| result.success | HdmiCecSinkSuccess | Is the operation successful or not | +| result.success.success | bool | - | + +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 11, "method": "org.rdk.HdmiCecSink.sendGetAudioStatusMessage" } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 11, "result": { "success": true } } ``` - -## *sendKeyPressEvent* + +## *sendKeyPressEvent [method](#head.Methods)* -Sends the CEC \ message when TV remote key is pressed. +Sends the CEC message when TV remote key is pressed. ### Events - -No Events - +No events are associated with this method. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.logicalAddress | integer | Logical address of the device | -| params.keyCode | integer | The key code for the pressed key. Possible values : `0x41` (VOLUME_UP), `0x42` (VOLUME_DOWN), `0x43` (MUTE), `0x01` (UP), `0x02` (DOWN), `0x03` (LEFT), `0x04` (RIGHT), `0x00` (SELECT), `0x09` (HOME), `0x0D` (BACK), `0x20` (NUMBER_0), `0x21` (NUMBER_1), `0x22` (NUMBER_2), `0x23` (NUMBER_3), `0x24` (NUMBER_4), `0x25` (NUMBER_5), `0x26` (NUMBER_6), `0x27` (NUMBER_7), `0x28` (NUMBER_8), `0x29` (NUMBER_9) | - -### Result - +| params.logicalAddress | uint32_t | Logical address of the device | +| params.keyCode | uint32_t | Key code of the key press event | +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | object | | -| result.success | boolean | Whether the request succeeded | +| result.success | HdmiCecSinkSuccess | Is the operation successful or not | +| result.success.success | bool | - | + +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 12, "method": "org.rdk.HdmiCecSink.sendKeyPressEvent", "params": { - "logicalAddress": 4, - "keyCode": 65 + "logicalAddress": 0, + "keyCode": 0 } } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 12, "result": { "success": true } } ``` - -## *sendUserControlPressed* + +## *sendStandbyMessage [method](#head.Methods)* -Sends the CEC \ message when TV remote key is pressed. +Sends the CEC message to another CEC device ### Events - -No Events - +No events are associated with this method. ### Parameters - +This method takes no parameters. +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| params | object | | -| params.logicalAddress | integer | Logical address of the device | -| params.keyCode | integer | The key code for the pressed key. Possible values : `0x41` (VOLUME_UP), `0x42` (VOLUME_DOWN), `0x43` (MUTE), `0x01` (UP), `0x02` (DOWN), `0x03` (LEFT), `0x04` (RIGHT), `0x00` (SELECT), `0x09` (HOME), `0x0D` (BACK), `0x20` (NUMBER_0), `0x21` (NUMBER_1), `0x22` (NUMBER_2), `0x23` (NUMBER_3), `0x24` (NUMBER_4), `0x25` (NUMBER_5), `0x26` (NUMBER_6), `0x27` (NUMBER_7), `0x28` (NUMBER_8), `0x29` (NUMBER_9) | +| result.success | HdmiCecSinkSuccess | Is the operation successful or not | +| result.success.success | bool | - | -### Result +### Examples -| Name | Type | Description | -| :-------- | :-------- | :-------- | -| result | object | | -| result.success | boolean | Whether the request succeeded | - -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "org.rdk.HdmiCecSink.sendUserControlPressed", - "params": { - "logicalAddress": 4, - "keyCode": 65 - } + "jsonrpc": 2.0, + "id": 13, + "method": "org.rdk.HdmiCecSink.sendStandbyMessage" } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 13, "result": { "success": true } } ``` - -## *sendUserControlReleased* + +## *sendUserControlPressed [method](#head.Methods)* -Sends the CEC \ message when TV remote key is released. +Sends the CEC message when TV remote key is pressed. ### Events - -No Events - +No events are associated with this method. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.logicalAddress | integer | Logical address of the device | - -### Result - +| params.logicalAddress | uint32_t | Logical address of the device | +| params.keyCode | uint32_t | Key code of the key press event | +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | object | | -| result.success | boolean | Whether the request succeeded | +| result.success | HdmiCecSinkSuccess | Is the operation successful or not | +| result.success.success | bool | - | + +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "org.rdk.HdmiCecSink.sendUserControlReleased", + "jsonrpc": 2.0, + "id": 14, + "method": "org.rdk.HdmiCecSink.sendUserControlPressed", "params": { - "logicalAddress": 4 + "logicalAddress": 0, + "keyCode": 0 } } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 14, "result": { "success": true } } ``` - -## *sendStandbyMessage* + +## *sendUserControlReleased [method](#head.Methods)* -Sends a CEC \ message to the logical address of the device. +Sends the CEC message when TV remote key is released. ### Events - -No Events - +No events are associated with this method. ### Parameters - -This method takes no parameters. - -### Result - | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | object | | -| result.success | boolean | Whether the request succeeded | +| params | object | | +| params.logicalAddress | uint32_t | Logical address of the device | +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result.success | HdmiCecSinkSuccess | Is the operation successful or not | +| result.success.success | bool | - | + +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "org.rdk.HdmiCecSink.sendStandbyMessage" + "jsonrpc": 2.0, + "id": 15, + "method": "org.rdk.HdmiCecSink.sendUserControlReleased", + "params": { + "logicalAddress": 0 + } } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 15, "result": { "success": true } } ``` - -## *setActivePath* + +## *setActivePath [method](#head.Methods)* -Sets the source device to active (`setStreamPath`). The source wakes from standby if it's in the standby state. +Sets the source device to active (setStreamPath). The source wakes from standby if it’s in the standby state. ### Events - -No Events - +No events are associated with this method. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.activePath | string | Physical address of the source device | - -### Result - +| params.activePath | string | Active path of the device | +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | object | | -| result.success | boolean | Whether the request succeeded | +| result.success | HdmiCecSinkSuccess | Is the operation successful or not | +| result.success.success | bool | - | + +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 16, "method": "org.rdk.HdmiCecSink.setActivePath", "params": { - "activePath": "1.0.0.0" + "activePath": "" } } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 16, "result": { "success": true } } ``` - -## *setActiveSource* + +## *setActiveSource [method](#head.Methods)* Sets the current active source as TV (physical address 0.0.0.0). This call needs to be made when the TV switches to internal tuner or any apps. ### Events - -No Events - +No events are associated with this method. ### Parameters - This method takes no parameters. - -### Result - +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | object | | -| result.success | boolean | Whether the request succeeded | +| result.success | HdmiCecSinkSuccess | Is the operation successful or not | +| result.success.success | bool | - | + +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 17, "method": "org.rdk.HdmiCecSink.setActiveSource" } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 17, "result": { "success": true } } ``` - -## *setEnabled* + +## *setEnabled [method](#head.Methods)* -Enables or disables HDMI-CEC support in the platform. +Sets the status of the HDMI CEC Sink ### Events - -| Event | Description | -| :-------- | :-------- | -| [reportCecEnabledEvent](#reportCecEnabledEvent) | Triggered when the HDMI-CEC is enabled. | +No events are associated with this method. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.enabled | boolean | Indicates whether HDMI-CEC is enabled (`true`) or disabled (`false`) in the platform | - -### Result - +| params.enabled | bool | Is the HDMI CEC Sink enabled or not | +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | object | | -| result.success | boolean | Whether the request succeeded | +| result.success | HdmiCecSinkSuccess | Is the operation successful or not | +| result.success.success | bool | - | + +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 18, "method": "org.rdk.HdmiCecSink.setEnabled", "params": { - "enabled": false + "enabled": true } } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 18, "result": { "success": true } } ``` - -## *setMenuLanguage* + +## *setLatencyInfo [method](#head.Methods)* -Updates the internal data structure with the new menu Language and also broadcasts the \ CEC message. +Sets the Current Latency Values such as Video Latency, Latency Flags,Audio Output Compensated value and Audio Output Delay by sending message for Dynamic Auto LipSync Feature. ### Events - -No Events - +No events are associated with this method. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.language | string | 3 byte ASCII defined in ISO_639-2_codes (https://en.wikipedia.org/wiki/List_of_ISO_639-2_codes) | - -### Result - +| params.videoLatency | string | Video Latency value | +| params.lowLatencyMode | string | Low Latency Mode value | +| params.audioOutputCompensated | string | Audio Output Compensated value | +| params.audioOutputDelay | string | Audio Output Delay value | +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | object | | -| result.success | boolean | Whether the request succeeded | +| result.success | HdmiCecSinkSuccess | Is the operation successful or not | +| result.success.success | bool | - | + +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "org.rdk.HdmiCecSink.setMenuLanguage", + "jsonrpc": 2.0, + "id": 19, + "method": "org.rdk.HdmiCecSink.setLatencyInfo", "params": { - "language": "chi" + "videoLatency": "", + "lowLatencyMode": "", + "audioOutputCompensated": "", + "audioOutputDelay": "" } } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 19, "result": { "success": true } } ``` - -## *setOSDName* + +## *setMenuLanguage [method](#head.Methods)* -Sets the OSD Name used by host device. +Updates the internal data structure with the new menu Language and also broadcasts the CEC message. ### Events - -No Events - +No events are associated with this method. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.name | string | The OSD Name | - -### Result - +| params.language | string | Menu language to be set | +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | object | | -| result.success | boolean | Whether the request succeeded | +| result.success | HdmiCecSinkSuccess | Is the operation successful or not | +| result.success.success | bool | - | + +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "org.rdk.HdmiCecSink.setOSDName", + "jsonrpc": 2.0, + "id": 20, + "method": "org.rdk.HdmiCecSink.setMenuLanguage", "params": { - "name": "Fire TV Stick" + "language": "" } } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 20, "result": { "success": true } } ``` - -## *setRoutingChange* + +## *setOSDName [method](#head.Methods)* -Changes routing while switching between HDMI inputs and TV. +Sets the OSD name of the HDMI CEC Sink ### Events - -No Events - +No events are associated with this method. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.oldPort | string | Current active port, such as `TV`, `HDMI0`, `HDMI1`, `HDMI2` | -| params.newPort | string | New port to switch to, such as `TV`, `HDMI0`, `HDMI1`, `HDMI2` | - -### Result - +| params.name | string | OSD name of the HDMI CEC Sink | +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | object | | -| result.success | boolean | Whether the request succeeded | +| result.success | HdmiCecSinkSuccess | Is the operation successful or not | +| result.success.success | bool | - | + +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "org.rdk.HdmiCecSink.setRoutingChange", + "jsonrpc": 2.0, + "id": 21, + "method": "org.rdk.HdmiCecSink.setOSDName", "params": { - "oldPort": "HDMI0", - "newPort": "TV" + "name": "" } } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 21, "result": { "success": true } } ``` - -## *setupARCRouting* + +## *setRoutingChange [method](#head.Methods)* -Enable (or disable) HDMI-CEC Audio Return Channel (ARC) routing. Upon enabling, triggers arcInitiationEvent and upon disabling, triggers arcTerminationEvent. +Changes routing while switching between HDMI inputs and TV. ### Events - -| Event | Description | -| :-------- | :-------- | -| [arcInitiationEvent](#arcInitiationEvent) | Triggered when routing though the HDMI ARC port is successfully established. | -| [arcTerminationEvent](#arcTerminationEvent) | Triggered when routing though the HDMI ARC port terminates. | +No events are associated with this method. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.enabled | boolean | Indicates whether HDMI-CEC ARC is enabled (`true`) or disabled (`false`). If enabled, the CEC \ and \ messages are sent. If disabled, the CEC \ and \ messages are sent | - -### Result - +| params.oldPort | string | Old port number | +| params.newPort | string | New port number | +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | object | | -| result.success | boolean | Whether the request succeeded | +| result.success | HdmiCecSinkSuccess | Is the operation successful or not | +| result.success.success | bool | - | + +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "org.rdk.HdmiCecSink.setupARCRouting", + "jsonrpc": 2.0, + "id": 22, + "method": "org.rdk.HdmiCecSink.setRoutingChange", "params": { - "enabled": true + "oldPort": "", + "newPort": "" } } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 22, "result": { "success": true } } ``` - -## *setVendorId* + +## *setVendorId [method](#head.Methods)* -Sets a vendor ID used by host device. +Sets the vendor ID of the HDMI CEC Sink ### Events - -No Events - +No events are associated with this method. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.vendorid | string | Vendor ID for this device. The ID can have a maximum of 6 characters | - -### Result - +| params.vendorid | string | Vendor ID of the HDMI CEC Sink | +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | object | | -| result.success | boolean | Whether the request succeeded | +| result.success | HdmiCecSinkSuccess | Is the operation successful or not | +| result.success.success | bool | - | + +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 23, "method": "org.rdk.HdmiCecSink.setVendorId", "params": { - "vendorid": "0019fc" + "vendorid": "" } } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 23, "result": { "success": true } } ``` - -## *setLatencyInfo* + +## *setupARCRouting [method](#head.Methods)* -Sets the Current Latency Values such as Video Latency, Latency Flags,Audio Output Compensated value and Audio Output Delay by sending \ message for Dynamic Auto LipSync Feature. +Enable (or disable) HDMI-CEC Audio Return Channel (ARC) routing. Upon enabling, triggers arcInitiationEvent and upon disabling, triggers arcTerminationEvent. ### Events - -No Events - +No events are associated with this method. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.videoLatency | string | Indicates the Video Latency value of the target device | -| params.lowLatencyMode | string | Indicates whether low latency Mode is 0 or 1 | -| params.audioOutputCompensated | string | Indicates whether Audio Output is delay compensated or not. 0 = (NA)Sent by Non-TV, 1 = TV's audio Output is delay compensated, 2 = Not delay compensated, 3 = Partially delayed | -| params.audioOutputDelay | string | Indicates the Audio Output Delay value of the target device | - -### Result - +| params.enabled | bool | Is the HDMI CEC Sink enabled or not | +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | object | | -| result.success | boolean | Whether the request succeeded | +| result.success | HdmiCecSinkSuccess | Is the operation successful or not | +| result.success.success | bool | - | + +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "org.rdk.HdmiCecSink.setLatencyInfo", + "jsonrpc": 2.0, + "id": 24, + "method": "org.rdk.HdmiCecSink.setupARCRouting", "params": { - "videoLatency": "2", - "lowLatencyMode": "1", - "audioOutputCompensated": "1", - "audioOutputDelay": "20" + "enabled": true } } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 24, "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](#Thunder)] for information on how to register for a notification. +Notifications are autonomous events, triggered by the internals of the implementation, and broadcasted via JSON-RPC to all registered observers. Refer to [[Thunder](#ref.Thunder)] for information on how to register for a notification. -The following events are provided by the org.rdk.HdmiCecSink plugin: +The following events are provided by the HdmiCecSink plugin: HdmiCecSink interface events: | Event | Description | | :-------- | :-------- | -| [arcInitiationEvent](#arcInitiationEvent) | Triggered when routing though the HDMI ARC port is successfully established | -| [arcTerminationEvent](#arcTerminationEvent) | Triggered when routing though the HDMI ARC port terminates | -| [onActiveSourceChange](#onActiveSourceChange) | Triggered with the active source device changes | -| [onDeviceAdded](#onDeviceAdded) | Triggered when an HDMI cable is physically connected to the HDMI port on a TV, or the power cable is connected to the source device | -| [onDeviceInfoUpdated](#onDeviceInfoUpdated) | Triggered when device information changes (physicalAddress, deviceType, vendorID, osdName, cecVersion, powerStatus) | -| [onDeviceRemoved](#onDeviceRemoved) | Triggered when HDMI cable is physically removed from the HDMI port on a TV or the power cable is removed from the source device | -| [onImageViewOnMsg](#onImageViewOnMsg) | Triggered when an \ CEC message is received from the source device | -| [onInActiveSource](#onInActiveSource) | Triggered when the source is no longer active | -| [onTextViewOnMsg](#onTextViewOnMsg) | Triggered when a \ CEC message is received from the source device | -| [onWakeupFromStandby](#onWakeupFromStandby) | Triggered when the TV is in standby mode and it receives \/ \/ \ CEC message from the connected source device | -| [reportAudioDeviceConnectedStatus](#reportAudioDeviceConnectedStatus) | Triggered when an audio device is added or removed | -| [reportAudioStatusEvent](#reportAudioStatusEvent) | Triggered when CEC \ message of device is received | -| [reportFeatureAbortEvent](#reportFeatureAbortEvent) | Triggered when CEC \ message of device is received | -| [reportCecEnabledEvent](#reportCecEnabledEvent) | Triggered when the HDMI-CEC is enabled | -| [setSystemAudioModeEvent](#setSystemAudioModeEvent) | Triggered when CEC \ message of device is received | -| [shortAudiodesciptorEvent](#shortAudiodesciptorEvent) | Triggered when SAD is received from the connected audio device | -| [standbyMessageReceived](#standbyMessageReceived) | Triggered when the source device changes status to `STANDBY` | - - - -## *arcInitiationEvent* +| [arcInitiationEvent](#event.arcInitiationEvent) | Triggered when routing though the HDMI ARC port is successfully established. | +| [arcTerminationEvent](#event.arcTerminationEvent) | Triggered when routing though the HDMI ARC port terminates. | +| [onActiveSourceChange](#event.onActiveSourceChange) | Triggered when the active source device changes. | +| [onDeviceAdded](#event.onDeviceAdded) | Triggered when a new device is added to the CEC network. | +| [onDeviceInfoUpdated](#event.onDeviceInfoUpdated) | Triggered when device information changes. | +| [onDeviceRemoved](#event.onDeviceRemoved) | Triggered when a device is removed from the CEC network. | +| [onImageViewOnMsg](#event.onImageViewOnMsg) | Triggered when an CEC message is received from the source device. | +| [onInActiveSource](#event.onInActiveSource) | Triggered when the source is no longer active. | +| [onTextViewOnMsg](#event.onTextViewOnMsg) | Triggered when a CEC message is received from the source device. | +| [onWakeupFromStandby](#event.onWakeupFromStandby) | Triggered when the TV is in standby mode and it receives / / CEC message from the connected source device. | +| [reportAudioDeviceConnectedStatus](#event.reportAudioDeviceConnectedStatus) | Triggered when an audio device is added or removed. | +| [reportAudioDevicePowerStatus](#event.reportAudioDevicePowerStatus) | Triggered when the source device changes. | +| [reportAudioStatusEvent](#event.reportAudioStatusEvent) | Triggered when CEC message of device is received. | +| [reportCecEnabledEvent](#event.reportCecEnabledEvent) | Triggered when the HDMI-CEC is enabled. | +| [reportFeatureAbortEvent](#event.reportFeatureAbortEvent) | Triggered when CEC message of device is received. | +| [setSystemAudioModeEvent](#event.setSystemAudioModeEvent) | Triggered when CEC message of device is received. | +| [shortAudiodescriptorEvent](#event.shortAudiodescriptorEvent) | Triggered when SAD is received from the connected audio device. See requestShortAudioDescriptor. | +| [standbyMessageReceived](#event.standbyMessageReceived) | Triggered when the source device changes status to STANDBY. | + + +## *arcInitiationEvent [event](#head.Notifications)* Triggered when routing though the HDMI ARC port is successfully established. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.status | string | Whether the operation succeeded | +| params.success | string | Is the operation successful or not | -### Example +### Examples ```json { - "jsonrpc": "2.0", - "method": "client.events.arcInitiationEvent", + "jsonrpc": 2.0, + "id": 25, + "method": "org.rdk.HdmiCecSink.arcInitiationEvent", "params": { - "status": "success" + "success": "" } } ``` - -## *arcTerminationEvent* + +## *arcTerminationEvent [event](#head.Notifications)* Triggered when routing though the HDMI ARC port terminates. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.status | string | Whether the operation succeeded | +| params.success | string | Is the operation successful or not | -### Example +### Examples ```json { - "jsonrpc": "2.0", - "method": "client.events.arcTerminationEvent", + "jsonrpc": 2.0, + "id": 26, + "method": "org.rdk.HdmiCecSink.arcTerminationEvent", "params": { - "status": "success" + "success": "" } } ``` - -## *onActiveSourceChange* + +## *onActiveSourceChange [event](#head.Notifications)* -Triggered with the active source device changes. +Triggered when the active source device changes. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.logicalAddress | integer | Logical address of the device | -| params.physicalAddress | string | Physical address of the device | +| params.logicalAddress | int | Logical address of the active source | +| params.physicalAddress | string | physical address | -### Example +### Examples ```json { - "jsonrpc": "2.0", - "method": "client.events.onActiveSourceChange", + "jsonrpc": 2.0, + "id": 27, + "method": "org.rdk.HdmiCecSink.onActiveSourceChange", "params": { - "logicalAddress": 4, - "physicalAddress": "1.0.0.0" + "logicalAddress": 0, + "physicalAddress": "" } } ``` - -## *onDeviceAdded* + +## *onDeviceAdded [event](#head.Notifications)* -Triggered when an HDMI cable is physically connected to the HDMI port on a TV, or the power cable is connected to the source device. After a new device is hotplugged to the port, various information is collected such as CEC version, OSD name, vendor ID, and power status. The `onDeviceAdded` event is sent as soon as any of these details are available. However, the connected device sends the information asynchronously; therefore, the information may not be collected immediately. +Triggered when a new device is added to the CEC network. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.logicalAddress | integer | Logical address of the device | +| params.logicalAddress | int | Logical address of the active source | -### Example +### Examples ```json { - "jsonrpc": "2.0", - "method": "client.events.onDeviceAdded", + "jsonrpc": 2.0, + "id": 28, + "method": "org.rdk.HdmiCecSink.onDeviceAdded", "params": { - "logicalAddress": 4 + "logicalAddress": 0 } } ``` - -## *onDeviceInfoUpdated* + +## *onDeviceInfoUpdated [event](#head.Notifications)* -Triggered when device information changes (physicalAddress, deviceType, vendorID, osdName, cecVersion, powerStatus). +Triggered when device information changes. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.logicalAddress | integer | Logical address of the device | +| params.logicalAddress | int | Logical address of the active source | -### Example +### Examples ```json { - "jsonrpc": "2.0", - "method": "client.events.onDeviceInfoUpdated", + "jsonrpc": 2.0, + "id": 29, + "method": "org.rdk.HdmiCecSink.onDeviceInfoUpdated", "params": { - "logicalAddress": 4 + "logicalAddress": 0 } } ``` - -## *onDeviceRemoved* + +## *onDeviceRemoved [event](#head.Notifications)* -Triggered when HDMI cable is physically removed from the HDMI port on a TV or the power cable is removed from the source device. The device is considered removed when no ACK messages are received after pinging the device. +Triggered when a device is removed from the CEC network. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.logicalAddress | integer | Logical address of the device | +| params.logicalAddress | int | Logical address of the active source | -### Example +### Examples ```json { - "jsonrpc": "2.0", - "method": "client.events.onDeviceRemoved", + "jsonrpc": 2.0, + "id": 30, + "method": "org.rdk.HdmiCecSink.onDeviceRemoved", "params": { - "logicalAddress": 4 + "logicalAddress": 0 } } ``` - -## *onImageViewOnMsg* + +## *onImageViewOnMsg [event](#head.Notifications)* -Triggered when an \ CEC message is received from the source device. +Triggered when an CEC message is received from the source device. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.logicalAddress | integer | Logical address of the device | +| params.logicalAddress | int | Logical address of the active source | -### Example +### Examples ```json { - "jsonrpc": "2.0", - "method": "client.events.onImageViewOnMsg", + "jsonrpc": 2.0, + "id": 31, + "method": "org.rdk.HdmiCecSink.onImageViewOnMsg", "params": { - "logicalAddress": 4 + "logicalAddress": 0 } } ``` - -## *onInActiveSource* + +## *onInActiveSource [event](#head.Notifications)* Triggered when the source is no longer active. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.logicalAddress | integer | Logical address of the device | -| params.physicalAddress | string | Physical address of the device | +| params.logicalAddress | int | Logical address of the active source | +| params.physicalAddress | string | physical address | -### Example +### Examples ```json { - "jsonrpc": "2.0", - "method": "client.events.onInActiveSource", + "jsonrpc": 2.0, + "id": 32, + "method": "org.rdk.HdmiCecSink.onInActiveSource", "params": { - "logicalAddress": 4, - "physicalAddress": "1.0.0.0" + "logicalAddress": 0, + "physicalAddress": "" } } ``` - -## *onTextViewOnMsg* + +## *onTextViewOnMsg [event](#head.Notifications)* -Triggered when a \ CEC message is received from the source device. +Triggered when a CEC message is received from the source device. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.logicalAddress | integer | Logical address of the device | +| params.logicalAddress | int | Logical address of the active source | -### Example +### Examples ```json { - "jsonrpc": "2.0", - "method": "client.events.onTextViewOnMsg", + "jsonrpc": 2.0, + "id": 33, + "method": "org.rdk.HdmiCecSink.onTextViewOnMsg", "params": { - "logicalAddress": 4 + "logicalAddress": 0 } } ``` - -## *onWakeupFromStandby* + +## *onWakeupFromStandby [event](#head.Notifications)* -Triggered when the TV is in standby mode and it receives \/ \/ \ CEC message from the connected source device. This event will be notified to UI/Application and application will bring the TV out of standby. +Triggered when the TV is in standby mode and it receives / / CEC message from the connected source device. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.logicalAddress | integer | Logical address of the device | +| params.logicalAddress | int | Logical address of the active source | -### Example +### Examples ```json { - "jsonrpc": "2.0", - "method": "client.events.onWakeupFromStandby", + "jsonrpc": 2.0, + "id": 34, + "method": "org.rdk.HdmiCecSink.onWakeupFromStandby", "params": { - "logicalAddress": 4 + "logicalAddress": 0 } } ``` - -## *reportAudioDeviceConnectedStatus* + +## *reportAudioDeviceConnectedStatus [event](#head.Notifications)* Triggered when an audio device is added or removed. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.status | string | The status | -| params.audioDeviceConnected | string | `true` if an audio device is connected, otherwise `false` | +| params.status | string | Status of the audio device | +| params.audioDeviceConnected | string | Audio device connected or not | -### Example +### Examples ```json { - "jsonrpc": "2.0", - "method": "client.events.reportAudioDeviceConnectedStatus", + "jsonrpc": 2.0, + "id": 35, + "method": "org.rdk.HdmiCecSink.reportAudioDeviceConnectedStatus", "params": { - "status": "success", - "audioDeviceConnected": "true" + "status": "", + "audioDeviceConnected": "" } } ``` - -## *reportAudioStatusEvent* + +## *reportAudioDevicePowerStatus [event](#head.Notifications)* -Triggered when CEC \ message of device is received. +Triggered when the source device changes. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.muteStatus | integer | The mute status | -| params.volumeLevel | integer | The volume level of device | +| params.powerStatus | int | Power status of the device | -### Example +### Examples ```json { - "jsonrpc": "2.0", - "method": "client.events.reportAudioStatusEvent", + "jsonrpc": 2.0, + "id": 36, + "method": "org.rdk.HdmiCecSink.reportAudioDevicePowerStatus", "params": { - "muteStatus": 0, - "volumeLevel": 28 + "powerStatus": 0 } } ``` - -## *reportFeatureAbortEvent* + +## *reportAudioStatusEvent [event](#head.Notifications)* -Triggered when CEC \ message of device is received. +Triggered when CEC message of device is received. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.logicalAddress | integer | Logical address of the device | -| params.opcode | integer | The opcode send to the device | -| params.FeatureAbortReason | integer | Reason for the feature abort | +| params.muteStatus | int | Mute status of the device | +| params.volumeLevel | int | Volume level of the device | -### Example +### Examples ```json { - "jsonrpc": "2.0", - "method": "client.events.reportFeatureAbortEvent", + "jsonrpc": 2.0, + "id": 37, + "method": "org.rdk.HdmiCecSink.reportAudioStatusEvent", "params": { - "logicalAddress": 4, - "opcode": 0, - "FeatureAbortReason": 0 + "muteStatus": 0, + "volumeLevel": 0 } } ``` - -## *reportCecEnabledEvent* + +## *reportCecEnabledEvent [event](#head.Notifications)* Triggered when the HDMI-CEC is enabled. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.cecEnable | string | Whether the cec is enabled | +| params.cecEnable | string | HDMI-CEC enabled or not | -### Example +### Examples ```json { - "jsonrpc": "2.0", - "method": "client.events.reportCecEnabledEvent", + "jsonrpc": 2.0, + "id": 38, + "method": "org.rdk.HdmiCecSink.reportCecEnabledEvent", "params": { - "cecEnable": "true" + "cecEnable": "" } } ``` - -## *setSystemAudioModeEvent* + +## *reportFeatureAbortEvent [event](#head.Notifications)* -Triggered when CEC \ message of device is received. +Triggered when CEC message of device is received. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.audioMode | string | Audio mode of system | +| params.logicalAddress | int | Logical address of the active source | +| params.opcode | int | Opcode of the message | +| params.FeatureAbortReason | int | Reason for the feature abort | -### Example +### Examples ```json { - "jsonrpc": "2.0", - "method": "client.events.setSystemAudioModeEvent", + "jsonrpc": 2.0, + "id": 39, + "method": "org.rdk.HdmiCecSink.reportFeatureAbortEvent", "params": { - "audioMode": "On" + "logicalAddress": 0, + "opcode": 0, + "FeatureAbortReason": 0 } } ``` - -## *shortAudiodesciptorEvent* + +## *setSystemAudioModeEvent [event](#head.Notifications)* -Triggered when SAD is received from the connected audio device. See `requestShortAudioDescriptor`. +Triggered when CEC message of device is received. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.ShortAudioDescriptor | array | The SAD information (formatid, audioFormatCode, numberofdescriptor) | -| params.ShortAudioDescriptor[#] | integer | | +| params.audioMode | string | Audio mode of the device | -### Example +### Examples ```json { - "jsonrpc": "2.0", - "method": "client.events.shortAudiodesciptorEvent", + "jsonrpc": 2.0, + "id": 40, + "method": "org.rdk.HdmiCecSink.setSystemAudioModeEvent", "params": { - "ShortAudioDescriptor": [ - [ - 0, - 10, - 2 - ] - ] + "audioMode": "" } } ``` - -## *standbyMessageReceived* + +## *shortAudiodescriptorEvent [event](#head.Notifications)* -Triggered when the source device changes status to `STANDBY`. +Triggered when SAD is received from the connected audio device. See requestShortAudioDescriptor. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.logicalAddress | integer | Logical address of the device | +| params.jsonresponse | string | JSON response containing the Short Audio Descriptor (SAD) information | -### Example +### Examples ```json { - "jsonrpc": "2.0", - "method": "client.events.standbyMessageReceived", + "jsonrpc": 2.0, + "id": 41, + "method": "org.rdk.HdmiCecSink.shortAudiodescriptorEvent", "params": { - "logicalAddress": 4 + "jsonresponse": "" } } ``` + +## *standbyMessageReceived [event](#head.Notifications)* + +Triggered when the source device changes status to STANDBY. + +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.logicalAddress | int | Logical address of the active source | + +### Examples + +```json +{ + "jsonrpc": 2.0, + "id": 42, + "method": "org.rdk.HdmiCecSink.standbyMessageReceived", + "params": { + "logicalAddress": 0 + } +} +``` diff --git a/docs/apis/HdmiCecSourcePlugin.md b/docs/apis/HdmiCecSourcePlugin.md index 29b33042..c95c25e9 100644 --- a/docs/apis/HdmiCecSourcePlugin.md +++ b/docs/apis/HdmiCecSourcePlugin.md @@ -1,168 +1,154 @@ - -# HdmiCecSourcePlugin + +# HdmiCecSource Plugin -**Version: [1.0.0]()** +**Version: [1.0.0](https://github.com/rdkcentral/rdkservices/blob/main/HdmiCecSource/CHANGELOG.md)** -A org.rdk.HdmiCecSource plugin for Thunder framework. +A HdmiCecSource 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](#head.Abbreviation,_Acronyms_and_Terms) +- [Description](#head.Description) +- [Configuration](#head.Configuration) +- [Methods](#head.Methods) +- [Notifications](#head.Notifications) - + # Abbreviation, Acronyms and Terms -[[Refer to this link](overview/aat.md)] +[[Refer to this link](userguide/aat.md)] - + # Description -The `HdmiCecSource` plugin allows you to configure HDMI Consumer Electronics Control (CEC) on a set-top device. The HdmiCecSource plugin is meant to be used on the source devices where an application relies on the Thunder plugin to handle protocol related messaging. The plugin also provides API's and events to implement the CEC use cases. +The `HdmiCecSource` plugin provides an interface for HdmiCecSource. -The plugin is designed to be loaded and executed within the Thunder framework. For more information about the framework refer to [[Thunder](#Thunder)]. +The plugin is designed to be loaded and executed within the Thunder framework. For more information about the framework refer to [[Thunder](#ref.Thunder)]. - + # Configuration The table below lists configuration options of the plugin. | Name | Type | Description | | :-------- | :-------- | :-------- | -| callsign | string | Plugin instance name (default: *org.rdk.HdmiCecSource*) | -| classname | string | Class name: *org.rdk.HdmiCecSource* | +| callsign | string | Plugin instance name (default: org.rdk.HdmiCecSource) | +| classname | string | Class name: *HdmiCecSource* | | locator | string | Library name: *libWPEFrameworkHdmiCecSource.so* | | autostart | boolean | Determines if the plugin shall be started automatically along with the framework | - + # Methods -The following methods are provided by the org.rdk.HdmiCecSource plugin: +The following methods are provided by the HdmiCecSource plugin: HdmiCecSource interface methods: | Method | Description | | :-------- | :-------- | -| [getActiveSourceStatus](#getActiveSourceStatus) | Gets the active source status of the device | -| [getDeviceList](#getDeviceList) | Gets the list of CEC enabled devices connected and system information for each device | -| [getEnabled](#getEnabled) | Returns HDMI-CEC driver enabled status | -| [getOSDName](#getOSDName) | Returns the OSD name set by the application | -| [getOTPEnabled](#getOTPEnabled) | Returns HDMI-CEC OTP option enabled status | -| [getVendorId](#getVendorId) | Returns the vendor ID set by the application | -| [performOTPAction](#performOTPAction) | Turns on the TV and takes back the input to the device | -| [sendKeyPressEvent](#sendKeyPressEvent) | Sends the CEC \ and \ message when TV remote key is pressed | -| [sendStandbyMessage](#sendStandbyMessage) | Sends a CEC \ message to the logical address of the device | -| [setEnabled](#setEnabled) | Enables or disables HDMI-CEC driver | -| [setOSDName](#setOSDName) | Sets the OSD name of the application | -| [setOTPEnabled](#setOTPEnabled) | Enables or disables HDMI-CEC OTP option | -| [setVendorId](#setVendorId) | Sets the vendor ID of the application | - - - -## *getActiveSourceStatus* - -Gets the active source status of the device. +| [getActiveSourceStatus](#method.getActiveSourceStatus) | Gets the status if the device is the current active source | +| [getDeviceList](#method.getDeviceList) | Gets the list of devices connected to the HDMI CEC source | +| [getEnabled](#method.getEnabled) | Gets the status of the HDMI CEC source | +| [getOSDName](#method.getOSDName) | Gets the OSD name of the HDMI CEC source | +| [getOTPEnabled](#method.getOTPEnabled) | Gets the OTP enabled status of the HDMI CEC source | +| [getVendorId](#method.getVendorId) | Gets the vendor ID of the HDMI CEC source | +| [performOTPAction](#method.performOTPAction) | Performs the OTP action | +| [sendKeyPressEvent](#method.sendKeyPressEvent) | Sends a key press event to the HDMI CEC device. | +| [sendStandbyMessage](#method.sendStandbyMessage) | Sends a standby message to another CEC device | +| [setEnabled](#method.setEnabled) | Sets the status of the HDMI CEC source | +| [setOSDName](#method.setOSDName) | Sets the OSD name of the HDMI CEC source | +| [setOTPEnabled](#method.setOTPEnabled) | Sets the OTP enabled status of the HDMI CEC source | +| [setVendorId](#method.setVendorId) | Sets the vendor ID of the HDMI CEC source | + + +## *getActiveSourceStatus [method](#head.Methods)* + +Gets the status if the device is the current active source ### Events - -No Events - +No events are associated with this method. ### Parameters - +This method takes no parameters. +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| params | object | | -| params.status | boolean | `true` if the device is active source otherwise, `false` | +| result.status | bool | Is the active source active or not | +| result.success | bool | Is the operation successful or not | -### Result +### Examples -| Name | Type | Description | -| :-------- | :-------- | :-------- | -| result | object | | -| result.success | boolean | Whether the request succeeded | - -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "org.rdk.HdmiCecSource.getActiveSourceStatus", - "params": { - "status": true - } + "jsonrpc": 2.0, + "id": 0, + "method": "org.rdk.HdmiCecSource.getActiveSourceStatus" } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 0, "result": { + "status": true, "success": true } } ``` - -## *getDeviceList* + +## *getDeviceList [method](#head.Methods)* -Gets the list of CEC enabled devices connected and system information for each device. The information includes logicalAddress,OSD name and vendor ID. +Gets the list of devices connected to the HDMI CEC source ### Events - -No Events - +No events are associated with this method. ### Parameters - This method takes no parameters. - -### Result - +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | object | | -| result.numberofdevices | integer | number of devices in the `deviceList` array | -| result.deviceList | array | Object [] of information about each device | -| result.deviceList[#] | object | | -| result.deviceList[#].logicalAddress | integer | Logical address of the device | -| result.deviceList[#].osdName | string | OSD name of the device | -| result.deviceList[#].vendorID | string | Vendor ID of the device | -| result.success | boolean | Whether the request succeeded | +| result.numberofdevices | uint32_t | Number of devices connected to the HDMI CEC source | +| result.deviceList | IHdmiCecSourceDeviceListIterator | List of devices connected to the HDMI CEC source | +| result.deviceList[#].logicalAddress | uint8_t | - | +| result.deviceList[#].vendorID | string | - | +| result.deviceList[#].osdName | string | - | +| result.success | bool | Is the operation successful or not | + +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 1, "method": "org.rdk.HdmiCecSource.getDeviceList" } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 1, "result": { - "numberofdevices": 1, + "numberofdevices": 0, "deviceList": [ { - "logicalAddress": 0, - "osdName": "TV Box", - "vendorID": "019fb" + "logicalAddress": "", + "vendorID": "", + "osdName": "" } ], "success": true @@ -170,669 +156,680 @@ This method takes no parameters. } ``` - -## *getEnabled* + +## *getEnabled [method](#head.Methods)* -Returns HDMI-CEC driver enabled status. +Gets the status of the HDMI CEC source ### Events - -No Events - +No events are associated with this method. ### Parameters - This method takes no parameters. - -### Result - +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | object | | -| result.enabled | boolean | Indicates whether HDMI-CEC is enabled (`true`) or disabled (`false`). The default value is `true` if the parameter has not been set before | -| result.success | boolean | Whether the request succeeded | +| result.enabled | bool | Is the HDMI CEC source enabled or not | +| result.success | bool | Is the operation successful or not | + +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 2, "method": "org.rdk.HdmiCecSource.getEnabled" } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 2, "result": { - "enabled": false, + "enabled": true, "success": true } } ``` - -## *getOSDName* + +## *getOSDName [method](#head.Methods)* -Returns the OSD name set by the application. +Gets the OSD name of the HDMI CEC source ### Events - -No Events - +No events are associated with this method. ### Parameters - This method takes no parameters. - -### Result - +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | object | | -| result.name | string | The OSD name. The default value is `TV Box` if no value is set | -| result.success | boolean | Whether the request succeeded | +| result.name | string | OSD name of the HDMI CEC source | +| result.success | bool | Is the operation successful or not | + +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 3, "method": "org.rdk.HdmiCecSource.getOSDName" } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 3, "result": { - "name": "My TV", + "name": "", "success": true } } ``` - -## *getOTPEnabled* + +## *getOTPEnabled [method](#head.Methods)* -Returns HDMI-CEC OTP option enabled status. +Gets the OTP enabled status of the HDMI CEC source ### Events - -No Events - +No events are associated with this method. ### Parameters - This method takes no parameters. - -### Result - +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | object | | -| result.enabled | boolean | Indicates whether HDMI-CEC OTP is enabled (`true`) or disabled (`false`). The default value is `true` if the parameter has not been set before | -| result.success | boolean | Whether the request succeeded | +| result.enabled | bool | Is the HDMI CEC source enabled or not | +| result.success | bool | Is the operation successful or not | + +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 4, "method": "org.rdk.HdmiCecSource.getOTPEnabled" } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 4, "result": { - "enabled": false, + "enabled": true, "success": true } } ``` - -## *getVendorId* + +## *getVendorId [method](#head.Methods)* -Returns the vendor ID set by the application. +Gets the vendor ID of the HDMI CEC source ### Events - -No Events - +No events are associated with this method. ### Parameters - This method takes no parameters. - -### Result - +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | object | | -| result.vendorid | string | The vendor ID. The default value is `0019FB` if no value is set. If the device is connected to an LG TV, then `00E091` is used as the vendor ID | -| result.success | boolean | Whether the request succeeded | +| result.vendorid | string | - | +| result.success | bool | Is the operation successful or not | + +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 5, "method": "org.rdk.HdmiCecSource.getVendorId" } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 5, "result": { - "vendorid": "0x0019FB", + "vendorid": "", "success": true } } ``` - -## *performOTPAction* + +## *performOTPAction [method](#head.Methods)* -Turns on the TV and takes back the input to the device. +Performs the OTP action ### Events - -No Events - +No events are associated with this method. ### Parameters - This method takes no parameters. - -### Result - +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | object | | -| result.success | boolean | Whether the request succeeded | +| result.success | HdmiCecSourceSuccess | Is the operation successful or not | +| result.success.success | bool | - | + +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 6, "method": "org.rdk.HdmiCecSource.performOTPAction" } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 6, "result": { "success": true } } ``` - -## *sendKeyPressEvent* - -Sends the CEC \ and \ message when TV remote key is pressed. - -### Event + +## *sendKeyPressEvent [method](#head.Methods)* - No Events. +Sends a key press event to the HDMI CEC device. ### Events - -No Events - +No events are associated with this method. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.logicalAddress | integer | Logical address of the device | -| params.keyCode | integer | The key code for the pressed key. Possible values : `0x41` (VOLUME_UP), `0x42` (VOLUME_DOWN), `0x43` (MUTE), `0x01` (UP), `0x02` (DOWN), `0x03` (LEFT), `0x04` (RIGHT), `0x00` (SELECT), `0x09` (HOME), `0x0D` (BACK), `0x20` (NUMBER_0), `0x21` (NUMBER_1), `0x22` (NUMBER_2), `0x23` (NUMBER_3), `0x24` (NUMBER_4), `0x25` (NUMBER_5), `0x26` (NUMBER_6), `0x27` (NUMBER_7), `0x28` (NUMBER_8), `0x29` (NUMBER_9) | - -### Result - +| params.logicalAddress | uint32_t | Logical address of the device | +| params.keyCode | uint32_t | Key code of the key press event | +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | object | | -| result.success | boolean | Whether the request succeeded | +| result.success | HdmiCecSourceSuccess | Is the operation successful or not | +| result.success.success | bool | - | + +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 7, "method": "org.rdk.HdmiCecSource.sendKeyPressEvent", "params": { "logicalAddress": 0, - "keyCode": 65 + "keyCode": 0 } } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 7, "result": { "success": true } } ``` - -## *sendStandbyMessage* + +## *sendStandbyMessage [method](#head.Methods)* -Sends a CEC \ message to the logical address of the device. +Sends a standby message to another CEC device ### Events - -No Events - +No events are associated with this method. ### Parameters - This method takes no parameters. - -### Result - +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | object | | -| result.success | boolean | Whether the request succeeded | +| result.success | HdmiCecSourceSuccess | Is the operation successful or not | +| result.success.success | bool | - | + +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 8, "method": "org.rdk.HdmiCecSource.sendStandbyMessage" } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 8, "result": { "success": true } } ``` - -## *setEnabled* + +## *setEnabled [method](#head.Methods)* -Enables or disables HDMI-CEC driver. +Sets the status of the HDMI CEC source ### Events - -No Events - +No events are associated with this method. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.enabled | boolean | Indicates whether HDMI-CEC is enabled (`true`) or disabled (`false`). The default value is `true` if the parameter has not been set before | - -### Result - +| params.enabled | bool | Is the HDMI CEC source enabled or not | +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | object | | -| result.success | boolean | Whether the request succeeded | +| result.success | HdmiCecSourceSuccess | Is the operation successful or not | +| result.success.success | bool | - | + +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 9, "method": "org.rdk.HdmiCecSource.setEnabled", "params": { - "enabled": false + "enabled": true } } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 9, "result": { "success": true } } ``` - -## *setOSDName* + +## *setOSDName [method](#head.Methods)* -Sets the OSD name of the application. +Sets the OSD name of the HDMI CEC source ### Events - -No Events - +No events are associated with this method. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.name | string | The OSD name. The default value is `TV Box` if no value is set | - -### Result - +| params.name | string | OSD name of the HDMI CEC source | +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | object | | -| result.success | boolean | Whether the request succeeded | +| result.success | HdmiCecSourceSuccess | Is the operation successful or not | +| result.success.success | bool | - | + +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 10, "method": "org.rdk.HdmiCecSource.setOSDName", "params": { - "name": "My TV" + "name": "" } } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 10, "result": { "success": true } } ``` - -## *setOTPEnabled* + +## *setOTPEnabled [method](#head.Methods)* -Enables or disables HDMI-CEC OTP option. +Sets the OTP enabled status of the HDMI CEC source ### Events - -No Events - +No events are associated with this method. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.enabled | boolean | Indicates whether HDMI-CEC OTP is enabled (`true`) or disabled (`false`). The default value is `true` if the parameter has not been set before | - -### Result - +| params.enabled | bool | Is the HDMI CEC source enabled or not | +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | object | | -| result.success | boolean | Whether the request succeeded | +| result.success | HdmiCecSourceSuccess | Is the operation successful or not | +| result.success.success | bool | - | + +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 11, "method": "org.rdk.HdmiCecSource.setOTPEnabled", "params": { - "enabled": false + "enabled": true } } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 11, "result": { "success": true } } ``` - -## *setVendorId* + +## *setVendorId [method](#head.Methods)* -Sets the vendor ID of the application. +Sets the vendor ID of the HDMI CEC source ### Events - -No Events - +No events are associated with this method. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.vendorid | string | The vendor ID. The default value is `0019FB` if no value is set. If the device is connected to an LG TV, then `00E091` is used as the vendor ID | - -### Result - +| params.vendorid | string | - | +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | object | | -| result.success | boolean | Whether the request succeeded | +| result.success | HdmiCecSourceSuccess | Is the operation successful or not | +| result.success.success | bool | - | + +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 12, "method": "org.rdk.HdmiCecSource.setVendorId", "params": { - "vendorid": "0x0019FB" + "vendorid": "" } } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 12, "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](#Thunder)] for information on how to register for a notification. +Notifications are autonomous events, triggered by the internals of the implementation, and broadcasted via JSON-RPC to all registered observers. Refer to [[Thunder](#ref.Thunder)] for information on how to register for a notification. -The following events are provided by the org.rdk.HdmiCecSource plugin: +The following events are provided by the HdmiCecSource plugin: HdmiCecSource interface events: | Event | Description | | :-------- | :-------- | -| [onActiveSourceStatusUpdated](#onActiveSourceStatusUpdated) | Triggered when the device active source status changes | -| [onDeviceAdded](#onDeviceAdded) | Triggered when an HDMI cable is physically connected to the HDMI port on a TV, or the power cable is connected to the source device | -| [onDeviceInfoUpdated](#onDeviceInfoUpdated) | Triggered when device system information is updated (vendorID, osdName) | -| [onDeviceRemoved](#onDeviceRemoved) | Triggered when HDMI cable is physically removed from the HDMI port on a TV or the power cable is removed from the source device | -| [standbyMessageReceived](#standbyMessageReceived) | Triggered when the source device changes status to `STANDBY` | +| [onActiveSourceStatusUpdated](#event.onActiveSourceStatusUpdated) | Notifies when the active source status is updated | +| [onDeviceAdded](#event.onDeviceAdded) | Notifies when CEC device added to CEC network | +| [onDeviceInfoUpdated](#event.onDeviceInfoUpdated) | Notifies when CEC device info updated | +| [onDeviceRemoved](#event.onDeviceRemoved) | Notifies when CEC device removed from CEC network | +| [onKeyPressEvent](#event.onKeyPressEvent) | Notifies when a key press CEC message is received from other CEC device | +| [onKeyReleaseEvent](#event.onKeyReleaseEvent) | Notifies when a key release CEC message is received from other CEC device | +| [standbyMessageReceived](#event.standbyMessageReceived) | Notifies when CEC standby message received from the other CEC device | + +## *onActiveSourceStatusUpdated [event](#head.Notifications)* - -## *onActiveSourceStatusUpdated* - -Triggered when the device active source status changes. +Notifies when the active source status is updated ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.status | boolean | `true` if the device is active source otherwise, `false` | +| params.status | bool | Is the active source active or not | -### Example +### Examples ```json { - "jsonrpc": "2.0", - "method": "client.events.onActiveSourceStatusUpdated", + "jsonrpc": 2.0, + "id": 13, + "method": "org.rdk.HdmiCecSource.onActiveSourceStatusUpdated", "params": { "status": true } } ``` - -## *onDeviceAdded* + +## *onDeviceAdded [event](#head.Notifications)* -Triggered when an HDMI cable is physically connected to the HDMI port on a TV, or the power cable is connected to the source device. After a new device is hotplugged to the port, various information such as OSD name and vendor ID is collected. The `onDeviceAdded` event is sent as soon as any of these details are available. However, the connected device sends the information asynchronously; therefore, the information may not be collected immediately. +Notifies when CEC device added to CEC network ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.logicalAddress | integer | Logical address of the device | +| params.logicalAddress | int | Logical address of the added device | -### Example +### Examples ```json { - "jsonrpc": "2.0", - "method": "client.events.onDeviceAdded", + "jsonrpc": 2.0, + "id": 14, + "method": "org.rdk.HdmiCecSource.onDeviceAdded", "params": { "logicalAddress": 0 } } ``` - -## *onDeviceInfoUpdated* + +## *onDeviceInfoUpdated [event](#head.Notifications)* -Triggered when device system information is updated (vendorID, osdName). +Notifies when CEC device info updated ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.logicalAddress | integer | Logical address of the device | +| params.logicalAddress | int | Logical address of the added device | -### Example +### Examples ```json { - "jsonrpc": "2.0", - "method": "client.events.onDeviceInfoUpdated", + "jsonrpc": 2.0, + "id": 15, + "method": "org.rdk.HdmiCecSource.onDeviceInfoUpdated", "params": { "logicalAddress": 0 } } ``` - -## *onDeviceRemoved* + +## *onDeviceRemoved [event](#head.Notifications)* -Triggered when HDMI cable is physically removed from the HDMI port on a TV or the power cable is removed from the source device. The device is considered removed when no ACK messages are received after pinging the device. +Notifies when CEC device removed from CEC network ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.logicalAddress | integer | Logical address of the device | +| params.logicalAddress | int | Logical address of the added device | -### Example +### Examples ```json { - "jsonrpc": "2.0", - "method": "client.events.onDeviceRemoved", + "jsonrpc": 2.0, + "id": 16, + "method": "org.rdk.HdmiCecSource.onDeviceRemoved", "params": { "logicalAddress": 0 } } ``` - -## *standbyMessageReceived* + +## *onKeyPressEvent [event](#head.Notifications)* -Triggered when the source device changes status to `STANDBY`. +Notifies when a key press CEC message is received from other CEC device ### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.logicalAddress | int | Logical address of the added device | +| params.keyCode | int | Key code of the key press event | + +### Examples + +```json +{ + "jsonrpc": 2.0, + "id": 17, + "method": "org.rdk.HdmiCecSource.onKeyPressEvent", + "params": { + "logicalAddress": 0, + "keyCode": 0 + } +} +``` + + +## *onKeyReleaseEvent [event](#head.Notifications)* + +Notifies when a key release CEC message is received from other CEC device +### Parameters | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.logicalAddress | integer | Logical address of the device | +| params.logicalAddress | int | Logical address of the added device | -### Example +### Examples ```json { - "jsonrpc": "2.0", - "method": "client.events.standbyMessageReceived", + "jsonrpc": 2.0, + "id": 18, + "method": "org.rdk.HdmiCecSource.onKeyReleaseEvent", "params": { "logicalAddress": 0 } } ``` + +## *standbyMessageReceived [event](#head.Notifications)* + +Notifies when CEC standby message received from the other CEC device + +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.logicalAddress | int | Logical address of the added device | + +### Examples + +```json +{ + "jsonrpc": 2.0, + "id": 19, + "method": "org.rdk.HdmiCecSource.standbyMessageReceived", + "params": { + "logicalAddress": 0 + } +} +``` diff --git a/docs/apis/HomeKitTVPlugin.md b/docs/apis/HomeKitTVPlugin.md new file mode 100644 index 00000000..19a9b7da --- /dev/null +++ b/docs/apis/HomeKitTVPlugin.md @@ -0,0 +1,488 @@ + + +# HomeKitTV Plugin + +**Version: [1.0.0](https://github.com/rdkcentral/rdkservices/blob/main/HomeKitTV/CHANGELOG.md)** + +A HomeKitTV plugin for Thunder framework. + +### Table of Contents + +- [Abbreviation, Acronyms and Terms](#head.Abbreviation,_Acronyms_and_Terms) +- [Description](#head.Description) +- [Configuration](#head.Configuration) +- [Methods](#head.Methods) +- [Notifications](#head.Notifications) + + +# Abbreviation, Acronyms and Terms + +[[Refer to this link](userguide/aat.md)] + + +# Description + +The `HomeKitTV` plugin provides an interface for HomeKitTV. + +The plugin is designed to be loaded and executed within the Thunder framework. For more information about the framework refer to [[Thunder](#ref.Thunder)]. + + +# Configuration + +The table below lists configuration options of the plugin. + +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| callsign | string | Plugin instance name (default: org.rdk.HomeKitTV) | +| classname | string | Class name: *HomeKitTV* | +| locator | string | Library name: *libWPEFrameworkHomeKitTV.so* | +| autostart | boolean | Determines if the plugin shall be started automatically along with the framework | + + +# Methods + +The following methods are provided by the HomeKitTV plugin: + +HomeKitTV interface methods: + +| Method | Description | +| :-------- | :-------- | +| [factoryReset](#method.factoryReset) | | +| [getConnectionStatus](#method.getConnectionStatus) | | +| [getEnabledStatus](#method.getEnabledStatus) | | +| [requestAppLaunch](#method.requestAppLaunch) | | +| [setAppContainerIPAddress](#method.setAppContainerIPAddress) | | +| [setCurrentInputSource](#method.setCurrentInputSource) | | + + +## *factoryReset [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 0, + "method": "org.rdk.HomeKitTV.factoryReset" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 0, + "result": null +} +``` + + +## *getConnectionStatus [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result.result | bool | - | + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 1, + "method": "org.rdk.HomeKitTV.getConnectionStatus" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 1, + "result": true +} +``` + + +## *getEnabledStatus [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result.result | bool | - | + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 2, + "method": "org.rdk.HomeKitTV.getEnabledStatus" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 2, + "result": true +} +``` + + +## *requestAppLaunch [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.origin | string | - | +| params.reason | string | - | +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result.result | string | - | + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 3, + "method": "org.rdk.HomeKitTV.requestAppLaunch", + "params": { + "origin": "", + "reason": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 3, + "result": "" +} +``` + + +## *setAppContainerIPAddress [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.ipaddress | string | - | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 4, + "method": "org.rdk.HomeKitTV.setAppContainerIPAddress", + "params": { + "ipaddress": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 4, + "result": null +} +``` + + +## *setCurrentInputSource [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.inputsource | string | - | +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result.response | string | - | + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 5, + "method": "org.rdk.HomeKitTV.setCurrentInputSource", + "params": { + "inputsource": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 5, + "result": "" +} +``` + + + + +# Notifications + +Notifications are autonomous events, triggered by the internals of the implementation, and broadcasted via JSON-RPC to all registered observers. Refer to [[Thunder](#ref.Thunder)] for information on how to register for a notification. + +The following events are provided by the HomeKitTV plugin: + +HomeKitTV interface events: + +| Event | Description | +| :-------- | :-------- | +| [exit](#event.exit) | | +| [stateChange](#event.stateChange) | | +| [dispatchAirplayErrorEvent](#event.dispatchAirplayErrorEvent) | | +| [dispatchOnAppStateChangeRequest](#event.dispatchOnAppStateChangeRequest) | | +| [dispatchOnConnectionStatusChanged](#event.dispatchOnConnectionStatusChanged) | | +| [dispatchOnEnabledStatusChanged](#event.dispatchOnEnabledStatusChanged) | | +| [dispatchOnInputSourceChanged](#event.dispatchOnInputSourceChanged) | | + + +## *exit [event](#head.Notifications)* + + + +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.exitCode | uint32_t | - | + +### Examples + +```json +{ + "jsonrpc": 2.0, + "id": 6, + "method": "org.rdk.HomeKitTV.exit", + "params": { + "exitCode": 0 + } +} +``` + + +## *stateChange [event](#head.Notifications)* + + + +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.state | IHomeKitTV::state | - | + +### Examples + +```json +{ + "jsonrpc": 2.0, + "id": 7, + "method": "org.rdk.HomeKitTV.stateChange", + "params": { + "state": "" + } +} +``` + + +## *dispatchAirplayErrorEvent [event](#head.Notifications)* + + + +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.params | string | - | + +### Examples + +```json +{ + "jsonrpc": 2.0, + "id": 8, + "method": "org.rdk.HomeKitTV.dispatchAirplayErrorEvent", + "params": { + "params": "" + } +} +``` + + +## *dispatchOnAppStateChangeRequest [event](#head.Notifications)* + + + +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.params | string | - | + +### Examples + +```json +{ + "jsonrpc": 2.0, + "id": 9, + "method": "org.rdk.HomeKitTV.dispatchOnAppStateChangeRequest", + "params": { + "params": "" + } +} +``` + + +## *dispatchOnConnectionStatusChanged [event](#head.Notifications)* + + + +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.params | string | - | + +### Examples + +```json +{ + "jsonrpc": 2.0, + "id": 10, + "method": "org.rdk.HomeKitTV.dispatchOnConnectionStatusChanged", + "params": { + "params": "" + } +} +``` + + +## *dispatchOnEnabledStatusChanged [event](#head.Notifications)* + + + +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.params | string | - | + +### Examples + +```json +{ + "jsonrpc": 2.0, + "id": 11, + "method": "org.rdk.HomeKitTV.dispatchOnEnabledStatusChanged", + "params": { + "params": "" + } +} +``` + + +## *dispatchOnInputSourceChanged [event](#head.Notifications)* + + + +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.params | string | - | + +### Examples + +```json +{ + "jsonrpc": 2.0, + "id": 12, + "method": "org.rdk.HomeKitTV.dispatchOnInputSourceChanged", + "params": { + "params": "" + } +} +``` diff --git a/docs/apis/LEDControlPlugin.md b/docs/apis/LEDControlPlugin.md index e0f03cf9..86e256f0 100644 --- a/docs/apis/LEDControlPlugin.md +++ b/docs/apis/LEDControlPlugin.md @@ -1,193 +1,183 @@ - + # LEDControl Plugin -**Version: [1.0.0]()** +**Version: [1.0.0](https://github.com/rdkcentral/rdkservices/blob/main/LEDControl/CHANGELOG.md)** -A org.rdk.LEDControl plugin for Thunder framework. +A LEDControl plugin for Thunder framework. ### Table of Contents -- [Abbreviation, Acronyms and Terms](#Abbreviation,_Acronyms_and_Terms) -- [Description](#Description) -- [Configuration](#Configuration) -- [Methods](#Methods) +- [Abbreviation, Acronyms and Terms](#head.Abbreviation,_Acronyms_and_Terms) +- [Description](#head.Description) +- [Configuration](#head.Configuration) +- [Methods](#head.Methods) - + # Abbreviation, Acronyms and Terms -[[Refer to this link](overview/aat.md)] +[[Refer to this link](userguide/aat.md)] - + # Description -The `LEDControl` plugin allows you to control brightness and power state for LEDs on a device. +The `LEDControl` plugin provides an interface for LEDControl. -The plugin is designed to be loaded and executed within the Thunder framework. For more information about the framework refer to [[Thunder](#Thunder)]. +The plugin is designed to be loaded and executed within the Thunder framework. For more information about the framework refer to [[Thunder](#ref.Thunder)]. - + # Configuration The table below lists configuration options of the plugin. | Name | Type | Description | | :-------- | :-------- | :-------- | -| callsign | string | Plugin instance name (default: *org.rdk.LEDControl*) | -| classname | string | Class name: *org.rdk.LEDControl* | +| callsign | string | Plugin instance name (default: org.rdk.LEDControl) | +| classname | string | Class name: *LEDControl* | | locator | string | Library name: *libWPEFrameworkLEDControl.so* | | autostart | boolean | Determines if the plugin shall be started automatically along with the framework | - + # Methods -The following methods are provided by the org.rdk.LEDControl plugin: +The following methods are provided by the LEDControl plugin: LEDControl interface methods: | Method | Description | | :-------- | :-------- | -| [getSupportedLEDStates](#getSupportedLEDStates) | Returns all the LED states supported by the platform | -| [getLEDState](#getLEDState) | Returns current LED state | -| [setLEDState](#setLEDState) | Change the device LED state to one mentioned in the input argument | +| [getLEDState](#method.getLEDState) | Returns current LED state. | +| [getSupportedLEDStates](#method.getSupportedLEDStates) | Returns all the LED states supported by the platform | +| [setLEDState](#method.setLEDState) | Change the device LED state to one mentioned in the input argument. | + +## *getLEDState [method](#head.Methods)* - -## *getSupportedLEDStates* - -Returns all the LED states supported by the platform. +Returns current LED state. ### Events - -No Events - +No events are associated with this method. ### Parameters - This method takes no parameters. - -### Result - +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | object | | -| result.supportedLEDStates | array | Returns all the LED states available on the platform | -| result.supportedLEDStates[#] | string | | -| result.success | boolean | Whether the request succeeded | +| result.ledState | LEDControlState | - | +| result.ledState.state | string | - | + +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "org.rdk.LEDControl.getSupportedLEDStates" + "jsonrpc": 2.0, + "id": 0, + "method": "org.rdk.LEDControl.getLEDState" } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 0, "result": { - "supportedLEDStates": [ - "`ACTIVE`, `STANDBY`, `WPS_CONNECTING`, `WPS_CONNECTED`, `WPS_ERROR`, `FACTORY_RESET', 'USB_UPGRADE', 'DOWNLOAD_ERROR'" - ], - "success": true + "state": "" } } ``` - -## *getLEDState* + +## *getSupportedLEDStates [method](#head.Methods)* -Returns current LED state. +Returns all the LED states supported by the platform ### Events - -No Events - +No events are associated with this method. ### Parameters - This method takes no parameters. - -### Result - +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | object | | -| result.state | string | Indicates a platform supported LED state | +| result.supportedLEDStates | IStringIterator | - out - string [] of supported LED states | +| result.supportedLEDStates[#] | string | - | +| result.success | bool | - out - boolean | + +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "org.rdk.LEDControl.getLEDState" + "jsonrpc": 2.0, + "id": 1, + "method": "org.rdk.LEDControl.getSupportedLEDStates" } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 1, "result": { - "state": "ACTIVE" + "supportedLEDStates": [ + "" + ], + "success": true } } ``` - -## *setLEDState* + +## *setLEDState [method](#head.Methods)* Change the device LED state to one mentioned in the input argument. ### Events - -No Events - +No events are associated with this method. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.state | string | Indicates a platform supported LED state | - -### Result - +| params.state | string | - in - string | +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | boolean | Whether the request succeeded | +| result.success | bool | - out - boolean | + +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 2, "method": "org.rdk.LEDControl.setLEDState", "params": { - "state": "ACTIVE" + "state": "" } } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 2, "result": true } ``` + diff --git a/docs/apis/LISAPlugin.md b/docs/apis/LISAPlugin.md new file mode 100644 index 00000000..84e07c77 --- /dev/null +++ b/docs/apis/LISAPlugin.md @@ -0,0 +1,1681 @@ + + +# LISA Plugin + +**Version: [1.0.0](https://github.com/rdkcentral/rdkservices/blob/main/LISA/CHANGELOG.md)** + +A LISA plugin for Thunder framework. + +### Table of Contents + +- [Abbreviation, Acronyms and Terms](#head.Abbreviation,_Acronyms_and_Terms) +- [Description](#head.Description) +- [Configuration](#head.Configuration) +- [Methods](#head.Methods) +- [Notifications](#head.Notifications) + + +# Abbreviation, Acronyms and Terms + +[[Refer to this link](userguide/aat.md)] + + +# Description + +The `LISA` plugin provides an interface for LISA. + +The plugin is designed to be loaded and executed within the Thunder framework. For more information about the framework refer to [[Thunder](#ref.Thunder)]. + + +# Configuration + +The table below lists configuration options of the plugin. + +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| callsign | string | Plugin instance name (default: org.rdk.LISA) | +| classname | string | Class name: *LISA* | +| locator | string | Library name: *libWPEFrameworkLISA.so* | +| autostart | boolean | Determines if the plugin shall be started automatically along with the framework | + + +# Methods + +The following methods are provided by the LISA plugin: + +LISA interface methods: + +| Method | Description | +| :-------- | :-------- | +| [appName](#method.appName) | | +| [apps](#method.apps) | | +| [auxMetadata](#method.auxMetadata) | | +| [cancel](#method.cancel) | Cancel asynchronous request. | +| [category](#method.category) | | +| [clearAuxMetadata](#method.clearAuxMetadata) | Clears an arbitrary metadata. | +| [configure](#method.configure) | | +| [current](#method.current) | | +| [download](#method.download) | Download arbitrary application's resource file. | +| [getList](#method.getList) | List installed applications. | +| [getLockInfo](#method.getLockInfo) | Get lock info. | +| [getMetadata](#method.getMetadata) | Get application metadata. | +| [getProgress](#method.getProgress) | Estimated progress of a request. | +| [getStorageDetails](#method.getStorageDetails) | Information on the storage usage. | +| [handle](#method.handle) | | +| [id](#method.id) | | +| [install](#method.install) | Download the application bundle. | +| [installed](#method.installed) | | +| [isValid](#method.isValid) | | +| [key](#method.key) | | +| [lock](#method.lock) | Lock the application. Preventing uninstallation. | +| [next](#method.next) | | +| [owner](#method.owner) | | +| [path](#method.path) | | +| [persistent](#method.persistent) | | +| [quotaKB](#method.quotaKB) | | +| [reason](#method.reason) | | +| [reset](#method.reset) | | +| [resources](#method.resources) | | +| [setAuxMetadata](#method.setAuxMetadata) | Set an arbitrary metadata. | +| [type](#method.type) | | +| [uninstall](#method.uninstall) | Uninstall the application. | +| [unlock](#method.unlock) | Unlock application. | +| [url](#method.url) | | +| [usedKB](#method.usedKB) | | +| [value](#method.value) | | +| [version](#method.version) | | + + +## *appName [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result.appName | string | - | + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 0, + "method": "org.rdk.LISA.appName" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 0, + "result": "" +} +``` + + +## *apps [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result.apps | ILISA::IApp::IIterator | - | + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 1, + "method": "org.rdk.LISA.apps" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 1, + "result": "" +} +``` + + +## *auxMetadata [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result.auxMetadata | ILISA::IKeyValueIterator | - | + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 2, + "method": "org.rdk.LISA.auxMetadata" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 2, + "result": "" +} +``` + + +## *cancel [method](#head.Methods)* + +Cancel asynchronous request. + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.handle | std::string | - | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 3, + "method": "org.rdk.LISA.cancel", + "params": { + "handle": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 3, + "result": null +} +``` + + +## *category [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result.category | string | - | + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 4, + "method": "org.rdk.LISA.category" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 4, + "result": "" +} +``` + + +## *clearAuxMetadata [method](#head.Methods)* + +Clears an arbitrary metadata. + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.type | std::string | - | +| params.id | std::string | - | +| params.version | std::string | - | +| params.key | std::string | - | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 5, + "method": "org.rdk.LISA.clearAuxMetadata", + "params": { + "type": "", + "id": "", + "version": "", + "key": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 5, + "result": null +} +``` + + +## *configure [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.config | std::string | - | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 6, + "method": "org.rdk.LISA.configure", + "params": { + "config": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 6, + "result": null +} +``` + + +## *current [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result.app | ILISA::IApp | - | + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 7, + "method": "org.rdk.LISA.current" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 7, + "result": "" +} +``` + + +## *download [method](#head.Methods)* + +Download arbitrary application's resource file. + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.type | std::string | - | +| params.id | std::string | - | +| params.version | std::string | - | +| params.resKey | std::string | - | +| params.url | std::string | - | +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result.handle | std::string | - | + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 8, + "method": "org.rdk.LISA.download", + "params": { + "type": "", + "id": "", + "version": "", + "resKey": "", + "url": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 8, + "result": "" +} +``` + + +## *getList [method](#head.Methods)* + +List installed applications. + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.type | std::string | - | +| params.id | std::string | - | +| params.version | std::string | - | +| params.appName | std::string | - | +| params.category | std::string | - | +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result.result | IAppsPayload | - | + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 9, + "method": "org.rdk.LISA.getList", + "params": { + "type": "", + "id": "", + "version": "", + "appName": "", + "category": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 9, + "result": "" +} +``` + + +## *getLockInfo [method](#head.Methods)* + +Get lock info. + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.type | std::string | - | +| params.id | std::string | - | +| params.version | std::string | - | +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result.result | ILISA::ILockInfo | - | + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 10, + "method": "org.rdk.LISA.getLockInfo", + "params": { + "type": "", + "id": "", + "version": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 10, + "result": "" +} +``` + + +## *getMetadata [method](#head.Methods)* + +Get application metadata. + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.type | std::string | - | +| params.id | std::string | - | +| params.version | std::string | - | +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result.result | ILISA::IMetadataPayload | - | + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 11, + "method": "org.rdk.LISA.getMetadata", + "params": { + "type": "", + "id": "", + "version": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 11, + "result": "" +} +``` + + +## *getProgress [method](#head.Methods)* + +Estimated progress of a request. + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.handle | std::string | - | +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result.progress | uint32_t | - | + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 12, + "method": "org.rdk.LISA.getProgress", + "params": { + "handle": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 12, + "result": 0 +} +``` + + +## *getStorageDetails [method](#head.Methods)* + +Information on the storage usage. + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.type | std::string | - | +| params.id | std::string | - | +| params.version | std::string | - | +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result.result | ILISA::IStoragePayload | - | + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 13, + "method": "org.rdk.LISA.getStorageDetails", + "params": { + "type": "", + "id": "", + "version": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 13, + "result": "" +} +``` + + +## *handle [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result.handle | std::string | - | + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 14, + "method": "org.rdk.LISA.handle" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 14, + "result": "" +} +``` + + +## *id [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result.id | string | - | + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 15, + "method": "org.rdk.LISA.id" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 15, + "result": "" +} +``` + + +## *install [method](#head.Methods)* + +Download the application bundle. + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.type | std::string | - | +| params.id | std::string | - | +| params.version | std::string | - | +| params.url | std::string | - | +| params.appName | std::string | - | +| params.category | std::string | - | +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result.handle | std::string | - | + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 16, + "method": "org.rdk.LISA.install", + "params": { + "type": "", + "id": "", + "version": "", + "url": "", + "appName": "", + "category": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 16, + "result": "" +} +``` + + +## *installed [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result.versions | ILISA::IAppVersion::IIterator | - | + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 17, + "method": "org.rdk.LISA.installed" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 17, + "result": "" +} +``` + + +## *isValid [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result.isValid | bool | - | + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 18, + "method": "org.rdk.LISA.isValid" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 18, + "result": true +} +``` + + +## *key [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result.key | string | - | + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 19, + "method": "org.rdk.LISA.key" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 19, + "result": "" +} +``` + + +## *lock [method](#head.Methods)* + +Lock the application. Preventing uninstallation. + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.type | std::string | - | +| params.id | std::string | - | +| params.version | std::string | - | +| params.reason | std::string | - | +| params.owner | std::string | - | +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result.result | ILISA::IHandleResult | - | + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 20, + "method": "org.rdk.LISA.lock", + "params": { + "type": "", + "id": "", + "version": "", + "reason": "", + "owner": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 20, + "result": "" +} +``` + + +## *next [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result.hasNext | bool | - | + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 21, + "method": "org.rdk.LISA.next" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 21, + "result": true +} +``` + + +## *owner [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result.owner | std::string | - | + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 22, + "method": "org.rdk.LISA.owner" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 22, + "result": "" +} +``` + + +## *path [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result.path | string | - | + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 23, + "method": "org.rdk.LISA.path" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 23, + "result": "" +} +``` + + +## *persistent [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result.storage | ILISA::IStorage | - | + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 24, + "method": "org.rdk.LISA.persistent" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 24, + "result": "" +} +``` + + +## *quotaKB [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result.quotaKB | string | - | + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 25, + "method": "org.rdk.LISA.quotaKB" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 25, + "result": "" +} +``` + + +## *reason [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result.reason | std::string | - | + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 26, + "method": "org.rdk.LISA.reason" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 26, + "result": "" +} +``` + + +## *reset [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 27, + "method": "org.rdk.LISA.reset" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 27, + "result": null +} +``` + + +## *resources [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result.resources | ILISA::IKeyValueIterator | - | + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 28, + "method": "org.rdk.LISA.resources" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 28, + "result": "" +} +``` + + +## *setAuxMetadata [method](#head.Methods)* + +Set an arbitrary metadata. + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.type | std::string | - | +| params.id | std::string | - | +| params.version | std::string | - | +| params.key | std::string | - | +| params.value | std::string | - | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 29, + "method": "org.rdk.LISA.setAuxMetadata", + "params": { + "type": "", + "id": "", + "version": "", + "key": "", + "value": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 29, + "result": null +} +``` + + +## *type [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result.type | string | - | + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 30, + "method": "org.rdk.LISA.type" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 30, + "result": "" +} +``` + + +## *uninstall [method](#head.Methods)* + +Uninstall the application. + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.type | std::string | - | +| params.id | std::string | - | +| params.version | std::string | - | +| params.uninstallType | std::string | - | +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result.handle | std::string | - | + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 31, + "method": "org.rdk.LISA.uninstall", + "params": { + "type": "", + "id": "", + "version": "", + "uninstallType": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 31, + "result": "" +} +``` + + +## *unlock [method](#head.Methods)* + +Unlock application. + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.handle | std::string | - | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 32, + "method": "org.rdk.LISA.unlock", + "params": { + "handle": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 32, + "result": null +} +``` + + +## *url [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result.url | string | - | + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 33, + "method": "org.rdk.LISA.url" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 33, + "result": "" +} +``` + + +## *usedKB [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result.usedKB | string | - | + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 34, + "method": "org.rdk.LISA.usedKB" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 34, + "result": "" +} +``` + + +## *value [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result.value | string | - | + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 35, + "method": "org.rdk.LISA.value" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 35, + "result": "" +} +``` + + +## *version [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result.version | string | - | + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 36, + "method": "org.rdk.LISA.version" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 36, + "result": "" +} +``` + + + + +# Notifications + +Notifications are autonomous events, triggered by the internals of the implementation, and broadcasted via JSON-RPC to all registered observers. Refer to [[Thunder](#ref.Thunder)] for information on how to register for a notification. + +The following events are provided by the LISA plugin: + +LISA interface events: + +| Event | Description | +| :-------- | :-------- | +| [operationStatus](#event.operationStatus) | Completion of asynchronous operation. | + + +## *operationStatus [event](#head.Notifications)* + +Completion of asynchronous operation. + +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.handle | string | - | +| params.operation | string | - | +| params.type | string | - | +| params.id | string | - | +| params.version | string | - | +| params.status | string | - | +| params.details | string | - | + +### Examples + +```json +{ + "jsonrpc": 2.0, + "id": 37, + "method": "org.rdk.LISA.operationStatus", + "params": { + "handle": "", + "operation": "", + "type": "", + "id": "", + "version": "", + "status": "", + "details": "" + } +} +``` diff --git a/docs/apis/LifecycleManagerPlugin.md b/docs/apis/LifecycleManagerPlugin.md new file mode 100644 index 00000000..8089e9be --- /dev/null +++ b/docs/apis/LifecycleManagerPlugin.md @@ -0,0 +1,39 @@ + + +# LifecycleManager Plugin + +**Version: [1.0.0](https://github.com/rdkcentral/rdkservices/blob/main/LifecycleManager/CHANGELOG.md)** + +A LifecycleManager plugin for Thunder framework. + +### Table of Contents + +- [Abbreviation, Acronyms and Terms](#head.Abbreviation,_Acronyms_and_Terms) +- [Description](#head.Description) +- [Configuration](#head.Configuration) + + +# Abbreviation, Acronyms and Terms + +[[Refer to this link](userguide/aat.md)] + + +# Description + +The `LifecycleManager` plugin provides an interface for LifecycleManager. + +The plugin is designed to be loaded and executed within the Thunder framework. For more information about the framework refer to [[Thunder](#ref.Thunder)]. + + +# Configuration + +The table below lists configuration options of the plugin. + +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| callsign | string | Plugin instance name (default: org.rdk.LifecycleManager) | +| classname | string | Class name: *LifecycleManager* | +| locator | string | Library name: *libWPEFrameworkLifecycleManager.so* | +| autostart | boolean | Determines if the plugin shall be started automatically along with the framework | + + diff --git a/docs/apis/LifecycleManagerStatePlugin.md b/docs/apis/LifecycleManagerStatePlugin.md new file mode 100644 index 00000000..a03a14b0 --- /dev/null +++ b/docs/apis/LifecycleManagerStatePlugin.md @@ -0,0 +1,231 @@ + + +# LifecycleManagerState Plugin + +**Version: [1.0.0](https://github.com/rdkcentral/rdkservices/blob/main/LifecycleManagerState/CHANGELOG.md)** + +A LifecycleManagerState plugin for Thunder framework. + +### Table of Contents + +- [Abbreviation, Acronyms and Terms](#head.Abbreviation,_Acronyms_and_Terms) +- [Description](#head.Description) +- [Configuration](#head.Configuration) +- [Methods](#head.Methods) +- [Notifications](#head.Notifications) + + +# Abbreviation, Acronyms and Terms + +[[Refer to this link](userguide/aat.md)] + + +# Description + +The `LifecycleManagerState` plugin provides an interface for LifecycleManagerState. + +The plugin is designed to be loaded and executed within the Thunder framework. For more information about the framework refer to [[Thunder](#ref.Thunder)]. + + +# Configuration + +The table below lists configuration options of the plugin. + +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| callsign | string | Plugin instance name (default: org.rdk.LifecycleManagerState) | +| classname | string | Class name: *LifecycleManagerState* | +| locator | string | Library name: *libWPEFrameworkLifecycleManagerState.so* | +| autostart | boolean | Determines if the plugin shall be started automatically along with the framework | + + +# Methods + +The following methods are provided by the LifecycleManagerState plugin: + +LifecycleManagerState interface methods: + +| Method | Description | +| :-------- | :-------- | +| [appReady](#method.appReady) | Response api call to appInitializing API | +| [closeApp](#method.closeApp) | close the app | +| [stateChangeComplete](#method.stateChangeComplete) | Response api call to appLifecycleStateChanged API | + + +## *appReady [method](#head.Methods)* + +Response api call to appInitializing API + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.appId | string | App identifier for the application. | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 0, + "method": "org.rdk.LifecycleManagerState.appReady", + "params": { + "appId": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 0, + "result": null +} +``` + + +## *closeApp [method](#head.Methods)* + +close the app + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.appId | string | App identifier for the application. | +| params.closeReason | AppCloseReason | closed reason for application | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 1, + "method": "org.rdk.LifecycleManagerState.closeApp", + "params": { + "appId": "", + "closeReason": "USER_EXIT" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 1, + "result": null +} +``` + + +## *stateChangeComplete [method](#head.Methods)* + +Response api call to appLifecycleStateChanged API + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.appId | string | App identifier for the application. | +| params.stateChangedId | uint32_t | state changed identifier | +| params.success | bool | - | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 2, + "method": "org.rdk.LifecycleManagerState.stateChangeComplete", + "params": { + "appId": "", + "stateChangedId": 0, + "success": true + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 2, + "result": null +} +``` + + + + +# Notifications + +Notifications are autonomous events, triggered by the internals of the implementation, and broadcasted via JSON-RPC to all registered observers. Refer to [[Thunder](#ref.Thunder)] for information on how to register for a notification. + +The following events are provided by the LifecycleManagerState plugin: + +LifecycleManagerState interface events: + +| Event | Description | +| :-------- | :-------- | +| [onAppLifecycleStateChanged](#event.onAppLifecycleStateChanged) | Notifies the new state | + + +## *onAppLifecycleStateChanged [event](#head.Notifications)* + +Notifies the new state + +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.appId | string | App identifier for the application. | +| params.appInstanceId | string | A numerical identifier for a specific instance of the application. | +| params.oldState | ILifecycleManager::LifecycleState | The previous state of the application instance before the update. | +| params.newState | ILifecycleManager::LifecycleState | The new state to transition the application. | +| params.navigationIntent | string | navigation intent during active state | + +### Examples + +```json +{ + "jsonrpc": 2.0, + "id": 3, + "method": "org.rdk.LifecycleManagerState.onAppLifecycleStateChanged", + "params": { + "appId": "", + "appInstanceId": "", + "oldState": "", + "newState": "", + "navigationIntent": "" + } +} +``` diff --git a/docs/apis/MemoryPlugin.md b/docs/apis/MemoryPlugin.md new file mode 100644 index 00000000..352d6060 --- /dev/null +++ b/docs/apis/MemoryPlugin.md @@ -0,0 +1,359 @@ + + +# Memory Plugin + +**Version: [1.0.0](https://github.com/rdkcentral/rdkservices/blob/main/Memory/CHANGELOG.md)** + +A Memory plugin for Thunder framework. + +### Table of Contents + +- [Abbreviation, Acronyms and Terms](#head.Abbreviation,_Acronyms_and_Terms) +- [Description](#head.Description) +- [Configuration](#head.Configuration) +- [Methods](#head.Methods) + + +# Abbreviation, Acronyms and Terms + +[[Refer to this link](userguide/aat.md)] + + +# Description + +The `Memory` plugin provides an interface for Memory. + +The plugin is designed to be loaded and executed within the Thunder framework. For more information about the framework refer to [[Thunder](#ref.Thunder)]. + + +# Configuration + +The table below lists configuration options of the plugin. + +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| callsign | string | Plugin instance name (default: org.rdk.Memory) | +| classname | string | Class name: *Memory* | +| locator | string | Library name: *libWPEFrameworkMemory.so* | +| autostart | boolean | Determines if the plugin shall be started automatically along with the framework | + + +# Methods + +The following methods are provided by the Memory plugin: + +Memory interface methods: + +| Method | Description | +| :-------- | :-------- | +| [allocated](#method.allocated) | | +| [identifier](#method.identifier) | | +| [isOperational](#method.isOperational) | | +| [name](#method.name) | | +| [process](#method.process) | | +| [processes](#method.processes) | | +| [resident](#method.resident) | | +| [shared](#method.shared) | | + + +## *allocated [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 0, + "method": "org.rdk.Memory.allocated" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 0, + "result": null +} +``` + + +## *identifier [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 1, + "method": "org.rdk.Memory.identifier" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 1, + "result": null +} +``` + + +## *isOperational [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 2, + "method": "org.rdk.Memory.isOperational" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 2, + "result": null +} +``` + + +## *name [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 3, + "method": "org.rdk.Memory.name" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 3, + "result": null +} +``` + + +## *process [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.processname | string | - | +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result.process | IProcessMemory | - | + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 4, + "method": "org.rdk.Memory.process", + "params": { + "processname": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 4, + "result": "" +} +``` + + +## *processes [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result.processnames | IStringIterator | - | +| result.processnames[#] | string | - | + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 5, + "method": "org.rdk.Memory.processes" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 5, + "result": [ + "" + ] +} +``` + + +## *resident [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 6, + "method": "org.rdk.Memory.resident" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 6, + "result": null +} +``` + + +## *shared [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 7, + "method": "org.rdk.Memory.shared" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 7, + "result": null +} +``` + + diff --git a/docs/apis/MessageControlPlugin.md b/docs/apis/MessageControlPlugin.md new file mode 100644 index 00000000..5c2a782b --- /dev/null +++ b/docs/apis/MessageControlPlugin.md @@ -0,0 +1,158 @@ + + +# MessageControl Plugin + +**Version: [1.0.0](https://github.com/rdkcentral/rdkservices/blob/main/MessageControl/CHANGELOG.md)** + +A MessageControl plugin for Thunder framework. + +### Table of Contents + +- [Abbreviation, Acronyms and Terms](#head.Abbreviation,_Acronyms_and_Terms) +- [Description](#head.Description) +- [Configuration](#head.Configuration) +- [Methods](#head.Methods) +- [Properties](#head.Properties) + + +# Abbreviation, Acronyms and Terms + +[[Refer to this link](userguide/aat.md)] + + +# Description + +The `MessageControl` plugin provides an interface for MessageControl. + +The plugin is designed to be loaded and executed within the Thunder framework. For more information about the framework refer to [[Thunder](#ref.Thunder)]. + + +# Configuration + +The table below lists configuration options of the plugin. + +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| callsign | string | Plugin instance name (default: org.rdk.MessageControl) | +| classname | string | Class name: *MessageControl* | +| locator | string | Library name: *libWPEFrameworkMessageControl.so* | +| autostart | boolean | Determines if the plugin shall be started automatically along with the framework | + + +# Methods + +The following methods are provided by the MessageControl plugin: + +MessageControl interface methods: + +| Method | Description | +| :-------- | :-------- | +| [enable](#method.enable) | Enables/disables a message control | + + +## *enable [method](#head.Methods)* + +Enables/disables a message control + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.type | messagetype | Type of message | +| params.category | string | Name of the message category (e.g. Information) | +| params.module | string | Name of the module the message is originating from (e.g. Plugin_BluetoothControl) | +| params.enabled | bool | Denotes if the control is enabled (true) or disabled (false) | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 0, + "method": "org.rdk.MessageControl.enable", + "params": { + "type": "TRACING", + "category": "", + "module": "", + "enabled": true + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 0, + "result": null +} +``` + + + +# Properties +The following properties are provided by the MessageControl plugin: + +MessageControl interface properties: + +| Method | Description | +| :-------- | :-------- | +| [Controls](#property.Controls)RO | Retrieves a list of current message controls | + + +## *Controls [property](#head.Properties)* + +Retrieves a list of current message controls + +> This property is read-only. +### Events +No events are associated with this method. +### Values +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| (property).control | IControlIterator | | +| (property).control[#].type | messagetype | Type of message | +| (property).control[#].category | string | Name of the message category (e.g. Information) | +| (property).control[#].module | string | Name of the module the message is originating from (e.g. Plugin_BluetoothControl) | +| (property).control[#].enabled | bool | Denotes if the control is enabled (true) or disabled (false) | + +### Examples + + +#### Get Request + +```json +{ + "jsonrpc": 2.0, + "id": 1, + "method": "org.rdk.MessageControl.controls" +} +``` + + +#### Get Response + +```json +{ + "jsonrpc": 2.0, + "id": 1, + "result": [ + { + "type": "TRACING", + "category": "", + "module": "", + "enabled": true + } + ] +} +``` + diff --git a/docs/apis/MiracastPlayerPlugin.md b/docs/apis/MiracastPlayerPlugin.md index f0fd8383..c074e642 100644 --- a/docs/apis/MiracastPlayerPlugin.md +++ b/docs/apis/MiracastPlayerPlugin.md @@ -1,593 +1,478 @@ - + # MiracastPlayer Plugin -**Version: [1.0.0]()** +**Version: [1.0.0](https://github.com/rdkcentral/rdkservices/blob/main/MiracastPlayer/CHANGELOG.md)** -A org.rdk.MiracastPlayer plugin for Thunder framework. +A MiracastPlayer 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](#head.Abbreviation,_Acronyms_and_Terms) +- [Description](#head.Description) +- [Configuration](#head.Configuration) +- [Methods](#head.Methods) +- [Notifications](#head.Notifications) - + # Abbreviation, Acronyms and Terms -[[Refer to this link](overview/aat.md)] +[[Refer to this link](userguide/aat.md)] - + # Description -The `MiracastPlayer` plugin will do RTSP message exchange for Source and Sink Device capabilities and Session Management. Afterwards, it will start streaming for screen mirroring. +The `MiracastPlayer` plugin provides an interface for MiracastPlayer. -The plugin is designed to be loaded and executed within the Thunder framework. For more information about the framework refer to [[Thunder](#Thunder)]. +The plugin is designed to be loaded and executed within the Thunder framework. For more information about the framework refer to [[Thunder](#ref.Thunder)]. - + # Configuration The table below lists configuration options of the plugin. | Name | Type | Description | | :-------- | :-------- | :-------- | -| callsign | string | Plugin instance name (default: *org.rdk.MiracastPlayer*) | -| classname | string | Class name: *org.rdk.MiracastPlayer* | +| callsign | string | Plugin instance name (default: org.rdk.MiracastPlayer) | +| classname | string | Class name: *MiracastPlayer* | | locator | string | Library name: *libWPEFrameworkMiracastPlayer.so* | | autostart | boolean | Determines if the plugin shall be started automatically along with the framework | - + # Methods -The following methods are provided by the org.rdk.MiracastPlayer plugin: +The following methods are provided by the MiracastPlayer plugin: MiracastPlayer interface methods: | Method | Description | | :-------- | :-------- | -| [playRequest](#playRequest) | To set the Miracast Player State to Play after the Miracast session like RTSP communication and GStreamer Playback | -| [stopRequest](#stopRequest) | To stop the Miracast Player to tear down the RTSP communication, stop/close the GStreamer pipeline, clean up, and reset the player state | -| [setPlayerState](#setPlayerState) | To set the Miracast Player to STOP/PLAY/PAUSE | -| [setVideoRectangle](#setVideoRectangle) | Set the Video Rectangle | -| [setRTSPWaitTimeout](#setRTSPWaitTimeout) | Set the RTSP Socket Receive timeout for M1-M7 messages | -| [setLogging](#setLogging) | Enable/Disable/Reduce the Logging level for Miracast | -| [setVideoFormats](#setVideoFormats) | Set the Video formats for RTSP capability negotiation | -| [setAudioFormats](#setAudioFormats) | Set the Audio formats for RTSP capability negotiation | +| [playRequest](#method.playRequest) | To set the Miracast Player State to Play after the Miracast session like RTSP communication and GStreamer Playback | +| [setEnvArguments](#method.setEnvArguments) | To configure the environment arguments for the Miracast Player | +| [setVideoRectangle](#method.setVideoRectangle) | Set the Video Rectangle. | +| [setWesterosEnvironment](#method.setWesterosEnvironment) | To configure the westeros environment arguments for the Miracast Player. This will be deprecated and SetEnvArguments will be used instead. | +| [stopRequest](#method.stopRequest) | To stop the Miracast Player to tear down the RTSP communication, stop/close the GStreamer pipeline, clean up, and reset the player state | +| [unsetEnvArguments](#method.unsetEnvArguments) | To reset the environment arguments for the Miracast Player | +| [unsetWesterosEnvironment](#method.unsetWesterosEnvironment) | To reset the westeros environment arguments for the Miracast Player. This will be deprecated and UnsetEnvArguments will be used instead. | + +## *playRequest [method](#head.Methods)* - -## *playRequest* - -To set the Miracast Player State to Play after the Miracast session like RTSP communication and GStreamer Playback. +To set the Miracast Player State to Play after the Miracast session like RTSP communication and GStreamer Playback ### Events - -No Events - +No events are associated with this method. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.device_parameters | object | Parameters about Source and Sink Device | -| params.device_parameters.source_dev_ip | string | Source Device IP address | -| params.device_parameters.source_dev_mac | string | Mac id of the source device | -| params.device_parameters.source_dev_name | string | Name of the source device | -| params.device_parameters.sink_dev_ip | string | IP address of the Local/Sink device | -| params.video_rectangle | object | Video streaming rectangle | -| params.video_rectangle.X | number | Start X of the Video rectangle | -| params.video_rectangle.Y | number | Start Y of the Video rectangle | -| params.video_rectangle.W | number | Width of the Video rectangle | -| params.video_rectangle.H | number | Height of the Video rectangle | - -### Result - +| params.device_parameters | DeviceParameters | Contains Source and Sink Device related properties | +| params.device_parameters.sourceDeviceIP | string | source_dev_ip */ /* @brief IP Address of Source Device | +| params.device_parameters.sourceDeviceMac | string | source_dev_mac */ /* @brief MAC Address of Source Device | +| params.device_parameters.sourceDeviceName | string | source_dev_name */ /* @brief Name of Source Device | +| params.device_parameters.sinkDeviceIP | string | sink_dev_ip */ /* @brief IP Address of Sink Device | +| params.video_rectangle | VideoRectangle | Video rectangle to be used for Miracast playback (x, y, width, height) | +| params.video_rectangle.startX | int | X */ /* @brief X coordinate of the rectangle | +| params.video_rectangle.startY | int | Y */ /* @brief Y coordinate of the rectangle | +| params.video_rectangle.width | int | W */ /* @brief Width of the rectangle | +| params.video_rectangle.height | int | H */ /* @brief Height of the rectangle | +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | object | | -| result.success | boolean | Whether the request succeeded | +| result.result | Result | - | +| result.result.message | string | message */ /* @brief reason for success or failure | +| result.result.success | bool | - | + +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 0, "method": "org.rdk.MiracastPlayer.playRequest", "params": { - "device_parameters": { - "source_dev_ip": "xx.xx.xx.xx", - "source_dev_mac": "XX:XX:XX:XX:XX:XX", - "source_dev_name": "Manufacturer WiFi-Direct Name", - "sink_dev_ip": "xx.xx.xx.xx" + "deviceParam": { + "sourceDeviceIP": "", + "sourceDeviceMac": "", + "sourceDeviceName": "", + "sinkDeviceIP": "" }, - "video_rectangle": { - "X": 0, - "Y": 0, - "W": 1920, - "H": 1080 + "videoRect": { + "startX": 0, + "startY": 0, + "width": 0, + "height": 0 } } } ``` -#### Response - -```json -{ - "jsonrpc": "2.0", - "id": 42, - "result": { - "success": true - } -} -``` - - -## *stopRequest* - -To stop the Miracast Player to tear down the RTSP communication, stop/close the GStreamer pipeline, clean up, and reset the player state. - -### Events - -No Events - -### Parameters - -| Name | Type | Description | -| :-------- | :-------- | :-------- | -| params | object | | -| params.mac | string | Mac id of the source device | -| params.name | string | Name of the source device | -| params.reason_code | number | player stop Reason codes (must be one of the following: *MIRACAST_PLAYER_APP_REQ_TO_STOP_ON_EXIT = 301*, *MIRACAST_PLAYER_APP_REQ_TO_STOP_ON_NEW_CONNECTION = 302*) | - -### Result - -| Name | Type | Description | -| :-------- | :-------- | :-------- | -| result | object | | -| result.success | boolean | Whether the request succeeded | - -### Example - -#### Request - -```json -{ - "jsonrpc": "2.0", - "id": 42, - "method": "org.rdk.MiracastPlayer.stopRequest", - "params": { - "mac": "XX:XX:XX:XX:XX:XX", - "name": "Manufacturer WiFi-Direct Name", - "reason_code": 301 - } -} -``` #### Response ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 0, "result": { + "message": "", "success": true } } ``` - -## *setPlayerState* + +## *setEnvArguments [method](#head.Methods)* -To set the Miracast Player to STOP/PLAY/PAUSE. +To configure the environment arguments for the Miracast Player ### Events - -No Events - +No events are associated with this method. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.state | string | Video streaming rectangle | - -### Result - +| params.envArgs | IEnvArgumentsIterator | environment arguments to be set | +| params.envArgs[#].argName | string | argName */ /* @brief environment argument name | +| params.envArgs[#].argValue | string | argValue */ /* @brief environment argument value | +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | object | | -| result.success | boolean | Whether the request succeeded | +| result.result | Result | - | +| result.result.message | string | message */ /* @brief reason for success or failure | +| result.result.success | bool | - | + +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "org.rdk.MiracastPlayer.setPlayerState", + "jsonrpc": 2.0, + "id": 1, + "method": "org.rdk.MiracastPlayer.setEnvArguments", "params": { - "state": "STOP|PLAY|PAUSE" + "envArgs": [ + { + "argName": "", + "argValue": "" + } + ] } } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 1, "result": { + "message": "", "success": true } } ``` - -## *setVideoRectangle* + +## *setVideoRectangle [method](#head.Methods)* Set the Video Rectangle. ### Events - -No Events - +No events are associated with this method. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.X | number | Start X of the Video rectangle | -| params.Y | number | Start Y of the Video rectangle | -| params.W | number | Width of the Video rectangle | -| params.H | number | Height of the Video rectangle | - -### Result - +| params.X | int | X */ /* @brief X coordinate of the rectangle | +| params.Y | int | Y */ /* @brief Y coordinate of the rectangle | +| params.W | int | W */ /* @brief Width of the rectangle | +| params.H | int | H */ /* @brief Height of the rectangle | +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | object | | -| result.success | boolean | Whether the request succeeded | +| result.result | Result | - | +| result.result.message | string | message */ /* @brief reason for success or failure | +| result.result.success | bool | - | + +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 2, "method": "org.rdk.MiracastPlayer.setVideoRectangle", "params": { - "X": 0, - "Y": 0, - "W": 1920, - "H": 1080 + "startX": 0, + "startY": 0, + "width": 0, + "height": 0 } } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 2, "result": { + "message": "", "success": true } } ``` - -## *setRTSPWaitTimeout* + +## *setWesterosEnvironment [method](#head.Methods)* -Set the RTSP Socket Receive timeout for M1-M7 messages. +To configure the westeros environment arguments for the Miracast Player. This will be deprecated and SetEnvArguments will be used instead. ### Events - -No Events - +No events are associated with this method. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.Request | number | Set RTSP Socket Receive timeout for WFD Sink RTSP request messages | -| params.Response | number | Set RTSP Socket Receive timeout for WFD Sink RTSP response messages | - -### Result - +| params.westerosArgs | IEnvArgumentsIterator | Westeros environment arguments to be set | +| params.westerosArgs[#].argName | string | argName */ /* @brief environment argument name | +| params.westerosArgs[#].argValue | string | argValue */ /* @brief environment argument value | +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | object | | -| result.success | boolean | Whether the request succeeded | +| result.result | Result | - | +| result.result.message | string | message */ /* @brief reason for success or failure | +| result.result.success | bool | - | + +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "org.rdk.MiracastPlayer.setRTSPWaitTimeout", + "jsonrpc": 2.0, + "id": 3, + "method": "org.rdk.MiracastPlayer.setWesterosEnvironment", "params": { - "Request": 6, - "Response": 5 + "westerosArgs": [ + { + "argName": "", + "argValue": "" + } + ] } } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 3, "result": { + "message": "", "success": true } } ``` - -## *setLogging* + +## *stopRequest [method](#head.Methods)* -Enable/Disable/Reduce the Logging level for Miracast. +To stop the Miracast Player to tear down the RTSP communication, stop/close the GStreamer pipeline, clean up, and reset the player state ### Events - -No Events - +No events are associated with this method. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.level | string | Set the log level for Miracast player plugin | -| params?.separate_logger | object | *(optional)* Route the Miracast player to a separate file if required | -| params?.separate_logger.logfilename | string | Name of a separate logging filename. Logfile will be created under /opt/logs/ | -| params?.separate_logger.status | string | Enable/Disable the separate logging | - -### Result - +| params.mac | string | MacAddress of the client device | +| params.name | string | Name of the client device | +| params.reason_code | int | Reason code for the player stop request | +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | object | | -| result.success | boolean | Whether the request succeeded | +| result.result | Result | - | +| result.result.message | string | message */ /* @brief reason for success or failure | +| result.result.success | bool | - | + +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "org.rdk.MiracastPlayer.setLogging", + "jsonrpc": 2.0, + "id": 4, + "method": "org.rdk.MiracastPlayer.stopRequest", "params": { - "level": "FATAL|ERROR|WARNING|INFO|VERBOSE|TRACE", - "separate_logger": { - "logfilename": "sample.log", - "status": "ENABLE|DISABLE" - } + "clientMac": "", + "clientName": "", + "reasonCode": 0 } } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 4, "result": { + "message": "", "success": true } } ``` - -## *setVideoFormats* + +## *unsetEnvArguments [method](#head.Methods)* -Set the Video formats for RTSP capability negotiation. +To reset the environment arguments for the Miracast Player ### Events - -No Events - +No events are associated with this method. ### Parameters - +This method takes no parameters. +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| params | object | | -| params.native | number | WFD Display Native Resolution Refresh Rate (must be one of the following: *RTSP_NATIVE_NO_RESOLUTION_SUPPORTED = 0x00*, *RTSP_NATIVE_CEA_RESOLUTION_SUPPORTED = 0x01*, *RTSP_NATIVE_VESA_RESOLUTION_SUPPORTED = 0x02*, *RTSP_NATIVE_HH_RESOLUTION_SUPPORTED = 0x04*) | -| params.display_mode_supported | boolean | WFD prefered display mode | -| params.h264_codecs | object | WFD Sink's h264_codecs information | -| params.h264_codecs.profile | number | This profile bitmap is also used by the wfd-video-formats parameter (must be one of the following: *WFD_NO_CONSTRAINED_PROFILE = 0x00*, *WFD_CONSTRAINED_BASELINE_PROFILE = 0x01*, *WFD_CONSTRAINED_HIGH_PROFILE = 0x02*, *WFD_BOTH_CONSTRAINED_PROFILES = 0x03*) | -| params.h264_codecs.level | number | The Levels bitmap indicates the maximum H.264 level supported for the corresponding H.264 profile indicated in the Profiles Bitmap. Only one bit in the Levels Bitmap used in a WFD subelement shall be set to one. This bitmap is also used in the WFD 3D Video Formats subelement. -This bitmap is also used by the wfd-video-formats parameter, the wfd-3d-formats parameter, and the wfd-preferred-display-mode parameter. In this case, the bitmap represents either: - the maximum level supported for the H.264 profile indicated in the Profiles Bitmap supported by the WFD Device in an RTSP M3 Response message (only one bit set to one) or - the level and the corresponding H.264 profile selected by the WFD Source in an RTSP M4 Request message (only one bit set to one). (must be one of the following: *WFD_H264_LEVEL_3p1 = 0x01*, *WFD_H264_LEVEL_3p2 = 0x02*, *WFD_H264_LEVEL_4 = 0x04*, *WFD_H264_LEVEL_4p1 = 0x08*, *WFD_H264_LEVEL_4p2 = 0x10*) | -| params.h264_codecs.cea_mask | number | The CEA Resolutions/Refresh rates bitmap represents the set of CEA resolutions and corresponding refresh rates that a WFD Device supports. This bitmap is also used by the wfd-video-formats parameter (must be one of the following: *WFD_NO_CEA_RESOLUTION_SUPPORTED = 0x00000000*, *WFD_CEA_RESOLUTION_640x480p60 = 0x00000001*, *WFD_CEA_RESOLUTION_720x480p60 = 0x00000002*, *WFD_CEA_RESOLUTION_720x480i60 = 0x00000004*, *WFD_CEA_RESOLUTION_720x576p50 = 0x00000008*, *WFD_CEA_RESOLUTION_720x576i50 = 0x00000010*, *WFD_CEA_RESOLUTION_1280x720p30 = 0x00000020*, *WFD_CEA_RESOLUTION_1280x720p60 = 0x00000040*, *WFD_CEA_RESOLUTION_1920x1080p30 = 0x00000080*, *WFD_CEA_RESOLUTION_1920x1080p60 = 0x00000100*, *WFD_CEA_RESOLUTION_1920x1080i60 = 0x00000200*, *WFD_CEA_RESOLUTION_1280x720p25 = 0x00000400*, *WFD_CEA_RESOLUTION_1280x720p50 = 0x00000800*, *WFD_CEA_RESOLUTION_1920x1080p25 = 0x00001000*, *WFD_CEA_RESOLUTION_1920x1080p50 = 0x00002000*, *WFD_CEA_RESOLUTION_1920x1080i50 = 0x00004000*, *WFD_CEA_RESOLUTION_1280x720p24 = 0x00008000*, *WFD_CEA_RESOLUTION_1920x1080p24 = 0x00010000*) | -| params.h264_codecs.vesa_mask | number | The VESA Resolutions/Refresh Rates bitmap represents the set of VESA resolutions and corresponding refresh rates that a WFD Device supports. This bitmap is also used by the wfd-video-formats parameter (must be one of the following: *WFD_NO_VESA_RESOLUTION_SUPPORTED = 0x00000000*, *WFD_VESA_RESOLUTION_800x600p30 = 0x00000001*, *WFD_VESA_RESOLUTION_800x600p60 = 0x00000002*, *WFD_VESA_RESOLUTION_1024x768p30 = 0x00000004*, *WFD_VESA_RESOLUTION_1024x768p60 = 0x00000008*, *WFD_VESA_RESOLUTION_1152x864p30 = 0x00000010*, *WFD_VESA_RESOLUTION_1152x864p60 = 0x00000020*, *WFD_VESA_RESOLUTION_1280x768p30 = 0x00000040*, *WFD_VESA_RESOLUTION_1280x768p60 = 0x00000080*, *WFD_VESA_RESOLUTION_1280x800p30 = 0x00000100*, *WFD_VESA_RESOLUTION_1280x800p60 = 0x00000200*, *WFD_VESA_RESOLUTION_1360x768p30 = 0x00000400*, *WFD_VESA_RESOLUTION_1360x768p60 = 0x00000800*, *WFD_VESA_RESOLUTION_1366x768p30 = 0x00001000*, *WFD_VESA_RESOLUTION_1366x768p60 = 0x00002000*, *WFD_VESA_RESOLUTION_1280x1024p30 = 0x00004000*, *WFD_VESA_RESOLUTION_1280x1024p60 = 0x00008000*, *WFD_VESA_RESOLUTION_1400x1050p30 = 0x00010000*, *WFD_VESA_RESOLUTION_1400x1050p60 = 0x00020000*, *WFD_VESA_RESOLUTION_1440x900p30 = 0x00040000*, *WFD_VESA_RESOLUTION_1440x900p60 = 0x00080000*, *WFD_VESA_RESOLUTION_1600x900p30 = 0x00100000*, *WFD_VESA_RESOLUTION_1600x900p60 = 0x00200000*, *WFD_VESA_RESOLUTION_1600x1200p30 = 0x00400000*, *WFD_VESA_RESOLUTION_1600x1200p60 = 0x00800000*, *WFD_VESA_RESOLUTION_1680x1024p30 = 0x01000000*, *WFD_VESA_RESOLUTION_1680x1024p60 = 0x02000000*, *WFD_VESA_RESOLUTION_1680x1050p30 = 0x04000000*, *WFD_VESA_RESOLUTION_1680x1050p60 = 0x08000000*, *WF_VESA_RESOLUTION_1920x1200p60 = 0x10000000*) | -| params.h264_codecs.hh_mask | number | The HH Resolutions/Refresh Rates bitmap represents the set of resolutions and corresponding refresh rates commonly supported in handheld devices that a WFD Device supports. This bitmap is also used by the wfd-video-formats parameter (must be one of the following: *WFD_NO_HH_RESOLUTION_SUPPORTED = 0x00000000*, *WFD_HH_RESOLUTION_800x480p60 = 0x00000001*, *WFD_HH_RESOLUTION_854x480p30 = 0x00000002*, *WFD_HH_RESOLUTION_854x480p60 = 0x00000004*, *WFD_HH_RESOLUTION_864x480p30 = 0x00000008*, *WFD_HH_RESOLUTION_864x480p60 = 0x00000010*, *WFD_HH_RESOLUTION_600x360p30 = 0x00000020*, *WFD_HH_RESOLUTION_600x360p60 = 0x00000040*, *WFD_HH_RESOLUTION_960x540p30 = 0x00000080*, *WFD_HH_RESOLUTION_960x540p60 = 0x00000100*, *WFD_HH_RESOLUTION_848x480p30 = 0x00000200*, *WFD_HH_RESOLUTION_848x480p60 = 0x00000400*) | -| params.h264_codecs?.latency | number | *(optional)* It specifies the latency of the video decoder at the Primary Sink as an integer multiple of 5 msec. This field shall be set to all zeros when transmitted by the WFD Source in a WFD Service Discovery Response frame. This field should be set to all zeros when transmitted by the WFD Source in an RTSP M4 Request message and the WFD Sink shall ignore this field upon reception. If the Primary Sink does not support this field, it shall set this field to all zeros. Otherwise, the WFD Sink shall set this field to a best-effort estimate of the worst-case time between the availability of source data at the input interface of the decoder, and the presentation of the corresponding decoded data at the input interface of the rendering device, rounded up to the next higher multiple of 5 msec | -| params.h264_codecs?.min_slice | number | *(optional)* It specifying the smallest slice size expressed in number of macroblocks. If this field is transmitted by the WFD Source, this value shall be the smallest encoded slice it can support. If this field is transmitted by the Primary Sink, this value shall be the smallest slice size it can decode. WFD devices that do not support slice encoding in which a picture is constructed by multiple slices shall set this field to 0x00 00 | -| params.h264_codecs?.slice_encode | number | *(optional)* Bitmap for the slice encoding in which a picture is constructed by multiple slices. -Bits [9:0] are named as Max Slice Num bits and used for the Maximum number of slices per picture, minus 1. -Bit [10:12] named as Max Slice Size Ratio bits and used for When this bitmap is used in a WFD subelement: Ratio of Maximum slice size to be used and Minimum slice size indicated in the minimum-slice-size field in WFD Video Formats or WFD 3D Video Formats subelement. When this bitmap is used in an RTSP message: Ratio of Maximum slice size to be used and Minimum slice size indicated in the minimum-slice-size field in wfd-video-formats or wfd-3d-formats. Rest of Bits are reserved | -| params.h264_codecs?.video_frame_skip_support | boolean | *(optional)* WFD Video Frame Skipping Support | -| params.h264_codecs?.max_skip_intervals | number | *(optional)* It indicates the maximum/allowable time-interval between two video frames after skipped as expressed equation as follows, except for 0b000. (value in decimal) x 0.5 second(s) -0b000 : No limitation -0b001~ 0b111 : parameter for indicating time-interval | -| params.h264_codecs?.video_frame_rate_change_support | boolean | *(optional)* WFD Video Framerate change Support | - -### Result +| result.result | Result | - | +| result.result.message | string | message */ /* @brief reason for success or failure | +| result.result.success | bool | - | -| Name | Type | Description | -| :-------- | :-------- | :-------- | -| result | object | | -| result.success | boolean | Whether the request succeeded | +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "org.rdk.MiracastPlayer.setVideoFormats", - "params": { - "native": 1, - "display_mode_supported": false, - "h264_codecs": { - "profile": "0x03", - "level": "0x08", - "cea_mask": "0x0001FFFF", - "vesa_mask": "0x00000000", - "hh_mask": "0x00000000", - "latency": 0, - "min_slice": 0, - "slice_encode": 0, - "video_frame_skip_support": false, - "max_skip_intervals": 0, - "video_frame_rate_change_support": false - } - } + "jsonrpc": 2.0, + "id": 5, + "method": "org.rdk.MiracastPlayer.unsetEnvArguments" } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 5, "result": { + "message": "", "success": true } } ``` - -## *setAudioFormats* + +## *unsetWesterosEnvironment [method](#head.Methods)* -Set the Audio formats for RTSP capability negotiation. +To reset the westeros environment arguments for the Miracast Player. This will be deprecated and UnsetEnvArguments will be used instead. ### Events - -No Events - +No events are associated with this method. ### Parameters - +This method takes no parameters. +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| params | object | | -| params?.audio_codecs | object | *(optional)* | -| params?.audio_codecs.audio_format | number | It specifies the type of the Audio decoder at the WFD Sink (must be one of the following: *WFD_LPCM_AUDIO_FORMAT = 0x00000001*, *WFD_AAC_AUDIO_FORMAT = 0x00000002*, *WFD_AC3_AUDIO_FORMAT = 0x00000003*) | -| params?.audio_codecs.modes | number | The LPCM/AAC/AC3 Modes bitmap represents configurations supported by the WFD Device. This bitmap is also used in the ‘modes’ field of wfd-audio-codecs. -If audio_format is WFD_LPCM_AUDIO_FORMAT, then use mode value from prefixed with WFD_LPCM_. Similarly use corresponding value for AAC and AC3 (must be one of the following: *WFD_LPCM_CH2_44p1kHz = 0x00000001*, *WFD_LPCM_CH2_48kHz = 0x00000002*, *WFD_AAC_CH2_48kHz = 0x00000001*, *WFD_AAC_CH4_48kHz = 0x00000002*, *WFD_AAC_CH6_48kHz = 0x00000004*, *WFD_AAC_CH8_48kHz = 0x00000008*, *WFD_AC3_CH2_48kHz = 0x00000001*, *WFD_AC3_CH4_48kHz = 0x00000002*, *WFD_AC3_CH6_48kHz = 0x00000004*) | -| params?.audio_codecs.latency | number | It specifies the latency of the Audio decoder at the WFD Sink as an integer multiple of 5 msec. This field shall be set to all zeros when transmitted by the WFD Source in a WFD Service Discovery Response frame. This field should be set to all zeros when transmitted by the WFD Source in an RTSP M4 Request message and the WFD Sink shall ignore this field upon reception. If the WFD Sink does not support this field, it shall set this field to all zeros. Otherwise, the WFD Sink shall set this field to a best-effort estimate of the worst-case time between the availability of source data at the input interface of the decoder, and the presentation of the corresponding decoded data at the input interface of the rendering device, rounded up to the next higher multiple of 5 msec | - -### Result +| result.result | Result | - | +| result.result.message | string | message */ /* @brief reason for success or failure | +| result.result.success | bool | - | -| Name | Type | Description | -| :-------- | :-------- | :-------- | -| result | object | | -| result.success | boolean | Whether the request succeeded | +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "org.rdk.MiracastPlayer.setAudioFormats", - "params": { - "audio_codecs": { - "audio_format": "0x00000002", - "modes": "0x00000001", - "latency": 0 - } - } + "jsonrpc": 2.0, + "id": 6, + "method": "org.rdk.MiracastPlayer.unsetWesterosEnvironment" } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 6, "result": { + "message": "", "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](#Thunder)] for information on how to register for a notification. +Notifications are autonomous events, triggered by the internals of the implementation, and broadcasted via JSON-RPC to all registered observers. Refer to [[Thunder](#ref.Thunder)] for information on how to register for a notification. -The following events are provided by the org.rdk.MiracastPlayer plugin: +The following events are provided by the MiracastPlayer plugin: MiracastPlayer interface events: | Event | Description | | :-------- | :-------- | -| [onStateChange](#onStateChange) | Triggered when the Miracast Player Plugin changes the states | - +| [onStateChange](#event.onStateChange) | Notifies when a Miracast source device wants to connect | - -## *onStateChange* + +## *onStateChange [event](#head.Notifications)* -Triggered when the Miracast Player Plugin changes the states. (INITIATED | INPROGRESS | PLAYING | IDLE/STOPPED(Default State)). +Notifies when a Miracast source device wants to connect ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.name | string | Name of the source device | -| params.mac | string | Mac id of the source device | -| params.state | string | Current state of the Miracast player | -| params.reason_code | number | Player Reason codes (must be one of the following: *MIRACAST_PLAYER_REASON_CODE_SUCCESS = 200*, *MIRACAST_PLAYER_REASON_CODE_APP_REQ_TO_STOP = 201*, *MIRACAST_PLAYER_REASON_CODE_SRC_DEV_REQ_TO_STOP = 202*, *MIRACAST_PLAYER_REASON_CODE_RTSP_ERROR = 203*, *MIRACAST_PLAYER_REASON_CODE_RTSP_TIMEOUT = 204*, *MIRACAST_PLAYER_REASON_CODE_RTSP_METHOD_NOT_SUPPORTED = 205*, *MIRACAST_PLAYER_REASON_CODE_GST_ERROR = 206*, *MIRACAST_PLAYER_REASON_CODE_INT_FAILURE = 207*, *MIRACAST_PLAYER_REASON_CODE_NEW_SRC_DEV_CONNECT_REQ = 208*) | -| params.reason | string | Description about reason_code | - -### Result - -| Name | Type | Description | -| :-------- | :-------- | :-------- | -| result | object | | -| result.success | boolean | Whether the request succeeded | +| params.name | string | Name of the client device | +| params.mac | string | MacAddress of the client device | +| params.state | State | Current state of the player (e.g., INITIATED | INPROGRESS | PLAYING | STOPPED/IDLE(Default State).) | +| params.reason_code | string | Reason code for the player state update | +| params.reason | ReasonCode | - | -### Example +### Examples ```json { - "jsonrpc": "2.0", - "method": "client.events.onStateChange", + "jsonrpc": 2.0, + "id": 7, + "method": "org.rdk.MiracastPlayer.onStateChange", "params": { - "name": "Manufacturer WiFi-Direct Name", - "mac": "XX:XX:XX:XX:XX:XX", - "state": "(INITIATED | INPROGRESS | PLAYING | STOPPED/IDLE(Default State))", - "reason_code": 200, - "reason": "read Description" + "clientName": "", + "clientMac": "", + "playerState": "STATE_IDLE", + "reasonCode": "", + "reasonDescription": "REASON_CODE_SUCCESS" } } ``` - diff --git a/docs/apis/MiracastServicePlugin.md b/docs/apis/MiracastServicePlugin.md index 1c758c06..0e4fcd24 100644 --- a/docs/apis/MiracastServicePlugin.md +++ b/docs/apis/MiracastServicePlugin.md @@ -1,149 +1,143 @@ - + # MiracastService Plugin -**Version: [1.0.0]()** +**Version: [1.0.0](https://github.com/rdkcentral/rdkservices/blob/main/MiracastService/CHANGELOG.md)** -A org.rdk.MiracastService plugin for Thunder framework. +A MiracastService 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](#head.Abbreviation,_Acronyms_and_Terms) +- [Description](#head.Description) +- [Configuration](#head.Configuration) +- [Methods](#head.Methods) +- [Notifications](#head.Notifications) - + # Abbreviation, Acronyms and Terms -[[Refer to this link](overview/aat.md)] +[[Refer to this link](userguide/aat.md)] - + # Description -The `MiracastService` plugin will manage Peer-to-Peer events from WiFi driver then It will launch Miracast player for screen mirroring. +The `MiracastService` plugin provides an interface for MiracastService. -The plugin is designed to be loaded and executed within the Thunder framework. For more information about the framework refer to [[Thunder](#Thunder)]. +The plugin is designed to be loaded and executed within the Thunder framework. For more information about the framework refer to [[Thunder](#ref.Thunder)]. - + # Configuration The table below lists configuration options of the plugin. | Name | Type | Description | | :-------- | :-------- | :-------- | -| callsign | string | Plugin instance name (default: *org.rdk.MiracastService*) | -| classname | string | Class name: *org.rdk.MiracastService* | +| callsign | string | Plugin instance name (default: org.rdk.MiracastService) | +| classname | string | Class name: *MiracastService* | | locator | string | Library name: *libWPEFrameworkMiracastService.so* | | autostart | boolean | Determines if the plugin shall be started automatically along with the framework | - + # Methods -The following methods are provided by the org.rdk.MiracastService plugin: +The following methods are provided by the MiracastService plugin: MiracastService interface methods: | Method | Description | | :-------- | :-------- | -| [setEnable](#setEnable) | To enable /disable the Miracast feature | -| [getEnable](#getEnable) | To get the enable status of the Miracast feature | -| [acceptClientConnection](#acceptClientConnection) | To accept /reject new client connection requests for the Miracast feature | -| [updatePlayerState](#updatePlayerState) | Update the Miracast Player State to the Miracast Service Plugin | -| [stopClientConnection](#stopClientConnection) | To abort the ongoing connection after accepted connection request | -| [setLogging](#setLogging) | Enable/Disable/Reduce the Logging level for Miracast | +| [acceptClientConnection](#method.acceptClientConnection) | To accept or reject new client connection requests for the Miracast feature | +| [getEnabled](#method.getEnabled) | To get the enable status of the Miracast feature | +| [setEnabled](#method.setEnabled) | To enable or disable the Miracast feature | +| [setP2PBackendDiscovery](#method.setP2PBackendDiscovery) | Sets the status of the MiracastService backend discovery | +| [stopClientConnection](#method.stopClientConnection) | To abort the ongoing connection after accepted connection request | +| [updatePlayerState](#method.updatePlayerState) | Update the Miracast Player State to the Miracast Service Plugin | + +## *acceptClientConnection [method](#head.Methods)* - -## *setEnable* - -To enable /disable the Miracast feature. +To accept or reject new client connection requests for the Miracast feature ### Events - -No Events - +No events are associated with this method. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.enabled | boolean | `true` for enabled or `false` for disabled | - -### Result - +| params.requestStatus | string | It should be "Accept" or "Reject" | +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | object | | -| result.success | boolean | Whether the request succeeded | +| result.result | Result | - | +| result.result.message | string | message */ /* @brief reason for success or failure | +| result.result.success | bool | - | + +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "org.rdk.MiracastService.setEnable", + "jsonrpc": 2.0, + "id": 0, + "method": "org.rdk.MiracastService.acceptClientConnection", "params": { - "enabled": true + "requestStatus": "" } } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 0, "result": { + "message": "", "success": true } } ``` - -## *getEnable* + +## *getEnabled [method](#head.Methods)* -To get the enable status of the Miracast feature. +To get the enable status of the Miracast feature ### Events - -No Events - +No events are associated with this method. ### Parameters - This method takes no parameters. - -### Result - +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | object | | -| result.enabled | boolean | `true` for enabled or `false` for disabled | -| result.success | boolean | Whether the request succeeded | +| result.enabled | bool | Is the MiracastService discovery enabled or not | +| result.success | bool | Is the operation successful or not | + +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "org.rdk.MiracastService.getEnable" + "jsonrpc": 2.0, + "id": 1, + "method": "org.rdk.MiracastService.getEnabled" } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 1, "result": { "enabled": true, "success": true @@ -151,339 +145,310 @@ This method takes no parameters. } ``` - -## *acceptClientConnection* + +## *setEnabled [method](#head.Methods)* -To accept /reject new client connection requests for the Miracast feature. +To enable or disable the Miracast feature ### Events - -No Events - +No events are associated with this method. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.requestStatus | string | `Accept` for connect device request or `Reject` for denying connect device request | - -### Result - +| params.enabled | bool | Is the MiracastService discovery enabled or not | +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | object | | -| result.success | boolean | Whether the request succeeded | +| result.result | Result | - | +| result.result.message | string | message */ /* @brief reason for success or failure | +| result.result.success | bool | - | + +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "org.rdk.MiracastService.acceptClientConnection", + "jsonrpc": 2.0, + "id": 2, + "method": "org.rdk.MiracastService.setEnabled", "params": { - "requestStatus": "Accept or Reject" + "enabled": true } } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 2, "result": { + "message": "", "success": true } } ``` - -## *updatePlayerState* + +## *setP2PBackendDiscovery [method](#head.Methods)* -Update the Miracast Player State to the Miracast Service Plugin. +Sets the status of the MiracastService backend discovery ### Events - -No Events - +No events are associated with this method. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.mac | string | Mac id of the source device | -| params.state | string | Current state of the Miracast player | -| params.reason_code | number | Player Reason codes (must be one of the following: *MIRACAST_PLAYER_REASON_CODE_SUCCESS = 200*, *MIRACAST_PLAYER_REASON_CODE_APP_REQ_TO_STOP = 201*, *MIRACAST_PLAYER_REASON_CODE_SRC_DEV_REQ_TO_STOP = 202*, *MIRACAST_PLAYER_REASON_CODE_RTSP_ERROR = 203*, *MIRACAST_PLAYER_REASON_CODE_RTSP_TIMEOUT = 204*, *MIRACAST_PLAYER_REASON_CODE_RTSP_METHOD_NOT_SUPPORTED = 205*, *MIRACAST_PLAYER_REASON_CODE_GST_ERROR = 206*, *MIRACAST_PLAYER_REASON_CODE_INT_FAILURE = 207*, *MIRACAST_PLAYER_REASON_CODE_NEW_SRC_DEV_CONNECT_REQ = 208*) | -| params.reason | string | Description of the player's reason code | - -### Result - +| params.enabled | bool | Is the MiracastService discovery enabled or not | +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | object | | -| result.success | boolean | Whether the request succeeded | +| result.result | Result | - | +| result.result.message | string | message */ /* @brief reason for success or failure | +| result.result.success | bool | - | + +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "org.rdk.MiracastService.updatePlayerState", + "jsonrpc": 2.0, + "id": 3, + "method": "org.rdk.MiracastService.setP2PBackendDiscovery", "params": { - "mac": "ab:cd:ef:12:34:56", - "state": "(INITIATED | INPROGRESS | PLAYING | STOPPED/IDLE(Default State))", - "reason_code": 200, - "reason": "read Description" + "enabled": true } } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 3, "result": { + "message": "", "success": true } } ``` - -## *stopClientConnection* + +## *stopClientConnection [method](#head.Methods)* -To abort the ongoing connection after accepted connection request. +To abort the ongoing connection after accepted connection request ### Events - -No Events - +No events are associated with this method. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.mac | string | Mac id of the source device | -| params.name | string | Name of the source device | - -### Result - +| params.mac | string | MacAddress of the client device | +| params.name | string | Name of the client device | +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | object | | -| result.success | boolean | Whether the request succeeded | +| result.result | Result | - | +| result.result.message | string | message */ /* @brief reason for success or failure | +| result.result.success | bool | - | + +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 4, "method": "org.rdk.MiracastService.stopClientConnection", "params": { - "mac": "ab:cd:ef:12:34:56", - "name": "Manufacturer WiFi-Direct Name" + "clientMac": "", + "clientName": "" } } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 4, "result": { + "message": "", "success": true } } ``` - -## *setLogging* + +## *updatePlayerState [method](#head.Methods)* -Enable/Disable/Reduce the Logging level for Miracast. +Update the Miracast Player State to the Miracast Service Plugin ### Events - -No Events - +No events are associated with this method. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.level | string | Set the log level for Miracast service plugin | -| params?.separate_logger | object | *(optional)* Route the Miracast service logs to a separate file if required | -| params?.separate_logger.logfilename | string | Name of a separate logging filename. Logfile will be created under /opt/logs/ | -| params?.separate_logger.status | string | Enable/Disable the separate logging | - -### Result - +| params.mac | string | MacAddress of the client device | +| params.state | PlayerState | Player state to be updated | +| params.reason_code | int | Reason code for the player state update | +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | object | | -| result.success | boolean | Whether the request succeeded | +| result.result | Result | - | +| result.result.message | string | message */ /* @brief reason for success or failure | +| result.result.success | bool | - | + +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "org.rdk.MiracastService.setLogging", + "jsonrpc": 2.0, + "id": 5, + "method": "org.rdk.MiracastService.updatePlayerState", "params": { - "level": "FATAL|ERROR|WARNING|INFO|VERBOSE|TRACE", - "separate_logger": { - "logfilename": "sample.log", - "status": "ENABLE|DISABLE" - } + "clientMac": "", + "playerState": "PLAYER_STATE_IDLE", + "reasonCode": 0 } } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 5, "result": { + "message": "", "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](#Thunder)] for information on how to register for a notification. +Notifications are autonomous events, triggered by the internals of the implementation, and broadcasted via JSON-RPC to all registered observers. Refer to [[Thunder](#ref.Thunder)] for information on how to register for a notification. -The following events are provided by the org.rdk.MiracastService plugin: +The following events are provided by the MiracastService plugin: MiracastService interface events: | Event | Description | | :-------- | :-------- | -| [onClientConnectionRequest](#onClientConnectionRequest) | Triggered when the Miracast Service plugin receives a new connection request from a client | -| [onLaunchRequest](#onLaunchRequest) | Miracast Service Plugin raises this Event to request RA to launch the Miracast Player | -| [onClientConnectionError](#onClientConnectionError) | It is triggered when the Miracast Service plugin failed to connect with the source streaming device due to some error, like P2P related errors during activation or while streaming | - +| [onClientConnectionError](#event.onClientConnectionError) | It is triggered when the Miracast Service plugin failed to connect with the source streaming device due to some error, like P2P related errors during activation or while streaming | +| [onClientConnectionRequest](#event.onClientConnectionRequest) | Triggered when the Miracast Service plugin receives a new connection request from a client | +| [onLaunchRequest](#event.onLaunchRequest) | Miracast Service Plugin raises this Event to request RA or MiracastWidget to launch the Miracast Player | - -## *onClientConnectionRequest* + +## *onClientConnectionError [event](#head.Notifications)* -Triggered when the Miracast Service plugin receives a new connection request from a client. The application should respond with an acceptClientConnection call to accept or reject the request. +It is triggered when the Miracast Service plugin failed to connect with the source streaming device due to some error, like P2P related errors during activation or while streaming ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.mac | string | Mac id of the source device | -| params.name | string | Name of the source device | - -### Result - -| Name | Type | Description | -| :-------- | :-------- | :-------- | -| result | object | | -| result.success | boolean | Whether the request succeeded | +| params.mac | string | MacAddress of the client device | +| params.name | string | Name of the client device | +| params.error_code | string | - | +| params.reason | ReasonCode | - | -### Example +### Examples ```json { - "jsonrpc": "2.0", - "method": "client.events.onClientConnectionRequest", + "jsonrpc": 2.0, + "id": 6, + "method": "org.rdk.MiracastService.onClientConnectionError", "params": { - "mac": "ab:cd:ef:12:34:56", - "name": "Manufacturer WiFi-Direct Name" + "clientMac": "", + "clientName": "", + "reasonCode": "", + "reasonDescription": "REASON_CODE_SUCCESS" } } ``` - -## *onLaunchRequest* + +## *onClientConnectionRequest [event](#head.Notifications)* -Miracast Service Plugin raises this Event to request RA to launch the Miracast Player. +Triggered when the Miracast Service plugin receives a new connection request from a client ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.source_dev_ip | string | Source Device IP address | -| params.source_dev_mac | string | Mac id of the source device | -| params.source_dev_name | string | Name of the source device | -| params.sink_dev_ip | string | IP address of the Local/Sink device | - -### Result +| params.mac | string | MacAddress of the client device | +| params.name | string | Name of the client device | -| Name | Type | Description | -| :-------- | :-------- | :-------- | -| result | object | | -| result.success | boolean | Whether the request succeeded | - -### Example +### Examples ```json { - "jsonrpc": "2.0", - "method": "client.events.onLaunchRequest", + "jsonrpc": 2.0, + "id": 7, + "method": "org.rdk.MiracastService.onClientConnectionRequest", "params": { - "source_dev_ip": "xx.xx.xx.xx", - "source_dev_mac": "ab:cd:ef:12:34:56", - "source_dev_name": "Manufacturer WiFi-Direct Name", - "sink_dev_ip": "xx.xx.xx.xx" + "clientMac": "", + "clientName": "" } } ``` - -## *onClientConnectionError* + +## *onLaunchRequest [event](#head.Notifications)* -It is triggered when the Miracast Service plugin failed to connect with the source streaming device due to some error, like P2P related errors during activation or while streaming. +Miracast Service Plugin raises this Event to request RA or MiracastWidget to launch the Miracast Player ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.name | string | Name of the source device | -| params.mac | string | Mac id of the source device | -| params.error_code | number | Miracast Service plugin error codes (must be one of the following: *MIRACAST_SERVICE_ERR_CODE_SUCCESS = 100*, *MIRACAST_SERVICE_ERR_CODE_P2P_CONNECT_ERROR = 102*, *MIRACAST_SERVICE_ERR_CODE_P2P_GROUP_NEGO_ERROR = 103*, *MIRACAST_SERVICE_ERR_CODE_P2P_GROUP_FORMATION_ERROR = 104*, *MIRACAST_SERVICE_ERR_CODE_GENERIC_FAILURE = 105*) | - -### Result - -| Name | Type | Description | -| :-------- | :-------- | :-------- | -| result | object | | -| result.success | boolean | Whether the request succeeded | +| params.device_parameters | DeviceParameters | - | +| params.device_parameters.sourceDeviceIP | string | source_dev_ip */ /* @brief IP Address of Source Device | +| params.device_parameters.sourceDeviceMac | string | source_dev_mac */ /* @brief MAC Address of Source Device | +| params.device_parameters.sourceDeviceName | string | source_dev_name */ /* @brief Name of Source Device | +| params.device_parameters.sinkDeviceIP | string | sink_dev_ip */ /* @brief IP Address of Sink Device | -### Example +### Examples ```json { - "jsonrpc": "2.0", - "method": "client.events.onClientConnectionError", + "jsonrpc": 2.0, + "id": 8, + "method": "org.rdk.MiracastService.onLaunchRequest", "params": { - "name": "Manufacturer WiFi-Direct Name", - "mac": "ab:cd:ef:12:34:56", - "error_code": 100 + "deviceParameters": { + "sourceDeviceIP": "", + "sourceDeviceMac": "", + "sourceDeviceName": "", + "sinkDeviceIP": "" + } } } ``` - diff --git a/docs/apis/NativeJSPlugin.md b/docs/apis/NativeJSPlugin.md new file mode 100644 index 00000000..d00c0527 --- /dev/null +++ b/docs/apis/NativeJSPlugin.md @@ -0,0 +1,265 @@ + + +# NativeJS Plugin + +**Version: [1.0.0](https://github.com/rdkcentral/rdkservices/blob/main/NativeJS/CHANGELOG.md)** + +A NativeJS plugin for Thunder framework. + +### Table of Contents + +- [Abbreviation, Acronyms and Terms](#head.Abbreviation,_Acronyms_and_Terms) +- [Description](#head.Description) +- [Configuration](#head.Configuration) +- [Methods](#head.Methods) + + +# Abbreviation, Acronyms and Terms + +[[Refer to this link](userguide/aat.md)] + + +# Description + +The `NativeJS` plugin provides an interface for NativeJS. + +The plugin is designed to be loaded and executed within the Thunder framework. For more information about the framework refer to [[Thunder](#ref.Thunder)]. + + +# Configuration + +The table below lists configuration options of the plugin. + +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| callsign | string | Plugin instance name (default: org.rdk.NativeJS) | +| classname | string | Class name: *NativeJS* | +| locator | string | Library name: *libWPEFrameworkNativeJS.so* | +| autostart | boolean | Determines if the plugin shall be started automatically along with the framework | + + +# Methods + +The following methods are provided by the NativeJS plugin: + +NativeJS interface methods: + +| Method | Description | +| :-------- | :-------- | +| [createApplication](#method.createApplication) | Create a NativeJS application. | +| [getApplications](#method.getApplications) | Get details of existing plugin. | +| [runApplication](#method.runApplication) | run a NativeJS application. | +| [runJavaScript](#method.runJavaScript) | run a NativeJS code. | +| [terminateApplication](#method.terminateApplication) | Destroy a running NativeJS application. | + + +## *createApplication [method](#head.Methods)* + +Create a NativeJS application. + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.options | std::string | Additional options for creating the application. | +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result.id | uint32_t | This should have the id of the created application | + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 0, + "method": "org.rdk.NativeJS.createApplication", + "params": { + "options": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 0, + "result": 0 +} +``` + + +## *getApplications [method](#head.Methods)* + +Get details of existing plugin. + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 1, + "method": "org.rdk.NativeJS.getApplications" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 1, + "result": null +} +``` + + +## *runApplication [method](#head.Methods)* + +run a NativeJS application. + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.id | uint32_t | This should have the id of the created application | +| params.url | std::string | URL for the application to run. | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 2, + "method": "org.rdk.NativeJS.runApplication", + "params": { + "id": 0, + "url": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 2, + "result": null +} +``` + + +## *runJavaScript [method](#head.Methods)* + +run a NativeJS code. + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.id | uint32_t | This should have the id of the created application | +| params.code | std::string | - | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 3, + "method": "org.rdk.NativeJS.runJavaScript", + "params": { + "id": 0, + "code": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 3, + "result": null +} +``` + + +## *terminateApplication [method](#head.Methods)* + +Destroy a running NativeJS application. + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.id | uint32_t | This should have the id of the created application | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 4, + "method": "org.rdk.NativeJS.terminateApplication", + "params": { + "id": 0 + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 4, + "result": null +} +``` + + diff --git a/docs/apis/NetflixPlugin.md b/docs/apis/NetflixPlugin.md new file mode 100644 index 00000000..dba66c0f --- /dev/null +++ b/docs/apis/NetflixPlugin.md @@ -0,0 +1,464 @@ + + +# Netflix Plugin + +**Version: [1.0.0](https://github.com/rdkcentral/rdkservices/blob/main/Netflix/CHANGELOG.md)** + +A Netflix plugin for Thunder framework. + +### Table of Contents + +- [Abbreviation, Acronyms and Terms](#head.Abbreviation,_Acronyms_and_Terms) +- [Description](#head.Description) +- [Configuration](#head.Configuration) +- [Methods](#head.Methods) +- [Notifications](#head.Notifications) + + +# Abbreviation, Acronyms and Terms + +[[Refer to this link](userguide/aat.md)] + + +# Description + +The `Netflix` plugin provides an interface for Netflix. + +The plugin is designed to be loaded and executed within the Thunder framework. For more information about the framework refer to [[Thunder](#ref.Thunder)]. + + +# Configuration + +The table below lists configuration options of the plugin. + +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| callsign | string | Plugin instance name (default: org.rdk.Netflix) | +| classname | string | Class name: *Netflix* | +| locator | string | Library name: *libWPEFrameworkNetflix.so* | +| autostart | boolean | Determines if the plugin shall be started automatically along with the framework | + + +# Methods + +The following methods are provided by the Netflix plugin: + +Netflix interface methods: + +| Method | Description | +| :-------- | :-------- | +| [factoryReset](#method.factoryReset) | | +| [getESN](#method.getESN) | | +| [language](#method.language) | | +| [setVisible](#method.setVisible) | | +| [systemCommand](#method.systemCommand) | | +| [voiceCommand](#method.voiceCommand) | | +| [getNFREnabled](#method.getNFREnabled) | | +| [setNFREnabled](#method.setNFREnabled) | | + + +## *factoryReset [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 0, + "method": "org.rdk.Netflix.factoryReset" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 0, + "result": null +} +``` + + +## *getESN [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 1, + "method": "org.rdk.Netflix.getESN" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 1, + "result": null +} +``` + + +## *language [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.language | string | - | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 2, + "method": "org.rdk.Netflix.language", + "params": { + "language": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 2, + "result": null +} +``` + + +## *setVisible [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.visibility | bool | - | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 3, + "method": "org.rdk.Netflix.setVisible", + "params": { + "visibility": true + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 3, + "result": null +} +``` + + +## *systemCommand [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.command | string | - | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 4, + "method": "org.rdk.Netflix.systemCommand", + "params": { + "command": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 4, + "result": null +} +``` + + +## *voiceCommand [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.command | string | - | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 5, + "method": "org.rdk.Netflix.voiceCommand", + "params": { + "command": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 5, + "result": null +} +``` + + +## *getNFREnabled [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 6, + "method": "org.rdk.Netflix.getNFREnabled" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 6, + "result": null +} +``` + + +## *setNFREnabled [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.nfrEnable | bool | - | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 7, + "method": "org.rdk.Netflix.setNFREnabled", + "params": { + "nfrEnable": true + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 7, + "result": null +} +``` + + + + +# Notifications + +Notifications are autonomous events, triggered by the internals of the implementation, and broadcasted via JSON-RPC to all registered observers. Refer to [[Thunder](#ref.Thunder)] for information on how to register for a notification. + +The following events are provided by the Netflix plugin: + +Netflix interface events: + +| Event | Description | +| :-------- | :-------- | +| [exit](#event.exit) | | +| [notifyClient](#event.notifyClient) | | +| [stateChange](#event.stateChange) | | + + +## *exit [event](#head.Notifications)* + + + +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.exitCode | uint32_t | - | + +### Examples + +```json +{ + "jsonrpc": 2.0, + "id": 8, + "method": "org.rdk.Netflix.exit", + "params": { + "exitCode": 0 + } +} +``` + + +## *notifyClient [event](#head.Notifications)* + + + +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.eventName | string | - | + +### Examples + +```json +{ + "jsonrpc": 2.0, + "id": 9, + "method": "org.rdk.Netflix.notifyClient", + "params": { + "eventName": "" + } +} +``` + + +## *stateChange [event](#head.Notifications)* + + + +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.state | INetflix::state | - | + +### Examples + +```json +{ + "jsonrpc": 2.0, + "id": 10, + "method": "org.rdk.Netflix.stateChange", + "params": { + "state": "" + } +} +``` diff --git a/docs/apis/NetflixSecurityPlugin.md b/docs/apis/NetflixSecurityPlugin.md new file mode 100644 index 00000000..3661212a --- /dev/null +++ b/docs/apis/NetflixSecurityPlugin.md @@ -0,0 +1,253 @@ + + +# NetflixSecurity Plugin + +**Version: [1.0.0](https://github.com/rdkcentral/rdkservices/blob/main/NetflixSecurity/CHANGELOG.md)** + +A NetflixSecurity plugin for Thunder framework. + +### Table of Contents + +- [Abbreviation, Acronyms and Terms](#head.Abbreviation,_Acronyms_and_Terms) +- [Description](#head.Description) +- [Configuration](#head.Configuration) +- [Methods](#head.Methods) + + +# Abbreviation, Acronyms and Terms + +[[Refer to this link](userguide/aat.md)] + + +# Description + +The `NetflixSecurity` plugin provides an interface for NetflixSecurity. + +The plugin is designed to be loaded and executed within the Thunder framework. For more information about the framework refer to [[Thunder](#ref.Thunder)]. + + +# Configuration + +The table below lists configuration options of the plugin. + +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| callsign | string | Plugin instance name (default: org.rdk.NetflixSecurity) | +| classname | string | Class name: *NetflixSecurity* | +| locator | string | Library name: *libWPEFrameworkNetflixSecurity.so* | +| autostart | boolean | Determines if the plugin shall be started automatically along with the framework | + + +# Methods + +The following methods are provided by the NetflixSecurity plugin: + +NetflixSecurity interface methods: + +| Method | Description | +| :-------- | :-------- | +| [deriveKeys](#method.deriveKeys) | | +| [eSN](#method.eSN) | | +| [encryptionKey](#method.encryptionKey) | | +| [hMACKey](#method.hMACKey) | | +| [wrappingKey](#method.wrappingKey) | | + + +## *deriveKeys [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.privateDhKeyId | uint32_t | - | +| params.peerPublicDhKeyId | uint32_t | - | +| params.derivationKeyId | uint32_t | - | +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result.encryptionKeyId | uint32_t | - | +| result.hmacKeyId | uint32_t | - | +| result.wrappingKeyId | uint32_t | - | + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 0, + "method": "org.rdk.NetflixSecurity.deriveKeys", + "params": { + "privateDhKeyId": 0, + "peerPublicDhKeyId": 0, + "derivationKeyId": 0 + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 0, + "result": { + "encryptionKeyId": 0, + "hmacKeyId": 0, + "wrappingKeyId": 0 + } +} +``` + + +## *eSN [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 1, + "method": "org.rdk.NetflixSecurity.eSN" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 1, + "result": null +} +``` + + +## *encryptionKey [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 2, + "method": "org.rdk.NetflixSecurity.encryptionKey" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 2, + "result": null +} +``` + + +## *hMACKey [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 3, + "method": "org.rdk.NetflixSecurity.hMACKey" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 3, + "result": null +} +``` + + +## *wrappingKey [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 4, + "method": "org.rdk.NetflixSecurity.wrappingKey" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 4, + "result": null +} +``` + + diff --git a/docs/apis/OCDMPlugin.md b/docs/apis/OCDMPlugin.md new file mode 100644 index 00000000..ad83e56d --- /dev/null +++ b/docs/apis/OCDMPlugin.md @@ -0,0 +1,1161 @@ + + +# OCDM Plugin + +**Version: [1.0.0](https://github.com/rdkcentral/rdkservices/blob/main/OCDM/CHANGELOG.md)** + +A OCDM plugin for Thunder framework. + +### Table of Contents + +- [Abbreviation, Acronyms and Terms](#head.Abbreviation,_Acronyms_and_Terms) +- [Description](#head.Description) +- [Configuration](#head.Configuration) +- [Methods](#head.Methods) + + +# Abbreviation, Acronyms and Terms + +[[Refer to this link](userguide/aat.md)] + + +# Description + +The `OCDM` plugin provides an interface for OCDM. + +The plugin is designed to be loaded and executed within the Thunder framework. For more information about the framework refer to [[Thunder](#ref.Thunder)]. + + +# Configuration + +The table below lists configuration options of the plugin. + +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| callsign | string | Plugin instance name (default: org.rdk.OCDM) | +| classname | string | Class name: *OCDM* | +| locator | string | Library name: *libWPEFrameworkOCDM.so* | +| autostart | boolean | Determines if the plugin shall be started automatically along with the framework | + + +# Methods + +The following methods are provided by the OCDM plugin: + +OCDM interface methods: + +| Method | Description | +| :-------- | :-------- | +| [bufferId](#method.bufferId) | | +| [bufferIdExt](#method.bufferIdExt) | | +| [cancelChallengeDataExt](#method.cancelChallengeDataExt) | | +| [cleanDecryptContext](#method.cleanDecryptContext) | | +| [close](#method.close) | | +| [createSessionBuffer](#method.createSessionBuffer) | | +| [deleteKeyStore](#method.deleteKeyStore) | | +| [deleteSecureStore](#method.deleteSecureStore) | | +| [getDrmSystemTime](#method.getDrmSystemTime) | | +| [getLdlSessionLimit](#method.getLdlSessionLimit) | | +| [getVersionExt](#method.getVersionExt) | | +| [isSecureStopEnabled](#method.isSecureStopEnabled) | | +| [isTypeSupported](#method.isTypeSupported) | | +| [load](#method.load) | | +| [metadata](#method.metadata) | | +| [onError](#method.onError) | | +| [onKeyMessage](#method.onKeyMessage) | | +| [onKeyStatusUpdate](#method.onKeyStatusUpdate) | | +| [onKeyStatusesUpdated](#method.onKeyStatusesUpdated) | | +| [remove](#method.remove) | | +| [resetOutputProtection](#method.resetOutputProtection) | | +| [resetSecureStops](#method.resetSecureStops) | | +| [revoke](#method.revoke) | | +| [sessionId](#method.sessionId) | | +| [sessionIdExt](#method.sessionIdExt) | | +| [setParameter](#method.setParameter) | | +| [status](#method.status) | | + + +## *bufferId [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 0, + "method": "org.rdk.OCDM.bufferId" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 0, + "result": null +} +``` + + +## *bufferIdExt [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 1, + "method": "org.rdk.OCDM.bufferIdExt" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 1, + "result": null +} +``` + + +## *cancelChallengeDataExt [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 2, + "method": "org.rdk.OCDM.cancelChallengeDataExt" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 2, + "result": null +} +``` + + +## *cleanDecryptContext [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 3, + "method": "org.rdk.OCDM.cleanDecryptContext" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 3, + "result": null +} +``` + + +## *close [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 4, + "method": "org.rdk.OCDM.close" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 4, + "result": null +} +``` + + +## *createSessionBuffer [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result.bufferID | string | - | + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 5, + "method": "org.rdk.OCDM.createSessionBuffer" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 5, + "result": "" +} +``` + + +## *deleteKeyStore [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.keySystem | std::string | - | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 6, + "method": "org.rdk.OCDM.deleteKeyStore", + "params": { + "keySystem": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 6, + "result": null +} +``` + + +## *deleteSecureStore [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.keySystem | std::string | - | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 7, + "method": "org.rdk.OCDM.deleteSecureStore", + "params": { + "keySystem": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 7, + "result": null +} +``` + + +## *getDrmSystemTime [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.keySystem | std::string | - | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 8, + "method": "org.rdk.OCDM.getDrmSystemTime", + "params": { + "keySystem": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 8, + "result": null +} +``` + + +## *getLdlSessionLimit [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.keySystem | std::string | - | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 9, + "method": "org.rdk.OCDM.getLdlSessionLimit", + "params": { + "keySystem": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 9, + "result": null +} +``` + + +## *getVersionExt [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.keySystem | std::string | - | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 10, + "method": "org.rdk.OCDM.getVersionExt", + "params": { + "keySystem": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 10, + "result": null +} +``` + + +## *isSecureStopEnabled [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.keySystem | std::string | - | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 11, + "method": "org.rdk.OCDM.isSecureStopEnabled", + "params": { + "keySystem": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 11, + "result": null +} +``` + + +## *isTypeSupported [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.keySystem | std::string | - | +| params.mimeType | std::string | - | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 12, + "method": "org.rdk.OCDM.isTypeSupported", + "params": { + "keySystem": "", + "mimeType": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 12, + "result": null +} +``` + + +## *load [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 13, + "method": "org.rdk.OCDM.load" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 13, + "result": null +} +``` + + +## *metadata [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.keySystem | std::string | - | +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result.metadata | std::string | - | + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 14, + "method": "org.rdk.OCDM.metadata", + "params": { + "keySystem": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 14, + "result": "" +} +``` + + +## *onError [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.error | int16_t | - | +| params.sysError | OCDM_RESULT | - | +| params.errorMessage | std::string | - | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 15, + "method": "org.rdk.OCDM.onError", + "params": { + "error": "", + "sysError": "OCDM_SUCCESS", + "errorMessage": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 15, + "result": null +} +``` + + +## *onKeyMessage [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.keyMessage | uint8_t | - | +| params.keyLength | uint16_t | - | +| params.URL | std::string | - | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 16, + "method": "org.rdk.OCDM.onKeyMessage", + "params": { + "keyMessage": "", + "keyLength": "", + "URL": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 16, + "result": null +} +``` + + +## *onKeyStatusUpdate [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.keyID[] | uint8_t | - | +| params.keyIDLength | uint8_t | - | +| params.status | ISession::KeyStatus | - | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 17, + "method": "org.rdk.OCDM.onKeyStatusUpdate", + "params": { + "keyID[]": "", + "keyIDLength": "", + "status": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 17, + "result": null +} +``` + + +## *onKeyStatusesUpdated [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 18, + "method": "org.rdk.OCDM.onKeyStatusesUpdated" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 18, + "result": null +} +``` + + +## *remove [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 19, + "method": "org.rdk.OCDM.remove" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 19, + "result": null +} +``` + + +## *resetOutputProtection [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 20, + "method": "org.rdk.OCDM.resetOutputProtection" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 20, + "result": null +} +``` + + +## *resetSecureStops [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.keySystem | std::string | - | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 21, + "method": "org.rdk.OCDM.resetSecureStops", + "params": { + "keySystem": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 21, + "result": null +} +``` + + +## *revoke [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.callback | ISession::ICallback | - | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 22, + "method": "org.rdk.OCDM.revoke", + "params": { + "callback": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 22, + "result": null +} +``` + + +## *sessionId [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 23, + "method": "org.rdk.OCDM.sessionId" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 23, + "result": null +} +``` + + +## *sessionIdExt [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 24, + "method": "org.rdk.OCDM.sessionIdExt" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 24, + "result": null +} +``` + + +## *setParameter [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.name | std::string | - | +| params.value | std::string | - | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 25, + "method": "org.rdk.OCDM.setParameter", + "params": { + "name": "", + "value": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 25, + "result": null +} +``` + + +## *status [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.keyID[] | uint8_t | - | +| params.keyIDLength | uint8_t | - | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 26, + "method": "org.rdk.OCDM.status", + "params": { + "keyID[]": "", + "keyIDLength": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 26, + "result": null +} +``` + + diff --git a/docs/apis/OCIContainerPlugin.md b/docs/apis/OCIContainerPlugin.md index 641f9280..abc74087 100644 --- a/docs/apis/OCIContainerPlugin.md +++ b/docs/apis/OCIContainerPlugin.md @@ -1,656 +1,948 @@ - + # OCIContainer Plugin -**Version: [1.0.0]()** +**Version: [1.0.0](https://github.com/rdkcentral/rdkservices/blob/main/OCIContainer/CHANGELOG.md)** -A org.rdk.OCIContainer plugin for Thunder framework. +A OCIContainer 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](#head.Abbreviation,_Acronyms_and_Terms) +- [Description](#head.Description) +- [Configuration](#head.Configuration) +- [Methods](#head.Methods) +- [Notifications](#head.Notifications) - + # Abbreviation, Acronyms and Terms -[[Refer to this link](overview/aat.md)] +[[Refer to this link](userguide/aat.md)] - + # Description -The `OCIContainer` plugin allows for control of OCI containers using the Dobby hypervisor. +The `OCIContainer` plugin provides an interface for OCIContainer. -The plugin is designed to be loaded and executed within the Thunder framework. For more information about the framework refer to [[Thunder](#Thunder)]. +The plugin is designed to be loaded and executed within the Thunder framework. For more information about the framework refer to [[Thunder](#ref.Thunder)]. - + # Configuration The table below lists configuration options of the plugin. | Name | Type | Description | | :-------- | :-------- | :-------- | -| callsign | string | Plugin instance name (default: *org.rdk.OCIContainer*) | -| classname | string | Class name: *org.rdk.OCIContainer* | +| callsign | string | Plugin instance name (default: org.rdk.OCIContainer) | +| classname | string | Class name: *OCIContainer* | | locator | string | Library name: *libWPEFrameworkOCIContainer.so* | | autostart | boolean | Determines if the plugin shall be started automatically along with the framework | - + # Methods -The following methods are provided by the org.rdk.OCIContainer plugin: +The following methods are provided by the OCIContainer plugin: OCIContainer interface methods: | Method | Description | | :-------- | :-------- | -| [executeCommand](#executeCommand) | Executes a command inside a running container | -| [getContainerInfo](#getContainerInfo) | Gets information about a running container such as CPU, memory, and GPU usage (GPU not supported on some products) | -| [getContainerState](#getContainerState) | Gets the state of a currently running container | -| [listContainers](#listContainers) | Lists all running OCI containers Dobby knows about | -| [pauseContainer](#pauseContainer) | Pauses a currently running container | -| [resumeContainer](#resumeContainer) | Resumes a previously paused container | -| [startContainer](#startContainer) | Starts a new container from an existing OCI bundle | -| [startContainerFromDobbySpec](#startContainerFromDobbySpec) | Starts a new container from a legacy Dobby JSON specification | -| [stopContainer](#stopContainer) | Stops a currently running container | +| [annotate](#method.annotate) | | +| [executeCommand](#method.executeCommand) | | +| [getContainerInfo](#method.getContainerInfo) | | +| [getContainerState](#method.getContainerState) | | +| [hibernateContainer](#method.hibernateContainer) | | +| [listContainers](#method.listContainers) | | +| [mount](#method.mount) | | +| [pauseContainer](#method.pauseContainer) | | +| [removeAnnotation](#method.removeAnnotation) | | +| [resumeContainer](#method.resumeContainer) | | +| [startContainer](#method.startContainer) | | +| [startContainerFromDobbySpec](#method.startContainerFromDobbySpec) | | +| [stopContainer](#method.stopContainer) | | +| [unmount](#method.unmount) | | +| [wakeupContainer](#method.wakeupContainer) | | + + +## *annotate [method](#head.Methods)* - -## *executeCommand* - -Executes a command inside a running container. The path to the executable must resolve within the container's namespace. ### Events - -No Events - +No events are associated with this method. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.containerId | string | The ID of a container as returned by `listContainers` | -| params?.options | string | *(optional)* Global options for crun `exec` command | -| params.command | string | Command to execute | +| params.containerId | string | Identifier of container | +| params.key | string | name of property | +| params.value | string | property data | +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result.success | bool | - | +| result.errorReason | string | - | + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 0, + "method": "org.rdk.OCIContainer.annotate", + "params": { + "containerId": "", + "key": "", + "value": "" + } +} +``` + -### Result +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 0, + "result": { + "success": true, + "errorReason": "" + } +} +``` + + +## *executeCommand [method](#head.Methods)* + + +### Events +No events are associated with this method. +### Parameters | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | object | | -| result.success | boolean | Whether the request succeeded | +| params | object | | +| params.containerId | string | Identifier of container | +| params?.options | string | (optional)options to be passed to command | +| params.command | string | command to run in container | +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result.success | bool | - | +| result.errorReason | string | - | + +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 1, "method": "org.rdk.OCIContainer.executeCommand", "params": { - "containerId": "com.bskyb.epgui", - "options": "--cwd=PATH", - "command": "command" + "containerId": "", + "options": "", + "command": "" } } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 1, "result": { - "success": true + "success": true, + "errorReason": "" } } ``` - -## *getContainerInfo* + +## *getContainerInfo [method](#head.Methods)* -Gets information about a running container such as CPU, memory, and GPU usage (GPU not supported on some products). -### Events - -No Events +### Events +No events are associated with this method. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.containerId | string | The ID of a container as returned by `listContainers` | - -### Result - -| Name | Type | Description | -| :-------- | :-------- | :-------- | -| result | object | | -| result.info | object | Information about the specified container | -| result.info.cpu | object | CPU information | -| result.info.cpu.usage | object | The amount of CPU usage | -| result.info.cpu.usage.percpu | array | The usage for each CPU | -| result.info.cpu.usage.percpu[#] | integer | | -| result.info.cpu.usage.total | integer | The combined usage for all CPUs | -| result.info.id | string | The ID of a container as returned by `listContainers` | -| result.info.memory | object | The amount of memory being used by the container | -| result.info.memory.user | object | User memory statistics | -| result.info.memory.user.failcnt | integer | The fail count; the number of times that the usage counter hit its limit | -| result.info.memory.user.limit | integer | The memory limit | -| result.info.memory.user.max | integer | The maximum amount of memory used | -| result.info.memory.user.usage | integer | The current memory being used | -| result.info.pids | array | A list of container process IDs | -| result.info.pids[#] | integer | | -| result.info.state | string | The container state (must be one of the following: *Invalid*, *Starting*, *Running*, *Stopped*, *Paused*) | -| result.info.timestamp | integer | The timestamp for container information | -| result.success | boolean | Whether the request succeeded | - -### Example +| params.containerId | string | Identifier of container | +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result.info | string | - | +| result.success | bool | - | +| result.errorReason | string | - | + +### Examples + #### Request ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 2, "method": "org.rdk.OCIContainer.getContainerInfo", "params": { - "containerId": "com.bskyb.epgui" + "containerId": "" } } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 2, "result": { - "info": { - "cpu": { - "usage": { - "percpu": [ - 83134464184 - ], - "total": 224025108679 - } - }, - "id": "com.bskyb.epgui", - "memory": { - "user": { - "failcnt": 0, - "limit": 230686720, - "max": 38555648, - "usage": 28655616 - } - }, - "pids": [ - 7644 - ], - "state": "Running", - "timestamp": 6849968158125 - }, - "success": true - } -} -``` - - -## *getContainerState* - -Gets the state of a currently running container. + "info": "", + "success": true, + "errorReason": "" + } +} +``` -### Events + +## *getContainerState [method](#head.Methods)* -No Events -### Parameters +### Events +No events are associated with this method. +### Parameters | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.containerId | string | The ID of a container as returned by `listContainers` | - -### Result - +| params.containerId | string | Identifier of container | +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | object | | -| result.containerId | string | The ID of a container as returned by `listContainers` | -| result.state | string | The container state (must be one of the following: *Invalid*, *Starting*, *Running*, *Stopped*, *Paused*) | -| result.success | boolean | Whether the request succeeded | +| result.state | ContainerState | - | +| result.success | bool | - | +| result.errorReason | string | - | + +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 3, "method": "org.rdk.OCIContainer.getContainerState", "params": { - "containerId": "com.bskyb.epgui" + "containerId": "" } } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 3, "result": { - "containerId": "com.bskyb.epgui", - "state": "Running", - "success": true + "state": "INVALID", + "success": true, + "errorReason": "" } } ``` - -## *listContainers* + +## *hibernateContainer [method](#head.Methods)* + -Lists all running OCI containers Dobby knows about. ### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.containerId | string | Identifier of container | +| params.options | string | options to be passed to command | +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result.success | bool | - | +| result.errorReason | string | - | -No Events +### Examples -### Parameters -This method takes no parameters. +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 4, + "method": "org.rdk.OCIContainer.hibernateContainer", + "params": { + "containerId": "", + "options": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 4, + "result": { + "success": true, + "errorReason": "" + } +} +``` + + +## *listContainers [method](#head.Methods)* + -### Result +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | object | | -| result.containers | array | A list of running containers | -| result.containers[#] | object | | -| result.containers[#].Descriptor | integer | The container descriptor | -| result.containers[#].Id | string | The container Id | -| result.success | boolean | Whether the request succeeded | +| result.containers | string | - out/json - string | +| result.success | bool | - | +| result.errorReason | string | - | + +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 5, "method": "org.rdk.OCIContainer.listContainers" } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 5, "result": { - "containers": [ - { - "Descriptor": 91, - "Id": "com.bskyb.epgui" - } - ], - "success": true + "containers": "", + "success": true, + "errorReason": "" } } ``` - -## *pauseContainer* - -Pauses a currently running container. + +## *mount [method](#head.Methods)* -### Events -No Events +### Events +No events are associated with this method. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.containerId | string | The ID of a container as returned by `listContainers` | +| params.containerId | string | Identifier of container | +| params.source | string | path source to mount | +| params.target | string | mount target inside container | +| params.type | string | type of mounting | +| params.options | string | options to be passed to command | +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result.success | bool | - | +| result.errorReason | string | - | + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 6, + "method": "org.rdk.OCIContainer.mount", + "params": { + "containerId": "", + "source": "", + "target": "", + "type": "", + "options": "" + } +} +``` -### Result +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 6, + "result": { + "success": true, + "errorReason": "" + } +} +``` + + +## *pauseContainer [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | object | | -| result.success | boolean | Whether the request succeeded | +| params | object | | +| params.containerId | string | Identifier of container | +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result.success | bool | - | +| result.errorReason | string | - | + +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 7, "method": "org.rdk.OCIContainer.pauseContainer", "params": { - "containerId": "com.bskyb.epgui" + "containerId": "" } } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 7, "result": { - "success": true + "success": true, + "errorReason": "" } } ``` - -## *resumeContainer* - -Resumes a previously paused container. + +## *removeAnnotation [method](#head.Methods)* -### Events -No Events +### Events +No events are associated with this method. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.containerId | string | The ID of a container as returned by `listContainers` | +| params.containerId | string | Identifier of container | +| params.key | string | name of property | +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result.success | bool | - | +| result.errorReason | string | - | + +### Examples + -### Result +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 8, + "method": "org.rdk.OCIContainer.removeAnnotation", + "params": { + "containerId": "", + "key": "" + } +} +``` + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 8, + "result": { + "success": true, + "errorReason": "" + } +} +``` + + +## *resumeContainer [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.containerId | string | Identifier of container | +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | object | | -| result.success | boolean | Whether the request succeeded | +| result.success | bool | - | +| result.errorReason | string | - | + +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 9, "method": "org.rdk.OCIContainer.resumeContainer", "params": { - "containerId": "com.bskyb.epgui" + "containerId": "" } } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 9, "result": { - "success": true + "success": true, + "errorReason": "" } } ``` - -## *startContainer* + +## *startContainer [method](#head.Methods)* -Starts a new container from an existing OCI bundle. -### Events -| Event | Description | -| :-------- | :-------- | -| [onContainerStarted](#onContainerStarted) | Triggers when a new container starts running. | +### Events +No events are associated with this method. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.containerId | string | The ID of a container as returned by `listContainers` | -| params.bundlePath | string | Path to the OCI bundle containing the rootfs and config to use to create the container | -| params?.command | string | *(optional)* Command to execute | -| params?.westerosSocket | string | *(optional)* Path to a Westeros socket to mount inside the container | -| params?.envvar | array | *(optional)* A list of environment variables to add to the container | -| params?.envvar[#] | string | *(optional)* | - -### Result - +| params.containerId | string | Identifier of container | +| params.bundlePath | string | path of application bundle | +| params?.command | string | (optional)command to run in container | +| params?.westerosSocket | string | (optional)Westeros socket container need to connect | +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | object | | -| result.descriptor | integer | The container descriptor | -| result.success | boolean | Whether the request succeeded | +| result.descriptor | int32_t | - | +| result.success | bool | - | +| result.errorReason | string | - | + +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 10, "method": "org.rdk.OCIContainer.startContainer", "params": { - "containerId": "com.bskyb.epgui", - "bundlePath": "/containers/myBundle", - "command": "command", - "westerosSocket": "/usr/mySocket", - "envvar": [ - "FOO=BAR" - ] + "containerId": "", + "bundlePath": "", + "command": "", + "westerosSocket": "" } } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 10, "result": { - "descriptor": 91, - "success": true + "descriptor": 0, + "success": true, + "errorReason": "" } } ``` - -## *startContainerFromDobbySpec* + +## *startContainerFromDobbySpec [method](#head.Methods)* -Starts a new container from a legacy Dobby JSON specification. -### Events -| Event | Description | -| :-------- | :-------- | -| [onContainerStarted](#onContainerStarted) | Triggers when a new container starts running. | +### Events +No events are associated with this method. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.containerId | string | The ID of a container as returned by `listContainers` | -| params.dobbySpec | string | Dobby specification to use for the container | -| params?.command | string | *(optional)* Command to execute | -| params?.westerosSocket | string | *(optional)* Path to a Westeros socket to mount inside the container | - -### Result - +| params.containerId | string | Identifier of container | +| params.dobbySpec | string | dobby specification as json string | +| params?.command | string | (optional)command to run in container | +| params?.westerosSocket | string | (optional)Westeros socket container need to connect | +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | object | | -| result.descriptor | integer | The container descriptor | -| result.success | boolean | Whether the request succeeded | +| result.descriptor | int32_t | - | +| result.success | bool | - | +| result.errorReason | string | - | + +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 11, "method": "org.rdk.OCIContainer.startContainerFromDobbySpec", "params": { - "containerId": "com.bskyb.epgui", - "dobbySpec": "/containers/dobbySpec", - "command": "command", - "westerosSocket": "/usr/mySocket" + "containerId": "", + "dobbySpec": "", + "command": "", + "westerosSocket": "" } } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 11, "result": { - "descriptor": 91, - "success": true + "descriptor": 0, + "success": true, + "errorReason": "" } } ``` - -## *stopContainer* + +## *stopContainer [method](#head.Methods)* -Stops a currently running container. -### Events -| Event | Description | -| :-------- | :-------- | -| [onContainerStopped](#onContainerStopped) | Triggers when the container stops running. | +### Events +No events are associated with this method. ### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.containerId | string | Identifier of container | +| params?.force | bool | (optional)Metion forceful or graceful termination of container | +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result.success | bool | - | +| result.errorReason | string | - | + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 12, + "method": "org.rdk.OCIContainer.stopContainer", + "params": { + "containerId": "", + "force": true + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 12, + "result": { + "success": true, + "errorReason": "" + } +} +``` + + +## *unmount [method](#head.Methods)* + + +### Events +No events are associated with this method. +### Parameters | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.containerId | string | The ID of a container as returned by `listContainers` | -| params?.force | boolean | *(optional)* If `true`, force stop the container using the `SIGKILL` signal). Otherwise, use the `SIGTERM` signal. The default value if no value is specified is `false` | +| params.containerId | string | Identifier of container | +| params.target | string | mount target inside container | +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result.success | bool | - | +| result.errorReason | string | - | + +### Examples + + +#### Request -### Result +```json +{ + "jsonrpc": 2.0, + "id": 13, + "method": "org.rdk.OCIContainer.unmount", + "params": { + "containerId": "", + "target": "" + } +} +``` + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 13, + "result": { + "success": true, + "errorReason": "" + } +} +``` + + +## *wakeupContainer [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | object | | -| result.success | boolean | Whether the request succeeded | +| params | object | | +| params.containerId | string | Identifier of container | +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result.success | bool | - | +| result.errorReason | string | - | + +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "org.rdk.OCIContainer.stopContainer", + "jsonrpc": 2.0, + "id": 14, + "method": "org.rdk.OCIContainer.wakeupContainer", "params": { - "containerId": "com.bskyb.epgui", - "force": true + "containerId": "" } } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 14, "result": { - "success": true + "success": true, + "errorReason": "" } } ``` - + + + # Notifications -Notifications are autonomous events, triggered by the internals of the implementation, and broadcasted via JSON-RPC to all registered observers. Refer to [[Thunder](#Thunder)] for information on how to register for a notification. +Notifications are autonomous events, triggered by the internals of the implementation, and broadcasted via JSON-RPC to all registered observers. Refer to [[Thunder](#ref.Thunder)] for information on how to register for a notification. -The following events are provided by the org.rdk.OCIContainer plugin: +The following events are provided by the OCIContainer plugin: OCIContainer interface events: | Event | Description | | :-------- | :-------- | -| [onContainerStarted](#onContainerStarted) | Triggered when a new container has started running | -| [onContainerStopped](#onContainerStopped) | Triggered when the container has stopped running | +| [onContainerFailed](#event.onContainerFailed) | Notifies failure in container execution | +| [onContainerStarted](#event.onContainerStarted) | Notifies container is started | +| [onContainerStateChanged](#event.onContainerStateChanged) | Notifies state change of container | +| [onContainerStopped](#event.onContainerStopped) | Notifies container is stopped | + +## *onContainerFailed [event](#head.Notifications)* - -## *onContainerStarted* - -Triggered when a new container has started running. +Notifies failure in container execution ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.descriptor | integer | The container descriptor | -| params.name | string | Name of the Container | +| params.containerId | string | Identifier of container | +| params.name | string | - | +| params.error | uint32_t | - | -### Example +### Examples ```json { - "jsonrpc": "2.0", - "method": "client.events.onContainerStarted", + "jsonrpc": 2.0, + "id": 15, + "method": "org.rdk.OCIContainer.onContainerFailed", "params": { - "descriptor": 91, - "name": "com.bskyb.epgui" + "containerId": "", + "name": "", + "error": 0 } } ``` - -## *onContainerStopped* + +## *onContainerStarted [event](#head.Notifications)* -Triggered when the container has stopped running. +Notifies container is started ### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.containerId | string | Identifier of container | +| params.name | string | - | + +### Examples + +```json +{ + "jsonrpc": 2.0, + "id": 16, + "method": "org.rdk.OCIContainer.onContainerStarted", + "params": { + "containerId": "", + "name": "" + } +} +``` + +## *onContainerStateChanged [event](#head.Notifications)* + +Notifies state change of container + +### Parameters | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.descriptor | integer | The container descriptor | -| params.name | string | Name of the Container | +| params.containerId | string | Identifier of container | +| params.state | ContainerState | - | -### Example +### Examples ```json { - "jsonrpc": "2.0", - "method": "client.events.onContainerStopped", + "jsonrpc": 2.0, + "id": 17, + "method": "org.rdk.OCIContainer.onContainerStateChanged", "params": { - "descriptor": 91, - "name": "com.bskyb.epgui" + "containerId": "", + "state": "INVALID" } } ``` + +## *onContainerStopped [event](#head.Notifications)* + +Notifies container is stopped + +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.containerId | string | Identifier of container | +| params.name | string | - | + +### Examples + +```json +{ + "jsonrpc": 2.0, + "id": 18, + "method": "org.rdk.OCIContainer.onContainerStopped", + "params": { + "containerId": "", + "name": "" + } +} +``` diff --git a/docs/apis/PackageManagerPlugin.md b/docs/apis/PackageManagerPlugin.md new file mode 100644 index 00000000..162873c9 --- /dev/null +++ b/docs/apis/PackageManagerPlugin.md @@ -0,0 +1,969 @@ + + +# PackageManager Plugin + +**Version: [1.0.0](https://github.com/rdkcentral/rdkservices/blob/main/PackageManager/CHANGELOG.md)** + +A PackageManager plugin for Thunder framework. + +### Table of Contents + +- [Abbreviation, Acronyms and Terms](#head.Abbreviation,_Acronyms_and_Terms) +- [Description](#head.Description) +- [Configuration](#head.Configuration) +- [Methods](#head.Methods) +- [Notifications](#head.Notifications) + + +# Abbreviation, Acronyms and Terms + +[[Refer to this link](userguide/aat.md)] + + +# Description + +The `PackageManager` plugin provides an interface for PackageManager. + +The plugin is designed to be loaded and executed within the Thunder framework. For more information about the framework refer to [[Thunder](#ref.Thunder)]. + + +# Configuration + +The table below lists configuration options of the plugin. + +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| callsign | string | Plugin instance name (default: org.rdk.PackageManager) | +| classname | string | Class name: *PackageManager* | +| locator | string | Library name: *libWPEFrameworkPackageManager.so* | +| autostart | boolean | Determines if the plugin shall be started automatically along with the framework | + + +# Methods + +The following methods are provided by the PackageManager plugin: + +PackageManager interface methods: + +| Method | Description | +| :-------- | :-------- | +| [cancel](#method.cancel) | Cancel asynchronous request. | +| [clearAuxMetadata](#method.clearAuxMetadata) | Clears an arbitrary metadata. | +| [download](#method.download) | Download arbitrary application's resource file. | +| [getList](#method.getList) | List installed applications. | +| [getLockInfo](#method.getLockInfo) | Get lock info. | +| [getMetadata](#method.getMetadata) | Get application metadata. | +| [getProgress](#method.getProgress) | Estimated progress of a request. | +| [getStorageDetails](#method.getStorageDetails) | Information on the storage usage. | +| [install](#method.install) | Download the application bundle. | +| [lock](#method.lock) | Lock the application. Preventing uninstallation. | +| [offer](#method.offer) | | +| [operationStatusUpdate](#method.operationStatusUpdate) | | +| [reset](#method.reset) | Delete persistent data stored locally. | +| [revoke](#method.revoke) | | +| [setAuxMetadata](#method.setAuxMetadata) | Set an arbitrary metadata. | +| [uninstall](#method.uninstall) | Uninstall the application. | +| [unlock](#method.unlock) | Unlock application. | + + +## *cancel [method](#head.Methods)* + +Cancel asynchronous request. + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.handle | string | - | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 0, + "method": "org.rdk.PackageManager.cancel", + "params": { + "handle": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 0, + "result": null +} +``` + + +## *clearAuxMetadata [method](#head.Methods)* + +Clears an arbitrary metadata. + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.type | string | - | +| params.id | string | - | +| params.version | string | - | +| params.key | string | - | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 1, + "method": "org.rdk.PackageManager.clearAuxMetadata", + "params": { + "type": "", + "id": "", + "version": "", + "key": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 1, + "result": null +} +``` + + +## *download [method](#head.Methods)* + +Download arbitrary application's resource file. + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.type | string | - | +| params.id | string | - | +| params.version | string | - | +| params.resKey | string | - | +| params.url | string | - | +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result.handle | string | - | + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 2, + "method": "org.rdk.PackageManager.download", + "params": { + "type": "", + "id": "", + "version": "", + "resKey": "", + "url": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 2, + "result": "" +} +``` + + +## *getList [method](#head.Methods)* + +List installed applications. + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.type | string | - | +| params.id | string | - | +| params.version | string | - | +| params.appName | string | - | +| params.category | string | - | +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result.installedIds | IPackageKeyIterator | - | +| result.installedIds[#].id | string | - | +| result.installedIds[#].version | string | - | + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 3, + "method": "org.rdk.PackageManager.getList", + "params": { + "type": "", + "id": "", + "version": "", + "appName": "", + "category": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 3, + "result": [ + { + "id": "", + "version": "" + } + ] +} +``` + + +## *getLockInfo [method](#head.Methods)* + +Get lock info. + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.type | string | - | +| params.id | string | - | +| params.version | string | - | +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result.result | LockInfo | - | +| result.result.reason | string | - | +| result.result.owner | string | - | + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 4, + "method": "org.rdk.PackageManager.getLockInfo", + "params": { + "type": "", + "id": "", + "version": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 4, + "result": { + "reason": "", + "owner": "" + } +} +``` + + +## *getMetadata [method](#head.Methods)* + +Get application metadata. + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.type | string | - | +| params.id | string | - | +| params.version | string | - | +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result.metadata | MetadataPayload | - | +| result.metadata.appName | string | - | +| result.metadata.type | string | - | +| result.metadata.category | string | - | +| result.metadata.url | string | - | +| result.resources | IPackageManager::IKeyValueIterator | - | +| result.auxMetadata | IPackageManager::IKeyValueIterator | - | + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 5, + "method": "org.rdk.PackageManager.getMetadata", + "params": { + "type": "", + "id": "", + "version": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 5, + "result": { + "metadata": { + "appName": "", + "type": "", + "category": "", + "url": "" + }, + "resources": "", + "auxMetadata": "" + } +} +``` + + +## *getProgress [method](#head.Methods)* + +Estimated progress of a request. + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.handle | string | - | +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result.progress | uint32_t | - | + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 6, + "method": "org.rdk.PackageManager.getProgress", + "params": { + "handle": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 6, + "result": 0 +} +``` + + +## *getStorageDetails [method](#head.Methods)* + +Information on the storage usage. + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.type | string | - | +| params.id | string | - | +| params.version | string | - | +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result.storageinfo | StorageInfo | - | +| result.storageinfo.EXTERNAL | struct | - | +| result.storageinfo.path | string | - | +| result.storageinfo.quotaKB | string | - | +| result.storageinfo.usedKB | string | - | + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 7, + "method": "org.rdk.PackageManager.getStorageDetails", + "params": { + "type": "", + "id": "", + "version": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 7, + "result": { + "EXTERNAL": "", + "path": "", + "quotaKB": "", + "usedKB": "" + } +} +``` + + +## *install [method](#head.Methods)* + +Download the application bundle. + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.type | string | - | +| params.id | string | - | +| params.version | string | - | +| params.url | string | - | +| params.appName | string | - | +| params.category | string | - | +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result.handle | string | - | + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 8, + "method": "org.rdk.PackageManager.install", + "params": { + "type": "", + "id": "", + "version": "", + "url": "", + "appName": "", + "category": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 8, + "result": "" +} +``` + + +## *lock [method](#head.Methods)* + +Lock the application. Preventing uninstallation. + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.type | string | - | +| params.id | string | - | +| params.version | string | - | +| params.reason | string | - | +| params.owner | string | - | +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result.handle | string | - | + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 9, + "method": "org.rdk.PackageManager.lock", + "params": { + "type": "", + "id": "", + "version": "", + "reason": "", + "owner": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 9, + "result": "" +} +``` + + +## *offer [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.packagemanager | IPackageManager | - | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 10, + "method": "org.rdk.PackageManager.offer", + "params": { + "packagemanager": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 10, + "result": null +} +``` + + +## *operationStatusUpdate [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.handle | string | - | +| params.operation | string | - | +| params.type | string | - | +| params.id | string | - | +| params.version | string | - | +| params.status | string | - | +| params.details | string | - | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 11, + "method": "org.rdk.PackageManager.operationStatusUpdate", + "params": { + "handle": "", + "operation": "", + "type": "", + "id": "", + "version": "", + "status": "", + "details": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 11, + "result": null +} +``` + + +## *reset [method](#head.Methods)* + +Delete persistent data stored locally. + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.type | string | - | +| params.id | string | - | +| params.version | string | - | +| params.resetType | string | - | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 12, + "method": "org.rdk.PackageManager.reset", + "params": { + "type": "", + "id": "", + "version": "", + "resetType": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 12, + "result": null +} +``` + + +## *revoke [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.packagemanager | IPackageManager | - | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 13, + "method": "org.rdk.PackageManager.revoke", + "params": { + "packagemanager": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 13, + "result": null +} +``` + + +## *setAuxMetadata [method](#head.Methods)* + +Set an arbitrary metadata. + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.type | string | - | +| params.id | string | - | +| params.version | string | - | +| params.key | string | - | +| params.value | string | - | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 14, + "method": "org.rdk.PackageManager.setAuxMetadata", + "params": { + "type": "", + "id": "", + "version": "", + "key": "", + "value": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 14, + "result": null +} +``` + + +## *uninstall [method](#head.Methods)* + +Uninstall the application. + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.type | string | - | +| params.id | string | - | +| params.version | string | - | +| params.uninstallType | string | - | +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result.handle | string | - | + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 15, + "method": "org.rdk.PackageManager.uninstall", + "params": { + "type": "", + "id": "", + "version": "", + "uninstallType": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 15, + "result": "" +} +``` + + +## *unlock [method](#head.Methods)* + +Unlock application. + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.handle | string | - | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 16, + "method": "org.rdk.PackageManager.unlock", + "params": { + "handle": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 16, + "result": null +} +``` + + + + +# Notifications + +Notifications are autonomous events, triggered by the internals of the implementation, and broadcasted via JSON-RPC to all registered observers. Refer to [[Thunder](#ref.Thunder)] for information on how to register for a notification. + +The following events are provided by the PackageManager plugin: + +PackageManager interface events: + +| Event | Description | +| :-------- | :-------- | +| [operationStatus](#event.operationStatus) | Completion of asynchronous operation. | + + +## *operationStatus [event](#head.Notifications)* + +Completion of asynchronous operation. + +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.handle | string | - | +| params.operation | string | - | +| params.type | string | - | +| params.id | string | - | +| params.version | string | - | +| params.status | string | - | +| params.details | string | - | + +### Examples + +```json +{ + "jsonrpc": 2.0, + "id": 17, + "method": "org.rdk.PackageManager.operationStatus", + "params": { + "handle": "", + "operation": "", + "type": "", + "id": "", + "version": "", + "status": "", + "details": "" + } +} +``` diff --git a/docs/apis/PackagerPlugin.md b/docs/apis/PackagerPlugin.md index bf41edbf..4e62a1ae 100644 --- a/docs/apis/PackagerPlugin.md +++ b/docs/apis/PackagerPlugin.md @@ -1,43 +1,44 @@ - + # Packager Plugin -**Version: [1.0.0]()** +**Version: [1.0.0](https://github.com/rdkcentral/rdkservices/blob/main/Packager/CHANGELOG.md)** A Packager plugin for Thunder framework. ### Table of Contents -- [Abbreviation, Acronyms and Terms](#Abbreviation,_Acronyms_and_Terms) -- [Description](#Description) -- [Configuration](#Configuration) -- [Methods](#Methods) +- [Abbreviation, Acronyms and Terms](#head.Abbreviation,_Acronyms_and_Terms) +- [Description](#head.Description) +- [Configuration](#head.Configuration) +- [Methods](#head.Methods) +- [Notifications](#head.Notifications) - + # Abbreviation, Acronyms and Terms -[[Refer to this link](overview/aat.md)] +[[Refer to this link](userguide/aat.md)] - + # Description -The `Packager` plugin allows installation of OPKG, IPKG, and DEB packages to the system from a remote repository. +The `Packager` plugin provides an interface for Packager. -The plugin is designed to be loaded and executed within the Thunder framework. For more information about the framework refer to [[Thunder](#Thunder)]. +The plugin is designed to be loaded and executed within the Thunder framework. For more information about the framework refer to [[Thunder](#ref.Thunder)]. - + # Configuration The table below lists configuration options of the plugin. | Name | Type | Description | | :-------- | :-------- | :-------- | -| callsign | string | Plugin instance name (default: *Packager*) | +| callsign | string | Plugin instance name (default: org.rdk.Packager) | | classname | string | Class name: *Packager* | | locator | string | Library name: *libWPEFrameworkPackager.so* | | autostart | boolean | Determines if the plugin shall be started automatically along with the framework | - + # Methods The following methods are provided by the Packager plugin: @@ -46,111 +47,492 @@ Packager interface methods: | Method | Description | | :-------- | :-------- | -| [install](#install) | Installs a package given by a name, a URL, or a file path | -| [synchronize](#synchronize) | Synchronizes the repository manifest with a repository | +| [abort](#method.abort) | | +| [appName](#method.appName) | | +| [architecture](#method.architecture) | | +| [configure](#method.configure) | | +| [errorCode](#method.errorCode) | | +| [install](#method.install) | | +| [name](#method.name) | | +| [progress](#method.progress) | | +| [state](#method.state) | | +| [synchronizeRepository](#method.synchronizeRepository) | | +| [version](#method.version) | | + +## *abort [method](#head.Methods)* - -## *install* -Installs a package given by a name, a URL, or a file path. ### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 0, + "method": "org.rdk.Packager.abort" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 0, + "result": null +} +``` + + +## *appName [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 1, + "method": "org.rdk.Packager.appName" +} +``` -No Events +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 1, + "result": null +} +``` + + +## *architecture [method](#head.Methods)* + + + +### Events +No events are associated with this method. ### Parameters +This method takes no parameters. +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 2, + "method": "org.rdk.Packager.architecture" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 2, + "result": null +} +``` + + +## *configure [method](#head.Methods)* + + +### Events +No events are associated with this method. +### Parameters | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.package | string | A name, a URL, or a file path of the package to install | -| params?.version | string | *(optional)* Version of the package to install | -| params?.architecture | string | *(optional)* Architecture of the package to install | +| params.service | PluginHost::IShell | - | +### Results +This method returns no results. -### Result +### Examples -| Name | Type | Description | -| :-------- | :-------- | :-------- | -| result | null | Always null | -### Errors +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 3, + "method": "org.rdk.Packager.configure", + "params": { + "service": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 3, + "result": null +} +``` + + +## *errorCode [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +This method returns no results. + +### Examples -| Code | Message | Description | + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 4, + "method": "org.rdk.Packager.errorCode" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 4, + "result": null +} +``` + + +## *install [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | | :-------- | :-------- | :-------- | -| 12 | ```ERROR_INPROGRESS``` | Returned when the function is called while other installation/synchronization is already in progress | +| params | object | | +| params.name | string | - | +| params.version | string | - | +| params.arch | string | - | +### Results +This method returns no results. + +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "Packager.install", + "jsonrpc": 2.0, + "id": 5, + "method": "org.rdk.Packager.install", "params": { - "package": "wpeframework-plugin-netflix", - "version": "1.0", - "architecture": "arm" + "name": "", + "version": "", + "arch": "" } } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 5, "result": null } ``` - -## *synchronize* + +## *name [method](#head.Methods)* + -Synchronizes the repository manifest with a repository. ### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +This method returns no results. -No Events +### Examples + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 6, + "method": "org.rdk.Packager.name" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 6, + "result": null +} +``` + + +## *progress [method](#head.Methods)* + + + +### Events +No events are associated with this method. ### Parameters +This method takes no parameters. +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 7, + "method": "org.rdk.Packager.progress" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 7, + "result": null +} +``` + + +## *state [method](#head.Methods)* + + +### Events +No events are associated with this method. +### Parameters This method takes no parameters. +### Results +This method returns no results. -### Result +### Examples -| Name | Type | Description | -| :-------- | :-------- | :-------- | -| result | null | Always null | -### Errors +#### Request -| Code | Message | Description | -| :-------- | :-------- | :-------- | -| 12 | ```ERROR_INPROGRESS``` | Returned when the function is called while other installation/synchronization is already in progress. | +```json +{ + "jsonrpc": 2.0, + "id": 8, + "method": "org.rdk.Packager.state" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 8, + "result": null +} +``` + + +## *synchronizeRepository [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +This method returns no results. + +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "Packager.synchronize" + "jsonrpc": 2.0, + "id": 9, + "method": "org.rdk.Packager.synchronizeRepository" } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 9, "result": null } ``` + +## *version [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 10, + "method": "org.rdk.Packager.version" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 10, + "result": null +} +``` + + + + +# Notifications + +Notifications are autonomous events, triggered by the internals of the implementation, and broadcasted via JSON-RPC to all registered observers. Refer to [[Thunder](#ref.Thunder)] for information on how to register for a notification. + +The following events are provided by the Packager plugin: + +Packager interface events: + +| Event | Description | +| :-------- | :-------- | +| [repositorySynchronize](#event.repositorySynchronize) | | +| [stateChange](#event.stateChange) | | + + +## *repositorySynchronize [event](#head.Notifications)* + + + +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.status | uint32_t | - | + +### Examples + +```json +{ + "jsonrpc": 2.0, + "id": 11, + "method": "org.rdk.Packager.repositorySynchronize", + "params": { + "status": 0 + } +} +``` + + +## *stateChange [event](#head.Notifications)* + + + +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.package | IPackageInfo | - | +| params.install | IInstallationInfo | - | + +### Examples + +```json +{ + "jsonrpc": 2.0, + "id": 12, + "method": "org.rdk.Packager.stateChange", + "params": { + "package": "", + "install": "" + } +} +``` diff --git a/docs/apis/PlayerInfoPlugin.md b/docs/apis/PlayerInfoPlugin.md index 16220877..c7d72926 100644 --- a/docs/apis/PlayerInfoPlugin.md +++ b/docs/apis/PlayerInfoPlugin.md @@ -1,504 +1,207 @@ - -# Player Info Plugin + +# PlayerInfo Plugin -**Version: [1.0.0]()** +**Version: [1.0.0](https://github.com/rdkcentral/rdkservices/blob/main/PlayerInfo/CHANGELOG.md)** A PlayerInfo plugin for Thunder framework. ### Table of Contents -- [Abbreviation, Acronyms and Terms](#Abbreviation,_Acronyms_and_Terms) -- [Description](#Description) -- [Configuration](#Configuration) -- [Methods](#Methods) -- [Properties](#Properties) -- [Notifications](#Notifications) +- [Abbreviation, Acronyms and Terms](#head.Abbreviation,_Acronyms_and_Terms) +- [Description](#head.Description) +- [Configuration](#head.Configuration) +- [Properties](#head.Properties) - + # Abbreviation, Acronyms and Terms -[[Refer to this link](overview/aat.md)] +[[Refer to this link](userguide/aat.md)] - + # Description -The `PlayerInfo` plugin helps to get system supported audio and video codecs. +The `PlayerInfo` plugin provides an interface for PlayerInfo. -The plugin is designed to be loaded and executed within the Thunder framework. For more information about the framework refer to [[Thunder](#Thunder)]. +The plugin is designed to be loaded and executed within the Thunder framework. For more information about the framework refer to [[Thunder](#ref.Thunder)]. - + # Configuration The table below lists configuration options of the plugin. | Name | Type | Description | | :-------- | :-------- | :-------- | -| callsign | string | Plugin instance name (default: *PlayerInfo*) | +| callsign | string | Plugin instance name (default: org.rdk.PlayerInfo) | | classname | string | Class name: *PlayerInfo* | -| locator | string | Library name: *libWPEPlayerInfo.so* | +| locator | string | Library name: *libWPEFrameworkPlayerInfo.so* | | autostart | boolean | Determines if the plugin shall be started automatically along with the framework | - -# Methods -The following methods are provided by the PlayerInfo plugin: + +# Properties +The following properties are provided by the PlayerInfo plugin: -PlayerInfo interface methods: +PlayerInfo interface properties: | Method | Description | | :-------- | :-------- | -| [audiocodecs](#audiocodecs) | Returns the audio codec supported by the platform | -| [videocodecs](#videocodecs) | Returns the video codec supported by the platform | +| [AudioCodecs](#property.AudioCodecs)RO | | +| [IsAudioEquivalenceEnabled](#property.IsAudioEquivalenceEnabled)RO | Checks Loudness Equivalence in platform | +| [Resolution](#property.Resolution)RO | Current Video playback resolution | +| [VideoCodecs](#property.VideoCodecs)RO | | + +## *AudioCodecs [property](#head.Properties)* - -## *audiocodecs* -Returns the audio codec supported by the platform. +> This property is read-only. ### Events - -No Events - -### Parameters - -This method takes no parameters. - -### Result - +No events are associated with this method. +### Values | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | array | | -| result[#] | string | (must be one of the following: *AudioUndefined*, *AudioAac*, *AudioAc3*, *AudioAc3Plus*, *AudioDts*, *AudioMpeg1*, *AudioMpeg2*, *AudioMpeg3*, *AudioMpeg4*, *AudioOpus*, *AudioVorbisOgg*, *AudioWav*) | +| (property).codec | IAudioCodecIterator | | +| (property).codec[#] | string | | -### Example +### Examples -#### Request -```json -{ - "jsonrpc": "2.0", - "id": 42, - "method": "PlayerInfo.audiocodecs" -} -``` - -#### Response +#### Get Request ```json { - "jsonrpc": "2.0", - "id": 42, - "result": [ - "AudioUndefined" - ] + "jsonrpc": 2.0, + "id": 0, + "method": "org.rdk.PlayerInfo.audioCodecs" } ``` - -## *videocodecs* - -Returns the video codec supported by the platform. - -### Events - -No Events - -### Parameters - -This method takes no parameters. - -### Result -| Name | Type | Description | -| :-------- | :-------- | :-------- | -| result | array | | -| result[#] | string | (must be one of the following: *VideoUndefined*, *VideoH263*, *VideoH264*, *VideoH265*, *VideoH26510*, *VideoMpeg*, *VideoVp8*, *VideoVp9*, *VideoVp10*) | - -### Example - -#### Request - -```json -{ - "jsonrpc": "2.0", - "id": 42, - "method": "PlayerInfo.videocodecs" -} -``` - -#### Response +#### Get Response ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 0, "result": [ - "VideoUndefined" + "AUDIO_UNDEFINED" ] } ``` - -# Properties - -The following properties are provided by the PlayerInfo plugin: - -PlayerInfo interface properties: - -| Property | Description | -| :-------- | :-------- | -| [playerinfo](#playerinfo) RO | Player general information | -| [resolution](#resolution) RO | Current configured video output port resolution | -| [isaudioequivalenceenabled](#isaudioequivalenceenabled) RO | Check for Loudness Equivalence in the platform | -| [dolby atmosmetadata](#dolby_atmosmetadata) RO | Atmos capabilities of Sink | -| [dolby soundmode](#dolby_soundmode) RO | Current sound mode | -| [dolby enableatmosoutput](#dolby_enableatmosoutput) WO | Audio output enablement for Atmos | -| [dolby mode](#dolby_mode) | Dolby mode | + +## *IsAudioEquivalenceEnabled [property](#head.Properties)* +Checks Loudness Equivalence in platform - -## *playerinfo* - -Provides access to the player general information. - -> This property is **read-only**. - +> This property is read-only. ### Events - -No Events - -### Value - +No events are associated with this method. +### Values | Name | Type | Description | | :-------- | :-------- | :-------- | -| (property) | object | Player general information | -| (property).audio | array | | -| (property).audio[#] | string | Audio Codec supported by the platform (must be one of the following: *Undefined*, *AAC*, *AC3*, *AC3Plus*, *DTS*, *MPEG1*, *MPEG2*, *MPEG3*, *MPEG4*, *OPUS*, *VorbisOGG*, *WAV*) | -| (property).video | array | | -| (property).video[#] | string | Video Codec supported by the platform (must be one of the following: *Undefined*, *H263*, *H264*, *H265*, *H26510*, *MPEG*, *MPEG2*, *MPEG4*, *VP8*, *VP9*, *VP10*) | - -### Example - -#### Get Request +| (property).ae | bool | enabled/disabled | -```json -{ - "jsonrpc": "2.0", - "id": 42, - "method": "PlayerInfo.playerinfo" -} -``` +### Examples -#### Get Response - -```json -{ - "jsonrpc": "2.0", - "id": 42, - "result": { - "audio": [ - "AudioAAC" - ], - "video": [ - "VideoH264" - ] - } -} -``` - - -## *resolution* - -Provides access to the current configured video output port resolution. - -> This property is **read-only**. - -### Events - -No Events - -### Value - -| Name | Type | Description | -| :-------- | :-------- | :-------- | -| (property) | string | Current configured video output port resolution (must be one of the following: *ResolutionUnknown*, *Resolution480I*, *Resolution480P*, *Resolution576I*, *Resolution576P*, *Resolution720P*, *Resolution1080I*, *Resolution1080P*, *Resolution2160P30*, *Resolution2160P60*) | - -### Example #### Get Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "PlayerInfo.resolution" + "jsonrpc": 2.0, + "id": 1, + "method": "org.rdk.PlayerInfo.isAudioEquivalenceEnabled" } ``` -#### Get Response - -```json -{ - "jsonrpc": "2.0", - "id": 42, - "result": "ResolutionUnknown" -} -``` - - -## *isaudioequivalenceenabled* - -Provides access to the check for Loudness Equivalence in the platform. - -> This property is **read-only**. - -### Events - -No Events - -### Value - -| Name | Type | Description | -| :-------- | :-------- | :-------- | -| (property) | boolean | Check for Loudness Equivalence in the platform | - -### Example - -#### Get Request - -```json -{ - "jsonrpc": "2.0", - "id": 42, - "method": "PlayerInfo.isaudioequivalenceenabled" -} -``` #### Get Response ```json { - "jsonrpc": "2.0", - "id": 42, - "result": false + "jsonrpc": 2.0, + "id": 1, + "result": true } ``` - -## *dolby_atmosmetadata* - -Provides access to the atmos capabilities of Sink. + +## *Resolution [property](#head.Properties)* -> This property is **read-only**. +Current Video playback resolution +> This property is read-only. ### Events - -No Events - -### Value - +No events are associated with this method. +### Values | Name | Type | Description | | :-------- | :-------- | :-------- | -| (property) | boolean | Atmos capabilities of Sink | - -### Example - -#### Get Request - -```json -{ - "jsonrpc": "2.0", - "id": 42, - "method": "PlayerInfo.dolby_atmosmetadata" -} -``` - -#### Get Response - -```json -{ - "jsonrpc": "2.0", - "id": 42, - "result": false -} -``` +| (property).res | PlaybackResolution | resolution | - -## *dolby_soundmode* +### Examples -Provides access to the current sound mode. - -> This property is **read-only**. - -### Events - -No Events - -### Value - -| Name | Type | Description | -| :-------- | :-------- | :-------- | -| (property) | string | Current sound mode (must be one of the following: *Unknown*, *Mono*, *Stereo*, *Surround*, *Passthru*) | - -### Example #### Get Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "PlayerInfo.dolby_soundmode" + "jsonrpc": 2.0, + "id": 2, + "method": "org.rdk.PlayerInfo.resolution" } ``` + #### Get Response ```json { - "jsonrpc": "2.0", - "id": 42, - "result": "Unknown" + "jsonrpc": 2.0, + "id": 2, + "result": "RESOLUTION_UNKNOWN" } ``` - -## *dolby_enableatmosoutput* + +## *VideoCodecs [property](#head.Properties)* -Provides access to the audio output enablement for Atmos. -> This property is **write-only**. +> This property is read-only. ### Events - -No Events - -### Value - +No events are associated with this method. +### Values | Name | Type | Description | | :-------- | :-------- | :-------- | -| (property) | boolean | Audio output enablement for Atmos | - -### Example +| (property).codec | IVideoCodecIterator | | +| (property).codec[#] | string | | -#### Set Request +### Examples -```json -{ - "jsonrpc": "2.0", - "id": 42, - "method": "PlayerInfo.dolby_enableatmosoutput", - "params": false -} -``` - -#### Set Response - -```json -{ - "jsonrpc": "2.0", - "id": 42, - "result": "null" -} -``` - - -## *dolby_mode* - -Provides access to the dolby mode. - -### Events - -No Events - -### Value - -| Name | Type | Description | -| :-------- | :-------- | :-------- | -| (property) | string | Dolby mode (must be one of the following: *DigitalPcm*, *DigitalPlus*, *DigitalAc3*, *Auto*, *Ms12*) | - -### Example #### Get Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "PlayerInfo.dolby_mode" + "jsonrpc": 2.0, + "id": 3, + "method": "org.rdk.PlayerInfo.videoCodecs" } ``` -#### Get Response - -```json -{ - "jsonrpc": "2.0", - "id": 42, - "result": "DigitalPcm" -} -``` - -#### Set Request - -```json -{ - "jsonrpc": "2.0", - "id": 42, - "method": "PlayerInfo.dolby_mode", - "params": "DigitalPcm" -} -``` -#### Set Response - -```json -{ - "jsonrpc": "2.0", - "id": 42, - "result": "null" -} -``` - - -# Notifications - -Notifications are autonomous events, triggered by the internals of the implementation, and broadcasted via JSON-RPC to all registered observers. Refer to [[Thunder](#Thunder)] for information on how to register for a notification. - -The following events are provided by the PlayerInfo plugin: - -PlayerInfo interface events: - -| Event | Description | -| :-------- | :-------- | -| [dolby audiomodechanged](#dolby_audiomodechanged) | Triggered after the audio sound mode changes | - - - -## *dolby_audiomodechanged* - -Triggered after the audio sound mode changes. - -### Parameters - -| Name | Type | Description | -| :-------- | :-------- | :-------- | -| params | object | | -| params.mode | string | The sound mode (must be one of the following: *Unknown*, *Mono*, *Stereo*, *Surround*, *Passthru*) | -| params.enable | boolean | | - -### Example +#### Get Response ```json { - "jsonrpc": "2.0", - "method": "client.events.dolby_audiomodechanged", - "params": { - "mode": "Unknown", - "enable": true - } + "jsonrpc": 2.0, + "id": 3, + "result": [ + "VIDEO_UNDEFINED" + ] } ``` diff --git a/docs/apis/RDKWindowManagerPlugin.md b/docs/apis/RDKWindowManagerPlugin.md index 4e618afe..33ae1a9f 100644 --- a/docs/apis/RDKWindowManagerPlugin.md +++ b/docs/apis/RDKWindowManagerPlugin.md @@ -1,289 +1,310 @@ - + # RDKWindowManager Plugin -**Version: [1.0.0]()** +**Version: [1.0.0](https://github.com/rdkcentral/rdkservices/blob/main/RDKWindowManager/CHANGELOG.md)** -A org.rdk.RDKWindowManager plugin for Thunder framework. +A RDKWindowManager 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](#head.Abbreviation,_Acronyms_and_Terms) +- [Description](#head.Description) +- [Configuration](#head.Configuration) +- [Methods](#head.Methods) +- [Notifications](#head.Notifications) - + # Abbreviation, Acronyms and Terms -[[Refer to this link](overview/aat.md)] +[[Refer to this link](userguide/aat.md)] - + # Description -The `RDKWindowManager`plugin controls the management of composition, layout, Z order, and key handling. +The `RDKWindowManager` plugin provides an interface for RDKWindowManager. -The plugin is designed to be loaded and executed within the Thunder framework. For more information about the framework refer to [[Thunder](#Thunder)]. +The plugin is designed to be loaded and executed within the Thunder framework. For more information about the framework refer to [[Thunder](#ref.Thunder)]. - + # Configuration The table below lists configuration options of the plugin. | Name | Type | Description | | :-------- | :-------- | :-------- | -| callsign | string | Plugin instance name (default: *org.rdk.RDKWindowManager*) | -| classname | string | Class name: *org.rdk.RDKWindowManager* | +| callsign | string | Plugin instance name (default: org.rdk.RDKWindowManager) | +| classname | string | Class name: *RDKWindowManager* | | locator | string | Library name: *libWPEFrameworkRDKWindowManager.so* | | autostart | boolean | Determines if the plugin shall be started automatically along with the framework | - + # Methods -The following methods are provided by the org.rdk.RDKWindowManager plugin: +The following methods are provided by the RDKWindowManager plugin: RDKWindowManager interface methods: | Method | Description | | :-------- | :-------- | -| [addKeyIntercept](#addKeyIntercept) | Adds a key intercept to the client application specified | -| [addKeyIntercepts](#addKeyIntercepts) | Adds the list of key intercepts | -| [addKeyListener](#addKeyListener) | Adds a key listener to an application | -| [createDisplay](#createDisplay) | Creates a display for the specified client using the configuration parameters | -| [enableInactivityReporting](#enableInactivityReporting) | Enables or disables inactivity reporting and events | -| [enableInputEvents](#enableInputEvents) | Enables KeyInputEvents for list of clients specified | -| [enableKeyRepeats](#enableKeyRepeats) | Enables or disables key repeats | -| [generateKey](#generateKey) | Triggers the key events (key press and release) | -| [getClients](#getClients) | Gets a list of clients | -| [getKeyRepeatsEnabled](#getKeyRepeatsEnabled) | Returns whether key repeating is enabled or disabled | -| [ignoreKeyInputs](#ignoreKeyInputs) | Blocks user key inputs | -| [injectKey](#injectKey) | Injects the keys | -| [keyRepeatConfig](#keyRepeatConfig) | Configuration for keyrepeat | -| [removeKeyIntercept](#removeKeyIntercept) | Removes a key intercept | -| [removeKeyListener](#removeKeyListener) | Removes a key listener for an application | -| [resetInactivityTime](#resetInactivityTime) | Resets the inactivity notification interval | -| [setInactivityInterval](#setInactivityInterval) | Sets the inactivity notification interval | - - - -## *addKeyIntercept* - -Adds a key intercept to the client application specified. The keys are specified by a key code and a set of modifiers. Regardless of the application that has focus, key presses that match the key code and modifiers will be sent to the client application. +| [addKeyIntercept](#method.addKeyIntercept) | Registers a key intercept for a specific key code and client | +| [addKeyIntercepts](#method.addKeyIntercepts) | Registers multiple key intercepts in a single operation. | +| [addKeyListener](#method.addKeyListener) | Registers listeners for specific keys. | +| [createDisplay](#method.createDisplay) | Create the display window | +| [enableDisplayRender](#method.enableDisplayRender) | Enable or disable the rendering of a Wayland display | +| [enableInactivityReporting](#method.enableInactivityReporting) | Enables the inactivity reporting | +| [enableInputEvents](#method.enableInputEvents) | Enables KeyInputEvents for list of clients specified | +| [enableKeyRepeats](#method.enableKeyRepeats) | Key repeats are enabled/disabled | +| [generateKey](#method.generateKey) | Generates a key event for the specified keys and client. | +| [getClients](#method.getClients) | get the list of Clients which are available | +| [getKeyRepeatsEnabled](#method.getKeyRepeatsEnabled) | Retrieves the flag determining whether keyRepeat true/false | +| [ignoreKeyInputs](#method.ignoreKeyInputs) | Ignore key inputs | +| [injectKey](#method.injectKey) | Simulates a key press event with optional modifiers. | +| [keyRepeatConfig](#method.keyRepeatConfig) | Enables KeyInputEvents for list of clients specified | +| [removeKeyIntercept](#method.removeKeyIntercept) | Removes a key intercept for a specific key code and client. | +| [removeKeyListener](#method.removeKeyListener) | Removes listeners for specific keys. | +| [renderReady](#method.renderReady) | To get the status of first frame is rendered or not | +| [resetInactivityTime](#method.resetInactivityTime) | Resets inactivity interval if EnableUserInactivity feature is enabled | +| [setFocus](#method.setFocus) | Sets the focus to the app with the app id | +| [setInactivityInterval](#method.setInactivityInterval) | Sets inactivity interval if EnableUserInactivity feature is enabled | +| [setVisible](#method.setVisible) | Sets the visibility of the given client or appInstanceId | + + +## *addKeyIntercept [method](#head.Methods)* + +Registers a key intercept for a specific key code and client ### Events - -No Events - +No events are associated with this method. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.intercept | string | A JSON String containing client, callSign (optional), keyCode and modifiers (optional) | - -### Result +| params.intercept | string | JSON String format with the client/callSign, keyCode, modifiers | +### Results +This method returns no results. -| Name | Type | Description | -| :-------- | :-------- | :-------- | -| result | null | null on success | +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 0, "method": "org.rdk.RDKWindowManager.addKeyIntercept", "params": { - "intercept": "{\"client\":\"org.rdk.Netflix\",\"keyCode\":37,\"modifiers\":[\"shift\"]}" + "intercept": "" } } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 0, "result": null } ``` - -## *addKeyIntercepts* + +## *addKeyIntercepts [method](#head.Methods)* -Adds the list of key intercepts. +Registers multiple key intercepts in a single operation. ### Events - -No Events - +No events are associated with this method. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.intercepts | string | A JSON String containing client, callSign (optional), keyCode and modifiers (optional) | +| params.intercepts | string | JSON String format containing the array of key intercept(client/callSign, keyCode, modifiers) configuration | +### Results +This method returns no results. -### Result - -| Name | Type | Description | -| :-------- | :-------- | :-------- | -| result | null | null on success | +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 1, "method": "org.rdk.RDKWindowManager.addKeyIntercepts", "params": { - "intercepts": "{\"intercepts\":[{\"keys\":[{\"keyCode\": 37,\"modifiers\":[\"ctrl\",\"alt\"]},{\"keyCode\": 38,\"modifiers\":[\"shift\"]}],\"client\":\"org.rdk.Netflix\"}]}" + "intercepts": "" } } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 1, "result": null } ``` - -## *addKeyListener* + +## *addKeyListener [method](#head.Methods)* -Adds a key listener to an application. The keys are bubbled up based on their z-order. +Registers listeners for specific keys. ### Events - -No Events - +No events are associated with this method. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.keyListeners | string | A JSON String containing keys(keyCode, nativekeyCode (optional), modifiers (optional), activate, propagate), client, callSign (optional) | - -### Result +| params.keyListeners | string | JSON String format containing the keylisteneres with keys(keyCode,nativekeyCode,modifiers,activate,propagate) and client/callSign | +### Results +This method returns no results. -| Name | Type | Description | -| :-------- | :-------- | :-------- | -| result | null | null on success | +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 2, "method": "org.rdk.RDKWindowManager.addKeyListener", "params": { - "keyListeners": "{\"keys\":[{\"keyCode\":37,\"modifiers\":[\"shift\"],\"activate\":false,\"propagate\":true}],\"client\":\"org.rdk.Netflix\"}" + "keyListeners": "" } } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 2, "result": null } ``` - -## *createDisplay* + +## *createDisplay [method](#head.Methods)* - Creates a display for the specified client using the configuration parameters. +Create the display window ### Events - -No Events - +No events are associated with this method. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.displayParams | string | A JSON String containing client, callSign (optional), displayName, displayWidth, displayHeight, virtualDisplay, virtualWidth, virtualHeight, topmost (optional), focus (optional) | +| params.displayParams | string | JSON String format with client,displayName,displayWidth,displayHeight,virtualDisplay,virtualWidth,virtualHeight,topmost,focus | +### Results +This method returns no results. -### Result +### Examples -| Name | Type | Description | -| :-------- | :-------- | :-------- | -| result | null | null on success | - -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 3, "method": "org.rdk.RDKWindowManager.createDisplay", "params": { - "displayParams": "{\"client\":\"org.rdk.Netflix\",\"callsign\":\"org.rdk.Netflix\",\"displayName\":\"test\",\"displayWidth\":1920,\"displayHeight\":1080,\"virtualDisplay\":true,\"virtualWidth\":1920,\"virtualHeight\":1080,\"topmost\":false,\"focus\":false}" + "displayParams": "" } } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 3, "result": null } ``` - -## *enableInactivityReporting* + +## *enableDisplayRender [method](#head.Methods)* -Enables or disables inactivity reporting and events. +Enable or disable the rendering of a Wayland display ### Events - -No Events - +No events are associated with this method. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.enable | boolean | Whether to enable (`true`) or disable (`false`) inactivity reporting | +| params.client | string | notify first frame event received for client or application instance ID | +| params.enable | bool | flag to true/false the feature | +### Results +This method returns no results. -### Result +### Examples + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 4, + "method": "org.rdk.RDKWindowManager.enableDisplayRender", + "params": { + "client": "", + "enable": true + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 4, + "result": null +} +``` + + +## *enableInactivityReporting [method](#head.Methods)* + +Enables the inactivity reporting + +### Events +No events are associated with this method. +### Parameters | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | null | null on success | +| params | object | | +| params.enable | bool | flag to true/false the feature | +### Results +This method returns no results. + +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 5, "method": "org.rdk.RDKWindowManager.enableInactivityReporting", "params": { "enable": true @@ -291,95 +312,85 @@ No Events } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 5, "result": null } ``` - -## *enableInputEvents* + +## *enableInputEvents [method](#head.Methods)* -Enables KeyInputEvents for list of clients specified. +Enables KeyInputEvents for list of clients specified ### Events - -No Events - +No events are associated with this method. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.clients | string | A JSON String containing one or more clients | -| params.enable | boolean | enable:Flag to enable input events | - -### Result +| params.clients | string | get the number of clients as a JSON string format | +| params.enable | bool | flag to true/false the feature | +### Results +This method returns no results. -| Name | Type | Description | -| :-------- | :-------- | :-------- | -| result | null | null on success | +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 6, "method": "org.rdk.RDKWindowManager.enableInputEvents", "params": { - "clients": "{\"clients\":[\"org.rdk.Netflix\"]}", + "clients": "", "enable": true } } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 6, "result": null } ``` - -## *enableKeyRepeats* + +## *enableKeyRepeats [method](#head.Methods)* -Enables or disables key repeats. +Key repeats are enabled/disabled ### Events - -No Events - +No events are associated with this method. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.enable | boolean | Whether to enable (`true`) or disable (`false`) key repeats | +| params.enable | bool | flag to true/false the feature | +### Results +This method returns no results. -### Result - -| Name | Type | Description | -| :-------- | :-------- | :-------- | -| result | null | null on success | +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 7, "method": "org.rdk.RDKWindowManager.enableKeyRepeats", "params": { "enable": true @@ -387,513 +398,644 @@ No Events } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 7, "result": null } ``` - -## *generateKey* + +## *generateKey [method](#head.Methods)* -Triggers the key events (key press and release). +Generates a key event for the specified keys and client. ### Events - -No Events - +No events are associated with this method. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.keys | string | A JSON String containing keyCode, modifiers (optional), delay | -| params?.client | string | *(optional)* The client name | - -### Result +| params.keys | string | JSON String format representing the key(s)(keyCode,modifiers,delay,client/callSign) to generate | +| params.client | string | notify first frame event received for client or application instance ID | +### Results +This method returns no results. -| Name | Type | Description | -| :-------- | :-------- | :-------- | -| result | null | null on success | +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 8, "method": "org.rdk.RDKWindowManager.generateKey", "params": { - "keys": "{\"keys\": [{\"keyCode\":37,\"modifiers\":[\"shift\"],\"delay\":1}]}", - "client": "org.rdk.Netflix" + "keys": "", + "client": "" } } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 8, "result": null } ``` - -## *getClients* + +## *getClients [method](#head.Methods)* -Gets a list of clients. +get the list of Clients which are available ### Events - -No Events - +No events are associated with this method. ### Parameters - This method takes no parameters. - -### Result - +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | string | A JSON String containing one or more clients | +| result.clients | string | get the number of clients as a JSON string format | + +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 9, "method": "org.rdk.RDKWindowManager.getClients" } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, - "result": "{\"clients\":[\"org.rdk.Netflix\"]}" + "jsonrpc": 2.0, + "id": 9, + "result": "" } ``` - -## *getKeyRepeatsEnabled* + +## *getKeyRepeatsEnabled [method](#head.Methods)* -Returns whether key repeating is enabled or disabled. +Retrieves the flag determining whether keyRepeat true/false ### Events - -No Events - +No events are associated with this method. ### Parameters - This method takes no parameters. - -### Result - +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | object | | -| result.keyRepeat | boolean | `true` if enabled, otherwise `false` | +| result.keyRepeat | bool | flag stating whether keyRepeat true/false | + +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 10, "method": "org.rdk.RDKWindowManager.getKeyRepeatsEnabled" } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, - "result": { - "keyRepeat": true - } + "jsonrpc": 2.0, + "id": 10, + "result": true } ``` - -## *ignoreKeyInputs* + +## *ignoreKeyInputs [method](#head.Methods)* -Blocks user key inputs. +Ignore key inputs ### Events - -No Events - +No events are associated with this method. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.ignore | boolean | Whether key inputs are ignored | +| params.ignore | bool | flag stating whether key inputs ignored | +### Results +This method returns no results. -### Result +### Examples -| Name | Type | Description | -| :-------- | :-------- | :-------- | -| result | null | null on success | - -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 11, "method": "org.rdk.RDKWindowManager.ignoreKeyInputs", "params": { - "ignore": false + "ignore": true } } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 11, "result": null } ``` - -## *injectKey* + +## *injectKey [method](#head.Methods)* -Injects the keys. +Simulates a key press event with optional modifiers. ### Events - -No Events - +No events are associated with this method. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.keycode | number | The key code of the key to intercept (only symbol * (string data type) is acceptable) | -| params?.modifiers | string | *(optional)* A JSON String containing one or more modifiers (`ctrl`, `alt`, and `shift` are supported) | - -### Result +| params.keyCode | uint32_t | Key code to be injected, modifiers : JSON String format with one or more modifiers | +| params.modifiers | string | - | +### Results +This method returns no results. -| Name | Type | Description | -| :-------- | :-------- | :-------- | -| result | null | null on success | +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 12, "method": "org.rdk.RDKWindowManager.injectKey", "params": { - "keycode": 37, - "modifiers": "{\"modifiers\":[\"ctrl\",\"alt\"]}" + "keyCode": 0, + "modifiers": "" } } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 12, "result": null } ``` - -## *keyRepeatConfig* + +## *keyRepeatConfig [method](#head.Methods)* -Configuration for keyrepeat. +Enables KeyInputEvents for list of clients specified ### Events - -No Events - +No events are associated with this method. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.input | string | Input type (default/keyboard) | -| params.keyConfig | string | A JSON String containing enabled, initialDelay (in milli seconds) and repeatInterval (in milli seconds) | +| params.input | string | input type (default/keyboard) | +| params.keyConfig | string | JSON String format with enabled, initialDelay and repeatInterval | +### Results +This method returns no results. -### Result - -| Name | Type | Description | -| :-------- | :-------- | :-------- | -| result | null | null on success | +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 13, "method": "org.rdk.RDKWindowManager.keyRepeatConfig", "params": { - "input": "default", - "keyConfig": "{\"enabled\":true,\"initialDelay\":500,\"repeatInterval\":100}" + "input": "", + "keyConfig": "" } } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 13, "result": null } ``` - -## *removeKeyIntercept* + +## *removeKeyIntercept [method](#head.Methods)* -Removes a key intercept. +Removes a key intercept for a specific key code and client. ### Events - -No Events - +No events are associated with this method. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.intercept | string | A JSON String containing client, callSign (optional), keyCode and modifiers (optional) | - -### Result +| params.intercept | string | JSON String format with the client/callSign, keyCode, modifiers | +### Results +This method returns no results. -| Name | Type | Description | -| :-------- | :-------- | :-------- | -| result | null | null on success | +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 14, "method": "org.rdk.RDKWindowManager.removeKeyIntercept", "params": { - "intercept": "{\"client\":\"org.rdk.Netflix\",\"keyCode\":37,\"modifiers\":[\"shift\"]}" + "intercept": "" } } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 14, "result": null } ``` - -## *removeKeyListener* + +## *removeKeyListener [method](#head.Methods)* -Removes a key listener for an application. +Removes listeners for specific keys. ### Events - -No Events - +No events are associated with this method. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.keyListeners | string | A JSON String containing keys(keyCode, nativekeyCode (optional), modifiers (optional), activate, propagate), client, callSign (optional) | - -### Result +| params.keyListeners | string | JSON String format containing the keylisteneres with keys(keyCode,nativekeyCode,modifiers,activate,propagate) and client/callSign | +### Results +This method returns no results. -| Name | Type | Description | -| :-------- | :-------- | :-------- | -| result | null | null on success | +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 15, "method": "org.rdk.RDKWindowManager.removeKeyListener", "params": { - "keyListeners": "{\"keys\":[{\"keyCode\":37,\"modifiers\":[\"ctrl\",\"alt\"]},{\"keyCode\":38,\"modifiers\":[\"ctrl\",\"alt\"]}],\"client\":\"org.rdk.Netflix\"}" + "keyListeners": "" } } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 15, "result": null } ``` - -## *resetInactivityTime* + +## *renderReady [method](#head.Methods)* -Resets the inactivity notification interval. +To get the status of first frame is rendered or not ### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.client | string | notify first frame event received for client or application instance ID | +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result.status | bool | Returns true if the application has rendered first frame, false if it has not yet. | -No Events +### Examples -### Parameters +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 16, + "method": "org.rdk.RDKWindowManager.renderReady", + "params": { + "client": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 16, + "result": true +} +``` + + +## *resetInactivityTime [method](#head.Methods)* + +Resets inactivity interval if EnableUserInactivity feature is enabled + +### Events +No events are associated with this method. +### Parameters This method takes no parameters. +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 17, + "method": "org.rdk.RDKWindowManager.resetInactivityTime" +} +``` -### Result +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 17, + "result": null +} +``` + + +## *setFocus [method](#head.Methods)* + +Sets the focus to the app with the app id + +### Events +No events are associated with this method. +### Parameters | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | null | null on success | +| params | object | | +| params.client | string | notify first frame event received for client or application instance ID | +### Results +This method returns no results. + +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "org.rdk.RDKWindowManager.resetInactivityTime" + "jsonrpc": 2.0, + "id": 18, + "method": "org.rdk.RDKWindowManager.setFocus", + "params": { + "client": "" + } } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 18, "result": null } ``` - -## *setInactivityInterval* + +## *setInactivityInterval [method](#head.Methods)* -Sets the inactivity notification interval. +Sets inactivity interval if EnableUserInactivity feature is enabled ### Events - -| Event | Description | -| :-------- | :-------- | -| [onUserInactivity](#onUserInactivity) | Triggers only if the device is inactive for the specified time interval | +No events are associated with this method. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.interval | integer | The inactivity event interval in minutes | +| params.interval | uint32_t | time interval set for inactivity | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 19, + "method": "org.rdk.RDKWindowManager.setInactivityInterval", + "params": { + "interval": 0 + } +} +``` -### Result +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 19, + "result": null +} +``` + + +## *setVisible [method](#head.Methods)* + +Sets the visibility of the given client or appInstanceId + +### Events +No events are associated with this method. +### Parameters | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | null | null on success | +| params | object | | +| params.client | std::string | the identifier of the disconnected application | +| params.visible | bool | boolean indicating the visibility status: `true` for visible, `false` for hide. | +### Results +This method returns no results. + +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "org.rdk.RDKWindowManager.setInactivityInterval", + "jsonrpc": 2.0, + "id": 20, + "method": "org.rdk.RDKWindowManager.setVisible", "params": { - "interval": 15 + "client": "", + "visible": true } } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 20, "result": null } ``` - + + + # Notifications -Notifications are autonomous events, triggered by the internals of the implementation, and broadcasted via JSON-RPC to all registered observers. Refer to [[Thunder](#Thunder)] for information on how to register for a notification. +Notifications are autonomous events, triggered by the internals of the implementation, and broadcasted via JSON-RPC to all registered observers. Refer to [[Thunder](#ref.Thunder)] for information on how to register for a notification. -The following events are provided by the org.rdk.RDKWindowManager plugin: +The following events are provided by the RDKWindowManager plugin: RDKWindowManager interface events: | Event | Description | | :-------- | :-------- | -| [onUserInactivity](#onUserInactivity) | Triggered when a device has been inactive for a period of time | +| [onDisconnected](#event.onDisconnected) | Notifies when an application is disconnected | +| [onReady](#event.onReady) | Posting the client for first frame ready. | +| [onUserInactivity](#event.onUserInactivity) | Posting the client is inactive state | + +## *onDisconnected [event](#head.Notifications)* - -## *onUserInactivity* - -Triggered when a device has been inactive for a period of time. This event is broadcasted at the frequency specified by `setInactivityInterval` if the device is not active. The default frequency is 15 minutes. +Notifies when an application is disconnected ### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.client | std::string | the identifier of the disconnected application | + +### Examples + +```json +{ + "jsonrpc": 2.0, + "id": 21, + "method": "org.rdk.RDKWindowManager.onDisconnected", + "params": { + "client": "" + } +} +``` + + +## *onReady [event](#head.Notifications)* + +Posting the client for first frame ready. +### Parameters | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.minutes | number | The number of minutes that the device has been inactive | +| params.client | string | notify first frame event received for client or application instance ID | -### Example +### Examples ```json { - "jsonrpc": "2.0", - "method": "client.events.onUserInactivity", + "jsonrpc": 2.0, + "id": 22, + "method": "org.rdk.RDKWindowManager.onReady", "params": { - "minutes": 5 + "client": "" } } ``` + +## *onUserInactivity [event](#head.Notifications)* + +Posting the client is inactive state + +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.minutes | double | notify how long user is inactive state | + +### Examples + +```json +{ + "jsonrpc": 2.0, + "id": 23, + "method": "org.rdk.RDKWindowManager.onUserInactivity", + "params": { + "minutes": 0.0 + } +} +``` diff --git a/docs/apis/RuntimeManagerPlugin.md b/docs/apis/RuntimeManagerPlugin.md new file mode 100644 index 00000000..0c361552 --- /dev/null +++ b/docs/apis/RuntimeManagerPlugin.md @@ -0,0 +1,706 @@ + + +# RuntimeManager Plugin + +**Version: [1.0.0](https://github.com/rdkcentral/rdkservices/blob/main/RuntimeManager/CHANGELOG.md)** + +A RuntimeManager plugin for Thunder framework. + +### Table of Contents + +- [Abbreviation, Acronyms and Terms](#head.Abbreviation,_Acronyms_and_Terms) +- [Description](#head.Description) +- [Configuration](#head.Configuration) +- [Methods](#head.Methods) +- [Notifications](#head.Notifications) + + +# Abbreviation, Acronyms and Terms + +[[Refer to this link](userguide/aat.md)] + + +# Description + +The `RuntimeManager` plugin provides an interface for RuntimeManager. + +The plugin is designed to be loaded and executed within the Thunder framework. For more information about the framework refer to [[Thunder](#ref.Thunder)]. + + +# Configuration + +The table below lists configuration options of the plugin. + +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| callsign | string | Plugin instance name (default: org.rdk.RuntimeManager) | +| classname | string | Class name: *RuntimeManager* | +| locator | string | Library name: *libWPEFrameworkRuntimeManager.so* | +| autostart | boolean | Determines if the plugin shall be started automatically along with the framework | + + +# Methods + +The following methods are provided by the RuntimeManager plugin: + +RuntimeManager interface methods: + +| Method | Description | +| :-------- | :-------- | +| [annotate](#method.annotate) | annotates are sent to Dobby for recording | +| [getInfo](#method.getInfo) | get info of the application | +| [hibernate](#method.hibernate) | Hibernate the application | +| [kill](#method.kill) | | +| [mount](#method.mount) | mounts a new host directory/device inside container | +| [resume](#method.resume) | Resume the application | +| [run](#method.run) | Run the application | +| [suspend](#method.suspend) | Suspend the application | +| [terminate](#method.terminate) | Terminate the application | +| [unmount](#method.unmount) | unmounts a new host directory/device inside container | +| [wake](#method.wake) | Wake the application to given state | + + +## *annotate [method](#head.Methods)* + +annotates are sent to Dobby for recording + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.appInstanceId | string | App identifier for the application/container | +| params.key | string | set a dictionary of value of key for running containers | +| params.value | string | - | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 0, + "method": "org.rdk.RuntimeManager.annotate", + "params": { + "appInstanceId": "", + "key": "", + "value": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 0, + "result": null +} +``` + + +## *getInfo [method](#head.Methods)* + +get info of the application + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.appInstanceId | string | App identifier for the application/container | +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result.info | string | This should contain information like RAM, CPU usage, GPU memory, and other stats, come as json string format | + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 1, + "method": "org.rdk.RuntimeManager.getInfo", + "params": { + "appInstanceId": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 1, + "result": "" +} +``` + + +## *hibernate [method](#head.Methods)* + +Hibernate the application + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.appInstanceId | string | App identifier for the application/container | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 2, + "method": "org.rdk.RuntimeManager.hibernate", + "params": { + "appInstanceId": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 2, + "result": null +} +``` + + +## *kill [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.appInstanceId | string | App identifier for the application/container | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 3, + "method": "org.rdk.RuntimeManager.kill", + "params": { + "appInstanceId": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 3, + "result": null +} +``` + + +## *mount [method](#head.Methods)* + +mounts a new host directory/device inside container + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 4, + "method": "org.rdk.RuntimeManager.mount" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 4, + "result": null +} +``` + + +## *resume [method](#head.Methods)* + +Resume the application + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.appInstanceId | string | App identifier for the application/container | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 5, + "method": "org.rdk.RuntimeManager.resume", + "params": { + "appInstanceId": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 5, + "result": null +} +``` + + +## *run [method](#head.Methods)* + +Run the application + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.appId | string | App identifier for the application/container | +| params.appInstanceId | string | App identifier for the application/container | +| params.userId | uint32_t | groupid used to represent a group | +| params.groupId | uint32_t | - | +| params?.ports | IValueIterator | (optional)array of socket ports to allow | +| params?.ports[#] | uint32_t | (optional)- | +| params?.paths | IStringIterator | (optional)paths contains an additional set of files and directories to map into the container | +| params?.paths[#] | string | (optional)- | +| params?.debugSettings | IStringIterator | (optional)can include additional ports to open for gdb and other settings for debugging | +| params?.debugSettings[#] | string | (optional)- | +| params.runtimeConfigObject | RuntimeConfig | - | +| params.runtimeConfigObject.dial | bool | - | +| params.runtimeConfigObject.wanLanAccess | bool | - | +| params.runtimeConfigObject.thunder | bool | - | +| params.runtimeConfigObject.systemMemoryLimit | int32_t | - | +| params.runtimeConfigObject.gpuMemoryLimit | int32_t | - | +| params.runtimeConfigObject.envVariables | std::string | - | +| params.runtimeConfigObject.userId | uint32_t | - | +| params.runtimeConfigObject.groupId | uint32_t | - | +| params.runtimeConfigObject.dataImageSize | uint32_t | - | +| params.runtimeConfigObject.resourceManagerClientEnabled | bool | - | +| params.runtimeConfigObject.dialId | std::string | - | +| params.runtimeConfigObject.command | std::string | - | +| params.runtimeConfigObject.appType | std::string | - | +| params.runtimeConfigObject.appPath | std::string | - | +| params.runtimeConfigObject.runtimePath | std::string | - | +| params.runtimeConfigObject.logFilePath | std::string | - | +| params.runtimeConfigObject.logFileMaxSize | uint32_t | - | +| params.runtimeConfigObject.logLevels | std::string | json array of strings | +| params.runtimeConfigObject.mapi | bool | - | +| params.runtimeConfigObject.fkpsFiles | std::string | json array of strings | +| params.runtimeConfigObject.fireboltVersion | std::string | - | +| params.runtimeConfigObject.enableDebugger | bool | - | +| params.runtimeConfigObject.unpackedPath | string | - | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 6, + "method": "org.rdk.RuntimeManager.run", + "params": { + "appId": "", + "appInstanceId": "", + "userId": 0, + "groupId": 0, + "ports": [ + 0 + ], + "paths": [ + "" + ], + "debugSettings": [ + "" + ], + "runtimeConfigObject": { + "dial": true, + "wanLanAccess": true, + "thunder": true, + "systemMemoryLimit": 0, + "gpuMemoryLimit": 0, + "envVariables": "", + "userId": 0, + "groupId": 0, + "dataImageSize": 0, + "resourceManagerClientEnabled": true, + "dialId": "", + "command": "", + "appType": "", + "appPath": "", + "runtimePath": "", + "logFilePath": "", + "logFileMaxSize": 0, + "logLevels": "", + "mapi": true, + "fkpsFiles": "", + "fireboltVersion": "", + "enableDebugger": true, + "unpackedPath": "" + } + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 6, + "result": null +} +``` + + +## *suspend [method](#head.Methods)* + +Suspend the application + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.appInstanceId | string | App identifier for the application/container | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 7, + "method": "org.rdk.RuntimeManager.suspend", + "params": { + "appInstanceId": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 7, + "result": null +} +``` + + +## *terminate [method](#head.Methods)* + +Terminate the application + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.appInstanceId | string | App identifier for the application/container | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 8, + "method": "org.rdk.RuntimeManager.terminate", + "params": { + "appInstanceId": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 8, + "result": null +} +``` + + +## *unmount [method](#head.Methods)* + +unmounts a new host directory/device inside container + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 9, + "method": "org.rdk.RuntimeManager.unmount" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 9, + "result": null +} +``` + + +## *wake [method](#head.Methods)* + +Wake the application to given state + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.appInstanceId | string | App identifier for the application/container | +| params.runtimeState | RuntimeState | state of runtime application/container | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 10, + "method": "org.rdk.RuntimeManager.wake", + "params": { + "appInstanceId": "", + "runtimeState": "RUNTIME_STATE_UNKNOWN" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 10, + "result": null +} +``` + + + + +# Notifications + +Notifications are autonomous events, triggered by the internals of the implementation, and broadcasted via JSON-RPC to all registered observers. Refer to [[Thunder](#ref.Thunder)] for information on how to register for a notification. + +The following events are provided by the RuntimeManager plugin: + +RuntimeManager interface events: + +| Event | Description | +| :-------- | :-------- | +| [onFailure](#event.onFailure) | Notifies failure in container execution | +| [onStarted](#event.onStarted) | Notifies container is started | +| [onStateChanged](#event.onStateChanged) | Notifies state of container | +| [onTerminated](#event.onTerminated) | Notifies container is shutdown | + + +## *onFailure [event](#head.Notifications)* + +Notifies failure in container execution + +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.appInstanceId | string | App identifier for the application/container | +| params.error | string | error string will send if there is failure | + +### Examples + +```json +{ + "jsonrpc": 2.0, + "id": 11, + "method": "org.rdk.RuntimeManager.onFailure", + "params": { + "appInstanceId": "", + "error": "" + } +} +``` + + +## *onStarted [event](#head.Notifications)* + +Notifies container is started + +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.appInstanceId | string | App identifier for the application/container | + +### Examples + +```json +{ + "jsonrpc": 2.0, + "id": 12, + "method": "org.rdk.RuntimeManager.onStarted", + "params": { + "appInstanceId": "" + } +} +``` + + +## *onStateChanged [event](#head.Notifications)* + +Notifies state of container + +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.appInstanceId | string | App identifier for the application/container | +| params.state | RuntimeState | state of the application/container | + +### Examples + +```json +{ + "jsonrpc": 2.0, + "id": 13, + "method": "org.rdk.RuntimeManager.onStateChanged", + "params": { + "appInstanceId": "", + "state": "RUNTIME_STATE_UNKNOWN" + } +} +``` + + +## *onTerminated [event](#head.Notifications)* + +Notifies container is shutdown + +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.appInstanceId | string | App identifier for the application/container | + +### Examples + +```json +{ + "jsonrpc": 2.0, + "id": 14, + "method": "org.rdk.RuntimeManager.onTerminated", + "params": { + "appInstanceId": "" + } +} +``` diff --git a/docs/apis/ScreenCapturePlugin.md b/docs/apis/ScreenCapturePlugin.md index bf63bcaf..3aeda3d7 100644 --- a/docs/apis/ScreenCapturePlugin.md +++ b/docs/apis/ScreenCapturePlugin.md @@ -1,151 +1,142 @@ - + # ScreenCapture Plugin -**Version: [1.0.0]()** +**Version: [1.0.0](https://github.com/rdkcentral/rdkservices/blob/main/ScreenCapture/CHANGELOG.md)** -A org.rdk.ScreenCapture plugin for Thunder framework. +A ScreenCapture 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](#head.Abbreviation,_Acronyms_and_Terms) +- [Description](#head.Description) +- [Configuration](#head.Configuration) +- [Methods](#head.Methods) +- [Notifications](#head.Notifications) - + # Abbreviation, Acronyms and Terms -[[Refer to this link](overview/aat.md)] +[[Refer to this link](userguide/aat.md)] - + # Description -The `ScreenCapture` plugin is used to upload screen captures. +The `ScreenCapture` plugin provides an interface for ScreenCapture. -The plugin is designed to be loaded and executed within the Thunder framework. For more information about the framework refer to [[Thunder](#Thunder)]. +The plugin is designed to be loaded and executed within the Thunder framework. For more information about the framework refer to [[Thunder](#ref.Thunder)]. - + # Configuration The table below lists configuration options of the plugin. | Name | Type | Description | | :-------- | :-------- | :-------- | -| callsign | string | Plugin instance name (default: *org.rdk.ScreenCapture*) | -| classname | string | Class name: *org.rdk.ScreenCapture* | +| callsign | string | Plugin instance name (default: org.rdk.ScreenCapture) | +| classname | string | Class name: *ScreenCapture* | | locator | string | Library name: *libWPEFrameworkScreenCapture.so* | | autostart | boolean | Determines if the plugin shall be started automatically along with the framework | - + # Methods -The following methods are provided by the org.rdk.ScreenCapture plugin: +The following methods are provided by the ScreenCapture plugin: ScreenCapture interface methods: | Method | Description | | :-------- | :-------- | -| [uploadScreenCapture](#uploadScreenCapture) | Takes a screenshot and uploads it to the specified URL | +| [uploadScreenCapture](#method.uploadScreenCapture) | Takes a screenshot and uploads it to the specified URL | + +## *uploadScreenCapture [method](#head.Methods)* - -## *uploadScreenCapture* - -Takes a screenshot and uploads it to the specified URL. A screenshot is uploaded using raw HTTP POST request as binary image/png data. It's the same as running the following command: -`wget -d -q -O - --header='Content-Type: application/octet-stream' --post-file=/path/to/screenshot.png http://server/cgi-bin/upload.cgi` -or, -`curl -F image=@/path/to/screenshot.png http://server/cgi-bin/upload.cgi` -For implementation details, see `bool ScreenCapture::uploadDataToUrl(std::vector &data, const char *url, std::string &error_str)`. +Takes a screenshot and uploads it to the specified URL ### Events - -| Event | Description | -| :-------- | :-------- | -| [uploadComplete](#uploadComplete) | Triggered after uploading a screen capture with status and message | +No events are associated with this method. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.url | string | The upload destination | -| params?.callGUID | string | *(optional)* A unique identifier of a call. The identifier is used to find a corresponding `uploadComplete` event | - -### Result - +| params.url | string | - in - string | +| params.callGUID | string | - in - string | +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | object | | -| result.success | boolean | Whether the request succeeded | +| result.result | Result | - | +| result.result.success | bool | success | + +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 0, "method": "org.rdk.ScreenCapture.uploadScreenCapture", "params": { - "url": "http://server/cgi-bin/upload.cgi", - "callGUID": "12345" + "url": "", + "callGUID": "" } } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 0, "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](#Thunder)] for information on how to register for a notification. +Notifications are autonomous events, triggered by the internals of the implementation, and broadcasted via JSON-RPC to all registered observers. Refer to [[Thunder](#ref.Thunder)] for information on how to register for a notification. -The following events are provided by the org.rdk.ScreenCapture plugin: +The following events are provided by the ScreenCapture plugin: ScreenCapture interface events: | Event | Description | | :-------- | :-------- | -| [uploadComplete](#uploadComplete) | Triggered after uploading a screen capture | +| [uploadComplete](#event.uploadComplete) | Triggered after uploading a screen capture | + +## *uploadComplete [event](#head.Notifications)* - -## *uploadComplete* - -Triggered after uploading a screen capture. +Triggered after uploading a screen capture ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.status | boolean | Indicates if the upload was successful | -| params.message | string | A `Success` value indicates that the upload was successful; otherwise, a description of the failure | -| params.call_guid | string | A unique identifier of the call | +| params.status | bool | - in - boolean | +| params.message | string | - in - string | +| params.call_guid | string | - in - string | -### Example +### Examples ```json { - "jsonrpc": "2.0", - "method": "client.events.uploadComplete", + "jsonrpc": 2.0, + "id": 1, + "method": "org.rdk.ScreenCapture.uploadComplete", "params": { "status": true, - "message": "Success", - "call_guid": "12345" + "message": "", + "call_guid": "" } } ``` - diff --git a/docs/apis/SharedStoragePlugin.md b/docs/apis/SharedStoragePlugin.md new file mode 100644 index 00000000..dad1e2fd --- /dev/null +++ b/docs/apis/SharedStoragePlugin.md @@ -0,0 +1,605 @@ + + +# SharedStorage Plugin + +**Version: [1.0.0](https://github.com/rdkcentral/rdkservices/blob/main/SharedStorage/CHANGELOG.md)** + +A SharedStorage plugin for Thunder framework. + +### Table of Contents + +- [Abbreviation, Acronyms and Terms](#head.Abbreviation,_Acronyms_and_Terms) +- [Description](#head.Description) +- [Configuration](#head.Configuration) +- [Methods](#head.Methods) +- [Notifications](#head.Notifications) + + +# Abbreviation, Acronyms and Terms + +[[Refer to this link](userguide/aat.md)] + + +# Description + +The `SharedStorage` plugin provides an interface for SharedStorage. + +The plugin is designed to be loaded and executed within the Thunder framework. For more information about the framework refer to [[Thunder](#ref.Thunder)]. + + +# Configuration + +The table below lists configuration options of the plugin. + +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| callsign | string | Plugin instance name (default: org.rdk.SharedStorage) | +| classname | string | Class name: *SharedStorage* | +| locator | string | Library name: *libWPEFrameworkSharedStorage.so* | +| autostart | boolean | Determines if the plugin shall be started automatically along with the framework | + + +# Methods + +The following methods are provided by the SharedStorage plugin: + +SharedStorage interface methods: + +| Method | Description | +| :-------- | :-------- | +| [deleteKey](#method.deleteKey) | Deletes a key from the specified namespace | +| [deleteNamespace](#method.deleteNamespace) | Deletes the specified namespace | +| [flushCache](#method.flushCache) | Flushes the device cache | +| [getKeys](#method.getKeys) | Returns the keys that are stored in the specified namespace | +| [getNamespaceStorageLimit](#method.getNamespaceStorageLimit) | Returns the storage limit for a given namespace | +| [getNamespaces](#method.getNamespaces) | Returns the namespaces | +| [getStorageSizes](#method.getStorageSizes) | Returns the size occupied by each namespace | +| [getValue](#method.getValue) | Returns the value of a key from the specified namespace. | +| [setNamespaceStorageLimit](#method.setNamespaceStorageLimit) | Sets the storage limit for a given namespace | +| [setValue](#method.setValue) | Sets the value of a key in the the specified namespace | + + +## *deleteKey [method](#head.Methods)* + +Deletes a key from the specified namespace + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.scope | ScopeType | must be device or account | +| params.namespace | string | name space | +| params.key | string | key | +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result.success | Success | success | +| result.success.success | bool | - | + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 0, + "method": "org.rdk.SharedStorage.deleteKey", + "params": { + "scope": "DEVICE", + "ns": "", + "key": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 0, + "result": { + "success": true + } +} +``` + + +## *deleteNamespace [method](#head.Methods)* + +Deletes the specified namespace + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.scope | ScopeType | must be device or account | +| params.namespace | string | name space | +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result.success | Success | success | +| result.success.success | bool | - | + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 1, + "method": "org.rdk.SharedStorage.deleteNamespace", + "params": { + "scope": "DEVICE", + "ns": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 1, + "result": { + "success": true + } +} +``` + + +## *flushCache [method](#head.Methods)* + +Flushes the device cache + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 2, + "method": "org.rdk.SharedStorage.flushCache" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 2, + "result": null +} +``` + + +## *getKeys [method](#head.Methods)* + +Returns the keys that are stored in the specified namespace + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.scope | ScopeType | must be device or account | +| params.namespace | string | name space | +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result.keys | IStringIterator | keys list | +| result.keys[#] | string | - | +| result.success | bool | success | + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 3, + "method": "org.rdk.SharedStorage.getKeys", + "params": { + "scope": "DEVICE", + "ns": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 3, + "result": { + "keys": [ + "" + ], + "success": true + } +} +``` + + +## *getNamespaceStorageLimit [method](#head.Methods)* + +Returns the storage limit for a given namespace + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.scope | ScopeType | must be device or account | +| params.namespace | string | name space | +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result.storageLimit | StorageLimit | Size in bytes | +| result.storageLimit.storageLimit | uint32_t | - | + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 4, + "method": "org.rdk.SharedStorage.getNamespaceStorageLimit", + "params": { + "scope": "DEVICE", + "ns": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 4, + "result": { + "storageLimit": 0 + } +} +``` + + +## *getNamespaces [method](#head.Methods)* + +Returns the namespaces + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.scope | ScopeType | must be device or account | +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result.namespaces | IStringIterator | namespaces list | +| result.namespaces[#] | string | - | +| result.success | bool | success | + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 5, + "method": "org.rdk.SharedStorage.getNamespaces", + "params": { + "scope": "DEVICE" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 5, + "result": { + "namespaces": [ + "" + ], + "success": true + } +} +``` + + +## *getStorageSizes [method](#head.Methods)* + +Returns the size occupied by each namespace + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.scope | ScopeType | must be device or account | +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result.storageList | INamespaceSizeIterator | list of namespaces and their sizes | +| result.storageList[#].ns | string | - | +| result.storageList[#].size | uint32_t | - | +| result.success | bool | success | + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 6, + "method": "org.rdk.SharedStorage.getStorageSizes", + "params": { + "scope": "DEVICE" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 6, + "result": { + "storageList": [ + { + "ns": "", + "size": 0 + } + ], + "success": true + } +} +``` + + +## *getValue [method](#head.Methods)* + +Returns the value of a key from the specified namespace. + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.scope | ScopeType | must be device or account | +| params.namespace | string | name space | +| params.key | string | key | +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result.value | string | value | +| result.ttl | uint32_t | time to live (optional) | +| result.success | bool | success | + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 7, + "method": "org.rdk.SharedStorage.getValue", + "params": { + "scope": "DEVICE", + "ns": "", + "key": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 7, + "result": { + "value": "", + "ttl": 0, + "success": true + } +} +``` + + +## *setNamespaceStorageLimit [method](#head.Methods)* + +Sets the storage limit for a given namespace + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.scope | ScopeType | must be device or account | +| params.namespace | string | name space | +| params.storageLimit | uint32_t | size | +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result.success | bool | success | + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 8, + "method": "org.rdk.SharedStorage.setNamespaceStorageLimit", + "params": { + "scope": "DEVICE", + "ns": "", + "storageLimit": 0 + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 8, + "result": true +} +``` + + +## *setValue [method](#head.Methods)* + +Sets the value of a key in the the specified namespace + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.scope | ScopeType | must be device or account | +| params.namespace | string | name space | +| params.key | string | key | +| params.value | string | value | +| params.ttl | uint32_t | time to live (optional) | +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result.success | Success | success | +| result.success.success | bool | - | + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 9, + "method": "org.rdk.SharedStorage.setValue", + "params": { + "scope": "DEVICE", + "ns": "", + "key": "", + "value": "", + "ttl": 0 + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 9, + "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](#ref.Thunder)] for information on how to register for a notification. + +The following events are provided by the SharedStorage plugin: + +SharedStorage interface events: + +| Event | Description | +| :-------- | :-------- | +| [onValueChanged](#event.onValueChanged) | Values stored are changed using setValue | + + +## *onValueChanged [event](#head.Notifications)* + +Values stored are changed using setValue + +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.scope | ScopeType | must be device or account | +| params.namespace | string | name space | +| params.key | string | key | +| params.value | string | value | + +### Examples + +```json +{ + "jsonrpc": 2.0, + "id": 10, + "method": "org.rdk.SharedStorage.onValueChanged", + "params": { + "scope": "DEVICE", + "ns": "", + "key": "", + "value": "" + } +} +``` diff --git a/docs/apis/StorageManagerPlugin.md b/docs/apis/StorageManagerPlugin.md new file mode 100644 index 00000000..649ea7db --- /dev/null +++ b/docs/apis/StorageManagerPlugin.md @@ -0,0 +1,140 @@ + + +# StorageManager Plugin + +**Version: [1.0.0](https://github.com/rdkcentral/rdkservices/blob/main/StorageManager/CHANGELOG.md)** + +A StorageManager plugin for Thunder framework. + +### Table of Contents + +- [Abbreviation, Acronyms and Terms](#head.Abbreviation,_Acronyms_and_Terms) +- [Description](#head.Description) +- [Configuration](#head.Configuration) +- [Methods](#head.Methods) + + +# Abbreviation, Acronyms and Terms + +[[Refer to this link](userguide/aat.md)] + + +# Description + +The `StorageManager` plugin provides an interface for StorageManager. + +The plugin is designed to be loaded and executed within the Thunder framework. For more information about the framework refer to [[Thunder](#ref.Thunder)]. + + +# Configuration + +The table below lists configuration options of the plugin. + +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| callsign | string | Plugin instance name (default: org.rdk.StorageManager) | +| classname | string | Class name: *StorageManager* | +| locator | string | Library name: *libWPEFrameworkStorageManager.so* | +| autostart | boolean | Determines if the plugin shall be started automatically along with the framework | + + +# Methods + +The following methods are provided by the StorageManager plugin: + +StorageManager interface methods: + +| Method | Description | +| :-------- | :-------- | +| [clear](#method.clear) | Called by IUI. This also clears device storage as well | +| [clearAll](#method.clearAll) | Called by IUI. This also clears device storage as well | + + +## *clear [method](#head.Methods)* + +Called by IUI. This also clears device storage as well + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.appId | string | - in - string App identifier for the application. | +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result.errorReason | string | - out - string error reason string | + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 0, + "method": "org.rdk.StorageManager.clear", + "params": { + "appId": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 0, + "result": "" +} +``` + + +## *clearAll [method](#head.Methods)* + +Called by IUI. This also clears device storage as well + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.exemptionAppIds | string | - in - string Clears all app data except for the exempt app ids as a json format | +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result.errorReason | string | - out - string error reason string | + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 1, + "method": "org.rdk.StorageManager.clearAll", + "params": { + "exemptionAppIds": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 1, + "result": "" +} +``` + + diff --git a/docs/apis/Store2Plugin.md b/docs/apis/Store2Plugin.md new file mode 100644 index 00000000..453b5225 --- /dev/null +++ b/docs/apis/Store2Plugin.md @@ -0,0 +1,534 @@ + + +# Store2 Plugin + +**Version: [1.0.0](https://github.com/rdkcentral/rdkservices/blob/main/Store2/CHANGELOG.md)** + +A Store2 plugin for Thunder framework. + +### Table of Contents + +- [Abbreviation, Acronyms and Terms](#head.Abbreviation,_Acronyms_and_Terms) +- [Description](#head.Description) +- [Configuration](#head.Configuration) +- [Methods](#head.Methods) +- [Notifications](#head.Notifications) + + +# Abbreviation, Acronyms and Terms + +[[Refer to this link](userguide/aat.md)] + + +# Description + +The `Store2` plugin provides an interface for Store2. + +The plugin is designed to be loaded and executed within the Thunder framework. For more information about the framework refer to [[Thunder](#ref.Thunder)]. + + +# Configuration + +The table below lists configuration options of the plugin. + +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| callsign | string | Plugin instance name (default: org.rdk.Store2) | +| classname | string | Class name: *Store2* | +| locator | string | Library name: *libWPEFrameworkStore2.so* | +| autostart | boolean | Determines if the plugin shall be started automatically along with the framework | + + +# Methods + +The following methods are provided by the Store2 plugin: + +Store2 interface methods: + +| Method | Description | +| :-------- | :-------- | +| [deleteKey](#method.deleteKey) | | +| [deleteNamespace](#method.deleteNamespace) | | +| [getKeys](#method.getKeys) | | +| [getNamespaceStorageLimit](#method.getNamespaceStorageLimit) | | +| [getNamespaces](#method.getNamespaces) | | +| [getStorageSizes](#method.getStorageSizes) | | +| [getValue](#method.getValue) | | +| [setNamespaceStorageLimit](#method.setNamespaceStorageLimit) | | +| [setValue](#method.setValue) | | + + +## *deleteKey [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.scope | ScopeType | - | +| params.namespace | string | - | +| params.key | string | - | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 0, + "method": "org.rdk.Store2.deleteKey", + "params": { + "scope": "DEVICE", + "ns": "", + "key": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 0, + "result": null +} +``` + + +## *deleteNamespace [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.scope | ScopeType | - | +| params.namespace | string | - | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 1, + "method": "org.rdk.Store2.deleteNamespace", + "params": { + "scope": "DEVICE", + "ns": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 1, + "result": null +} +``` + + +## *getKeys [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.scope | ScopeType | - | +| params.ns | string | - | +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result.keys | IStringIterator | - | +| result.keys[#] | string | - | + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 2, + "method": "org.rdk.Store2.getKeys", + "params": { + "scope": "DEVICE", + "ns": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 2, + "result": [ + "" + ] +} +``` + + +## *getNamespaceStorageLimit [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.scope | ScopeType | - | +| params.ns | string | - | +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result.size | uint32_t | - | + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 3, + "method": "org.rdk.Store2.getNamespaceStorageLimit", + "params": { + "scope": "DEVICE", + "ns": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 3, + "result": 0 +} +``` + + +## *getNamespaces [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.scope | ScopeType | - | +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result.namespaces | IStringIterator | - | +| result.namespaces[#] | string | - | + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 4, + "method": "org.rdk.Store2.getNamespaces", + "params": { + "scope": "DEVICE" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 4, + "result": [ + "" + ] +} +``` + + +## *getStorageSizes [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.scope | ScopeType | - | +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result.storageList | INamespaceSizeIterator | - | +| result.storageList[#].ns | string | - | +| result.storageList[#].size | uint32_t | - | + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 5, + "method": "org.rdk.Store2.getStorageSizes", + "params": { + "scope": "DEVICE" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 5, + "result": [ + { + "ns": "", + "size": 0 + } + ] +} +``` + + +## *getValue [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.scope | ScopeType | - | +| params.namespace | string | - | +| params.key | string | - | +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result.value | string | - | +| result.ttl | uint32_t | - | + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 6, + "method": "org.rdk.Store2.getValue", + "params": { + "scope": "DEVICE", + "ns": "", + "key": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 6, + "result": { + "value": "", + "ttl": 0 + } +} +``` + + +## *setNamespaceStorageLimit [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.scope | ScopeType | - | +| params.ns | string | - | +| params.size | uint32_t | - | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 7, + "method": "org.rdk.Store2.setNamespaceStorageLimit", + "params": { + "scope": "DEVICE", + "ns": "", + "size": 0 + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 7, + "result": null +} +``` + + +## *setValue [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.scope | ScopeType | - | +| params.namespace | string | - | +| params.key | string | - | +| params.value | string | - | +| params.ttl | uint32_t | - | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 8, + "method": "org.rdk.Store2.setValue", + "params": { + "scope": "DEVICE", + "ns": "", + "key": "", + "value": "", + "ttl": 0 + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 8, + "result": null +} +``` + + + + +# Notifications + +Notifications are autonomous events, triggered by the internals of the implementation, and broadcasted via JSON-RPC to all registered observers. Refer to [[Thunder](#ref.Thunder)] for information on how to register for a notification. + +The following events are provided by the Store2 plugin: + +Store2 interface events: + +| Event | Description | +| :-------- | :-------- | +| [valueChanged](#event.valueChanged) | | + + +## *valueChanged [event](#head.Notifications)* + + + +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.scope | ScopeType | - | +| params.namespace | string | - | +| params.key | string | - | +| params.value | string | - | + +### Examples + +```json +{ + "jsonrpc": 2.0, + "id": 9, + "method": "org.rdk.Store2.valueChanged", + "params": { + "scope": "DEVICE", + "ns": "", + "key": "", + "value": "" + } +} +``` diff --git a/docs/apis/StoreCachePlugin.md b/docs/apis/StoreCachePlugin.md new file mode 100644 index 00000000..77de93f8 --- /dev/null +++ b/docs/apis/StoreCachePlugin.md @@ -0,0 +1,87 @@ + + +# StoreCache Plugin + +**Version: [1.0.0](https://github.com/rdkcentral/rdkservices/blob/main/StoreCache/CHANGELOG.md)** + +A StoreCache plugin for Thunder framework. + +### Table of Contents + +- [Abbreviation, Acronyms and Terms](#head.Abbreviation,_Acronyms_and_Terms) +- [Description](#head.Description) +- [Configuration](#head.Configuration) +- [Methods](#head.Methods) + + +# Abbreviation, Acronyms and Terms + +[[Refer to this link](userguide/aat.md)] + + +# Description + +The `StoreCache` plugin provides an interface for StoreCache. + +The plugin is designed to be loaded and executed within the Thunder framework. For more information about the framework refer to [[Thunder](#ref.Thunder)]. + + +# Configuration + +The table below lists configuration options of the plugin. + +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| callsign | string | Plugin instance name (default: org.rdk.StoreCache) | +| classname | string | Class name: *StoreCache* | +| locator | string | Library name: *libWPEFrameworkStoreCache.so* | +| autostart | boolean | Determines if the plugin shall be started automatically along with the framework | + + +# Methods + +The following methods are provided by the StoreCache plugin: + +StoreCache interface methods: + +| Method | Description | +| :-------- | :-------- | +| [flushCache](#method.flushCache) | | + + +## *flushCache [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 0, + "method": "org.rdk.StoreCache.flushCache" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 0, + "result": null +} +``` + + diff --git a/docs/apis/StorePlugin.md b/docs/apis/StorePlugin.md new file mode 100644 index 00000000..adfc6ea8 --- /dev/null +++ b/docs/apis/StorePlugin.md @@ -0,0 +1,293 @@ + + +# Store Plugin + +**Version: [1.0.0](https://github.com/rdkcentral/rdkservices/blob/main/Store/CHANGELOG.md)** + +A Store plugin for Thunder framework. + +### Table of Contents + +- [Abbreviation, Acronyms and Terms](#head.Abbreviation,_Acronyms_and_Terms) +- [Description](#head.Description) +- [Configuration](#head.Configuration) +- [Methods](#head.Methods) +- [Notifications](#head.Notifications) + + +# Abbreviation, Acronyms and Terms + +[[Refer to this link](userguide/aat.md)] + + +# Description + +The `Store` plugin provides an interface for Store. + +The plugin is designed to be loaded and executed within the Thunder framework. For more information about the framework refer to [[Thunder](#ref.Thunder)]. + + +# Configuration + +The table below lists configuration options of the plugin. + +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| callsign | string | Plugin instance name (default: org.rdk.Store) | +| classname | string | Class name: *Store* | +| locator | string | Library name: *libWPEFrameworkStore.so* | +| autostart | boolean | Determines if the plugin shall be started automatically along with the framework | + + +# Methods + +The following methods are provided by the Store plugin: + +Store interface methods: + +| Method | Description | +| :-------- | :-------- | +| [deleteKey](#method.deleteKey) | | +| [deleteNamespace](#method.deleteNamespace) | | +| [getValue](#method.getValue) | | +| [setValue](#method.setValue) | | + + +## *deleteKey [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.ns | string | - | +| params.key | string | - | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 0, + "method": "org.rdk.Store.deleteKey", + "params": { + "ns": "", + "key": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 0, + "result": null +} +``` + + +## *deleteNamespace [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.ns | string | - | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 1, + "method": "org.rdk.Store.deleteNamespace", + "params": { + "ns": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 1, + "result": null +} +``` + + +## *getValue [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.ns | string | - | +| params.key | string | - | +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result.value | string | - | + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 2, + "method": "org.rdk.Store.getValue", + "params": { + "ns": "", + "key": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 2, + "result": "" +} +``` + + +## *setValue [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.ns | string | - | +| params.key | string | - | +| params.value | string | - | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 3, + "method": "org.rdk.Store.setValue", + "params": { + "ns": "", + "key": "", + "value": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 3, + "result": null +} +``` + + + + +# Notifications + +Notifications are autonomous events, triggered by the internals of the implementation, and broadcasted via JSON-RPC to all registered observers. Refer to [[Thunder](#ref.Thunder)] for information on how to register for a notification. + +The following events are provided by the Store plugin: + +Store interface events: + +| Event | Description | +| :-------- | :-------- | +| [storageExceeded](#event.storageExceeded) | | +| [valueChanged](#event.valueChanged) | | + + +## *storageExceeded [event](#head.Notifications)* + + + +### Parameters +This method takes no parameters. + +### Examples + +```json +{ + "jsonrpc": 2.0, + "id": 4, + "method": "org.rdk.Store.storageExceeded" +} +``` + + +## *valueChanged [event](#head.Notifications)* + + + +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.ns | string | - | +| params.key | string | - | +| params.value | string | - | + +### Examples + +```json +{ + "jsonrpc": 2.0, + "id": 5, + "method": "org.rdk.Store.valueChanged", + "params": { + "ns": "", + "key": "", + "value": "" + } +} +``` diff --git a/docs/apis/SystemAudioPlayerPlugin.md b/docs/apis/SystemAudioPlayerPlugin.md index ca205116..62280821 100644 --- a/docs/apis/SystemAudioPlayerPlugin.md +++ b/docs/apis/SystemAudioPlayerPlugin.md @@ -1,782 +1,676 @@ - + # SystemAudioPlayer Plugin -**Version: [1.0.0]()** +**Version: [1.0.0](https://github.com/rdkcentral/rdkservices/blob/main/SystemAudioPlayer/CHANGELOG.md)** -A org.rdk.SystemAudioPlayer plugin for Thunder framework. +A SystemAudioPlayer 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](#head.Abbreviation,_Acronyms_and_Terms) +- [Description](#head.Description) +- [Configuration](#head.Configuration) +- [Methods](#head.Methods) - + # Abbreviation, Acronyms and Terms -[[Refer to this link](overview/aat.md)] +[[Refer to this link](userguide/aat.md)] - + # Description -The `SystemAudioPlayer` plugin provides system audio playback functionality for client applications. It supports various audio types (viz., pcm, mp3, wav) and can play them from various sources (viz., websocket, httpsrc, filesrc, data buffer). +The `SystemAudioPlayer` plugin provides an interface for SystemAudioPlayer. -**Note**: MP3 playback development remains a work-in-progress. +The plugin is designed to be loaded and executed within the Thunder framework. For more information about the framework refer to [[Thunder](#ref.Thunder)]. -The plugin is designed to be loaded and executed within the Thunder framework. For more information about the framework refer to [[Thunder](#Thunder)]. - - + # Configuration The table below lists configuration options of the plugin. | Name | Type | Description | | :-------- | :-------- | :-------- | -| callsign | string | Plugin instance name (default: *org.rdk.SystemAudioPlayer*) | -| classname | string | Class name: *org.rdk.SystemAudioPlayer* | +| callsign | string | Plugin instance name (default: org.rdk.SystemAudioPlayer) | +| classname | string | Class name: *SystemAudioPlayer* | | locator | string | Library name: *libWPEFrameworkSystemAudioPlayer.so* | | autostart | boolean | Determines if the plugin shall be started automatically along with the framework | - + # Methods -The following methods are provided by the org.rdk.SystemAudioPlayer plugin: +The following methods are provided by the SystemAudioPlayer plugin: SystemAudioPlayer interface methods: | Method | Description | | :-------- | :-------- | -| [close](#close) | Closes the system audio player with the specified ID | -| [config](#config) | Configures playback for a PCM audio source (audio/x-raw) on the specified player | -| [getPlayerSessionId](#getPlayerSessionId) | Gets the session ID from the provided the URL | -| [isspeaking](#isspeaking) | Checks if playback is in progress | -| [open](#open) | Opens a player instance and assigns it a unique ID | -| [pause](#pause) | Pauses playback on the specified player | -| [play](#play) | Plays audio on the specified player | -| [playbuffer](#playbuffer) | Buffers the audio playback on the specified player | -| [resume](#resume) | Resumes playback on the specified player | -| [setMixerLevels](#setMixerLevels) | Sets the audio level on the specified player | -| [setSmartVolControl](#setSmartVolControl) | Sets the smart volume audio control on the specified player | -| [stop](#stop) | Stops playback on the specified player | - - - -## *close* +| [close](#method.close) | | +| [config](#method.config) | | +| [configure](#method.configure) | | +| [getPlayerSessionId](#method.getPlayerSessionId) | | +| [isPlaying](#method.isPlaying) | | +| [onSAPEvents](#method.onSAPEvents) | | +| [open](#method.open) | | +| [pause](#method.pause) | | +| [play](#method.play) | | +| [playBuffer](#method.playBuffer) | | +| [resume](#method.resume) | | +| [setMixerLevels](#method.setMixerLevels) | | +| [setSmartVolControl](#method.setSmartVolControl) | | +| [stop](#method.stop) | | + + +## *close [method](#head.Methods)* -Closes the system audio player with the specified ID. The `SystemAudioPlayer` plugin destroys the player object. That is, if the player is playing, then it is stopped and closed. All volume mixer level settings are restored. - Also See: [open](#open). ### Events - -No Events - +No events are associated with this method. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.id | integer | A unique identifier for a player instance | - -### Result - +| params.input | string | - | +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | object | | -| result.success | boolean | Whether the request succeeded | +| result.output | string | - | + +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 0, "method": "org.rdk.SystemAudioPlayer.close", "params": { - "id": 1 + "input": "" } } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, - "result": { - "success": true - } + "jsonrpc": 2.0, + "id": 0, + "result": "" } ``` - -## *config* + +## *config [method](#head.Methods)* -Configures playback for a PCM audio source (audio/x-raw) on the specified player. This method must be called before the [play](#play) There may be more optional configuration parameters added in the future for PCM as well as for other audio types. Supported audio/x-raw configuration parameters can be found at https://gstreamer.freedesktop.org/documentation/rawparse/rawaudioparse.html#src. -### Events - -No Events +### Events +No events are associated with this method. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.id | integer | A unique identifier for a player instance | -| params.pcmconfig | object | PCM configuration properties | -| params.pcmconfig?.format | string | *(optional)* | -| params.pcmconfig?.rate | string | *(optional)* | -| params.pcmconfig?.channels | string | *(optional)* | -| params.pcmconfig?.layout | string | *(optional)* | -| params?.websocketsecparam | object | *(optional)* Parameters that are needed to establish a secured websocket connection | -| params?.websocketsecparam?.cafilenames | array | *(optional)* A list of Certificate Authorities file names. If empty, code will try to load CAs from default system path for wss connection | -| params?.websocketsecparam?.cafilenames[#] | object | *(optional)* | -| params?.websocketsecparam?.cafilenames[#]?.cafilename | string | *(optional)* A certificate file name in pem format | -| params?.websocketsecparam?.certfilename | string | *(optional)* Full file name of cert file in pem format. If a file name is not provided, then the other end of the communication needs to be configured to not validate a client certificate | -| params?.websocketsecparam?.keyfilename | string | *(optional)* Full file name of key file in pem format. A key file name must be provided if the certificate file name is provided | - -### Result - +| params.input | string | - | +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | object | | -| result.success | boolean | Whether the request succeeded | +| result.output | string | - | + +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 1, "method": "org.rdk.SystemAudioPlayer.config", "params": { - "id": 1, - "pcmconfig": { - "format": "S16LE", - "rate": "22050", - "channels": "1", - "layout": "interleaved" - }, - "websocketsecparam": { - "cafilenames": [ - { - "cafilename": "/etc/ssl/certs/Xfinity_Subscriber_ECC_Root.pem" - } - ], - "certfilename": "...", - "keyfilename": "..." - } + "input": "" } } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, - "result": { - "success": true - } + "jsonrpc": 2.0, + "id": 1, + "result": "" } ``` - -## *getPlayerSessionId* + +## *configure [method](#head.Methods)* -Gets the session ID from the provided the URL. The session is the ID returned in open cal. - -### Events -No Events +### Events +No events are associated with this method. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.url | string | The URL for returning the session ID | - -### Result +| params.service | PluginHost::IShell | - | +### Results +This method returns no results. -| Name | Type | Description | -| :-------- | :-------- | :-------- | -| result | object | | -| result.sessionId | integer | A unique identifier for a player instance | -| result.success | boolean | Whether the request succeeded | +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "org.rdk.SystemAudioPlayer.getPlayerSessionId", + "jsonrpc": 2.0, + "id": 2, + "method": "org.rdk.SystemAudioPlayer.configure", "params": { - "url": "http://localhost:50050/nuanceEve/tts?voice=ava&language=en-US&rate=50&text=SETTINGS" + "service": "" } } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, - "result": { - "sessionId": 1, - "success": true - } + "jsonrpc": 2.0, + "id": 2, + "result": null } ``` - -## *isspeaking* + +## *getPlayerSessionId [method](#head.Methods)* -Checks if playback is in progress. - -### Events -No Events +### Events +No events are associated with this method. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.id | integer | A unique identifier for a player instance | - -### Result - +| params.input | string | - | +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | object | | -| result.success | boolean | Whether the request succeeded | +| result.output | string | - | + +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "org.rdk.SystemAudioPlayer.isspeaking", + "jsonrpc": 2.0, + "id": 3, + "method": "org.rdk.SystemAudioPlayer.getPlayerSessionId", "params": { - "id": 1 + "input": "" } } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, - "result": { - "success": true - } + "jsonrpc": 2.0, + "id": 3, + "result": "" } ``` - -## *open* + +## *isPlaying [method](#head.Methods)* -Opens a player instance and assigns it a unique ID. The player ID is used to reference the player when calling other methods. -**Note**: The `SystemAudioPlayer` plugin can have a maximum of 1 system and 1 application play mode player at a time. - -Also See: [close](#close). ### Events - -No Events - +No events are associated with this method. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.audiotype | string | The audio type. If the audio type is `pcm`, then the application is expected to also provide the format using the `playmode` parameter. The `playmode` parameter is ignored for the other audio types. (must be one of the following: *pcm*, *mp3*, *wav*) | -| params.sourcetype | string | The source type (must be one of the following: *data*, *httpsrc*, *filesrc*, *websocket*) | -| params.playmode | string | The play mode. The play mode is only set if the `audiotype` parameter is set to `pcm`. (must be one of the following: *system*, *app*) | - -### Result - +| params.input | string | - | +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | object | | -| result.id | integer | A unique identifier for a player instance | -| result.success | boolean | Whether the request succeeded | +| result.output | string | - | + +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "org.rdk.SystemAudioPlayer.open", + "jsonrpc": 2.0, + "id": 4, + "method": "org.rdk.SystemAudioPlayer.isPlaying", "params": { - "audiotype": "pcm", - "sourcetype": "websocket", - "playmode": "system" + "input": "" } } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, - "result": { - "id": 1, - "success": true - } + "jsonrpc": 2.0, + "id": 4, + "result": "" } ``` - -## *pause* + +## *onSAPEvents [method](#head.Methods)* -Pauses playback on the specified player. Pause is only supported for HTTP and file source types. -### Events -| Event | Description | -| :-------- | :-------- | -| [onsapevents](#onsapevents) | Triggered if the playback paused on the specified player. | +### Events +No events are associated with this method. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.id | integer | A unique identifier for a player instance | +| params.data | string | - | +### Results +This method returns no results. -### Result +### Examples -| Name | Type | Description | -| :-------- | :-------- | :-------- | -| result | object | | -| result.success | boolean | Whether the request succeeded | - -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "org.rdk.SystemAudioPlayer.pause", + "jsonrpc": 2.0, + "id": 5, + "method": "org.rdk.SystemAudioPlayer.onSAPEvents", "params": { - "id": 1 + "data": "" } } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, - "result": { - "success": true - } + "jsonrpc": 2.0, + "id": 5, + "result": null } ``` - -## *play* + +## *open [method](#head.Methods)* -Plays audio on the specified player. -**Note**: If a player is using one play mode and another player tries to play audio using the same play mode, then an error returns indicating that the hardware resource has already been acquired by the session and includes the player ID. ### Events - -| Event | Description | -| :-------- | :-------- | -| [onsapevents](#onsapevents) | Triggered if the playback is started to play or finished normally on the specified player. | +No events are associated with this method. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.id | integer | A unique identifier for a player instance | -| params.url | string | The source URL. If no port number is provided for a web socket source, then the player uses `40001` as the default port | - -### Result - +| params.input | string | - | +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | object | | -| result.success | boolean | Whether the request succeeded | +| result.output | string | - | + +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "org.rdk.SystemAudioPlayer.play", + "jsonrpc": 2.0, + "id": 6, + "method": "org.rdk.SystemAudioPlayer.open", "params": { - "id": 1, - "url": "http://localhost:50050/nuanceEve/tts?voice=ava&language=en-US&rate=50&text=SETTINGS" + "input": "" } } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, - "result": { - "success": true - } + "jsonrpc": 2.0, + "id": 6, + "result": "" } ``` - -## *playbuffer* + +## *pause [method](#head.Methods)* -Buffers the audio playback on the specified player. -### Events -| Event | Description | -| :-------- | :-------- | -| [onsapevents](#onsapevents) | Triggered if the buffer needs more data to play. | +### Events +No events are associated with this method. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.id | integer | A unique identifier for a player instance | -| params.data | string | Size of the buffer | - -### Result - +| params.input | string | - | +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | object | | -| result.success | boolean | Whether the request succeeded | +| result.output | string | - | + +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "org.rdk.SystemAudioPlayer.playbuffer", + "jsonrpc": 2.0, + "id": 7, + "method": "org.rdk.SystemAudioPlayer.pause", "params": { - "id": 1, - "data": "180" + "input": "" } } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, - "result": { - "success": true - } + "jsonrpc": 2.0, + "id": 7, + "result": "" } ``` - -## *resume* + +## *play [method](#head.Methods)* -Resumes playback on the specified player. Resume is only supported for HTTP and file source types. -### Events -| Event | Description | -| :-------- | :-------- | -| [onsapevents](#onsapevents) | Triggered if the playback resumed on the specified player. | +### Events +No events are associated with this method. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.id | integer | A unique identifier for a player instance | - -### Result - +| params.input | string | - | +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | object | | -| result.success | boolean | Whether the request succeeded | +| result.output | string | - | + +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "org.rdk.SystemAudioPlayer.resume", + "jsonrpc": 2.0, + "id": 8, + "method": "org.rdk.SystemAudioPlayer.play", "params": { - "id": 1 + "input": "" } } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, - "result": { - "success": true - } + "jsonrpc": 2.0, + "id": 8, + "result": "" } ``` - -## *setMixerLevels* + +## *playBuffer [method](#head.Methods)* -Sets the audio level on the specified player. The `SystemAudioPlayer` plugin can control the volume of the content being played back as well as the primary program audio; thus, an application can duck down the volume on the primary program audio when system audio is played and then restore it back when the system audio playback is complete. -### Events - -No Events +### Events +No events are associated with this method. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.id | integer | A unique identifier for a player instance | -| params.primaryVolume | string | The primary volume. Valid values are `0` to `100` where `0` is the minimum and `100` is the maximum volume. A value of `0` indicates that the user will not hear any audio during playback | -| params.playerVolume | string | The player volume. Valid values are `0` to `100` where `0` is the minimum and `100` is the maximum volume. A value of `0` indicates that the user will not hear any audio during playback | - -### Result - +| params.input | string | - | +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | object | | -| result.success | boolean | Whether the request succeeded | +| result.output | string | - | + +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "org.rdk.SystemAudioPlayer.setMixerLevels", + "jsonrpc": 2.0, + "id": 9, + "method": "org.rdk.SystemAudioPlayer.playBuffer", "params": { - "id": 1, - "primaryVolume": "20", - "playerVolume": "7" + "input": "" } } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, - "result": { - "success": true - } + "jsonrpc": 2.0, + "id": 9, + "result": "" } ``` - -## *setSmartVolControl* + +## *resume [method](#head.Methods)* -Sets the smart volume audio control on the specified player. The plugin can control the smart volume of the content being played back as well as the primary program audio; thus, an application can duck down the volume on the primary program audio when system audio is played and then restore it back when the system audio playback is complete. -### Events - -No Events +### Events +No events are associated with this method. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.id | integer | A unique identifier for a player instance | -| params.enable | boolean | Enables or disables smart volume control | -| params.playerAudioLevelThreshold | number | The minimum audio level threshold in the player source stream above which smart audio mixing detection is triggered. Range: 0 to 1 (in real number) | -| params.playerDetectTimeMs | integer | The duration that the `playerAudioLevelThreshold` value must be detected before primary audio ducking is started. Range: Above 0 (in milliseconds) | -| params.playerHoldTimeMs | integer | The duration that primary audio ducking is enabled after the 'playerAudioLevelThreshold' value is no longer met and before primary audio ducking is stopped. Range: Above 0 (in milliseconds) | -| params.primaryDuckingPercent | integer | The percentage to duck the primary audio volume. If `setMixerLevels` has been called, then this percentage is scaled to the `params.primVolume` range. Range: 0 to 100 (in percentage) | - -### Result - +| params.input | string | - | +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | object | | -| result.success | boolean | Whether the request succeeded | +| result.output | string | - | + +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "org.rdk.SystemAudioPlayer.setSmartVolControl", + "jsonrpc": 2.0, + "id": 10, + "method": "org.rdk.SystemAudioPlayer.resume", "params": { - "id": 1, - "enable": true, - "playerAudioLevelThreshold": 0.1, - "playerDetectTimeMs": 200, - "playerHoldTimeMs": 1000, - "primaryDuckingPercent": 1 + "input": "" } } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, - "result": { - "success": true - } + "jsonrpc": 2.0, + "id": 10, + "result": "" } ``` - -## *stop* + +## *setMixerLevels [method](#head.Methods)* -Stops playback on the specified player. - -### Events -No Events +### Events +No events are associated with this method. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.id | integer | A unique identifier for a player instance | - -### Result - +| params.input | string | - | +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | object | | -| result.success | boolean | Whether the request succeeded | +| result.output | string | - | + +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "org.rdk.SystemAudioPlayer.stop", + "jsonrpc": 2.0, + "id": 11, + "method": "org.rdk.SystemAudioPlayer.setMixerLevels", "params": { - "id": 1 + "input": "" } } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, - "result": { - "success": true - } + "jsonrpc": 2.0, + "id": 11, + "result": "" } ``` - -# Notifications + +## *setSmartVolControl [method](#head.Methods)* + -Notifications are autonomous events, triggered by the internals of the implementation, and broadcasted via JSON-RPC to all registered observers. Refer to [[Thunder](#Thunder)] for information on how to register for a notification. -The following events are provided by the org.rdk.SystemAudioPlayer plugin: +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.input | string | - | +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result.output | string | - | -SystemAudioPlayer interface events: +### Examples -| Event | Description | -| :-------- | :-------- | -| [onsapevents](#onsapevents) | Triggered during playback for each player | +#### Request - -## *onsapevents* +```json +{ + "jsonrpc": 2.0, + "id": 12, + "method": "org.rdk.SystemAudioPlayer.setSmartVolControl", + "params": { + "input": "" + } +} +``` -Triggered during playback for each player. Events from each player are broadcast to all registered clients. The client is responsible for checking the player `id` attribute and discarding events for unwanted players. -### Notifications +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 12, + "result": "" +} +``` + + +## *stop [method](#head.Methods)* -The following events are supported. -| Event Name | Description | -| :-------- | :-------- | -| PLAYBACK_STARTED| Triggered when playback starts | -| PLAYBACK_FINISHED | Triggered when playback finishes normally. **Note**: Web socket playback is continuous and does not receive the `PLAYBACK_FINISHED` event until the stream contains `EOS`. | -| PLAYBACK_PAUSED| Triggered when playback is paused | - |PLAYBACK_RESUMED | Triggered when playback resumes | -| NETWORK_ERROR | Triggered when a playback network error occurs (httpsrc/web socket) | -| PLAYBACK_ERROR| Triggered when any other playback error occurs (internal issue)| -| NEED_DATA| Triggered when the buffer needs more data to play|. -### Parameters +### Events +No events are associated with this method. +### Parameters | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.id | integer | A unique identifier for a player instance | -| params.event | string | A playback event | +| params.input | string | - | +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result.output | string | - | + +### Examples -### Example + +#### Request ```json { - "jsonrpc": "2.0", - "method": "client.events.onsapevents", + "jsonrpc": 2.0, + "id": 13, + "method": "org.rdk.SystemAudioPlayer.stop", "params": { - "id": 1, - "event": "PLAYBACK_STARTED" + "input": "" } } ``` + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 13, + "result": "" +} +``` + + diff --git a/docs/apis/SystemModePlugin.md b/docs/apis/SystemModePlugin.md index 796967e8..fd7814fe 100644 --- a/docs/apis/SystemModePlugin.md +++ b/docs/apis/SystemModePlugin.md @@ -1,151 +1,233 @@ - -# System Mode Plugin + +# SystemMode Plugin -**Version: [1.0.0]()** +**Version: [1.0.0](https://github.com/rdkcentral/rdkservices/blob/main/SystemMode/CHANGELOG.md)** -A org.rdk.SystemMode plugin for Thunder framework. +A SystemMode plugin for Thunder framework. ### Table of Contents -- [Abbreviation, Acronyms and Terms](#Abbreviation,_Acronyms_and_Terms) -- [Description](#Description) -- [Configuration](#Configuration) -- [Methods](#Methods) +- [Abbreviation, Acronyms and Terms](#head.Abbreviation,_Acronyms_and_Terms) +- [Description](#head.Description) +- [Configuration](#head.Configuration) +- [Methods](#head.Methods) - + # Abbreviation, Acronyms and Terms -[[Refer to this link](overview/aat.md)] +[[Refer to this link](userguide/aat.md)] - + # Description -The `SystemMode` plugin coordinates state changes that take effect across multiple components in the system. +The `SystemMode` plugin provides an interface for SystemMode. -The plugin is designed to be loaded and executed within the Thunder framework. For more information about the framework refer to [[Thunder](#Thunder)]. +The plugin is designed to be loaded and executed within the Thunder framework. For more information about the framework refer to [[Thunder](#ref.Thunder)]. - + # Configuration The table below lists configuration options of the plugin. | Name | Type | Description | | :-------- | :-------- | :-------- | -| callsign | string | Plugin instance name (default: *org.rdk.SystemMode*) | -| classname | string | Class name: *org.rdk.SystemMode* | +| callsign | string | Plugin instance name (default: org.rdk.SystemMode) | +| classname | string | Class name: *SystemMode* | | locator | string | Library name: *libWPEFrameworkSystemMode.so* | | autostart | boolean | Determines if the plugin shall be started automatically along with the framework | - + # Methods -The following methods are provided by the org.rdk.SystemMode plugin: +The following methods are provided by the SystemMode plugin: -org.rdk.SystemMode interface methods: +SystemMode interface methods: | Method | Description | | :-------- | :-------- | -| [requestState](#requestState) | Requests a new system mode state in the device | -| [getState](#getState) | Gets the current state for a given system property | +| [clientActivated](#method.clientActivated) | To put client plugin entry in map. | +| [clientDeactivated](#method.clientDeactivated) | To put client plugin entry in map. | +| [getState](#method.getState) | Gets the current state for a given system property | +| [requestState](#method.requestState) | Requests a new system mode state in the device. Thunder components asynchronously reconfigure themselves so the caller cannot be guaranteed a full state transition upon return. | + +## *clientActivated [method](#head.Methods)* - -## *requestState* - -Requests a new system mode state in the device. Thunder components asynchronously reconfigure themselves so the caller cannot be guaranteed a full state transition upon return. +To put client plugin entry in map. ### Events - -No Events - +No events are associated with this method. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.systemMode | string | System mode (must be one of the following: device_optimize) | -| params.state | string | The target state (must be one of the following: video, game) | +| params.callsign | string | callsign of client. | +| params.systemMode | string | The system mode. | +### Results +This method returns no results. + +### Examples + + +#### Request -### Result +```json +{ + "jsonrpc": 2.0, + "id": 0, + "method": "org.rdk.SystemMode.clientActivated", + "params": { + "callsign": "", + "systemMode": "" + } +} +``` + + +#### Response +```json +{ + "jsonrpc": 2.0, + "id": 0, + "result": null +} +``` + + +## *clientDeactivated [method](#head.Methods)* + +To put client plugin entry in map. + +### Events +No events are associated with this method. +### Parameters | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | null | Always null | +| params | object | | +| params.callsign | string | callsign of client. | +| params.systemMode | string | The system mode. | +### Results +This method returns no results. + +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "org.rdk.SystemMode.requestState", + "jsonrpc": 2.0, + "id": 1, + "method": "org.rdk.SystemMode.clientDeactivated", "params": { - "systemMode": "device_optimize", - "state": "game" + "callsign": "", + "systemMode": "" } } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 1, "result": null } ``` - -## *getState* + +## *getState [method](#head.Methods)* -Gets the current state for a given system +Gets the current state for a given system property ### Events - -No Events - +No events are associated with this method. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.systemMode | string | System mode (must be one of the following: device_optimize) | - -### Result - +| params.systemMode | SystemMode | The system mode. | +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | object | | -| result.state | string | The target state (must be one of the following: video, game) | +| result.getStateResult | GetStateResult | - | +| result.getStateResult.state | State | state | + +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 2, "method": "org.rdk.SystemMode.getState", "params": { - "systemMode": "device_optimize" + "systemMode": "DEVICE_OPTIMIZE" } } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 2, "result": { - "state": "game" + "state": "GAME" } } ``` + +## *requestState [method](#head.Methods)* + +Requests a new system mode state in the device. Thunder components asynchronously reconfigure themselves so the caller cannot be guaranteed a full state transition upon return. + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.systemMode | SystemMode | The system mode. | +| params.state | State | state | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 3, + "method": "org.rdk.SystemMode.requestState", + "params": { + "systemMode": "DEVICE_OPTIMIZE", + "state": "GAME" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 3, + "result": null +} +``` + + diff --git a/docs/apis/TelemetryPlugin.md b/docs/apis/TelemetryPlugin.md index 1cc344ff..1b985b53 100644 --- a/docs/apis/TelemetryPlugin.md +++ b/docs/apis/TelemetryPlugin.md @@ -1,300 +1,250 @@ - + # Telemetry Plugin -**Version: [1.0.0]()** +**Version: [1.0.0](https://github.com/rdkcentral/rdkservices/blob/main/Telemetry/CHANGELOG.md)** -A org.rdk.Telemetry plugin for Thunder framework. +A Telemetry 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](#head.Abbreviation,_Acronyms_and_Terms) +- [Description](#head.Description) +- [Configuration](#head.Configuration) +- [Methods](#head.Methods) +- [Notifications](#head.Notifications) - + # Abbreviation, Acronyms and Terms -[[Refer to this link](overview/aat.md)] +[[Refer to this link](userguide/aat.md)] - + # Description -The `Telemetry` plugin allows you to persist event data for monitoring applications. +The `Telemetry` plugin provides an interface for Telemetry. -The plugin is designed to be loaded and executed within the Thunder framework. For more information about the framework refer to [[Thunder](#Thunder)]. +The plugin is designed to be loaded and executed within the Thunder framework. For more information about the framework refer to [[Thunder](#ref.Thunder)]. - + # Configuration The table below lists configuration options of the plugin. | Name | Type | Description | | :-------- | :-------- | :-------- | -| callsign | string | Plugin instance name (default: *org.rdk.Telemetry*) | -| classname | string | Class name: *org.rdk.Telemetry* | +| callsign | string | Plugin instance name (default: org.rdk.Telemetry) | +| classname | string | Class name: *Telemetry* | | locator | string | Library name: *libWPEFrameworkTelemetry.so* | | autostart | boolean | Determines if the plugin shall be started automatically along with the framework | - + # Methods -The following methods are provided by the org.rdk.Telemetry plugin: +The following methods are provided by the Telemetry plugin: -Telemtry interface methods: +Telemetry interface methods: | Method | Description | | :-------- | :-------- | -| [setReportProfileStatus](#setReportProfileStatus) | Sets the status of telemetry reporting | -| [logApplicationEvent](#logApplicationEvent) | Logs an application event | -| [uploadReport](#uploadReport) | Triggers processing and uploading of telemetry report for legacy Xconf based configuration | -| [abortReport](#abortReport) | Makes request to Telemetry service to abort report upload | +| [abortReport](#method.abortReport) | Abort report upload | +| [logApplicationEvent](#method.logApplicationEvent) | Logs an application | +| [setReportProfileStatus](#method.setReportProfileStatus) | Sets the status of telemetry reporting | +| [uploadReport](#method.uploadReport) | Uploading of telemetry report | + +## *abortReport [method](#head.Methods)* - -## *setReportProfileStatus* - -Sets the status of telemetry reporting. +Abort report upload ### Events - -No Events - +No events are associated with this method. ### Parameters +This method takes no parameters. +### Results +This method returns no results. -| Name | Type | Description | -| :-------- | :-------- | :-------- | -| params | object | | -| params.status | string | The report status (must be one of the following: *STARTED*, *COMPLETE*) | - -### Result - -| Name | Type | Description | -| :-------- | :-------- | :-------- | -| result | null | Always null | - -### Errors - -| Code | Message | Description | -| :-------- | :-------- | :-------- | -| 1 | ```ERROR_GENERAL``` | General error | +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "org.rdk.Telemetry.setReportProfileStatus", - "params": { - "status": "STARTED" - } + "jsonrpc": 2.0, + "id": 0, + "method": "org.rdk.Telemetry.abortReport" } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 0, "result": null } ``` - -## *logApplicationEvent* + +## *logApplicationEvent [method](#head.Methods)* -Logs an application +Logs an application ### Events - -No Events - +No events are associated with this method. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.eventName | string | The event name | -| params.eventValue | string | The event value | +| params.eventName | string | - in - string | +| params.eventValue | string | - in - string | +### Results +This method returns no results. -### Result +### Examples -| Name | Type | Description | -| :-------- | :-------- | :-------- | -| result | null | Always null | - -### Errors - -| Code | Message | Description | -| :-------- | :-------- | :-------- | -| 1 | ```ERROR_GENERAL``` | General error | - -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 1, "method": "org.rdk.Telemetry.logApplicationEvent", "params": { - "eventName": "...", - "eventValue": "..." + "eventName": "", + "eventValue": "" } } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 1, "result": null } ``` - -## *uploadReport* + +## *setReportProfileStatus [method](#head.Methods)* -Triggers processing and uploading of telemetry report for legacy Xconf based configuration. +Sets the status of telemetry reporting ### Events - -| Event | Description | -| :-------- | :-------- | -| [onReportUpload](#onReportUpload) | Triggered by callback from Telemetry after report uploading | +No events are associated with this method. ### Parameters - -This method takes no parameters. - -### Result - | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | null | Always null | - -### Errors +| params | object | | +| params.status | string | - in - string | +### Results +This method returns no results. -| Code | Message | Description | -| :-------- | :-------- | :-------- | -| 25 | ```ERROR_RPC_CALL_FAILED``` | RBus call report uploading failed | -| 6 | ```ERROR_OPENING_FAILED``` | Failed to open RBus handle | -| 43 | ```ERROR_NOT_EXIST``` | Built with no support for RBus | +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "org.rdk.Telemetry.uploadReport" + "jsonrpc": 2.0, + "id": 2, + "method": "org.rdk.Telemetry.setReportProfileStatus", + "params": { + "status": "" + } } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 2, "result": null } ``` - -## *abortReport* + +## *uploadReport [method](#head.Methods)* -Makes request to Telemetry service to abort report upload. +Uploading of telemetry report ### Events - -No Events - +No events are associated with this method. ### Parameters - This method takes no parameters. +### Results +This method returns no results. -### Result - -| Name | Type | Description | -| :-------- | :-------- | :-------- | -| result | null | Always null | - -### Errors - -| Code | Message | Description | -| :-------- | :-------- | :-------- | -| 25 | ```ERROR_RPC_CALL_FAILED``` | RBus call report uploading failed | -| 6 | ```ERROR_OPENING_FAILED``` | Failed to open RBus handle | -| 43 | ```ERROR_NOT_EXIST``` | Built with no support for RBus | +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "org.rdk.Telemetry.abortReport" + "jsonrpc": 2.0, + "id": 3, + "method": "org.rdk.Telemetry.uploadReport" } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 3, "result": null } ``` - + + + # Notifications -Notifications are autonomous events, triggered by the internals of the implementation, and broadcasted via JSON-RPC to all registered observers. Refer to [[Thunder](#Thunder)] for information on how to register for a notification. +Notifications are autonomous events, triggered by the internals of the implementation, and broadcasted via JSON-RPC to all registered observers. Refer to [[Thunder](#ref.Thunder)] for information on how to register for a notification. -The following events are provided by the org.rdk.Telemetry plugin: +The following events are provided by the Telemetry plugin: -Telemtry interface events: +Telemetry interface events: | Event | Description | | :-------- | :-------- | -| [onReportUpload](#onReportUpload) | Triggered by callback from Telemetry after report uploading | +| [onReportUpload](#event.onReportUpload) | Triggered by callback from Telemetry after report uploading | + +## *onReportUpload [event](#head.Notifications)* - -## *onReportUpload* - -Triggered by callback from Telemetry after report uploading. +Triggered by callback from Telemetry after report uploading ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.telemetryUploadStatus | string | Indicates if the upload was successful | +| params.telemetryUploadStatus | string | - in - string | -### Example +### Examples ```json { - "jsonrpc": "2.0", - "method": "client.events.onReportUpload", + "jsonrpc": 2.0, + "id": 4, + "method": "org.rdk.Telemetry.onReportUpload", "params": { - "telemetryUploadStatus": "UPLOAD_SUCCESS" + "telemetryUploadStatus": "" } } ``` - diff --git a/docs/apis/TextToSpeechPlugin.md b/docs/apis/TextToSpeechPlugin.md index 43b7c4f0..b80b8185 100644 --- a/docs/apis/TextToSpeechPlugin.md +++ b/docs/apis/TextToSpeechPlugin.md @@ -1,1060 +1,1164 @@ - + # TextToSpeech Plugin -**Version: [1.0.0]()** +**Version: [1.0.0](https://github.com/rdkcentral/rdkservices/blob/main/TextToSpeech/CHANGELOG.md)** -A org.rdk.TextToSpeech plugin for Thunder framework. +A TextToSpeech 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](#head.Abbreviation,_Acronyms_and_Terms) +- [Description](#head.Description) +- [Configuration](#head.Configuration) +- [Methods](#head.Methods) +- [Properties](#head.Properties) - + # Abbreviation, Acronyms and Terms -[[Refer to this link](overview/aat.md)] +[[Refer to this link](userguide/aat.md)] - + # Description -The `TextToSpeech` plugin provides TTS functionality (Voice Guidance & Speech Synthesis) for the client application. +The `TextToSpeech` plugin provides an interface for TextToSpeech. -The plugin is designed to be loaded and executed within the Thunder framework. For more information about the framework refer to [[Thunder](#Thunder)]. +The plugin is designed to be loaded and executed within the Thunder framework. For more information about the framework refer to [[Thunder](#ref.Thunder)]. - + # Configuration The table below lists configuration options of the plugin. | Name | Type | Description | | :-------- | :-------- | :-------- | -| callsign | string | Plugin instance name (default: *org.rdk.TextToSpeech*) | -| classname | string | Class name: *org.rdk.TextToSpeech* | +| callsign | string | Plugin instance name (default: org.rdk.TextToSpeech) | +| classname | string | Class name: *TextToSpeech* | | locator | string | Library name: *libWPEFrameworkTextToSpeech.so* | | autostart | boolean | Determines if the plugin shall be started automatically along with the framework | - + # Methods -The following methods are provided by the org.rdk.TextToSpeech plugin: +The following methods are provided by the TextToSpeech plugin: TextToSpeech interface methods: | Method | Description | | :-------- | :-------- | -| [cancel](#cancel) | Cancels the speech | -| [enabletts](#enabletts) | (For Resident App) Enables or disables the TTS conversion processing | -| [getapiversion](#getapiversion) | Gets the API Version | -| [getspeechstate](#getspeechstate) | Returns the current state of the speech request | -| [getttsconfiguration](#getttsconfiguration) | Gets the current TTS configuration | -| [isspeaking](#isspeaking) | Checks if speech is in progress | -| [isttsenabled](#isttsenabled) | Returns whether the TTS engine is enabled or disabled | -| [listvoices](#listvoices) | Lists the available voices for the specified language | -| [pause](#pause) | Pauses the speech | -| [resume](#resume) | Resumes the speech | -| [setttsconfiguration](#setttsconfiguration) | Sets the TTS configuration | -| [speak](#speak) | Converts the input text to speech when TTS is enabled | -| [setACL](#setACL) | Configures app to speak | - - - -## *cancel* - -Cancels the speech. Triggers the `onspeechinterrupted` +| [cancel](#method.cancel) | Cancel the speech | +| [enabled](#method.enabled) | Notify TTS enabled/disabled | +| [getConfiguration](#method.getConfiguration) | Retrieve tts configuration attributes | +| [getSpeechState](#method.getSpeechState) | Get speech status | +| [listVoices](#method.listVoices) | List voices available | +| [networkError](#method.networkError) | | +| [pause](#method.pause) | Pause the speech | +| [playbackError](#method.playbackError) | | +| [registerWithCallsign](#method.registerWithCallsign) | | +| [resume](#method.resume) | Resume the speech | +| [setACL](#method.setACL) | | +| [setAPIKey](#method.setAPIKey) | | +| [setConfiguration](#method.setConfiguration) | Set the tts configuration attributes | +| [setFallbackText](#method.setFallbackText) | | +| [setPrimaryVolDuck](#method.setPrimaryVolDuck) | | +| [speak](#method.speak) | Speaks text provided | +| [speechComplete](#method.speechComplete) | | +| [speechInterrupted](#method.speechInterrupted) | | +| [speechPause](#method.speechPause) | | +| [speechResume](#method.speechResume) | | +| [speechStart](#method.speechStart) | | +| [voiceChanged](#method.voiceChanged) | Notify change in voice used for speaking | +| [willSpeak](#method.willSpeak) | Notify speechid based on the speech state(eg: start,pause,..etc) | + + +## *cancel [method](#head.Methods)* + +Cancel the speech ### Events - -| Event | Description | -| :-------- | :-------- | -| [onspeechinterrupted](#onspeechinterrupted) | Triggered when ongoing speech is cancelled. Event is not triggered: if TTS is not enabled; if ongoing Speech is completed | +No events are associated with this method. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.speechid | number | The speech ID | +| params.speechid | uint32_t | id of the text | +### Results +This method returns no results. -### Result - -| Name | Type | Description | -| :-------- | :-------- | :-------- | -| result | object | | -| result.TTS_Status | number | (must be one of the following: *TTS_OK(0)*, *TTS_FAIL(1)*, *TTS_NOT_ENABLED(2)*, *TTS_INVALID_CONFIGURATION(3)*) | -| result.success | boolean | Whether the request succeeded | +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 0, "method": "org.rdk.TextToSpeech.cancel", "params": { - "speechid": 1 + "speechid": 0 } } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, - "result": { - "TTS_Status": 0, - "success": true - } + "jsonrpc": 2.0, + "id": 0, + "result": null } ``` - -## *enabletts* + +## *enabled [method](#head.Methods)* -(For Resident App) Enables or disables the TTS conversion processing. Triggered `onttsstatechanged` event when state changes and `onspeechinterrupted` event when disabling TTS while speech is in-progress. +Notify TTS enabled/disabled ### Events - -| Event | Description | -| :-------- | :-------- | -| [onttsstatechanged](#onttsstatechanged) | state : true Triggered when TTS is enabled; state : false Triggered when TTS is disabled; otherwise No event When TTS enable or disable is in-progress | -| [onspeechinterrupted](#onspeechinterrupted) | Triggered when disabling TTS while speech is in-progress. | +No events are associated with this method. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.enabletts | boolean | Enable or Disable TTS | +| params.state | bool | enabled/disabled | +### Results +This method returns no results. -### Result +### Examples -| Name | Type | Description | -| :-------- | :-------- | :-------- | -| result | object | | -| result.TTS_Status | number | (must be one of the following: *TTS_OK(0)*, *TTS_FAIL(1)*, *TTS_NOT_ENABLED(2)*, *TTS_INVALID_CONFIGURATION(3)*) | -| result.success | boolean | Whether the request succeeded | - -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "org.rdk.TextToSpeech.enabletts", + "jsonrpc": 2.0, + "id": 1, + "method": "org.rdk.TextToSpeech.enabled", "params": { - "enabletts": true + "state": true } } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, - "result": { - "TTS_Status": 0, - "success": true - } + "jsonrpc": 2.0, + "id": 1, + "result": null } ``` - -## *getapiversion* + +## *getConfiguration [method](#head.Methods)* -Gets the API Version. +Retrieve tts configuration attributes ### Events - -No Events - +No events are associated with this method. ### Parameters - This method takes no parameters. - -### Result - +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | object | | -| result.version | number | Indicates the API Version | -| result.success | boolean | Whether the request succeeded | +| result.config | Configuration | tts configuration | +| result.config.ttsEndPoint | std::string | - | +| result.config.ttsEndPointSecured | std::string | - | +| result.config.language | std::string | - | +| result.config.voice | std::string | - | +| result.config.speechRate | std::string | - | +| result.config.volume | uint8_t | - | +| result.config.rate | uint8_t | - | + +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "org.rdk.TextToSpeech.getapiversion" + "jsonrpc": 2.0, + "id": 2, + "method": "org.rdk.TextToSpeech.getConfiguration" } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 2, "result": { - "version": 1, - "success": true + "ttsEndPoint": "", + "ttsEndPointSecured": "", + "language": "", + "voice": "", + "speechRate": "", + "volume": "", + "rate": "" } } ``` - -## *getspeechstate* + +## *getSpeechState [method](#head.Methods)* -Returns the current state of the speech request. +Get speech status ### Events - -No Events - +No events are associated with this method. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.speechid | number | The speech ID | - -### Result - +| params.speechid | uint32_t | id of the text | +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | object | | -| result.speechstate | string | The speech state (must be one of the following: *SPEECH_PENDING(0)*, *SPEECH_IN_PROGRESS(1)*, *SPEECH_PAUSED(2)*, *SPEECH_NOT_FOUND(3)*) | -| result.TTS_Status | number | (must be one of the following: *TTS_OK(0)*, *TTS_FAIL(1)*, *TTS_NOT_ENABLED(2)*, *TTS_INVALID_CONFIGURATION(3)*) | -| result.success | boolean | Whether the request succeeded | +| result.state | SpeechState | speech state | + +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "org.rdk.TextToSpeech.getspeechstate", + "jsonrpc": 2.0, + "id": 3, + "method": "org.rdk.TextToSpeech.getSpeechState", "params": { - "speechid": 1 + "speechid": 0 } } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, - "result": { - "speechstate": "SPEECH_IN_PROGRESS", - "TTS_Status": 0, - "success": true - } + "jsonrpc": 2.0, + "id": 3, + "result": "SPEECH_PENDING" } ``` - -## *getttsconfiguration* + +## *listVoices [method](#head.Methods)* -Gets the current TTS configuration. +List voices available ### Events - -No Events - +No events are associated with this method. ### Parameters - -This method takes no parameters. - -### Result - | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | object | | -| result.ttsendpoint | string | The TTS engine URL | -| result.ttsendpointsecured | string | The TTS engine secured URL | -| result.language | string | The TTS language | -| result.voice | string | The TTS Voice | -| result.volume | string | The TTS Volume | -| result.rate | number | The TTS Rate | -| result?.speechrate | string | *(optional)* TTS Rate for TTS2 endpoint | -| result.TTS_Status | number | (must be one of the following: *TTS_OK(0)*, *TTS_FAIL(1)*, *TTS_NOT_ENABLED(2)*, *TTS_INVALID_CONFIGURATION(3)*) | -| result.success | boolean | Whether the request succeeded | - -### Example +| params | object | | +| params.language | string | input | +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result.voices | RPC::IStringIterator | list of voices | +| result.voices[#] | string | - | + +### Examples + #### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "org.rdk.TextToSpeech.getttsconfiguration" + "jsonrpc": 2.0, + "id": 4, + "method": "org.rdk.TextToSpeech.listVoices", + "params": { + "language": "" + } } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, - "result": { - "ttsendpoint": "http://url_for_the_text_to_speech_processing_unit", - "ttsendpointsecured": "https://url_for_the_text_to_speech_processing_unit", - "language": "en-US", - "voice": "carol", - "volume": "100.000000", - "rate": 50, - "speechrate": "medium", - "TTS_Status": 0, - "success": true - } + "jsonrpc": 2.0, + "id": 4, + "result": [ + "" + ] } ``` - -## *isspeaking* + +## *networkError [method](#head.Methods)* -Checks if speech is in progress. -### Events - -No Events +### Events +No events are associated with this method. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.speechid | number | The speech ID | - -### Result +| params.speechid | uint32_t | id of the text | +### Results +This method returns no results. -| Name | Type | Description | -| :-------- | :-------- | :-------- | -| result | object | | -| result.speaking | boolean | `true` if the passed speech is in progress (that is, audio was playing), `false` if speech is completed or speech ID not found | -| result.TTS_Status | number | (must be one of the following: *TTS_OK(0)*, *TTS_FAIL(1)*, *TTS_NOT_ENABLED(2)*, *TTS_INVALID_CONFIGURATION(3)*) | -| result.success | boolean | Whether the request succeeded | +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "org.rdk.TextToSpeech.isspeaking", + "jsonrpc": 2.0, + "id": 5, + "method": "org.rdk.TextToSpeech.networkError", "params": { - "speechid": 1 + "speechid": 0 } } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, - "result": { - "speaking": true, - "TTS_Status": 0, - "success": true - } + "jsonrpc": 2.0, + "id": 5, + "result": null } ``` - -## *isttsenabled* + +## *pause [method](#head.Methods)* -Returns whether the TTS engine is enabled or disabled. By default the TTS engine is disabled. +Pause the speech ### Events - -No Events - +No events are associated with this method. ### Parameters - -This method takes no parameters. - -### Result - | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | object | | -| result.isenabled | boolean | `true` if the TTS engine is enabled, otherwise `false` | -| result.TTS_Status | number | (must be one of the following: *TTS_OK(0)*, *TTS_FAIL(1)*, *TTS_NOT_ENABLED(2)*, *TTS_INVALID_CONFIGURATION(3)*) | -| result.success | boolean | Whether the request succeeded | +| params | object | | +| params.speechid | uint32_t | id of the text | +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result.status | TTSErrorDetail | return status | + +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "org.rdk.TextToSpeech.isttsenabled" + "jsonrpc": 2.0, + "id": 6, + "method": "org.rdk.TextToSpeech.pause", + "params": { + "speechid": 0 + } } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, - "result": { - "isenabled": true, - "TTS_Status": 0, - "success": true - } + "jsonrpc": 2.0, + "id": 6, + "result": "TTS_OK" } ``` - -## *listvoices* - -Lists the available voices for the specified language. For every language there is a set of pre-defined voices. + +## *playbackError [method](#head.Methods)* -### Events -No Events +### Events +No events are associated with this method. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.language | string | The TTS language | +| params.speechid | uint32_t | id of the text | +### Results +This method returns no results. -### Result +### Examples -| Name | Type | Description | -| :-------- | :-------- | :-------- | -| result | object | | -| result.voices | string | Array of available voice | -| result.TTS_Status | number | (must be one of the following: *TTS_OK(0)*, *TTS_FAIL(1)*, *TTS_NOT_ENABLED(2)*, *TTS_INVALID_CONFIGURATION(3)*) | -| result.success | boolean | Whether the request succeeded | - -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "org.rdk.TextToSpeech.listvoices", + "jsonrpc": 2.0, + "id": 7, + "method": "org.rdk.TextToSpeech.playbackError", "params": { - "language": "en-US" + "speechid": 0 } } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, - "result": { - "voices": "carol", - "TTS_Status": 0, - "success": true - } + "jsonrpc": 2.0, + "id": 7, + "result": null } ``` - -## *pause* + +## *registerWithCallsign [method](#head.Methods)* -Pauses the speech. Triggers the `onspeechpause` -### Events -| Event | Description | -| :-------- | :-------- | -| [onspeechpause](#onspeechpause) | Triggered when ongoing speech is paused. Event not triggered on following conditions: TTS is not enabled; Speech is already in pause; or Speech is completed | +### Events +No events are associated with this method. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.speechid | number | The speech ID | +| params.callsign | string | - | +| params.sink | ITextToSpeech::INotification | - | +### Results +This method returns no results. -### Result +### Examples -| Name | Type | Description | -| :-------- | :-------- | :-------- | -| result | object | | -| result.TTS_Status | number | (must be one of the following: *TTS_OK(0)*, *TTS_FAIL(1)*, *TTS_NOT_ENABLED(2)*, *TTS_INVALID_CONFIGURATION(3)*) | -| result.success | boolean | Whether the request succeeded | - -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "org.rdk.TextToSpeech.pause", + "jsonrpc": 2.0, + "id": 8, + "method": "org.rdk.TextToSpeech.registerWithCallsign", "params": { - "speechid": 1 + "callsign": "", + "sink": "" } } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, - "result": { - "TTS_Status": 0, - "success": true - } + "jsonrpc": 2.0, + "id": 8, + "result": null } ``` - -## *resume* + +## *resume [method](#head.Methods)* -Resumes the speech. Triggers the `onspeechresume` +Resume the speech ### Events - -| Event | Description | -| :-------- | :-------- | -| [onspeechresume](#onspeechresume) | Triggered when speech is resumed and speech output is available. Event not triggered under following conditions: TTS is not enabled; Speech is resumed already; or Speech is completed | +No events are associated with this method. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.speechid | number | The speech ID | - -### Result - +| params.speechid | uint32_t | id of the text | +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | object | | -| result.TTS_Status | number | (must be one of the following: *TTS_OK(0)*, *TTS_FAIL(1)*, *TTS_NOT_ENABLED(2)*, *TTS_INVALID_CONFIGURATION(3)*) | -| result.success | boolean | Whether the request succeeded | +| result.status | TTSErrorDetail | return status | + +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 9, "method": "org.rdk.TextToSpeech.resume", "params": { - "speechid": 1 + "speechid": 0 } } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, - "result": { - "TTS_Status": 0, - "success": true - } + "jsonrpc": 2.0, + "id": 9, + "result": "TTS_OK" } ``` - -## *setttsconfiguration* + +## *setACL [method](#head.Methods)* -Sets the TTS configuration. Triggers the `onvoicechanged` -### Events -| Event | Description | -| :-------- | :-------- | -| [onvoicechanged](#onvoicechanged) | Triggered only when the voice configuration is changed | +### Events +No events are associated with this method. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params?.ttsendpoint | string | *(optional)* The TTS engine URL | -| params?.ttsendpointsecured | string | *(optional)* The TTS engine secured URL | -| params?.language | string | *(optional)* The TTS language | -| params?.voice | string | *(optional)* The TTS Voice | -| params?.volume | string | *(optional)* The TTS Volume | -| params?.primvolduckpercent | number | *(optional)* The TTS Primary Volumeduckpercentage | -| params?.rate | number | *(optional)* The TTS Rate | -| params?.speechrate | string | *(optional)* TTS Rate for TTS2 endpoint | -| params?.fallbacktext | object | *(optional)* | -| params?.fallbacktext?.scenario | string | *(optional)* Describes the scenario where fallback text is to be used . At present, only `offline` is supported | -| params?.fallbacktext?.value | string | *(optional)* The Text which is to be spoken when the scenario is met | -| params?.authinfo | object | *(optional)* | -| params?.authinfo?.type | string | *(optional)* The type of authentication. At present, only `apikey` is supported | -| params?.authinfo?.value | string | *(optional)* x api key(secret key) required for GCD Endpoints | - -### Result +| params.method | string | - | +| params.apps | string | - | +### Results +This method returns no results. -| Name | Type | Description | -| :-------- | :-------- | :-------- | -| result | object | | -| result.TTS_Status | number | (must be one of the following: *TTS_OK(0)*, *TTS_FAIL(1)*, *TTS_NOT_ENABLED(2)*, *TTS_INVALID_CONFIGURATION(3)*) | -| result.success | boolean | Whether the request succeeded | +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "org.rdk.TextToSpeech.setttsconfiguration", + "jsonrpc": 2.0, + "id": 10, + "method": "org.rdk.TextToSpeech.setACL", "params": { - "ttsendpoint": "http://url_for_the_text_to_speech_processing_unit", - "ttsendpointsecured": "https://url_for_the_text_to_speech_processing_unit", - "language": "en-US", - "voice": "carol", - "volume": "100.000000", - "primvolduckpercent": 25, - "rate": 50, - "speechrate": "medium", - "fallbacktext": { - "scenario": "offline", - "value": "No Internet connection" - }, - "authinfo": { - "type": "apikey", - "value": "XXXXXXXXXXXX" - } + "method": "", + "apps": "" } } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, - "result": { - "TTS_Status": 0, - "success": true - } + "jsonrpc": 2.0, + "id": 10, + "result": null } ``` - -## *speak* + +## *setAPIKey [method](#head.Methods)* -Converts the input text to speech when TTS is enabled. Any ongoing speech is interrupted and the newly requested speech is processed. The clients of the previous speech is sent an `onspeechinterrupted` Upon success, this API returns an ID, which is used as input to other API methods for controlling the speech (for example, `pause`, `resume`, and `cancel`). -### Events -| Event | Description | -| :-------- | :-------- | -| [onwillspeak](#onwillspeak) | Triggered when speech conversion is about to start | -| [onspeechstart](#onspeechstart) | Triggered when conversion of text to speech is started | -| [onspeechinterrupted](#onspeechinterrupted) | Current speech is interrupted either by a next speech request; by calling the cancel method; or by disabling TTS, when speech is in-progress | -| [onspeechcomplete](#onspeechcomplete) | Triggered when conversion from text to speech is completed | -| [onnetworkerror](#onnetworkerror) | Triggered when failed to fetch audio from the endpoint | -| [onplaybackerror](#onplaybackerror) | Triggered when an error occurs during playback including pipeline failures; Triggered when speak is called during TTS disabled | +### Events +No events are associated with this method. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.text | string | The text input | -| params?.callsign | string | *(optional)* Callsign of the application. This is mandatory when setACL is called prior to speak | +| params.apikey | string | - | +### Results +This method returns no results. -### Result +### Examples -| Name | Type | Description | -| :-------- | :-------- | :-------- | -| result | object | | -| result.speechid | number | The speech ID | -| result.TTS_Status | number | (must be one of the following: *TTS_OK(0)*, *TTS_FAIL(1)*, *TTS_NOT_ENABLED(2)*, *TTS_INVALID_CONFIGURATION(3)*) | -| result.success | boolean | Whether the request succeeded | - -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "org.rdk.TextToSpeech.speak", + "jsonrpc": 2.0, + "id": 11, + "method": "org.rdk.TextToSpeech.setAPIKey", "params": { - "text": "speech_1", - "callsign": "WebApp" + "apikey": "" } } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, - "result": { - "speechid": 1, - "TTS_Status": 0, - "success": true - } + "jsonrpc": 2.0, + "id": 11, + "result": null } ``` - -## *setACL* + +## *setConfiguration [method](#head.Methods)* -Configures app to speak. Allows the ResidentAPP to configure the particular app and provides access to `speak` If not configured any then gives access to all apps to speak. Configuration does not retained after reboot. +Set the tts configuration attributes ### Events - -No Events - +No events are associated with this method. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.accesslist | array | | -| params.accesslist[#] | object | | -| params.accesslist[#].method | string | Method of TTS function to be performed | -| params.accesslist[#].apps | array | List of client application | -| params.accesslist[#].apps[#] | string | | - -### Result - +| params.config | Configuration | tts configuration | +| params.config.ttsEndPoint | std::string | - | +| params.config.ttsEndPointSecured | std::string | - | +| params.config.language | std::string | - | +| params.config.voice | std::string | - | +| params.config.speechRate | std::string | - | +| params.config.volume | uint8_t | - | +| params.config.rate | uint8_t | - | +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | object | | -| result.success | boolean | Whether the request succeeded | +| result.status | TTSErrorDetail | return status | + +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "org.rdk.TextToSpeech.setACL", + "jsonrpc": 2.0, + "id": 12, + "method": "org.rdk.TextToSpeech.setConfiguration", "params": { - "accesslist": [ - { - "method": "speak", - "apps": [ - "App1" - ] - } - ] + "config": { + "ttsEndPoint": "", + "ttsEndPointSecured": "", + "language": "", + "voice": "", + "speechRate": "", + "volume": "", + "rate": "" + } } } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, - "result": { - "success": true - } + "jsonrpc": 2.0, + "id": 12, + "result": "TTS_OK" } ``` - -# Notifications + +## *setFallbackText [method](#head.Methods)* + + -Notifications are autonomous events, triggered by the internals of the implementation, and broadcasted via JSON-RPC to all registered observers. Refer to [[Thunder](#Thunder)] for information on how to register for a notification. +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.scenario | string | - | +| params.value | string | - | +### Results +This method returns no results. -The following events are provided by the org.rdk.TextToSpeech plugin: +### Examples -TextToSpeech interface events: -| Event | Description | -| :-------- | :-------- | -| [onnetworkerror](#onnetworkerror) | Triggered when a network error occurs while fetching the audio from the endpoint | -| [onplaybackerror](#onplaybackerror) | Triggered when an error occurs during playback including pipeline failures | -| [onspeechcomplete](#onspeechcomplete) | Triggered when the speech completes | -| [onspeechinterrupted](#onspeechinterrupted) | Triggered when the current speech is interrupted either by a next speech request, by calling `cancel` or by disabling TTS, when speech is in progress | -| [onspeechpause](#onspeechpause) | Triggered when the ongoing speech pauses | -| [onspeechresume](#onspeechresume) | Triggered when any paused speech resumes | -| [onspeechstart](#onspeechstart) | Triggered when the speech start | -| [onttsstatechanged](#onttsstatechanged) | Triggered when TTS is enabled or disabled | -| [onvoicechanged](#onvoicechanged) | Triggered when the configured voice changes | -| [onwillspeak](#onwillspeak) | Triggered when the text to speech conversion is about to start | +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 13, + "method": "org.rdk.TextToSpeech.setFallbackText", + "params": { + "scenario": "", + "value": "" + } +} +``` - -## *onnetworkerror* +#### Response -Triggered when a network error occurs while fetching the audio from the endpoint. +```json +{ + "jsonrpc": 2.0, + "id": 13, + "result": null +} +``` -### Parameters + +## *setPrimaryVolDuck [method](#head.Methods)* + + +### Events +No events are associated with this method. +### Parameters | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.speechid | number | The speech ID | +| params.prim | uint8_t | - | +### Results +This method returns no results. + +### Examples -### Example + +#### Request ```json { - "jsonrpc": "2.0", - "method": "client.events.onnetworkerror", + "jsonrpc": 2.0, + "id": 14, + "method": "org.rdk.TextToSpeech.setPrimaryVolDuck", "params": { - "speechid": 1 + "prim": "" } } ``` - -## *onplaybackerror* -Triggered when an error occurs during playback including pipeline failures. +#### Response -### Parameters +```json +{ + "jsonrpc": 2.0, + "id": 14, + "result": null +} +``` + + +## *speak [method](#head.Methods)* +Speaks text provided + +### Events +No events are associated with this method. +### Parameters | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.speechid | number | The speech ID | +| params.callsign | string | - | +| params.text | string | for conversion | +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result.speechid | uint32_t | id of the text | +| result.status | TTSErrorDetail | return status | -### Example +### Examples + + +#### Request ```json { - "jsonrpc": "2.0", - "method": "client.events.onplaybackerror", + "jsonrpc": 2.0, + "id": 15, + "method": "org.rdk.TextToSpeech.speak", "params": { - "speechid": 1 + "callsign": "", + "text": "" } } ``` - -## *onspeechcomplete* -Triggered when the speech completes. +#### Response -### Parameters +```json +{ + "jsonrpc": 2.0, + "id": 15, + "result": { + "speechid": 0, + "status": "TTS_OK" + } +} +``` + +## *speechComplete [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.speechid | number | The speech ID | +| params.speechid | uint32_t | id of the text | +### Results +This method returns no results. -### Example +### Examples + + +#### Request ```json { - "jsonrpc": "2.0", - "method": "client.events.onspeechcomplete", + "jsonrpc": 2.0, + "id": 16, + "method": "org.rdk.TextToSpeech.speechComplete", "params": { - "speechid": 1 + "speechid": 0 } } ``` - -## *onspeechinterrupted* -Triggered when the current speech is interrupted either by a next speech request, by calling `cancel` or by disabling TTS, when speech is in progress. +#### Response -### Parameters +```json +{ + "jsonrpc": 2.0, + "id": 16, + "result": null +} +``` + + +## *speechInterrupted [method](#head.Methods)* + + +### Events +No events are associated with this method. +### Parameters | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.speechid | number | The speech ID | +| params.speechid | uint32_t | id of the text | +### Results +This method returns no results. + +### Examples -### Example + +#### Request ```json { - "jsonrpc": "2.0", - "method": "client.events.onspeechinterrupted", + "jsonrpc": 2.0, + "id": 17, + "method": "org.rdk.TextToSpeech.speechInterrupted", "params": { - "speechid": 1 + "speechid": 0 } } ``` - -## *onspeechpause* -Triggered when the ongoing speech pauses. +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 17, + "result": null +} +``` + + +## *speechPause [method](#head.Methods)* -### Parameters + +### Events +No events are associated with this method. +### Parameters | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.speechid | number | The speech ID | +| params.speechid | uint32_t | id of the text | +### Results +This method returns no results. + +### Examples + -### Example +#### Request ```json { - "jsonrpc": "2.0", - "method": "client.events.onspeechpause", + "jsonrpc": 2.0, + "id": 18, + "method": "org.rdk.TextToSpeech.speechPause", "params": { - "speechid": 1 + "speechid": 0 } } ``` - -## *onspeechresume* -Triggered when any paused speech resumes. +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 18, + "result": null +} +``` + + +## *speechResume [method](#head.Methods)* + -### Parameters +### Events +No events are associated with this method. +### Parameters | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.speechid | number | The speech ID | +| params.speechid | uint32_t | id of the text | +### Results +This method returns no results. + +### Examples -### Example + +#### Request ```json { - "jsonrpc": "2.0", - "method": "client.events.onspeechresume", + "jsonrpc": 2.0, + "id": 19, + "method": "org.rdk.TextToSpeech.speechResume", "params": { - "speechid": 1 + "speechid": 0 } } ``` - -## *onspeechstart* -Triggered when the speech start. +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 19, + "result": null +} +``` + + +## *speechStart [method](#head.Methods)* -### Parameters + +### Events +No events are associated with this method. +### Parameters | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.speechid | number | The speech ID | +| params.speechid | uint32_t | id of the text | +### Results +This method returns no results. + +### Examples -### Example + +#### Request ```json { - "jsonrpc": "2.0", - "method": "client.events.onspeechstart", + "jsonrpc": 2.0, + "id": 20, + "method": "org.rdk.TextToSpeech.speechStart", "params": { - "speechid": 1 + "speechid": 0 } } ``` - -## *onttsstatechanged* -Triggered when TTS is enabled or disabled. +#### Response -### Parameters +```json +{ + "jsonrpc": 2.0, + "id": 20, + "result": null +} +``` + +## *voiceChanged [method](#head.Methods)* + +Notify change in voice used for speaking + +### Events +No events are associated with this method. +### Parameters | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.state | boolean | `True` if TTS is enabled, otherwise `False` | +| params.voice | string | voice changed | +### Results +This method returns no results. + +### Examples -### Example + +#### Request ```json { - "jsonrpc": "2.0", - "method": "client.events.onttsstatechanged", + "jsonrpc": 2.0, + "id": 21, + "method": "org.rdk.TextToSpeech.voiceChanged", "params": { - "state": true + "voice": "" } } ``` - -## *onvoicechanged* -Triggered when the configured voice changes. +#### Response -### Parameters +```json +{ + "jsonrpc": 2.0, + "id": 21, + "result": null +} +``` + + +## *willSpeak [method](#head.Methods)* +Notify speechid based on the speech state(eg: start,pause,..etc) + +### Events +No events are associated with this method. +### Parameters | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.voice | string | The TTS Voice | +| params.speechid | uint32_t | id of the text | +### Results +This method returns no results. + +### Examples + -### Example +#### Request ```json { - "jsonrpc": "2.0", - "method": "client.events.onvoicechanged", + "jsonrpc": 2.0, + "id": 22, + "method": "org.rdk.TextToSpeech.willSpeak", "params": { - "voice": "carol" + "speechid": 0 } } ``` - -## *onwillspeak* -Triggered when the text to speech conversion is about to start. It provides the speech ID, generated for the text input given in the speak +#### Response -### Parameters +```json +{ + "jsonrpc": 2.0, + "id": 22, + "result": null +} +``` + + + +# Properties +The following properties are provided by the TextToSpeech plugin: + +TextToSpeech interface properties: +| Method | Description | +| :-------- | :-------- | +| [Enable](#property.Enable) | Query the status/enable tts | + + +## *Enable [property](#head.Properties)* + +Query the status/enable tts + +### Events +No events are associated with this method. +### Values | Name | Type | Description | | :-------- | :-------- | :-------- | -| params | object | | -| params.speechid | number | The speech ID | +| (property).enable | bool | status/enable | + +### Examples + + +#### Get Request -### Example +```json +{ + "jsonrpc": 2.0, + "id": 23, + "method": "org.rdk.TextToSpeech.enable" +} +``` + + +#### Get Response + +```json +{ + "jsonrpc": 2.0, + "id": 23, + "result": null +} +``` + + +#### Set Request ```json { - "jsonrpc": "2.0", - "method": "client.events.onwillspeak", + "jsonrpc": 2.0, + "id": 23, + "method": "org.rdk.TextToSpeech.enable", "params": { - "speechid": 1 + "enable": true } } ``` + +#### Set Response + +```json +{ + "jsonrpc": 2.0, + "id": 23, + "result": null +} +``` + diff --git a/docs/apis/TextTrackPlugin.md b/docs/apis/TextTrackPlugin.md new file mode 100644 index 00000000..75e5be79 --- /dev/null +++ b/docs/apis/TextTrackPlugin.md @@ -0,0 +1,2118 @@ + + +# TextTrack Plugin + +**Version: [1.0.0](https://github.com/rdkcentral/rdkservices/blob/main/TextTrack/CHANGELOG.md)** + +A TextTrack plugin for Thunder framework. + +### Table of Contents + +- [Abbreviation, Acronyms and Terms](#head.Abbreviation,_Acronyms_and_Terms) +- [Description](#head.Description) +- [Configuration](#head.Configuration) +- [Methods](#head.Methods) +- [Notifications](#head.Notifications) + + +# Abbreviation, Acronyms and Terms + +[[Refer to this link](userguide/aat.md)] + + +# Description + +The `TextTrack` plugin provides an interface for TextTrack. + +The plugin is designed to be loaded and executed within the Thunder framework. For more information about the framework refer to [[Thunder](#ref.Thunder)]. + + +# Configuration + +The table below lists configuration options of the plugin. + +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| callsign | string | Plugin instance name (default: org.rdk.TextTrack) | +| classname | string | Class name: *TextTrack* | +| locator | string | Library name: *libWPEFrameworkTextTrack.so* | +| autostart | boolean | Determines if the plugin shall be started automatically along with the framework | + + +# Methods + +The following methods are provided by the TextTrack plugin: + +TextTrack interface methods: + +| Method | Description | +| :-------- | :-------- | +| [closeSession](#method.closeSession) | Closes a previously opened render session. | +| [getBackgroundColor](#method.getBackgroundColor) | Getter for BackgroundColor | +| [getBackgroundOpacity](#method.getBackgroundOpacity) | Getter for BackgroundOpacity | +| [getClosedCaptionsStyle](#method.getClosedCaptionsStyle) | Gets the current ClosedCaptionsStyle settings. | +| [getFontColor](#method.getFontColor) | Getter for FontColor | +| [getFontEdge](#method.getFontEdge) | Getter for FontEdge | +| [getFontEdgeColor](#method.getFontEdgeColor) | Getter for FontEdgeColor | +| [getFontFamily](#method.getFontFamily) | Getter for FontFamily | +| [getFontOpacity](#method.getFontOpacity) | Getter for FontOpacity | +| [getFontSize](#method.getFontSize) | Getter for FontSize | +| [getTtmlStyleOverrides](#method.getTtmlStyleOverrides) | | +| [getWindowColor](#method.getWindowColor) | Getter for WindowColor | +| [getWindowOpacity](#method.getWindowOpacity) | Getter for WindowOpacity | +| [muteSession](#method.muteSession) | Mute will hide rendering of Captions | +| [openSession](#method.openSession) | Opens a new renderSession. | +| [pauseSession](#method.pauseSession) | Pauses a render session. | +| [resetSession](#method.resetSession) | Resets a previously opened render session back to its opened state. | +| [resumeSession](#method.resumeSession) | Resumed a paused session | +| [sendSessionData](#method.sendSessionData) | Sends data of Closed Captions, Captions or Timed Text data to a render session. | +| [sendSessionTimestamp](#method.sendSessionTimestamp) | Sends the current timestamp from a media player to a render session. | +| [setBackgroundColor](#method.setBackgroundColor) | Setter for BackgroundColor | +| [setBackgroundOpacity](#method.setBackgroundOpacity) | Setter for BackgroundOpacity | +| [setClosedCaptionsStyle](#method.setClosedCaptionsStyle) | Sets the ClosedCaptionsStyle. | +| [setFontColor](#method.setFontColor) | Setter for FontColor | +| [setFontEdge](#method.setFontEdge) | Setter for FontEdge | +| [setFontEdgeColor](#method.setFontEdgeColor) | Setter for FontEdgeColor | +| [setFontFamily](#method.setFontFamily) | Setter for FontFamily | +| [setFontOpacity](#method.setFontOpacity) | Setter for FontOpacity | +| [setFontSize](#method.setFontSize) | Setter for FontSize | +| [setPreviewText](#method.setPreviewText) | Sets a static text in the display for preview purposes. | +| [setSessionClosedCaptionsService](#method.setSessionClosedCaptionsService) | Sets the render session into CC mode. | +| [setSessionDvbSubtitleSelection](#method.setSessionDvbSubtitleSelection) | Set the render session into Dvb Subtitle mode, specifying the the page for presentation. (See ETSI EN 300 743) | +| [setSessionSCTESelection](#method.setSessionSCTESelection) | Set the render session into SCTE mode | +| [setSessionTTMLSelection](#method.setSessionTTMLSelection) | Set the render session into TTML mode | +| [setSessionTeletextSelection](#method.setSessionTeletextSelection) | Set the render session into Teletext mode, providing the teletext caption page for presentation | +| [setSessionWebVTTSelection](#method.setSessionWebVTTSelection) | Set the render session into WebVTT mode | +| [setTtmlStyleOverrides](#method.setTtmlStyleOverrides) | Sets global TTML override style. | +| [setWindowColor](#method.setWindowColor) | Setter for WindowColor | +| [setWindowOpacity](#method.setWindowOpacity) | Setter for WindowOpacity | +| [unMuteSession](#method.unMuteSession) | UnMute will unhide the rendering of Captions. | + + +## *closeSession [method](#head.Methods)* + +Closes a previously opened render session. + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.sessionId | uint32_t | On success the returned session id | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 0, + "method": "org.rdk.TextTrack.closeSession", + "params": { + "sessionId": 0 + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 0, + "result": null +} +``` + + +## *getBackgroundColor [method](#head.Methods)* + +Getter for BackgroundColor + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result.color | string | - | + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 1, + "method": "org.rdk.TextTrack.getBackgroundColor" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 1, + "result": "" +} +``` + + +## *getBackgroundOpacity [method](#head.Methods)* + +Getter for BackgroundOpacity + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result.opacity | int8_t | - | + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 2, + "method": "org.rdk.TextTrack.getBackgroundOpacity" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 2, + "result": "" +} +``` + + +## *getClosedCaptionsStyle [method](#head.Methods)* + +Gets the current ClosedCaptionsStyle settings. + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result.style | ClosedCaptionsStyle | Contains the chosen styles | +| result.style.fontFamily | FontFamily | - | +| result.style.fontSize | FontSize | - | +| result.style.fontColor | string | - | +| result.style.fontOpacity | int8_t | - | +| result.style.fontEdge | FontEdge | - | +| result.style.fontEdgeColor | string | - | +| result.style.backgroundColor | string | - | +| result.style.backgroundOpacity | int8_t | - | +| result.style.windowColor | string | - | +| result.style.windowOpacity | int8_t | - | + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 3, + "method": "org.rdk.TextTrack.getClosedCaptionsStyle" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 3, + "result": { + "fontFamily": "", + "fontSize": "", + "fontColor": "", + "fontOpacity": "", + "fontEdge": "", + "fontEdgeColor": "", + "backgroundColor": "", + "backgroundOpacity": "", + "windowColor": "", + "windowOpacity": "" + } +} +``` + + +## *getFontColor [method](#head.Methods)* + +Getter for FontColor + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result.color | string | - | + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 4, + "method": "org.rdk.TextTrack.getFontColor" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 4, + "result": "" +} +``` + + +## *getFontEdge [method](#head.Methods)* + +Getter for FontEdge + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result.edge | FontEdge | - | + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 5, + "method": "org.rdk.TextTrack.getFontEdge" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 5, + "result": "" +} +``` + + +## *getFontEdgeColor [method](#head.Methods)* + +Getter for FontEdgeColor + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result.color | string | - | + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 6, + "method": "org.rdk.TextTrack.getFontEdgeColor" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 6, + "result": "" +} +``` + + +## *getFontFamily [method](#head.Methods)* + +Getter for FontFamily + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result.font | FontFamily | - | + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 7, + "method": "org.rdk.TextTrack.getFontFamily" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 7, + "result": "" +} +``` + + +## *getFontOpacity [method](#head.Methods)* + +Getter for FontOpacity + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result.opacity | int8_t | - | + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 8, + "method": "org.rdk.TextTrack.getFontOpacity" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 8, + "result": "" +} +``` + + +## *getFontSize [method](#head.Methods)* + +Getter for FontSize + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result.size | FontSize | - | + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 9, + "method": "org.rdk.TextTrack.getFontSize" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 9, + "result": "" +} +``` + + +## *getTtmlStyleOverrides [method](#head.Methods)* + + + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result.style | string | Contains the chosen override for styles | + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 10, + "method": "org.rdk.TextTrack.getTtmlStyleOverrides" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 10, + "result": "" +} +``` + + +## *getWindowColor [method](#head.Methods)* + +Getter for WindowColor + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result.color | string | - | + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 11, + "method": "org.rdk.TextTrack.getWindowColor" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 11, + "result": "" +} +``` + + +## *getWindowOpacity [method](#head.Methods)* + +Getter for WindowOpacity + +### Events +No events are associated with this method. +### Parameters +This method takes no parameters. +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result.opacity | int8_t | - | + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 12, + "method": "org.rdk.TextTrack.getWindowOpacity" +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 12, + "result": "" +} +``` + + +## *muteSession [method](#head.Methods)* + +Mute will hide rendering of Captions + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.sessionId | uint32_t | On success the returned session id | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 13, + "method": "org.rdk.TextTrack.muteSession", + "params": { + "sessionId": 0 + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 13, + "result": null +} +``` + + +## *openSession [method](#head.Methods)* + +Opens a new renderSession. + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.displayHandle | string | The displayHandle is an encoding of the wayland display name optionally including the and window ID | +### Results +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result.sessionId | uint32_t | On success the returned session id | + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 14, + "method": "org.rdk.TextTrack.openSession", + "params": { + "displayHandle": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 14, + "result": 0 +} +``` + + +## *pauseSession [method](#head.Methods)* + +Pauses a render session. + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.sessionId | uint32_t | On success the returned session id | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 15, + "method": "org.rdk.TextTrack.pauseSession", + "params": { + "sessionId": 0 + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 15, + "result": null +} +``` + + +## *resetSession [method](#head.Methods)* + +Resets a previously opened render session back to its opened state. + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.sessionId | uint32_t | On success the returned session id | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 16, + "method": "org.rdk.TextTrack.resetSession", + "params": { + "sessionId": 0 + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 16, + "result": null +} +``` + + +## *resumeSession [method](#head.Methods)* + +Resumed a paused session + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.sessionId | uint32_t | On success the returned session id | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 17, + "method": "org.rdk.TextTrack.resumeSession", + "params": { + "sessionId": 0 + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 17, + "result": null +} +``` + + +## *sendSessionData [method](#head.Methods)* + +Sends data of Closed Captions, Captions or Timed Text data to a render session. + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.sessionId | uint32_t | On success the returned session id | +| params.type | DataType | Is the type of data | +| params.displayOffsetMs | int32_t | Is currently unused | +| params.data | string | Is the data to display, properly formatted as per the expectations of the type used | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 18, + "method": "org.rdk.TextTrack.sendSessionData", + "params": { + "sessionId": 0, + "type": "", + "displayOffsetMs": 0, + "data": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 18, + "result": null +} +``` + + +## *sendSessionTimestamp [method](#head.Methods)* + +Sends the current timestamp from a media player to a render session. + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.sessionId | uint32_t | On success the returned session id | +| params.mediaTimestampMs | uint64_t | Is a timestamp | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 19, + "method": "org.rdk.TextTrack.sendSessionTimestamp", + "params": { + "sessionId": 0, + "mediaTimestampMs": 0 + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 19, + "result": null +} +``` + + +## *setBackgroundColor [method](#head.Methods)* + +Setter for BackgroundColor + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.color | string | - | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 20, + "method": "org.rdk.TextTrack.setBackgroundColor", + "params": { + "color": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 20, + "result": null +} +``` + + +## *setBackgroundOpacity [method](#head.Methods)* + +Setter for BackgroundOpacity + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.opacity | int8_t | - | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 21, + "method": "org.rdk.TextTrack.setBackgroundOpacity", + "params": { + "opacity": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 21, + "result": null +} +``` + + +## *setClosedCaptionsStyle [method](#head.Methods)* + +Sets the ClosedCaptionsStyle. + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.style | ClosedCaptionsStyle | Contains the chosen styles | +| params.style.fontFamily | FontFamily | - | +| params.style.fontSize | FontSize | - | +| params.style.fontColor | string | - | +| params.style.fontOpacity | int8_t | - | +| params.style.fontEdge | FontEdge | - | +| params.style.fontEdgeColor | string | - | +| params.style.backgroundColor | string | - | +| params.style.backgroundOpacity | int8_t | - | +| params.style.windowColor | string | - | +| params.style.windowOpacity | int8_t | - | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 22, + "method": "org.rdk.TextTrack.setClosedCaptionsStyle", + "params": { + "style": { + "fontFamily": "", + "fontSize": "", + "fontColor": "", + "fontOpacity": "", + "fontEdge": "", + "fontEdgeColor": "", + "backgroundColor": "", + "backgroundOpacity": "", + "windowColor": "", + "windowOpacity": "" + } + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 22, + "result": null +} +``` + + +## *setFontColor [method](#head.Methods)* + +Setter for FontColor + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.color | string | - | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 23, + "method": "org.rdk.TextTrack.setFontColor", + "params": { + "color": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 23, + "result": null +} +``` + + +## *setFontEdge [method](#head.Methods)* + +Setter for FontEdge + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.edge | FontEdge | - | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 24, + "method": "org.rdk.TextTrack.setFontEdge", + "params": { + "edge": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 24, + "result": null +} +``` + + +## *setFontEdgeColor [method](#head.Methods)* + +Setter for FontEdgeColor + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.color | string | - | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 25, + "method": "org.rdk.TextTrack.setFontEdgeColor", + "params": { + "color": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 25, + "result": null +} +``` + + +## *setFontFamily [method](#head.Methods)* + +Setter for FontFamily + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.font | FontFamily | - | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 26, + "method": "org.rdk.TextTrack.setFontFamily", + "params": { + "font": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 26, + "result": null +} +``` + + +## *setFontOpacity [method](#head.Methods)* + +Setter for FontOpacity + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.opacity | int8_t | - | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 27, + "method": "org.rdk.TextTrack.setFontOpacity", + "params": { + "opacity": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 27, + "result": null +} +``` + + +## *setFontSize [method](#head.Methods)* + +Setter for FontSize + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.size | FontSize | - | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 28, + "method": "org.rdk.TextTrack.setFontSize", + "params": { + "size": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 28, + "result": null +} +``` + + +## *setPreviewText [method](#head.Methods)* + +Sets a static text in the display for preview purposes. + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.sessionId | uint32_t | On success the returned session id | +| params.text | string | Is the text to display | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 29, + "method": "org.rdk.TextTrack.setPreviewText", + "params": { + "sessionId": 0, + "text": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 29, + "result": null +} +``` + + +## *setSessionClosedCaptionsService [method](#head.Methods)* + +Sets the render session into CC mode. + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.sessionId | uint32_t | On success the returned session id | +| params.service | string | Identifies the service to display | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 30, + "method": "org.rdk.TextTrack.setSessionClosedCaptionsService", + "params": { + "sessionId": 0, + "service": "CC3" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 30, + "result": null +} +``` + + +## *setSessionDvbSubtitleSelection [method](#head.Methods)* + +Set the render session into Dvb Subtitle mode, specifying the the page for presentation. (See ETSI EN 300 743) + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.sessionId | uint32_t | On success the returned session id | +| params.compositionPageId | uint16_t | Is the one Id | +| params.ancillaryPageId | uint16_t | Is the other Id | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 31, + "method": "org.rdk.TextTrack.setSessionDvbSubtitleSelection", + "params": { + "sessionId": 0, + "compositionPageId": "", + "ancillaryPageId": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 31, + "result": null +} +``` + + +## *setSessionSCTESelection [method](#head.Methods)* + +Set the render session into SCTE mode + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.sessionId | uint32_t | On success the returned session id | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 32, + "method": "org.rdk.TextTrack.setSessionSCTESelection", + "params": { + "sessionId": 0 + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 32, + "result": null +} +``` + + +## *setSessionTTMLSelection [method](#head.Methods)* + +Set the render session into TTML mode + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.sessionId | uint32_t | On success the returned session id | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 33, + "method": "org.rdk.TextTrack.setSessionTTMLSelection", + "params": { + "sessionId": 0 + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 33, + "result": null +} +``` + + +## *setSessionTeletextSelection [method](#head.Methods)* + +Set the render session into Teletext mode, providing the teletext caption page for presentation + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.sessionId | uint32_t | On success the returned session id | +| params.page | uint16_t | The user selected teletext caption page 100-899 | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 34, + "method": "org.rdk.TextTrack.setSessionTeletextSelection", + "params": { + "sessionId": 0, + "page": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 34, + "result": null +} +``` + + +## *setSessionWebVTTSelection [method](#head.Methods)* + +Set the render session into WebVTT mode + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.sessionId | uint32_t | On success the returned session id | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 35, + "method": "org.rdk.TextTrack.setSessionWebVTTSelection", + "params": { + "sessionId": 0 + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 35, + "result": null +} +``` + + +## *setTtmlStyleOverrides [method](#head.Methods)* + +Sets global TTML override style. + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.style | string | Contains the chosen override for styles | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 36, + "method": "org.rdk.TextTrack.setTtmlStyleOverrides", + "params": { + "style": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 36, + "result": null +} +``` + + +## *setWindowColor [method](#head.Methods)* + +Setter for WindowColor + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.color | string | - | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 37, + "method": "org.rdk.TextTrack.setWindowColor", + "params": { + "color": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 37, + "result": null +} +``` + + +## *setWindowOpacity [method](#head.Methods)* + +Setter for WindowOpacity + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.opacity | int8_t | - | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 38, + "method": "org.rdk.TextTrack.setWindowOpacity", + "params": { + "opacity": "" + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 38, + "result": null +} +``` + + +## *unMuteSession [method](#head.Methods)* + +UnMute will unhide the rendering of Captions. + +### Events +No events are associated with this method. +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.sessionId | uint32_t | On success the returned session id | +### Results +This method returns no results. + +### Examples + + +#### Request + +```json +{ + "jsonrpc": 2.0, + "id": 39, + "method": "org.rdk.TextTrack.unMuteSession", + "params": { + "sessionId": 0 + } +} +``` + + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 39, + "result": null +} +``` + + + + +# Notifications + +Notifications are autonomous events, triggered by the internals of the implementation, and broadcasted via JSON-RPC to all registered observers. Refer to [[Thunder](#ref.Thunder)] for information on how to register for a notification. + +The following events are provided by the TextTrack plugin: + +TextTrack interface events: + +| Event | Description | +| :-------- | :-------- | +| [onBackgroundColorChanged](#event.onBackgroundColorChanged) | Notify backgroundColor Changed | +| [onBackgroundOpacityChanged](#event.onBackgroundOpacityChanged) | Notify backgroundOpacity Changed | +| [onClosedCaptionsStyleChanged](#event.onClosedCaptionsStyleChanged) | The ClosedCaptionsStyle settings has changed. Call GetClosedCaptionsStyle() to get the new settings. | +| [onFontColorChanged](#event.onFontColorChanged) | Notify fontColor Changed | +| [onFontEdgeChanged](#event.onFontEdgeChanged) | Notify fontEdge Changed | +| [onFontEdgeColorChanged](#event.onFontEdgeColorChanged) | Notify fontEdgeColor Changed | +| [onFontFamilyChanged](#event.onFontFamilyChanged) | Notify fontFamily Changed | +| [onFontOpacityChanged](#event.onFontOpacityChanged) | Notify fontOpacity Changed | +| [onFontSizeChanged](#event.onFontSizeChanged) | Notify fontSize Changed | +| [onTtmlStyleOverridesChanged](#event.onTtmlStyleOverridesChanged) | The TTML Style override settings has changed. | +| [onWindowColorChanged](#event.onWindowColorChanged) | Notify windowColor Changed | +| [onWindowOpacityChanged](#event.onWindowOpacityChanged) | Notify windowOpacity Changed | + + +## *onBackgroundColorChanged [event](#head.Notifications)* + +Notify backgroundColor Changed + +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.color | string | - | + +### Examples + +```json +{ + "jsonrpc": 2.0, + "id": 40, + "method": "org.rdk.TextTrack.onBackgroundColorChanged", + "params": { + "color": "" + } +} +``` + + +## *onBackgroundOpacityChanged [event](#head.Notifications)* + +Notify backgroundOpacity Changed + +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.opacity | int8_t | - | + +### Examples + +```json +{ + "jsonrpc": 2.0, + "id": 41, + "method": "org.rdk.TextTrack.onBackgroundOpacityChanged", + "params": { + "opacity": "" + } +} +``` + + +## *onClosedCaptionsStyleChanged [event](#head.Notifications)* + +The ClosedCaptionsStyle settings has changed. Call GetClosedCaptionsStyle() to get the new settings. + +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.style | ClosedCaptionsStyle | Contains the chosen styles | +| params.style.fontFamily | FontFamily | - | +| params.style.fontSize | FontSize | - | +| params.style.fontColor | string | - | +| params.style.fontOpacity | int8_t | - | +| params.style.fontEdge | FontEdge | - | +| params.style.fontEdgeColor | string | - | +| params.style.backgroundColor | string | - | +| params.style.backgroundOpacity | int8_t | - | +| params.style.windowColor | string | - | +| params.style.windowOpacity | int8_t | - | + +### Examples + +```json +{ + "jsonrpc": 2.0, + "id": 42, + "method": "org.rdk.TextTrack.onClosedCaptionsStyleChanged", + "params": { + "style": { + "fontFamily": "", + "fontSize": "", + "fontColor": "", + "fontOpacity": "", + "fontEdge": "", + "fontEdgeColor": "", + "backgroundColor": "", + "backgroundOpacity": "", + "windowColor": "", + "windowOpacity": "" + } + } +} +``` + + +## *onFontColorChanged [event](#head.Notifications)* + +Notify fontColor Changed + +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.color | string | - | + +### Examples + +```json +{ + "jsonrpc": 2.0, + "id": 43, + "method": "org.rdk.TextTrack.onFontColorChanged", + "params": { + "color": "" + } +} +``` + + +## *onFontEdgeChanged [event](#head.Notifications)* + +Notify fontEdge Changed + +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.edge | FontEdge | - | + +### Examples + +```json +{ + "jsonrpc": 2.0, + "id": 44, + "method": "org.rdk.TextTrack.onFontEdgeChanged", + "params": { + "edge": "" + } +} +``` + + +## *onFontEdgeColorChanged [event](#head.Notifications)* + +Notify fontEdgeColor Changed + +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.color | string | - | + +### Examples + +```json +{ + "jsonrpc": 2.0, + "id": 45, + "method": "org.rdk.TextTrack.onFontEdgeColorChanged", + "params": { + "color": "" + } +} +``` + + +## *onFontFamilyChanged [event](#head.Notifications)* + +Notify fontFamily Changed + +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.font | FontFamily | - | + +### Examples + +```json +{ + "jsonrpc": 2.0, + "id": 46, + "method": "org.rdk.TextTrack.onFontFamilyChanged", + "params": { + "font": "" + } +} +``` + + +## *onFontOpacityChanged [event](#head.Notifications)* + +Notify fontOpacity Changed + +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.opacity | int8_t | - | + +### Examples + +```json +{ + "jsonrpc": 2.0, + "id": 47, + "method": "org.rdk.TextTrack.onFontOpacityChanged", + "params": { + "opacity": "" + } +} +``` + + +## *onFontSizeChanged [event](#head.Notifications)* + +Notify fontSize Changed + +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.size | FontSize | - | + +### Examples + +```json +{ + "jsonrpc": 2.0, + "id": 48, + "method": "org.rdk.TextTrack.onFontSizeChanged", + "params": { + "size": "" + } +} +``` + + +## *onTtmlStyleOverridesChanged [event](#head.Notifications)* + +The TTML Style override settings has changed. + +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.style | string | Contains the chosen override for styles | + +### Examples + +```json +{ + "jsonrpc": 2.0, + "id": 49, + "method": "org.rdk.TextTrack.onTtmlStyleOverridesChanged", + "params": { + "style": "" + } +} +``` + + +## *onWindowColorChanged [event](#head.Notifications)* + +Notify windowColor Changed + +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.color | string | - | + +### Examples + +```json +{ + "jsonrpc": 2.0, + "id": 50, + "method": "org.rdk.TextTrack.onWindowColorChanged", + "params": { + "color": "" + } +} +``` + + +## *onWindowOpacityChanged [event](#head.Notifications)* + +Notify windowOpacity Changed + +### Parameters +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.opacity | int8_t | - | + +### Examples + +```json +{ + "jsonrpc": 2.0, + "id": 51, + "method": "org.rdk.TextTrack.onWindowOpacityChanged", + "params": { + "opacity": "" + } +} +``` diff --git a/docs/apis/USBDevicePlugin.md b/docs/apis/USBDevicePlugin.md index 83c91c41..5da6730f 100644 --- a/docs/apis/USBDevicePlugin.md +++ b/docs/apis/USBDevicePlugin.md @@ -1,434 +1,392 @@ - + # USBDevice Plugin -**Version: [1.0.0]()** +**Version: [1.0.0](https://github.com/rdkcentral/rdkservices/blob/main/USBDevice/CHANGELOG.md)** -A org.rdk.UsbDevice plugin for Thunder framework. +A USBDevice 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](#head.Abbreviation,_Acronyms_and_Terms) +- [Description](#head.Description) +- [Configuration](#head.Configuration) +- [Methods](#head.Methods) +- [Notifications](#head.Notifications) - + # Abbreviation, Acronyms and Terms -[[Refer to this link](overview/aat.md)] +[[Refer to this link](userguide/aat.md)] - + # Description -The `USBDevice`Plugin is responsible for notifying and providing information about USB devices attached to the host system. +The `USBDevice` plugin provides an interface for USBDevice. -The plugin is designed to be loaded and executed within the Thunder framework. For more information about the framework refer to [[Thunder](#Thunder)]. +The plugin is designed to be loaded and executed within the Thunder framework. For more information about the framework refer to [[Thunder](#ref.Thunder)]. - + # Configuration The table below lists configuration options of the plugin. | Name | Type | Description | | :-------- | :-------- | :-------- | -| callsign | string | Plugin instance name (default: *org.rdk.UsbDevice*) | -| classname | string | Class name: *org.rdk.UsbDevice* | +| callsign | string | Plugin instance name (default: org.rdk.USBDevice) | +| classname | string | Class name: *USBDevice* | | locator | string | Library name: *libWPEFrameworkUSBDevice.so* | | autostart | boolean | Determines if the plugin shall be started automatically along with the framework | - + # Methods -The following methods are provided by the org.rdk.UsbDevice plugin: +The following methods are provided by the USBDevice plugin: -org.rdk.UsbDevice interface methods: +USBDevice interface methods: | Method | Description | | :-------- | :-------- | -| [getDeviceList](#getDeviceList) | Gets the device information of the connected USB Devices | -| [getDeviceInfo](#getDeviceInfo) | Gets detailed device information for the given device name | -| [bindDriver](#bindDriver) | Binds the respective driver for the device | -| [unbindDriver](#unbindDriver) | Unbinds the respective driver for the device | +| [bindDriver](#method.bindDriver) | Bind the respective driver for the device | +| [getDeviceInfo](#method.getDeviceInfo) | Get the extended USB device information for the provided device name | +| [getDeviceList](#method.getDeviceList) | Get the basic information about list of devices connected with the system. | +| [unbindDriver](#method.unbindDriver) | Unbind the respective driver for the device | + +## *bindDriver [method](#head.Methods)* - -## *getDeviceList* - -Gets the device information of the connected USB Devices. +Bind the respective driver for the device ### Events - -No Events - +No events are associated with this method. ### Parameters - -This method takes no parameters. - -### Result - | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | array | | -| result[#] | object | | -| result[#].deviceClass | integer | USB class of the device | -| result[#].deviceSubclass | integer | USB Sub class of the device | -| result[#].deviceName | string | Name of the USB device | -| result[#].devicePath | string | The path to be used for the USB device | - -### Errors +| params | object | | +| params.deviceName | string | Name of the USB device | +### Results +This method returns no results. -| Code | Message | Description | -| :-------- | :-------- | :-------- | -| 1 | ```ERROR_GENERAL``` | General error | +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "org.rdk.UsbDevice.getDeviceList" + "jsonrpc": 2.0, + "id": 0, + "method": "org.rdk.USBDevice.bindDriver", + "params": { + "deviceName": "" + } } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, - "result": [ - { - "deviceClass": 8, - "deviceSubclass": 6, - "deviceName": "001/006", - "devicePath": "/dev/sda" - } - ] + "jsonrpc": 2.0, + "id": 0, + "result": null } ``` - -## *getDeviceInfo* + +## *getDeviceInfo [method](#head.Methods)* -Gets detailed device information for the given device name. +Get the extended USB device information for the provided device name ### Events - -No Events - +No events are associated with this method. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.deviceName | string | Get the extended USB device information for the provided device name | - -### Result - +| params.deviceName | string | Name of the USB device | +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | object | | -| result.parentId | integer | Parent Node ID of the device | -| result.deviceStatus | integer | Current device status | -| result.deviceLevel | integer | Device level | -| result.portNumber | integer | Port number of USB on which the device is attached | -| result.vendorId | integer | Vendor ID of the device | -| result.productid | integer | Product ID of the device | -| result.protocol | integer | Protocol supported by the device | -| result.serialnumber | string | Serial number of the device | -| result.device | object | | -| result.device.deviceClass | integer | USB class of the device | -| result.device.deviceSubclass | integer | USB Sub class of the device | -| result.device.deviceName | string | Name of the USB device | -| result.device.devicePath | string | The path to be used for the USB device | -| result.flags | string | Flags of the device | -| result?.features | integer | *(optional)* Features supported by the device - reserved | -| result.busSpeed | string | Speed of the device | -| result?.numLanguageIds | integer | *(optional)* Number of language IDs present on the device | -| result?.productInfo1 | object | *(optional)* | -| result?.productInfo1.languageId | integer | Language ID present on the device | -| result?.productInfo1.serialNumber | string | Unicode string representing the serial number of the device | -| result?.productInfo1.manufacturer | string | Unicode string representing the manufacturer of the device | -| result?.productInfo1.product | string | Unicode string representing the product | -| result?.productInfo2 | object | *(optional)* | -| result?.productInfo2.languageId | integer | Language ID present on the device | -| result?.productInfo2.serialNumber | string | Unicode string representing the serial number of the device | -| result?.productInfo2.manufacturer | string | Unicode string representing the manufacturer of the device | -| result?.productInfo2.product | string | Unicode string representing the product | -| result?.productInfo3 | object | *(optional)* | -| result?.productInfo3.languageId | integer | Language ID present on the device | -| result?.productInfo3.serialNumber | string | Unicode string representing the serial number of the device | -| result?.productInfo3.manufacturer | string | Unicode string representing the manufacturer of the device | -| result?.productInfo3.product | string | Unicode string representing the product | -| result?.productInfo4 | object | *(optional)* | -| result?.productInfo4.languageId | integer | Language ID present on the device | -| result?.productInfo4.serialNumber | string | Unicode string representing the serial number of the device | -| result?.productInfo4.manufacturer | string | Unicode string representing the manufacturer of the device | -| result?.productInfo4.product | string | Unicode string representing the product | - -### Errors - -| Code | Message | Description | -| :-------- | :-------- | :-------- | -| 1 | ```ERROR_GENERAL``` | General error | +| result.deviceInfo | USBDeviceInfo | Detailed device information | +| result.deviceInfo.parentId | uint32_t | Parent Node ID of the device | +| result.deviceInfo.deviceStatus | uint8_t | current device status | +| result.deviceInfo.deviceLevel | uint8_t | device level | +| result.deviceInfo.portNumber | uint8_t | port number of USB on which the device is attached | +| result.deviceInfo.vendorId | uint16_t | Vendor ID of the device | +| result.deviceInfo.productId | uint16_t | Product ID of the device | +| result.deviceInfo.protocol | uint8_t | Protocol supported by the device | +| result.deviceInfo.serialNumber | string | Serial number of the device | +| result.deviceInfo.device | USBDevice | Basic device information included | +| result.deviceInfo.device.deviceClass | uint8_t | USB class of the device as per USB specificiation */ | +| result.deviceInfo.device.deviceSubclass | uint8_t | USB sub class of the device as per USB specificiation | +| result.deviceInfo.device.deviceName | string | Name of the USB device | +| result.deviceInfo.device.devicePath | string | the path to be used for the USB device | +| result.deviceInfo.flags | USBDeviceFlags | Flags of the device | +| result.deviceInfo.features | uint32_t | Features supported by the device - reserved | +| result.deviceInfo.busSpeed | USBDeviceSpeed | Speed of the device | +| result.deviceInfo.numLanguageIds | uint8_t | number of language ids present on the device | +| result.deviceInfo.productInfo1 | USBProductInfo | - | +| result.deviceInfo.productInfo1.languageId | uint16_t | language id present on the device | +| result.deviceInfo.productInfo1.serialNumber | string | unicode string representing the serial number of the device | +| result.deviceInfo.productInfo1.manufacturer | string | unicode string representing the manufacturer of the device | +| result.deviceInfo.productInfo1.product | string | unicode string representing the product | +| result.deviceInfo.productInfo2 | USBProductInfo | - | +| result.deviceInfo.productInfo2.languageId | uint16_t | language id present on the device | +| result.deviceInfo.productInfo2.serialNumber | string | unicode string representing the serial number of the device | +| result.deviceInfo.productInfo2.manufacturer | string | unicode string representing the manufacturer of the device | +| result.deviceInfo.productInfo2.product | string | unicode string representing the product | +| result.deviceInfo.productInfo3 | USBProductInfo | - | +| result.deviceInfo.productInfo3.languageId | uint16_t | language id present on the device | +| result.deviceInfo.productInfo3.serialNumber | string | unicode string representing the serial number of the device | +| result.deviceInfo.productInfo3.manufacturer | string | unicode string representing the manufacturer of the device | +| result.deviceInfo.productInfo3.product | string | unicode string representing the product | +| result.deviceInfo.productInfo4 | USBProductInfo | - | +| result.deviceInfo.productInfo4.languageId | uint16_t | language id present on the device | +| result.deviceInfo.productInfo4.serialNumber | string | unicode string representing the serial number of the device | +| result.deviceInfo.productInfo4.manufacturer | string | unicode string representing the manufacturer of the device | +| result.deviceInfo.productInfo4.product | string | unicode string representing the product | + +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "org.rdk.UsbDevice.getDeviceInfo", + "jsonrpc": 2.0, + "id": 1, + "method": "org.rdk.USBDevice.getDeviceInfo", "params": { - "deviceName": "001/012" + "deviceName": "" } } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 1, "result": { "parentId": 0, - "deviceStatus": 1, - "deviceLevel": 1, - "portNumber": 1, - "vendorId": 1921, - "productid": 21889, - "protocol": 0, - "serialnumber": "4C530000120309105565", + "deviceStatus": "", + "deviceLevel": "", + "portNumber": "", + "vendorId": "", + "productId": "", + "protocol": "", + "serialNumber": "", "device": { - "deviceClass": 8, - "deviceSubclass": 6, - "deviceName": "001/006", - "devicePath": "/dev/sda" + "deviceClass": "", + "deviceSubclass": "", + "deviceName": "", + "devicePath": "/dev/sdX" }, - "flags": "AVAILABLE", + "flags": "DEVICE_FLAGS_DRIVER_AVAILABLE", "features": 0, - "busSpeed": "Super", - "numLanguageIds": 1, + "busSpeed": "DEVICE_SPEED_LOW", + "numLanguageIds": "", "productInfo1": { - "languageId": 1033, - "serialNumber": "04011a1ac241414372e459026efb4429e88c8b51d9f5d101fb0c73505a872c1cc9ae0000000000000000000020c9773500885a1881558107882f26a7", - "manufacturer": "USB", - "product": "SanDisk 3.2Gen1" + "languageId": "", + "serialNumber": "", + "manufacturer": "", + "product": "" }, "productInfo2": { - "languageId": 0, - "serialNumber": "...", - "manufacturer": "...", - "product": "..." + "languageId": "", + "serialNumber": "", + "manufacturer": "", + "product": "" }, "productInfo3": { - "languageId": 0, - "serialNumber": "...", - "manufacturer": "...", - "product": "..." + "languageId": "", + "serialNumber": "", + "manufacturer": "", + "product": "" }, "productInfo4": { - "languageId": 0, - "serialNumber": "...", - "manufacturer": "...", - "product": "..." + "languageId": "", + "serialNumber": "", + "manufacturer": "", + "product": "" } } } ``` - -## *bindDriver* + +## *getDeviceList [method](#head.Methods)* -Binds the respective driver for the device. +Get the basic information about list of devices connected with the system. ### Events - -No Events - +No events are associated with this method. ### Parameters - -| Name | Type | Description | -| :-------- | :-------- | :-------- | -| params | object | | -| params.deviceName | string | Name of the device | - -### Result - +This method takes no parameters. +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | null | On success null will be returned | +| result.devices | IUSBDeviceIterator | List of USB devices along with basic info. | +| result.devices[#].deviceClass | uint8_t | USB class of the device as per USB specificiation */ | +| result.devices[#].deviceSubclass | uint8_t | USB sub class of the device as per USB specificiation | +| result.devices[#].deviceName | string | Name of the USB device | +| result.devices[#].devicePath | string | the path to be used for the USB device | -### Errors +### Examples -| Code | Message | Description | -| :-------- | :-------- | :-------- | -| 1 | ```ERROR_GENERAL``` | General error | - -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "org.rdk.UsbDevice.bindDriver", - "params": { - "deviceName": "001/012" - } + "jsonrpc": 2.0, + "id": 2, + "method": "org.rdk.USBDevice.getDeviceList" } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, - "result": null + "jsonrpc": 2.0, + "id": 2, + "result": [ + { + "deviceClass": "", + "deviceSubclass": "", + "deviceName": "", + "devicePath": "/dev/sdX" + } + ] } ``` - -## *unbindDriver* + +## *unbindDriver [method](#head.Methods)* -Unbinds the respective driver for the device. +Unbind the respective driver for the device ### Events - -No Events - +No events are associated with this method. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.deviceName | string | Name of the device | - -### Result - -| Name | Type | Description | -| :-------- | :-------- | :-------- | -| result | null | On success null will be returned | +| params.deviceName | string | Name of the USB device | +### Results +This method returns no results. -### Errors - -| Code | Message | Description | -| :-------- | :-------- | :-------- | -| 1 | ```ERROR_GENERAL``` | General error | +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "org.rdk.UsbDevice.unbindDriver", + "jsonrpc": 2.0, + "id": 3, + "method": "org.rdk.USBDevice.unbindDriver", "params": { - "deviceName": "001/012" + "deviceName": "" } } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 3, "result": null } ``` - + + + # Notifications -Notifications are autonomous events, triggered by the internals of the implementation, and broadcasted via JSON-RPC to all registered observers. Refer to [[Thunder](#Thunder)] for information on how to register for a notification. +Notifications are autonomous events, triggered by the internals of the implementation, and broadcasted via JSON-RPC to all registered observers. Refer to [[Thunder](#ref.Thunder)] for information on how to register for a notification. -The following events are provided by the org.rdk.UsbDevice plugin: +The following events are provided by the USBDevice plugin: -org.rdk.UsbDevice interface events: +USBDevice interface events: | Event | Description | | :-------- | :-------- | -| [onDevicePluggedIn](#onDevicePluggedIn) | Device Plugged in notification | -| [onDevicePluggedOut](#onDevicePluggedOut) | Device Plugged out notification | - +| [onDevicePluggedIn](#event.onDevicePluggedIn) | Device Plugged in notification | +| [onDevicePluggedOut](#event.onDevicePluggedOut) | Device Plugged out notification | - -## *onDevicePluggedIn* + +## *onDevicePluggedIn [event](#head.Notifications)* -Device Plugged in notification. +Device Plugged in notification ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.device | object | | -| params.device.deviceClass | integer | USB class of the device | -| params.device.deviceSubclass | integer | USB Sub class of the device | +| params.device | USBDevice | Basic device information included | +| params.device.deviceClass | uint8_t | USB class of the device as per USB specificiation */ | +| params.device.deviceSubclass | uint8_t | USB sub class of the device as per USB specificiation | | params.device.deviceName | string | Name of the USB device | -| params.device.devicePath | string | The path to be used for the USB device | +| params.device.devicePath | string | the path to be used for the USB device | -### Example +### Examples ```json { - "jsonrpc": "2.0", - "method": "client.events.onDevicePluggedIn", + "jsonrpc": 2.0, + "id": 4, + "method": "org.rdk.USBDevice.onDevicePluggedIn", "params": { "device": { - "deviceClass": 8, - "deviceSubclass": 6, - "deviceName": "001/006", - "devicePath": "/dev/sda" + "deviceClass": "", + "deviceSubclass": "", + "deviceName": "", + "devicePath": "/dev/sdX" } } } ``` - -## *onDevicePluggedOut* + +## *onDevicePluggedOut [event](#head.Notifications)* -Device Plugged out notification. +Device Plugged out notification ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.device | object | | -| params.device.deviceClass | integer | USB class of the device | -| params.device.deviceSubclass | integer | USB Sub class of the device | +| params.device | USBDevice | Basic device information included | +| params.device.deviceClass | uint8_t | USB class of the device as per USB specificiation */ | +| params.device.deviceSubclass | uint8_t | USB sub class of the device as per USB specificiation | | params.device.deviceName | string | Name of the USB device | -| params.device.devicePath | string | The path to be used for the USB device | +| params.device.devicePath | string | the path to be used for the USB device | -### Example +### Examples ```json { - "jsonrpc": "2.0", - "method": "client.events.onDevicePluggedOut", + "jsonrpc": 2.0, + "id": 5, + "method": "org.rdk.USBDevice.onDevicePluggedOut", "params": { "device": { - "deviceClass": 8, - "deviceSubclass": 6, - "deviceName": "001/006", - "devicePath": "/dev/sda" + "deviceClass": "", + "deviceSubclass": "", + "deviceName": "", + "devicePath": "/dev/sdX" } } } ``` - diff --git a/docs/apis/USBMassStoragePlugin.md b/docs/apis/USBMassStoragePlugin.md index b5ea4eaf..6a89a601 100644 --- a/docs/apis/USBMassStoragePlugin.md +++ b/docs/apis/USBMassStoragePlugin.md @@ -1,97 +1,92 @@ - + # USBMassStorage Plugin -**Version: [1.0.0]()** +**Version: [1.0.0](https://github.com/rdkcentral/rdkservices/blob/main/USBMassStorage/CHANGELOG.md)** -A org.rdk.UsbMassStorage plugin for Thunder framework. +A USBMassStorage 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](#head.Abbreviation,_Acronyms_and_Terms) +- [Description](#head.Description) +- [Configuration](#head.Configuration) +- [Methods](#head.Methods) +- [Notifications](#head.Notifications) - + # Abbreviation, Acronyms and Terms -[[Refer to this link](overview/aat.md)] +[[Refer to this link](userguide/aat.md)] - + # Description The `USBMassStorage` plugin is using For mounting the file system on mass storage and enumeration of mount points. -The plugin is designed to be loaded and executed within the Thunder framework. For more information about the framework refer to [[Thunder](#Thunder)]. +The plugin is designed to be loaded and executed within the Thunder framework. For more information about the framework refer to [[Thunder](#ref.Thunder)]. - + # Configuration The table below lists configuration options of the plugin. | Name | Type | Description | | :-------- | :-------- | :-------- | -| callsign | string | Plugin instance name (default: *org.rdk.UsbMassStorage*) | -| classname | string | Class name: *org.rdk.UsbMassStorage* | +| callsign | string | Plugin instance name (default: org.rdk.USBMassStorage) | +| classname | string | Class name: *USBMassStorage* | | locator | string | Library name: *libWPEFrameworkUSBMassStorage.so* | | autostart | boolean | Determines if the plugin shall be started automatically along with the framework | - + # Methods -The following methods are provided by the org.rdk.UsbMassStorage plugin: +The following methods are provided by the USBMassStorage plugin: -org.rdk.UsbMassStorage interface methods: +USBMassStorage interface methods: | Method | Description | | :-------- | :-------- | -| [getDeviceList](#getDeviceList) | Retrieve the list of connected USB storage devices | -| [getMountPoints](#getMountPoints) | Retrieve the mount info list by given USB storage device name | -| [getPartitionInfo](#getPartitionInfo) | Get the partition information for the given mount path | +| [getDeviceList](#method.getDeviceList) | Get list of devices that are currently mounted in the system | +| [getMountPoints](#method.getMountPoints) | Get mount points information for a specified device | +| [getPartitionInfo](#method.getPartitionInfo) | Get partition information for a given partition | + +## *getDeviceList [method](#head.Methods)* - -## *getDeviceList* - -Retrieve the list of connected USB storage devices. +Get list of devices that are currently mounted in the system ### Events - -No Events - +No events are associated with this method. ### Parameters - This method takes no parameters. - -### Result - +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | array | On success, a list of USB storage devices will be returned | -| result[#] | object | Information about a USB storage device | -| result[#].devicePath | string | The path to the USB device | -| result[#].deviceName | string | The name of the USB device | +| result.deviceInfo | IUSBStorageDeviceInfoIterator | Device info for devices that are currently mounted. | +| result.deviceInfo[#].devicePath | string | Device path in the file system (sysfs) | +| result.deviceInfo[#].deviceName | string | Device name identifying the device | + +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "org.rdk.UsbMassStorage.getDeviceList" + "jsonrpc": 2.0, + "id": 0, + "method": "org.rdk.USBMassStorage.getDeviceList" } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 0, "result": [ { "devicePath": "/dev/sda", @@ -101,116 +96,109 @@ This method takes no parameters. } ``` - -## *getMountPoints* + +## *getMountPoints [method](#head.Methods)* -Retrieve the mount info list by given USB storage device name. +Get mount points information for a specified device ### Events - -No Events - +No events are associated with this method. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.deviceName | string | Name of the USB storage device | - -### Result - +| params.deviceName | string | Device name identifying the device | +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | array | On success, mount info list of a USB storage device will be returned | -| result[#] | object | | -| result[#].partitionName | string | The name of the partition being mounted | -| result[#].mountFlags | string | Flags indicating how the partition is mounted | -| result[#].mountPath | string | The mount point path in the file system | -| result[#]?.fileSystem | string | *(optional)* File system | +| result.mountPoints | IUSBStorageMountInfoIterator | List of mountpoints information for the device mounted. | +| result.mountPoints[#].partitionName | string | name of the partition | +| result.mountPoints[#].mountFlags | USBStorageMountFlags | Mount flags used for mounting the device / partition | +| result.mountPoints[#].mountPath | string | path at which the partition is mounted on | +| result.mountPoints[#].fileSystem | USBStorageFileSystem | file system of the partition | + +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "org.rdk.UsbMassStorage.getMountPoints", + "jsonrpc": 2.0, + "id": 1, + "method": "org.rdk.USBMassStorage.getMountPoints", "params": { "deviceName": "001/006" } } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 1, "result": [ { "partitionName": "/dev/sda1", "mountFlags": "READ_ONLY", "mountPath": "/tmp/media/usb2", - "fileSystem": "VFAT" + "fileSystem": "UNKNOWN" } ] } ``` - -## *getPartitionInfo* + +## *getPartitionInfo [method](#head.Methods)* -Get the partition information for the given mount path. +Get partition information for a given partition ### Events - -No Events - +No events are associated with this method. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.mountPath | string | Name of the USB storage device | - -### Result - +| params.mountPath | string | path at which the partition is mounted on | +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | object | | -| result.fileSystem | string | The file system of the partition | -| result.size | integer | Total size of the partition in MB | -| result.startSector | integer | The starting sector of the partition | -| result.numSectors | integer | The number of sectors in the partition | -| result.sectorSize | integer | The size of each sector in bytes | -| result.totalSpace | integer | Total space of the partition in MB | -| result.usedSpace | integer | Used space of the partition in MB | -| result.availableSpace | integer | Available space in the partition in MB | - -### Example +| result.partitionInfo | USBStoragePartitionInfo | partition info details | +| result.partitionInfo.fileSystem | USBStorageFileSystem | file system of the partition | +| result.partitionInfo.size | uint32_t | total size of the partition in MB | +| result.partitionInfo.startSector | uint64_t | start sector of the partition | +| result.partitionInfo.numSectors | uint64_t | number of sectors in the partition | +| result.partitionInfo.sectorSize | uint32_t | size of the sector in the partition in bytes | +| result.partitionInfo.totalSpace | uint32_t | total space of the partition in MB | +| result.partitionInfo.usedSpace | uint32_t | used space in the partition in MB | +| result.partitionInfo.availableSpace | uint32_t | available space in the partition in MB | + +### Examples + #### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "org.rdk.UsbMassStorage.getPartitionInfo", + "jsonrpc": 2.0, + "id": 2, + "method": "org.rdk.USBMassStorage.getPartitionInfo", "params": { "mountPath": "/tmp/media/usb2" } } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 2, "result": { "fileSystem": "VFAT", "size": 1024, @@ -224,104 +212,102 @@ No Events } ``` - + + + # Notifications -Notifications are autonomous events, triggered by the internals of the implementation, and broadcasted via JSON-RPC to all registered observers. Refer to [[Thunder](#Thunder)] for information on how to register for a notification. +Notifications are autonomous events, triggered by the internals of the implementation, and broadcasted via JSON-RPC to all registered observers. Refer to [[Thunder](#ref.Thunder)] for information on how to register for a notification. -The following events are provided by the org.rdk.UsbMassStorage plugin: +The following events are provided by the USBMassStorage plugin: -org.rdk.UsbMassStorage interface events: +USBMassStorage interface events: | Event | Description | | :-------- | :-------- | -| [onDeviceMounted](#onDeviceMounted) | Triggered after the device partitions are mounted | -| [onDeviceUnmounted](#onDeviceUnmounted) | Triggered after the device partitions are unmounted | +| [onDeviceMounted](#event.onDeviceMounted) | Device Mounted notification @@iterator | +| [onDeviceUnmounted](#event.onDeviceUnmounted) | Device Unmounted notification @@iterator | + +## *onDeviceMounted [event](#head.Notifications)* - -## *onDeviceMounted* - -Triggered after the device partitions are mounted. +Device Mounted notification @@iterator ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.deviceinfo | object | | -| params.deviceinfo.devicePath | string | The device path | -| params.deviceinfo.deviceName | string | The name of the device | -| params.mountPoints | array | mount info list of a USB storage device will be returned | -| params.mountPoints[#] | object | | -| params.mountPoints[#].partitionName | string | The name of the partition being mounted | -| params.mountPoints[#].mountFlags | string | Flags indicating how the partition is mounted | -| params.mountPoints[#].mountPath | string | The mount point path in the file system | -| params.mountPoints[#]?.fileSystem | string | *(optional)* File system | - -### Example +| params.deviceInfo | USBStorageDeviceInfo | name and device path of the mounted device. | +| params.deviceInfo.devicePath | string | Device path in the file system (sysfs) | +| params.deviceInfo.deviceName | string | Device name identifying the device | +| params.mountPoints | IUSBStorageMountInfoIterator | List of mountpoints information for the device mounted. | +| params.mountPoints[#].partitionName | string | name of the partition | +| params.mountPoints[#].mountFlags | USBStorageMountFlags | Mount flags used for mounting the device / partition | +| params.mountPoints[#].mountPath | string | path at which the partition is mounted on | +| params.mountPoints[#].fileSystem | USBStorageFileSystem | file system of the partition | + +### Examples ```json { - "jsonrpc": "2.0", - "method": "client.events.onDeviceMounted", + "jsonrpc": 2.0, + "id": 3, + "method": "org.rdk.USBMassStorage.onDeviceMounted", "params": { - "deviceinfo": { + "deviceInfo": { "devicePath": "/dev/sda", - "deviceName": "001/022" + "deviceName": "001/006" }, "mountPoints": [ { "partitionName": "/dev/sda1", "mountFlags": "READ_ONLY", "mountPath": "/tmp/media/usb2", - "fileSystem": "VFAT" + "fileSystem": "UNKNOWN" } ] } } ``` - -## *onDeviceUnmounted* + +## *onDeviceUnmounted [event](#head.Notifications)* -Triggered after the device partitions are unmounted. +Device Unmounted notification @@iterator ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.deviceinfo | object | | -| params.deviceinfo.devicePath | string | The device path | -| params.deviceinfo.deviceName | string | The name of the device | -| params.mountPoints | array | mount info list of a USB storage device will be returned | -| params.mountPoints[#] | object | | -| params.mountPoints[#].partitionName | string | The name of the partition being mounted | -| params.mountPoints[#].mountFlags | string | Flags indicating how the partition is mounted | -| params.mountPoints[#].mountPath | string | The mount point path in the file system | -| params.mountPoints[#]?.fileSystem | string | *(optional)* File system | - -### Example +| params.deviceInfo | USBStorageDeviceInfo | name and device path of the mounted device. | +| params.deviceInfo.devicePath | string | Device path in the file system (sysfs) | +| params.deviceInfo.deviceName | string | Device name identifying the device | +| params.mountPoints | IUSBStorageMountInfoIterator | List of mountpoints information for the device mounted. | +| params.mountPoints[#].partitionName | string | name of the partition | +| params.mountPoints[#].mountFlags | USBStorageMountFlags | Mount flags used for mounting the device / partition | +| params.mountPoints[#].mountPath | string | path at which the partition is mounted on | +| params.mountPoints[#].fileSystem | USBStorageFileSystem | file system of the partition | + +### Examples ```json { - "jsonrpc": "2.0", - "method": "client.events.onDeviceUnmounted", + "jsonrpc": 2.0, + "id": 4, + "method": "org.rdk.USBMassStorage.onDeviceUnmounted", "params": { - "deviceinfo": { + "deviceInfo": { "devicePath": "/dev/sda", - "deviceName": "001/022" + "deviceName": "001/006" }, "mountPoints": [ { "partitionName": "/dev/sda1", "mountFlags": "READ_ONLY", "mountPath": "/tmp/media/usb2", - "fileSystem": "VFAT" + "fileSystem": "UNKNOWN" } ] } } ``` - diff --git a/docs/apis/UserSettingsPlugin.md b/docs/apis/UserSettingsPlugin.md old mode 100755 new mode 100644 index 9a94ecd7..cd74fd1d --- a/docs/apis/UserSettingsPlugin.md +++ b/docs/apis/UserSettingsPlugin.md @@ -1,2366 +1,2187 @@ - + # UserSettings Plugin -**Version: [1.0.0]()** +**Version: [1.0.0](https://github.com/rdkcentral/rdkservices/blob/main/UserSettings/CHANGELOG.md)** -A org.rdk.UserSettings plugin for Thunder framework. +A UserSettings 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](#head.Abbreviation,_Acronyms_and_Terms) +- [Description](#head.Description) +- [Configuration](#head.Configuration) +- [Methods](#head.Methods) +- [Notifications](#head.Notifications) - + # Abbreviation, Acronyms and Terms -[[Refer to this link](overview/aat.md)] +[[Refer to this link](userguide/aat.md)] - + # Description -The `UserSettings` that is responsible for persisting and notifying listeners of any change of these settings. +The `UserSettings` plugin provides an interface for UserSettings. -The plugin is designed to be loaded and executed within the Thunder framework. For more information about the framework refer to [[Thunder](#Thunder)]. +The plugin is designed to be loaded and executed within the Thunder framework. For more information about the framework refer to [[Thunder](#ref.Thunder)]. - + # Configuration The table below lists configuration options of the plugin. | Name | Type | Description | | :-------- | :-------- | :-------- | -| callsign | string | Plugin instance name (default: *org.rdk.UserSettings*) | -| classname | string | Class name: *org.rdk.UserSettings* | +| callsign | string | Plugin instance name (default: org.rdk.UserSettings) | +| classname | string | Class name: *UserSettings* | | locator | string | Library name: *libWPEFrameworkUserSettings.so* | | autostart | boolean | Determines if the plugin shall be started automatically along with the framework | - + # Methods -The following methods are provided by the org.rdk.UserSettings plugin: +The following methods are provided by the UserSettings plugin: -org.rdk.UserSettings interface methods: +UserSettings interface methods: | Method | Description | | :-------- | :-------- | -| [setAudioDescription](#setAudioDescription) | Setting Audio Description | -| [setPreferredAudioLanguages](#setPreferredAudioLanguages) | Setting Preferred Audio Languages | -| [setPresentationLanguage](#setPresentationLanguage) | Setting Presentation Languages | -| [setCaptions](#setCaptions) | Setting Captions | -| [setPreferredCaptionsLanguages](#setPreferredCaptionsLanguages) | Setting PreferredCaption Languages | -| [setPreferredClosedCaptionService](#setPreferredClosedCaptionService) | Setting Preferred Closed Caption Service | -| [setPrivacyMode](#setPrivacyMode) | Setting Privacy Mode | -| [setPinControl](#setPinControl) | Setting PinControl | -| [setViewingRestrictions](#setViewingRestrictions) | Setting ViewingRestrictions | -| [setViewingRestrictionsWindow](#setViewingRestrictionsWindow) | Setting viewingRestrictionsWindow | -| [setLiveWatershed](#setLiveWatershed) | Setting LiveWatershed | -| [setPlaybackWatershed](#setPlaybackWatershed) | Setting PlaybackWatershed | -| [setBlockNotRatedContent](#setBlockNotRatedContent) | Setting BlockNotRatedContent | -| [setPinOnPurchase](#setPinOnPurchase) | Setting setPinOnPurchase | -| [setHighContrast](#setHighContrast) | Sets highContrast | -| [setVoiceGuidance](#setVoiceGuidance) | Sets voiceGuidance | -| [setVoiceGuidanceRate](#setVoiceGuidanceRate) | Sets voiceGuidanceRate | -| [setVoiceGuidanceHints](#setVoiceGuidanceHints) | Sets voiceGuidanceHints ON/OFF | -| [setContentPin](#setContentPin) | Setting ContentPin | -| [getAudioDescription](#getAudioDescription) | Returns Audio Description | -| [getPreferredAudioLanguages](#getPreferredAudioLanguages) | Returns Preferred Audio Languages | -| [getPresentationLanguage](#getPresentationLanguage) | Getting Presentation Languages | -| [getCaptions](#getCaptions) | Getting Captions Enabled | -| [getPreferredCaptionsLanguages](#getPreferredCaptionsLanguages) | Getting Preferred Caption Languages | -| [getPreferredClosedCaptionService](#getPreferredClosedCaptionService) | Getting Preferred ClosedCaption Service | -| [getPrivacyMode](#getPrivacyMode) | Getting Privacy Mode | -| [getPinControl](#getPinControl) | Returns Pin Control | -| [getViewingRestrictions](#getViewingRestrictions) | Returns Get Viewing Restrictions | -| [getViewingRestrictionsWindow](#getViewingRestrictionsWindow) | Returns Get Viewing Restrictions Window | -| [getLiveWatershed](#getLiveWatershed) | Returns Live Watershed | -| [getPlaybackWatershed](#getPlaybackWatershed) | Returns Playback Watershed | -| [getBlockNotRatedContent](#getBlockNotRatedContent) | Returns BlockNotRatedContent | -| [getPinOnPurchase](#getPinOnPurchase) | Returns PinOnPurchase | -| [getHighContrast](#getHighContrast) | Gets the current highContrast setting | -| [getVoiceGuidance](#getVoiceGuidance) | Gets the current voiceGuidance setting | -| [getVoiceGuidanceRate](#getVoiceGuidanceRate) | Gets the current voiceGuidanceRate setting | -| [getVoiceGuidanceHints](#getVoiceGuidanceHints) | Gets the current voiceGuidanceHints setting | -| [getMigrationState](#getMigrationState) | Gets the migration state of the respective key | -| [getMigrationStates](#getMigrationStates) | Gets the migration state of all the defined keys | -| [getContentPin](#getContentPin) | Returns ContentPin | - - - -## *setAudioDescription* - -Setting Audio Description. +| [getAudioDescription](#method.getAudioDescription) | Gets the current AudioDescription setting | +| [getBlockNotRatedContent](#method.getBlockNotRatedContent) | Gets the BlockNotRatedContent setting | +| [getCaptions](#method.getCaptions) | Gets the Captions setting. | +| [getContentPin](#method.getContentPin) | Gets the ContentPin. | +| [getHighContrast](#method.getHighContrast) | Gets the current highContrast setting. | +| [getLiveWatershed](#method.getLiveWatershed) | Gets the LiveWatershed setting | +| [getMigrationState](#method.getMigrationState) | Get the migration state of the respective key | +| [getMigrationStates](#method.getMigrationStates) | Get the migration state of all the defined keys | +| [getPinControl](#method.getPinControl) | Gets the PinControl setting | +| [getPinOnPurchase](#method.getPinOnPurchase) | Gets the PinOnPurchase setting | +| [getPlaybackWatershed](#method.getPlaybackWatershed) | Gets the PlaybackWatershed setting | +| [getPreferredAudioLanguages](#method.getPreferredAudioLanguages) | Gets the current PreferredAudioLanguages setting | +| [getPreferredCaptionsLanguages](#method.getPreferredCaptionsLanguages) | Gets the current PreferredCaptionsLanguages setting. | +| [getPreferredClosedCaptionService](#method.getPreferredClosedCaptionService) | Gets the current PreferredClosedCaptionService setting. | +| [getPresentationLanguage](#method.getPresentationLanguage) | Gets the presentationLanguage | +| [getPrivacyMode](#method.getPrivacyMode) | Gets the current PrivacyMode setting. | +| [getViewingRestrictions](#method.getViewingRestrictions) | Gets the current ViewingRestrictions. | +| [getViewingRestrictionsWindow](#method.getViewingRestrictionsWindow) | Gets the current ViewingRestrictionsWindow. | +| [getVoiceGuidance](#method.getVoiceGuidance) | Gets the current voiceGuidance setting. | +| [getVoiceGuidanceHints](#method.getVoiceGuidanceHints) | Gets the current voiceGuidanceHints setting. | +| [getVoiceGuidanceRate](#method.getVoiceGuidanceRate) | Gets the current voiceGuidanceRate setting. | +| [setAudioDescription](#method.setAudioDescription) | Sets AudioDescription ON/OFF. Players should preferred Audio Descriptive tracks over normal audio track when enabled | +| [setBlockNotRatedContent](#method.setBlockNotRatedContent) | Sets BlockNotRatedContent ON/OFF. Whether content that is not rated should be blocked, if applicable for the project. | +| [setCaptions](#method.setCaptions) | brief Sets Captions ON/OFF. | +| [setContentPin](#method.setContentPin) | Sets the ContentPin. | +| [setHighContrast](#method.setHighContrast) | Sets highContrast. Whether the app should display with high contrast or not. | +| [setLiveWatershed](#method.setLiveWatershed) | Sets LiveWatershed ON/OFF.Whether project-specific watershed rules should be applied for live content, if applicable for the project. | +| [setPinControl](#method.setPinControl) | Sets PinControl ON/OFF. Parental Control as a whole is enabled or disabled. | +| [setPinOnPurchase](#method.setPinOnPurchase) | Sets PinOnPurchase ON/OFF.Whether a PIN challenge should be made when a purchase is attempted. | +| [setPlaybackWatershed](#method.setPlaybackWatershed) | Sets PlaybackWatershed ON/OFF. Whether project-specific watershed rules should be applied for non-live content, if applicable for the project. | +| [setPreferredAudioLanguages](#method.setPreferredAudioLanguages) | A prioritized list of ISO 639-2/B codes for the preferred audio languages, expressed as a comma separated lists of languages of zero of more elements. The players will pick the audio track that has the best match compared with this list. In the absence of a matching track, the player should by best effort select the preferred audio track. | +| [setPreferredCaptionsLanguages](#method.setPreferredCaptionsLanguages) | Set preferred languages for captions. | +| [setPreferredClosedCaptionService](#method.setPreferredClosedCaptionService) | Sets the PreferredClosedCaptionService. | +| [setPresentationLanguage](#method.setPresentationLanguage) | Sets the presentationLanguage in a full BCP 47 value, including script, region, variant | +| [setPrivacyMode](#method.setPrivacyMode) | Sets the PrivacyMode. | +| [setViewingRestrictions](#method.setViewingRestrictions) | Sets the ViewingRestrictions. | +| [setViewingRestrictionsWindow](#method.setViewingRestrictionsWindow) | Sets the ViewingRestrictionsWindow. | +| [setVoiceGuidance](#method.setVoiceGuidance) | Sets voiceGuidance. Whether Voice Guidance is enabled or not. | +| [setVoiceGuidanceHints](#method.setVoiceGuidanceHints) | Sets voiceGuidanceHints ON/OFF. Whether Voice Guidance hints setting is switched on or not. | +| [setVoiceGuidanceRate](#method.setVoiceGuidanceRate) | Sets voiceGuidanceRate. Setting voice guidance rate value. from 0.1 to 10 inclusive. | + + +## *getAudioDescription [method](#head.Methods)* + +Gets the current AudioDescription setting ### Events - -| Event | Description | -| :-------- | :-------- | -| [onAudioDescriptionChanged](#onAudioDescriptionChanged) | Triggered when the audio description changes. | +No events are associated with this method. ### Parameters - +This method takes no parameters. +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| params | object | | -| params.enabled | boolean | Audio Description Enabled: true/false | +| result.enabled | bool | audioDescription enabled or not | -### Result - -| Name | Type | Description | -| :-------- | :-------- | :-------- | -| result | null | On success null will be returned | +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "org.rdk.UserSettings.setAudioDescription", - "params": { - "enabled": true - } + "jsonrpc": 2.0, + "id": 0, + "method": "org.rdk.UserSettings.getAudioDescription" } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, - "result": null + "jsonrpc": 2.0, + "id": 0, + "result": true } ``` - -## *setPreferredAudioLanguages* + +## *getBlockNotRatedContent [method](#head.Methods)* -Setting Preferred Audio Languages. +Gets the BlockNotRatedContent setting ### Events - -| Event | Description | -| :-------- | :-------- | -| [onPreferredAudioLanguagesChanged](#onPreferredAudioLanguagesChanged) | Triggered when the audio preferred Audio languages changes. | +No events are associated with this method. ### Parameters - +This method takes no parameters. +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| params | object | | -| params.preferredLanguages | string | A prioritized list of ISO 639-2/B codes for the preferred audio languages | - -### Result +| result.blockNotRatedContent | bool | blockNotRatedContent enabled or not. | -| Name | Type | Description | -| :-------- | :-------- | :-------- | -| result | null | On success null will be returned | +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "org.rdk.UserSettings.setPreferredAudioLanguages", - "params": { - "preferredLanguages": "eng" - } + "jsonrpc": 2.0, + "id": 1, + "method": "org.rdk.UserSettings.getBlockNotRatedContent" } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, - "result": null + "jsonrpc": 2.0, + "id": 1, + "result": true } ``` - -## *setPresentationLanguage* + +## *getCaptions [method](#head.Methods)* -Setting Presentation Languages. +Gets the Captions setting. ### Events - -| Event | Description | -| :-------- | :-------- | -| [onPresentationLanguageChanged](#onPresentationLanguageChanged) | Triggered when the presentation Language changes. | +No events are associated with this method. ### Parameters - +This method takes no parameters. +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| params | object | | -| params.presentationLanguage | string | The preferred presentationLanguage in a full BCP 47 value, including script, * region, variant The language set and used by Immerse UI | - -### Result +| result.enabled | bool | audioDescription enabled or not | -| Name | Type | Description | -| :-------- | :-------- | :-------- | -| result | null | On success null will be returned | +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "org.rdk.UserSettings.setPresentationLanguage", - "params": { - "presentationLanguage": "en-US" - } + "jsonrpc": 2.0, + "id": 2, + "method": "org.rdk.UserSettings.getCaptions" } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, - "result": null + "jsonrpc": 2.0, + "id": 2, + "result": true } ``` - -## *setCaptions* + +## *getContentPin [method](#head.Methods)* -Setting Captions. +Gets the ContentPin. ### Events - -| Event | Description | -| :-------- | :-------- | -| [onCaptionsChanged](#onCaptionsChanged) | Triggered when the captions changes. | +No events are associated with this method. ### Parameters - +This method takes no parameters. +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| params | object | | -| params.enabled | boolean | Captions Enabled: true/false | +| result.contentPin | string | The changed contentPin. | -### Result +### Examples -| Name | Type | Description | -| :-------- | :-------- | :-------- | -| result | null | On success null will be returned | - -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "org.rdk.UserSettings.setCaptions", - "params": { - "enabled": true - } + "jsonrpc": 2.0, + "id": 3, + "method": "org.rdk.UserSettings.getContentPin" } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, - "result": null + "jsonrpc": 2.0, + "id": 3, + "result": "" } ``` - -## *setPreferredCaptionsLanguages* + +## *getHighContrast [method](#head.Methods)* -Setting PreferredCaption Languages. +Gets the current highContrast setting. ### Events - -| Event | Description | -| :-------- | :-------- | -| [onPreferredCaptionsLanguagesChanged](#onPreferredCaptionsLanguagesChanged) | Triggered when the PreferredCaption Languages changes. | +No events are associated with this method. ### Parameters - +This method takes no parameters. +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| params | object | | -| params.preferredLanguages | string | A prioritized list of ISO 639-2/B codes for the preferred captions languages | - -### Result +| result.enabled | bool | audioDescription enabled or not | -| Name | Type | Description | -| :-------- | :-------- | :-------- | -| result | null | On success null will be returned | +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "org.rdk.UserSettings.setPreferredCaptionsLanguages", - "params": { - "preferredLanguages": "eng" - } + "jsonrpc": 2.0, + "id": 4, + "method": "org.rdk.UserSettings.getHighContrast" } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, - "result": null + "jsonrpc": 2.0, + "id": 4, + "result": true } ``` - -## *setPreferredClosedCaptionService* + +## *getLiveWatershed [method](#head.Methods)* -Setting Preferred Closed Caption Service. +Gets the LiveWatershed setting ### Events - -| Event | Description | -| :-------- | :-------- | -| [onPreferredClosedCaptionServiceChanged](#onPreferredClosedCaptionServiceChanged) | Triggered when the Preferred Closed Caption changes. | +No events are associated with this method. ### Parameters - +This method takes no parameters. +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| params | object | | -| params.service | string | A string for the preferred closed captions service. Valid values are AUTO, CC[1-4], TEXT[1-4], SERVICE[1-64] where CC and TEXT is CTA-608 and SERVICE is CTA-708. AUTO indicates that the choice is left to the player | +| result.liveWatershed | bool | liveWatershed enabled or not. | -### Result +### Examples -| Name | Type | Description | -| :-------- | :-------- | :-------- | -| result | null | On success null will be returned | - -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "org.rdk.UserSettings.setPreferredClosedCaptionService", - "params": { - "service": "CC3" - } + "jsonrpc": 2.0, + "id": 5, + "method": "org.rdk.UserSettings.getLiveWatershed" } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, - "result": null + "jsonrpc": 2.0, + "id": 5, + "result": true } ``` - -## *setPrivacyMode* + +## *getMigrationState [method](#head.Methods)* -Setting Privacy Mode. +Get the migration state of the respective key ### Events - -| Event | Description | -| :-------- | :-------- | -| [onPrivacyModeChanged](#onPrivacyModeChanged) | Triggered when the Privacy Mode changes. | +No events are associated with this method. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.privacyMode | string | The Privacy Mode. Valid values are SHARE, DO_NOT_SHARE | - -### Result - +| params.key | SettingsKey | one of UserSettingsKey | +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | null | On success null will be returned | +| result.requiresMigration | bool | - | + +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "org.rdk.UserSettings.setPrivacyMode", + "jsonrpc": 2.0, + "id": 6, + "method": "org.rdk.UserSettings.getMigrationState", "params": { - "privacyMode": "SHARE" + "key": "PREFERRED_AUDIO_LANGUAGES" } } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, - "result": null + "jsonrpc": 2.0, + "id": 6, + "result": true } ``` - -## *setPinControl* + +## *getMigrationStates [method](#head.Methods)* -Setting PinControl. +Get the migration state of all the defined keys ### Events - -| Event | Description | -| :-------- | :-------- | -| [onPinControlChanged](#onPinControlChanged) | Triggered when the pincontrol changes. | +No events are associated with this method. ### Parameters - +This method takes no parameters. +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| params | object | | -| params.pinControl | boolean | PinControl Enabled: true/false | +| result.states | IUserSettingsMigrationStateIterator | array of migration status. | +| result.states[#].key | SettingsKey | - | +| result.states[#].requiresMigration | bool | - | -### Result - -| Name | Type | Description | -| :-------- | :-------- | :-------- | -| result | null | On success null will be returned | +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "org.rdk.UserSettings.setPinControl", - "params": { - "pinControl": true - } + "jsonrpc": 2.0, + "id": 7, + "method": "org.rdk.UserSettings.getMigrationStates" } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, - "result": null + "jsonrpc": 2.0, + "id": 7, + "result": [ + { + "key": "PREFERRED_AUDIO_LANGUAGES", + "requiresMigration": true + } + ] } ``` - -## *setViewingRestrictions* + +## *getPinControl [method](#head.Methods)* -Setting ViewingRestrictions. +Gets the PinControl setting ### Events - -| Event | Description | -| :-------- | :-------- | -| [onViewingRestrictionsChanged](#onViewingRestrictionsChanged) | Triggered when the viewingRestrictions changes. | +No events are associated with this method. ### Parameters - +This method takes no parameters. +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| params | object | | -| params.viewingRestrictions | string | A project-specific representation of the time interval when viewing | - -### Result +| result.pinControl | bool | pinControl enabled or not. | -| Name | Type | Description | -| :-------- | :-------- | :-------- | -| result | null | On success null will be returned | +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "org.rdk.UserSettings.setViewingRestrictions", - "params": { - "viewingRestrictions": "{\"restrictions\": [{\"scheme\": \"US_TV\", \"restrict\": [\"TV-Y7/FV\"]}, {\"scheme\": \"MPAA\", \"restrict\": []}]}" - } + "jsonrpc": 2.0, + "id": 8, + "method": "org.rdk.UserSettings.getPinControl" } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, - "result": null + "jsonrpc": 2.0, + "id": 8, + "result": true } ``` - -## *setViewingRestrictionsWindow* + +## *getPinOnPurchase [method](#head.Methods)* -Setting viewingRestrictionsWindow. +Gets the PinOnPurchase setting ### Events - -| Event | Description | -| :-------- | :-------- | -| [onViewingRestrictionsWindowChanged](#onViewingRestrictionsWindowChanged) | Triggered when the viewingRestrictionsWindow changes. | +No events are associated with this method. ### Parameters - +This method takes no parameters. +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| params | object | | -| params.viewingRestrictionsWindow | string | A project-specific representation of the time interval | - -### Result +| result.pinOnPurchase | bool | pinOnPurchase enabled or not. | -| Name | Type | Description | -| :-------- | :-------- | :-------- | -| result | null | On success null will be returned | +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "org.rdk.UserSettings.setViewingRestrictionsWindow", - "params": { - "viewingRestrictionsWindow": "ALWAYS" - } + "jsonrpc": 2.0, + "id": 9, + "method": "org.rdk.UserSettings.getPinOnPurchase" } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, - "result": null + "jsonrpc": 2.0, + "id": 9, + "result": true } ``` - -## *setLiveWatershed* + +## *getPlaybackWatershed [method](#head.Methods)* -Setting LiveWatershed. +Gets the PlaybackWatershed setting ### Events - -| Event | Description | -| :-------- | :-------- | -| [onLiveWatershedChanged](#onLiveWatershedChanged) | Triggered when the liveWatershed changes. | +No events are associated with this method. ### Parameters - +This method takes no parameters. +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| params | object | | -| params.liveWatershed | boolean | LiveWatershed Enabled: true/false | +| result.playbackWatershed | bool | playbackWatershed enabled or not. | -### Result +### Examples -| Name | Type | Description | -| :-------- | :-------- | :-------- | -| result | null | On success null will be returned | - -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "org.rdk.UserSettings.setLiveWatershed", - "params": { - "liveWatershed": true - } + "jsonrpc": 2.0, + "id": 10, + "method": "org.rdk.UserSettings.getPlaybackWatershed" } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, - "result": null + "jsonrpc": 2.0, + "id": 10, + "result": true } ``` - -## *setPlaybackWatershed* + +## *getPreferredAudioLanguages [method](#head.Methods)* -Setting PlaybackWatershed. +Gets the current PreferredAudioLanguages setting ### Events - -| Event | Description | -| :-------- | :-------- | -| [onPlaybackWatershedChanged](#onPlaybackWatershedChanged) | Triggered when the playbackWatershed changes. | +No events are associated with this method. ### Parameters - +This method takes no parameters. +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| params | object | | -| params.playbackWatershed | boolean | PlaybackWatershed Enabled: true/false | +| result.preferredLanguages | string | the changed preferredLanguages. | -### Result +### Examples -| Name | Type | Description | -| :-------- | :-------- | :-------- | -| result | null | On success null will be returned | - -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "org.rdk.UserSettings.setPlaybackWatershed", - "params": { - "playbackWatershed": true - } + "jsonrpc": 2.0, + "id": 11, + "method": "org.rdk.UserSettings.getPreferredAudioLanguages" } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, - "result": null + "jsonrpc": 2.0, + "id": 11, + "result": "eng,fra" } ``` - -## *setBlockNotRatedContent* + +## *getPreferredCaptionsLanguages [method](#head.Methods)* -Setting BlockNotRatedContent. +Gets the current PreferredCaptionsLanguages setting. ### Events - -| Event | Description | -| :-------- | :-------- | -| [onBlockNotRatedContentChanged](#onBlockNotRatedContentChanged) | Triggered when the blockNotRatedContent changes. | +No events are associated with this method. ### Parameters - +This method takes no parameters. +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| params | object | | -| params.blockNotRatedContent | boolean | BlockNotRatedContent Enabled: true/false | +| result.preferredLanguages | string | the changed preferredLanguages. | -### Result - -| Name | Type | Description | -| :-------- | :-------- | :-------- | -| result | null | On success null will be returned | +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "org.rdk.UserSettings.setBlockNotRatedContent", - "params": { - "blockNotRatedContent": true - } + "jsonrpc": 2.0, + "id": 12, + "method": "org.rdk.UserSettings.getPreferredCaptionsLanguages" } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, - "result": null + "jsonrpc": 2.0, + "id": 12, + "result": "eng,fra" } ``` - -## *setPinOnPurchase* + +## *getPreferredClosedCaptionService [method](#head.Methods)* -Setting setPinOnPurchase. +Gets the current PreferredClosedCaptionService setting. ### Events - -| Event | Description | -| :-------- | :-------- | -| [onPinOnPurchaseChanged](#onPinOnPurchaseChanged) | Triggered when the pin on the purchase changes. | +No events are associated with this method. ### Parameters - +This method takes no parameters. +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| params | object | | -| params.pinOnPurchase | boolean | setPinOnPurchase Enabled: true/false | +| result.service | string | the changed preferredClosedCaptionService. | -### Result - -| Name | Type | Description | -| :-------- | :-------- | :-------- | -| result | null | On success null will be returned | +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "org.rdk.UserSettings.setPinOnPurchase", - "params": { - "pinOnPurchase": true - } + "jsonrpc": 2.0, + "id": 13, + "method": "org.rdk.UserSettings.getPreferredClosedCaptionService" } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, - "result": null + "jsonrpc": 2.0, + "id": 13, + "result": "CC3" } ``` - -## *setHighContrast* + +## *getPresentationLanguage [method](#head.Methods)* -Sets highContrast. Whether the app should display with high contrast or not. +Gets the presentationLanguage ### Events - -| Event | Description | -| :-------- | :-------- | -| [onHighContrastChanged](#onHighContrastChanged) | Triggers when the highContrast changes. | +No events are associated with this method. ### Parameters - +This method takes no parameters. +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| params | object | | -| params.enabled | boolean | high contrast enabled(true) or disabled(false) | - -### Result +| result.presentationLanguage | string | the changed presentationLanguage. | -| Name | Type | Description | -| :-------- | :-------- | :-------- | -| result | null | On success null will be returned | +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "org.rdk.UserSettings.setHighContrast", - "params": { - "enabled": true - } + "jsonrpc": 2.0, + "id": 14, + "method": "org.rdk.UserSettings.getPresentationLanguage" } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, - "result": null + "jsonrpc": 2.0, + "id": 14, + "result": "" } ``` - -## *setVoiceGuidance* + +## *getPrivacyMode [method](#head.Methods)* -Sets voiceGuidance. Whether Voice Guidance is enabled or not. +Gets the current PrivacyMode setting. ### Events - -| Event | Description | -| :-------- | :-------- | -| [onVoiceGuidanceChanged](#onVoiceGuidanceChanged) | Triggers after the voice guidance enabled settings changes. | +No events are associated with this method. ### Parameters - +This method takes no parameters. +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| params | object | | -| params.enabled | boolean | voice guidance enabled(true) or disabled(false) | +| result.privacyMode | string | "SHARE", "DO_NOT_SHARE". | -### Result +### Examples -| Name | Type | Description | -| :-------- | :-------- | :-------- | -| result | null | On success null will be returned | - -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "org.rdk.UserSettings.setVoiceGuidance", - "params": { - "enabled": true - } + "jsonrpc": 2.0, + "id": 15, + "method": "org.rdk.UserSettings.getPrivacyMode" } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, - "result": null + "jsonrpc": 2.0, + "id": 15, + "result": "" } ``` - -## *setVoiceGuidanceRate* + +## *getViewingRestrictions [method](#head.Methods)* -Sets voiceGuidanceRate. Setting voice guidance rate value. from 0.1 to 10 inclusive. +Gets the current ViewingRestrictions. ### Events - -| Event | Description | -| :-------- | :-------- | -| [onVoiceGuidanceRateChanged](#onVoiceGuidanceRateChanged) | Triggered after the voice guidance rate changed. | +No events are associated with this method. ### Parameters - +This method takes no parameters. +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| params | object | | -| params.rate | number | voice guidance rate value | +| result.viewingRestrictions | string | the changed viewingRestrictions. | -### Result +### Examples -| Name | Type | Description | -| :-------- | :-------- | :-------- | -| result | null | On success null will be returned | - -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "org.rdk.UserSettings.setVoiceGuidanceRate", - "params": { - "rate": 0.1 - } + "jsonrpc": 2.0, + "id": 16, + "method": "org.rdk.UserSettings.getViewingRestrictions" } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, - "result": null + "jsonrpc": 2.0, + "id": 16, + "result": "" } ``` - -## *setVoiceGuidanceHints* + +## *getViewingRestrictionsWindow [method](#head.Methods)* -Sets voiceGuidanceHints ON/OFF. Whether Voice Guidance hints setting is switched on or not. +Gets the current ViewingRestrictionsWindow. ### Events - -| Event | Description | -| :-------- | :-------- | -| [onVoiceGuidanceHintsChanged](#onVoiceGuidanceHintsChanged) | Triggered after the voice guidance hints changes. | +No events are associated with this method. ### Parameters - +This method takes no parameters. +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| params | object | | -| params.hints | boolean | voiceGuidanceHints enabled(true) or disabled(false) | +| result.viewingRestrictionsWindow | string | the changed viewingRestrictionsWindow. | -### Result - -| Name | Type | Description | -| :-------- | :-------- | :-------- | -| result | null | On success null will be returned | +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "org.rdk.UserSettings.setVoiceGuidanceHints", - "params": { - "hints": true - } + "jsonrpc": 2.0, + "id": 17, + "method": "org.rdk.UserSettings.getViewingRestrictionsWindow" } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, - "result": null + "jsonrpc": 2.0, + "id": 17, + "result": "" } ``` - -## *setContentPin* + +## *getVoiceGuidance [method](#head.Methods)* -Setting ContentPin. +Gets the current voiceGuidance setting. ### Events - -| Event | Description | -| :-------- | :-------- | -| [onContentPinChanged](#onContentPinChanged) | Triggered when the ContentPin changes. | +No events are associated with this method. ### Parameters - +This method takes no parameters. +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| params | object | | -| params.contentPin | string | contentPin | - -### Result +| result.enabled | bool | audioDescription enabled or not | -| Name | Type | Description | -| :-------- | :-------- | :-------- | -| result | null | On success null will be returned | +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "org.rdk.UserSettings.setContentPin", - "params": { - "contentPin": "1234" - } + "jsonrpc": 2.0, + "id": 18, + "method": "org.rdk.UserSettings.getVoiceGuidance" } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, - "result": null + "jsonrpc": 2.0, + "id": 18, + "result": true } ``` - -## *getAudioDescription* + +## *getVoiceGuidanceHints [method](#head.Methods)* -Returns Audio Description. +Gets the current voiceGuidanceHints setting. ### Events - -No Events - +No events are associated with this method. ### Parameters - This method takes no parameters. - -### Result - +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | boolean | Audio Description Enabled: true/false | +| result.hints | bool | voice guidance hints enabled or not. | + +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "org.rdk.UserSettings.getAudioDescription" + "jsonrpc": 2.0, + "id": 19, + "method": "org.rdk.UserSettings.getVoiceGuidanceHints" } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 19, "result": true } ``` - -## *getPreferredAudioLanguages* + +## *getVoiceGuidanceRate [method](#head.Methods)* -Returns Preferred Audio Languages. +Gets the current voiceGuidanceRate setting. ### Events - -No Events - +No events are associated with this method. ### Parameters - This method takes no parameters. - -### Result - +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | string | A prioritized list of ISO 639-2/B codes for the preferred audio languages | +| result.rate | double | the changed voice guidance rate. | + +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "org.rdk.UserSettings.getPreferredAudioLanguages" + "jsonrpc": 2.0, + "id": 20, + "method": "org.rdk.UserSettings.getVoiceGuidanceRate" } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, - "result": "eng" + "jsonrpc": 2.0, + "id": 20, + "result": 0.0 } ``` - -## *getPresentationLanguage* + +## *setAudioDescription [method](#head.Methods)* -Getting Presentation Languages. +Sets AudioDescription ON/OFF. Players should preferred Audio Descriptive tracks over normal audio track when enabled ### Events - -No Events - +No events are associated with this method. ### Parameters - -This method takes no parameters. - -### Result - | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | string | The preferred presentationLanguage in a full BCP 47 value, including script, * region, variant The language set and used by Immerse UI | +| params | object | | +| params.enabled | bool | audioDescription enabled or not | +### Results +This method returns no results. + +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "org.rdk.UserSettings.getPresentationLanguage" + "jsonrpc": 2.0, + "id": 21, + "method": "org.rdk.UserSettings.setAudioDescription", + "params": { + "enabled": true + } } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, - "result": "en-US" + "jsonrpc": 2.0, + "id": 21, + "result": null } ``` - -## *getCaptions* + +## *setBlockNotRatedContent [method](#head.Methods)* -Getting Captions Enabled. +Sets BlockNotRatedContent ON/OFF. Whether content that is not rated should be blocked, if applicable for the project. ### Events - -No Events - +No events are associated with this method. ### Parameters - -This method takes no parameters. - -### Result - | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | boolean | Captions Enabled: true/false | +| params | object | | +| params.blockNotRatedContent | bool | blockNotRatedContent enabled or not. | +### Results +This method returns no results. + +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "org.rdk.UserSettings.getCaptions" + "jsonrpc": 2.0, + "id": 22, + "method": "org.rdk.UserSettings.setBlockNotRatedContent", + "params": { + "blockNotRatedContent": true + } } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, - "result": true + "jsonrpc": 2.0, + "id": 22, + "result": null } ``` - -## *getPreferredCaptionsLanguages* + +## *setCaptions [method](#head.Methods)* -Getting Preferred Caption Languages. +brief Sets Captions ON/OFF. ### Events - -No Events - +No events are associated with this method. ### Parameters - -This method takes no parameters. - -### Result - | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | string | A prioritized list of ISO 639-2/B codes for the preferred captions languages | +| params | object | | +| params.enabled | bool | audioDescription enabled or not | +### Results +This method returns no results. + +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "org.rdk.UserSettings.getPreferredCaptionsLanguages" + "jsonrpc": 2.0, + "id": 23, + "method": "org.rdk.UserSettings.setCaptions", + "params": { + "enabled": true + } } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, - "result": "eng" + "jsonrpc": 2.0, + "id": 23, + "result": null } ``` - -## *getPreferredClosedCaptionService* + +## *setContentPin [method](#head.Methods)* -Getting Preferred ClosedCaption Service. +Sets the ContentPin. ### Events - -No Events - +No events are associated with this method. ### Parameters - -This method takes no parameters. - -### Result - | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | string | A string for the preferred closed captions service. Valid values are AUTO, CC[1-4], TEXT[1-4], SERVICE[1-64] where CC and TEXT is CTA-608 and SERVICE is CTA-708. AUTO indicates that the choice is left to the player | +| params | object | | +| params.contentPin | string | The changed contentPin. | +### Results +This method returns no results. + +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "org.rdk.UserSettings.getPreferredClosedCaptionService" + "jsonrpc": 2.0, + "id": 24, + "method": "org.rdk.UserSettings.setContentPin", + "params": { + "contentPin": "" + } } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, - "result": "CC3" + "jsonrpc": 2.0, + "id": 24, + "result": null } ``` - -## *getPrivacyMode* + +## *setHighContrast [method](#head.Methods)* -Getting Privacy Mode. +Sets highContrast. Whether the app should display with high contrast or not. ### Events - -No Events - +No events are associated with this method. ### Parameters - -This method takes no parameters. - -### Result - | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | string | The Privacy Mode. Valid values are SHARE, DO_NOT_SHARE | +| params | object | | +| params.enabled | bool | audioDescription enabled or not | +### Results +This method returns no results. + +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "org.rdk.UserSettings.getPrivacyMode" + "jsonrpc": 2.0, + "id": 25, + "method": "org.rdk.UserSettings.setHighContrast", + "params": { + "enabled": true + } } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, - "result": "SHARE" + "jsonrpc": 2.0, + "id": 25, + "result": null } ``` - -## *getPinControl* + +## *setLiveWatershed [method](#head.Methods)* -Returns Pin Control. +Sets LiveWatershed ON/OFF.Whether project-specific watershed rules should be applied for live content, if applicable for the project. ### Events - -No Events - +No events are associated with this method. ### Parameters - -This method takes no parameters. - -### Result - | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | boolean | Pin Control Enabled: true/false | +| params | object | | +| params.liveWatershed | bool | liveWatershed enabled or not. | +### Results +This method returns no results. + +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "org.rdk.UserSettings.getPinControl" + "jsonrpc": 2.0, + "id": 26, + "method": "org.rdk.UserSettings.setLiveWatershed", + "params": { + "liveWatershed": true + } } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, - "result": true + "jsonrpc": 2.0, + "id": 26, + "result": null } ``` - -## *getViewingRestrictions* + +## *setPinControl [method](#head.Methods)* -Returns Get Viewing Restrictions. +Sets PinControl ON/OFF. Parental Control as a whole is enabled or disabled. ### Events - -No Events - +No events are associated with this method. ### Parameters - -This method takes no parameters. - -### Result - | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | string | A project-specific representation of the time interval when viewing | +| params | object | | +| params.pinControl | bool | pinControl enabled or not. | +### Results +This method returns no results. + +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "org.rdk.UserSettings.getViewingRestrictions" + "jsonrpc": 2.0, + "id": 27, + "method": "org.rdk.UserSettings.setPinControl", + "params": { + "pinControl": true + } } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, - "result": "{\"restrictions\": [{\"scheme\": \"US_TV\", \"restrict\": [\"TV-Y7/FV\"]}, {\"scheme\": \"MPAA\", \"restrict\": []}]}" + "jsonrpc": 2.0, + "id": 27, + "result": null } ``` - -## *getViewingRestrictionsWindow* + +## *setPinOnPurchase [method](#head.Methods)* -Returns Get Viewing Restrictions Window. +Sets PinOnPurchase ON/OFF.Whether a PIN challenge should be made when a purchase is attempted. ### Events - -No Events - +No events are associated with this method. ### Parameters - -This method takes no parameters. - -### Result - | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | string | A project-specific representation of the time interval | +| params | object | | +| params.pinOnPurchase | bool | pinOnPurchase enabled or not. | +### Results +This method returns no results. + +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "org.rdk.UserSettings.getViewingRestrictionsWindow" + "jsonrpc": 2.0, + "id": 28, + "method": "org.rdk.UserSettings.setPinOnPurchase", + "params": { + "pinOnPurchase": true + } } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, - "result": "ALWAYS" + "jsonrpc": 2.0, + "id": 28, + "result": null } ``` - -## *getLiveWatershed* + +## *setPlaybackWatershed [method](#head.Methods)* -Returns Live Watershed. +Sets PlaybackWatershed ON/OFF. Whether project-specific watershed rules should be applied for non-live content, if applicable for the project. ### Events - -No Events - +No events are associated with this method. ### Parameters - -This method takes no parameters. - -### Result - | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | boolean | Live Watershed Enabled: true/false | +| params | object | | +| params.playbackWatershed | bool | playbackWatershed enabled or not. | +### Results +This method returns no results. + +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "org.rdk.UserSettings.getLiveWatershed" + "jsonrpc": 2.0, + "id": 29, + "method": "org.rdk.UserSettings.setPlaybackWatershed", + "params": { + "playbackWatershed": true + } } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, - "result": true + "jsonrpc": 2.0, + "id": 29, + "result": null } ``` - -## *getPlaybackWatershed* + +## *setPreferredAudioLanguages [method](#head.Methods)* -Returns Playback Watershed. +A prioritized list of ISO 639-2/B codes for the preferred audio languages, expressed as a comma separated lists of languages of zero of more elements. The players will pick the audio track that has the best match compared with this list. In the absence of a matching track, the player should by best effort select the preferred audio track. ### Events - -No Events - +No events are associated with this method. ### Parameters - -This method takes no parameters. - -### Result - | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | boolean | Playback Watershed Enabled: true/false | +| params | object | | +| params.preferredLanguages | string | the changed preferredLanguages. | +### Results +This method returns no results. + +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "org.rdk.UserSettings.getPlaybackWatershed" + "jsonrpc": 2.0, + "id": 30, + "method": "org.rdk.UserSettings.setPreferredAudioLanguages", + "params": { + "preferredLanguages": "eng,fra" + } } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, - "result": true + "jsonrpc": 2.0, + "id": 30, + "result": null } ``` - -## *getBlockNotRatedContent* + +## *setPreferredCaptionsLanguages [method](#head.Methods)* -Returns BlockNotRatedContent. +Set preferred languages for captions. ### Events - -No Events - +No events are associated with this method. ### Parameters - -This method takes no parameters. - -### Result - | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | boolean | BlockNotRatedContent Enabled: true/false | +| params | object | | +| params.preferredLanguages | string | the changed preferredLanguages. | +### Results +This method returns no results. + +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "org.rdk.UserSettings.getBlockNotRatedContent" + "jsonrpc": 2.0, + "id": 31, + "method": "org.rdk.UserSettings.setPreferredCaptionsLanguages", + "params": { + "preferredLanguages": "eng,fra" + } } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, - "result": true + "jsonrpc": 2.0, + "id": 31, + "result": null } ``` - -## *getPinOnPurchase* + +## *setPreferredClosedCaptionService [method](#head.Methods)* -Returns PinOnPurchase. +Sets the PreferredClosedCaptionService. ### Events - -No Events - +No events are associated with this method. ### Parameters - -This method takes no parameters. - -### Result - | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | boolean | PinOnPurchase Enabled: true/false | +| params | object | | +| params.service | string | the changed preferredClosedCaptionService. | +### Results +This method returns no results. + +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "org.rdk.UserSettings.getPinOnPurchase" + "jsonrpc": 2.0, + "id": 32, + "method": "org.rdk.UserSettings.setPreferredClosedCaptionService", + "params": { + "service": "CC3" + } } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, - "result": true + "jsonrpc": 2.0, + "id": 32, + "result": null } ``` - -## *getHighContrast* + +## *setPresentationLanguage [method](#head.Methods)* -Gets the current highContrast setting. +Sets the presentationLanguage in a full BCP 47 value, including script, region, variant ### Events - -No Events - +No events are associated with this method. ### Parameters - -This method takes no parameters. - -### Result - | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | boolean | HighContrast Enabled: true/false | +| params | object | | +| params.presentationLanguage | string | the changed presentationLanguage. | +### Results +This method returns no results. + +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "org.rdk.UserSettings.getHighContrast" + "jsonrpc": 2.0, + "id": 33, + "method": "org.rdk.UserSettings.setPresentationLanguage", + "params": { + "presentationLanguage": "" + } } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, - "result": true + "jsonrpc": 2.0, + "id": 33, + "result": null } ``` - -## *getVoiceGuidance* + +## *setPrivacyMode [method](#head.Methods)* -Gets the current voiceGuidance setting. +Sets the PrivacyMode. ### Events - -No Events - +No events are associated with this method. ### Parameters - -This method takes no parameters. - -### Result - | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | boolean | voiceGuidance Enabled: true/false | +| params | object | | +| params.privacyMode | string | "SHARE", "DO_NOT_SHARE". | +### Results +This method returns no results. + +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "org.rdk.UserSettings.getVoiceGuidance" + "jsonrpc": 2.0, + "id": 34, + "method": "org.rdk.UserSettings.setPrivacyMode", + "params": { + "privacyMode": "" + } } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, - "result": true + "jsonrpc": 2.0, + "id": 34, + "result": null } ``` - -## *getVoiceGuidanceRate* + +## *setViewingRestrictions [method](#head.Methods)* -Gets the current voiceGuidanceRate setting. +Sets the ViewingRestrictions. ### Events - -No Events - +No events are associated with this method. ### Parameters - -This method takes no parameters. - -### Result - | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | number | voice guidance rate value | +| params | object | | +| params.viewingRestrictions | string | the changed viewingRestrictions. | +### Results +This method returns no results. + +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "org.rdk.UserSettings.getVoiceGuidanceRate" + "jsonrpc": 2.0, + "id": 35, + "method": "org.rdk.UserSettings.setViewingRestrictions", + "params": { + "viewingRestrictions": "" + } } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, - "result": 0.1 + "jsonrpc": 2.0, + "id": 35, + "result": null } ``` - -## *getVoiceGuidanceHints* + +## *setViewingRestrictionsWindow [method](#head.Methods)* -Gets the current voiceGuidanceHints setting. +Sets the ViewingRestrictionsWindow. ### Events - -No Events - +No events are associated with this method. ### Parameters - -This method takes no parameters. - -### Result - | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | boolean | voiceGuidanceHints Enabled: true/false | +| params | object | | +| params.viewingRestrictionsWindow | string | the changed viewingRestrictionsWindow. | +### Results +This method returns no results. + +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "org.rdk.UserSettings.getVoiceGuidanceHints" + "jsonrpc": 2.0, + "id": 36, + "method": "org.rdk.UserSettings.setViewingRestrictionsWindow", + "params": { + "viewingRestrictionsWindow": "" + } } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, - "result": true + "jsonrpc": 2.0, + "id": 36, + "result": null } ``` - -## *getMigrationState* + +## *setVoiceGuidance [method](#head.Methods)* -Gets the migration state of the respective key. +Sets voiceGuidance. Whether Voice Guidance is enabled or not. ### Events - -No Events - +No events are associated with this method. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.key | string | the property key, for which we need to get migration state | - -### Result +| params.enabled | bool | audioDescription enabled or not | +### Results +This method returns no results. -| Name | Type | Description | -| :-------- | :-------- | :-------- | -| result | boolean | migration state of the respective key true/false | +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "org.rdk.UserSettings.getMigrationState", + "jsonrpc": 2.0, + "id": 37, + "method": "org.rdk.UserSettings.setVoiceGuidance", "params": { - "key": "VOICE_GUIDANCE_RATE" + "enabled": true } } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, - "result": true + "jsonrpc": 2.0, + "id": 37, + "result": null } ``` - -## *getMigrationStates* + +## *setVoiceGuidanceHints [method](#head.Methods)* -Gets the migration state of all the defined keys. +Sets voiceGuidanceHints ON/OFF. Whether Voice Guidance hints setting is switched on or not. ### Events - -No Events - +No events are associated with this method. ### Parameters - -This method takes no parameters. - -### Result - | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | array | migration state of all the defined keys | -| result[#] | object | Keys and it's migration states | -| result[#]?.key | string | *(optional)* key of the property | -| result[#]?.requiresMigration | boolean | *(optional)* migration state of the property | +| params | object | | +| params.hints | bool | voice guidance hints enabled or not. | +### Results +This method returns no results. + +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "org.rdk.UserSettings.getMigrationStates" + "jsonrpc": 2.0, + "id": 38, + "method": "org.rdk.UserSettings.setVoiceGuidanceHints", + "params": { + "hints": true + } } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, - "result": [ - { - "key": "PREFERRED_AUDIO_LANGUAGES", - "requiresMigration": true - } - ] + "jsonrpc": 2.0, + "id": 38, + "result": null } ``` - -## *getContentPin* + +## *setVoiceGuidanceRate [method](#head.Methods)* -Returns ContentPin. +Sets voiceGuidanceRate. Setting voice guidance rate value. from 0.1 to 10 inclusive. ### Events - -No Events - +No events are associated with this method. ### Parameters - -This method takes no parameters. - -### Result - | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | string | contentPin | +| params | object | | +| params.rate | double | the changed voice guidance rate. | +### Results +This method returns no results. + +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "org.rdk.UserSettings.getContentPin" + "jsonrpc": 2.0, + "id": 39, + "method": "org.rdk.UserSettings.setVoiceGuidanceRate", + "params": { + "rate": 0.0 + } } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, - "result": "1234" + "jsonrpc": 2.0, + "id": 39, + "result": null } ``` - + + + # Notifications -Notifications are autonomous events, triggered by the internals of the implementation, and broadcasted via JSON-RPC to all registered observers. Refer to [[Thunder](#Thunder)] for information on how to register for a notification. +Notifications are autonomous events, triggered by the internals of the implementation, and broadcasted via JSON-RPC to all registered observers. Refer to [[Thunder](#ref.Thunder)] for information on how to register for a notification. -The following events are provided by the org.rdk.UserSettings plugin: +The following events are provided by the UserSettings plugin: -org.rdk.UserSettings interface events: +UserSettings interface events: | Event | Description | | :-------- | :-------- | -| [onAudioDescriptionChanged](#onAudioDescriptionChanged) | Triggered after the audio description changes (see `SetAudioDescription`) | -| [onPreferredAudioLanguagesChanged](#onPreferredAudioLanguagesChanged) | Triggered after the audio preferred Audio languages changes (see `SetPreferredAudioLanguages`) | -| [onPresentationLanguageChanged](#onPresentationLanguageChanged) | Triggered after the Presentation Language changes (see `SetPresentationLanguage`) | -| [onCaptionsChanged](#onCaptionsChanged) | Triggered after the captions changes (see `SetCaptions`) | -| [onPreferredCaptionsLanguagesChanged](#onPreferredCaptionsLanguagesChanged) | Triggered after the PreferredCaption Languages changes (see `SetPreferredCaptionsLanguages`) | -| [onPreferredClosedCaptionServiceChanged](#onPreferredClosedCaptionServiceChanged) | Triggered after the Preferred Closed Caption changes (see `SetPreferredClosedCaptionService`) | -| [onPrivacyModeChanged](#onPrivacyModeChanged) | Triggered after the Privacy Mode changes (see `SetPrivacyMode`) | -| [onPinControlChanged](#onPinControlChanged) | Triggered after the pin control changes (see `setPinControl`) | -| [onViewingRestrictionsChanged](#onViewingRestrictionsChanged) | Triggered after the viewingRestrictions changes (see `setViewingRestrictions`) | -| [onViewingRestrictionsWindowChanged](#onViewingRestrictionsWindowChanged) | Triggered after the viewingRestrictionsWindow changes (see `setViewingRestrictionsWindow`) | -| [onLiveWatershedChanged](#onLiveWatershedChanged) | Triggered after the liveWatershed changes (see `setLiveWatershed`) | -| [onPlaybackWatershedChanged](#onPlaybackWatershedChanged) | Triggered after the playbackWatershed changes (see `setPlaybackWatershed`) | -| [onBlockNotRatedContentChanged](#onBlockNotRatedContentChanged) | Triggered after the blockNotRatedContent changes (see `setBlockNotRatedContent`) | -| [onPinOnPurchaseChanged](#onPinOnPurchaseChanged) | Triggered after the pinOnPurchase changes (see `setPinOnPurchase`) | -| [onHighContrastChanged](#onHighContrastChanged) | Triggered after the high contrast settings changes(see `SetHighContrast`) | -| [onVoiceGuidanceChanged](#onVoiceGuidanceChanged) | Triggered after the voice guidance enabled settings changes | -| [onVoiceGuidanceRateChanged](#onVoiceGuidanceRateChanged) | Triggered after the voice guidance rate changed | -| [onVoiceGuidanceHintsChanged](#onVoiceGuidanceHintsChanged) | Triggered after the voice guidance hints changes | -| [onContentPinChanged](#onContentPinChanged) | Triggered after the ContentPin changes (see `setContentPin`) | - - - -## *onAudioDescriptionChanged* - -Triggered after the audio description changes (see `SetAudioDescription`). +| [onAudioDescriptionChanged](#event.onAudioDescriptionChanged) | The AudioDescription setting has changed. | +| [onBlockNotRatedContentChanged](#event.onBlockNotRatedContentChanged) | The BlockNotRatedContent setting has changed. | +| [onCaptionsChanged](#event.onCaptionsChanged) | The Captions setting has changed. | +| [onContentPinChanged](#event.onContentPinChanged) | The ContentPin setting has changed. | +| [onHighContrastChanged](#event.onHighContrastChanged) | Triggered after the high contrast settings changes. | +| [onLiveWatershedChanged](#event.onLiveWatershedChanged) | The LiveWatershed setting has changed. | +| [onPinControlChanged](#event.onPinControlChanged) | The PinControl setting has changed. | +| [onPinOnPurchaseChanged](#event.onPinOnPurchaseChanged) | The PinOnPurchase setting has changed. | +| [onPlaybackWatershedChanged](#event.onPlaybackWatershedChanged) | The PlaybackWatershed setting has changed. | +| [onPreferredAudioLanguagesChanged](#event.onPreferredAudioLanguagesChanged) | The preferredLanguages setting has changed. | +| [onPreferredCaptionsLanguagesChanged](#event.onPreferredCaptionsLanguagesChanged) | The PreferredCaptionsLanguages setting has changed. | +| [onPreferredClosedCaptionServiceChanged](#event.onPreferredClosedCaptionServiceChanged) | The PreferredClosedCaptionService setting has changed.Eg: "CC[1-4]", "TEXT[1-4]", "SERVICE[1-64]". | +| [onPresentationLanguageChanged](#event.onPresentationLanguageChanged) | The PresentationLanguages setting has changed. | +| [onPrivacyModeChanged](#event.onPrivacyModeChanged) | The PrivacyMode setting has changed. | +| [onViewingRestrictionsChanged](#event.onViewingRestrictionsChanged) | The ViewingRestrictions setting has changed. | +| [onViewingRestrictionsWindowChanged](#event.onViewingRestrictionsWindowChanged) | The ViewingRestrictionsWindow setting has changed. | +| [onVoiceGuidanceChanged](#event.onVoiceGuidanceChanged) | Triggered after the voice guidance enabled settings changes. | +| [onVoiceGuidanceHintsChanged](#event.onVoiceGuidanceHintsChanged) | Triggered after the voice guidance hints changes. | +| [onVoiceGuidanceRateChanged](#event.onVoiceGuidanceRateChanged) | Triggered after the voice guidance rate changed. | + + +## *onAudioDescriptionChanged [event](#head.Notifications)* + +The AudioDescription setting has changed. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.enabled | boolean | Receive audio description changes enable or not | +| params.enabled | bool | audioDescription enabled or not | -### Example +### Examples ```json { - "jsonrpc": "2.0", - "method": "client.events.onAudioDescriptionChanged", + "jsonrpc": 2.0, + "id": 40, + "method": "org.rdk.UserSettings.onAudioDescriptionChanged", "params": { "enabled": true } } ``` - -## *onPreferredAudioLanguagesChanged* + +## *onBlockNotRatedContentChanged [event](#head.Notifications)* -Triggered after the audio preferred Audio languages changes (see `SetPreferredAudioLanguages`). +The BlockNotRatedContent setting has changed. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.preferredLanguages | string | Receive preferred Audio languages changes | +| params.blockNotRatedContent | bool | blockNotRatedContent enabled or not. | -### Example +### Examples ```json { - "jsonrpc": "2.0", - "method": "client.events.onPreferredAudioLanguagesChanged", + "jsonrpc": 2.0, + "id": 41, + "method": "org.rdk.UserSettings.onBlockNotRatedContentChanged", "params": { - "preferredLanguages": "eng" + "blockNotRatedContent": true } } ``` - -## *onPresentationLanguageChanged* + +## *onCaptionsChanged [event](#head.Notifications)* -Triggered after the Presentation Language changes (see `SetPresentationLanguage`). +The Captions setting has changed. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.presentationLanguage | string | Receive Presentation Language changes | +| params.enabled | bool | audioDescription enabled or not | -### Example +### Examples ```json { - "jsonrpc": "2.0", - "method": "client.events.onPresentationLanguageChanged", + "jsonrpc": 2.0, + "id": 42, + "method": "org.rdk.UserSettings.onCaptionsChanged", "params": { - "presentationLanguage": "en-US" + "enabled": true } } ``` - -## *onCaptionsChanged* + +## *onContentPinChanged [event](#head.Notifications)* -Triggered after the captions changes (see `SetCaptions`). +The ContentPin setting has changed. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.enabled | boolean | | +| params.contentPin | string | The changed contentPin. | -### Example +### Examples ```json { - "jsonrpc": "2.0", - "method": "client.events.onCaptionsChanged", + "jsonrpc": 2.0, + "id": 43, + "method": "org.rdk.UserSettings.onContentPinChanged", "params": { - "enabled": true + "contentPin": "" } } ``` - -## *onPreferredCaptionsLanguagesChanged* + +## *onHighContrastChanged [event](#head.Notifications)* -Triggered after the PreferredCaption Languages changes (see `SetPreferredCaptionsLanguages`). +Triggered after the high contrast settings changes. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.preferredLanguages | string | Receive PreferredCaption Languages changes | +| params.enabled | bool | audioDescription enabled or not | -### Example +### Examples ```json { - "jsonrpc": "2.0", - "method": "client.events.onPreferredCaptionsLanguagesChanged", + "jsonrpc": 2.0, + "id": 44, + "method": "org.rdk.UserSettings.onHighContrastChanged", "params": { - "preferredLanguages": "eng" + "enabled": true } } ``` - -## *onPreferredClosedCaptionServiceChanged* + +## *onLiveWatershedChanged [event](#head.Notifications)* -Triggered after the Preferred Closed Caption changes (see `SetPreferredClosedCaptionService`). +The LiveWatershed setting has changed. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.service | string | Receive Preferred Closed Caption Service changes | +| params.liveWatershed | bool | liveWatershed enabled or not. | -### Example +### Examples ```json { - "jsonrpc": "2.0", - "method": "client.events.onPreferredClosedCaptionServiceChanged", + "jsonrpc": 2.0, + "id": 45, + "method": "org.rdk.UserSettings.onLiveWatershedChanged", "params": { - "service": "CC3" + "liveWatershed": true } } ``` - -## *onPrivacyModeChanged* + +## *onPinControlChanged [event](#head.Notifications)* -Triggered after the Privacy Mode changes (see `SetPrivacyMode`). +The PinControl setting has changed. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.privacyMode | string | Receive Privacy Mode changes | +| params.pinControl | bool | pinControl enabled or not. | -### Example +### Examples ```json { - "jsonrpc": "2.0", - "method": "client.events.onPrivacyModeChanged", + "jsonrpc": 2.0, + "id": 46, + "method": "org.rdk.UserSettings.onPinControlChanged", "params": { - "privacyMode": "DO_NOT_SHARE" + "pinControl": true } } ``` - -## *onPinControlChanged* + +## *onPinOnPurchaseChanged [event](#head.Notifications)* -Triggered after the pin control changes (see `setPinControl`). +The PinOnPurchase setting has changed. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.pinControl | boolean | Receive pin control changes enable or not | +| params.pinOnPurchase | bool | pinOnPurchase enabled or not. | -### Example +### Examples ```json { - "jsonrpc": "2.0", - "method": "client.events.onPinControlChanged", + "jsonrpc": 2.0, + "id": 47, + "method": "org.rdk.UserSettings.onPinOnPurchaseChanged", "params": { - "pinControl": true + "pinOnPurchase": true } } ``` - -## *onViewingRestrictionsChanged* + +## *onPlaybackWatershedChanged [event](#head.Notifications)* -Triggered after the viewingRestrictions changes (see `setViewingRestrictions`). +The PlaybackWatershed setting has changed. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.viewingRestrictions | string | Receive viewingRestrictions changes | +| params.playbackWatershed | bool | playbackWatershed enabled or not. | -### Example +### Examples ```json { - "jsonrpc": "2.0", - "method": "client.events.onViewingRestrictionsChanged", + "jsonrpc": 2.0, + "id": 48, + "method": "org.rdk.UserSettings.onPlaybackWatershedChanged", "params": { - "viewingRestrictions": "{\"restrictions\": [{\"scheme\": \"US_TV\", \"restrict\": [\"TV-Y7/FV\"]}, {\"scheme\": \"MPAA\", \"restrict\": []}]}" + "playbackWatershed": true } } ``` - -## *onViewingRestrictionsWindowChanged* + +## *onPreferredAudioLanguagesChanged [event](#head.Notifications)* -Triggered after the viewingRestrictionsWindow changes (see `setViewingRestrictionsWindow`). +The preferredLanguages setting has changed. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.viewingRestrictionsWindow | string | Receive viewingRestrictionsWindow changes | +| params.preferredLanguages | string | the changed preferredLanguages. | -### Example +### Examples ```json { - "jsonrpc": "2.0", - "method": "client.events.onViewingRestrictionsWindowChanged", + "jsonrpc": 2.0, + "id": 49, + "method": "org.rdk.UserSettings.onPreferredAudioLanguagesChanged", "params": { - "viewingRestrictionsWindow": "ALWAYS" + "preferredLanguages": "eng,fra" } } ``` - -## *onLiveWatershedChanged* + +## *onPreferredCaptionsLanguagesChanged [event](#head.Notifications)* -Triggered after the liveWatershed changes (see `setLiveWatershed`). +The PreferredCaptionsLanguages setting has changed. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.liveWatershed | boolean | Receives liveWatershed changes enable or not | +| params.preferredLanguages | string | the changed preferredLanguages. | -### Example +### Examples ```json { - "jsonrpc": "2.0", - "method": "client.events.onLiveWatershedChanged", + "jsonrpc": 2.0, + "id": 50, + "method": "org.rdk.UserSettings.onPreferredCaptionsLanguagesChanged", "params": { - "liveWatershed": true + "preferredLanguages": "eng,fra" } } ``` - -## *onPlaybackWatershedChanged* + +## *onPreferredClosedCaptionServiceChanged [event](#head.Notifications)* -Triggered after the playbackWatershed changes (see `setPlaybackWatershed`). +The PreferredClosedCaptionService setting has changed.Eg: "CC[1-4]", "TEXT[1-4]", "SERVICE[1-64]". ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.playbackWatershed | boolean | Receive playbackWatershed changes enable or not | +| params.service | string | the changed preferredClosedCaptionService. | -### Example +### Examples ```json { - "jsonrpc": "2.0", - "method": "client.events.onPlaybackWatershedChanged", + "jsonrpc": 2.0, + "id": 51, + "method": "org.rdk.UserSettings.onPreferredClosedCaptionServiceChanged", "params": { - "playbackWatershed": true + "service": "CC3" } } ``` - -## *onBlockNotRatedContentChanged* + +## *onPresentationLanguageChanged [event](#head.Notifications)* -Triggered after the blockNotRatedContent changes (see `setBlockNotRatedContent`). +The PresentationLanguages setting has changed. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.blockNotRatedContent | boolean | Receive blockNotRatedContent changes enable or not | +| params.presentationLanguage | string | the changed presentationLanguage. | -### Example +### Examples ```json { - "jsonrpc": "2.0", - "method": "client.events.onBlockNotRatedContentChanged", + "jsonrpc": 2.0, + "id": 52, + "method": "org.rdk.UserSettings.onPresentationLanguageChanged", "params": { - "blockNotRatedContent": true + "presentationLanguage": "" } } ``` - -## *onPinOnPurchaseChanged* + +## *onPrivacyModeChanged [event](#head.Notifications)* -Triggered after the pinOnPurchase changes (see `setPinOnPurchase`). +The PrivacyMode setting has changed. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.pinOnPurchase | boolean | Receive pinOnPurchase changes enable or not | +| params.privacyMode | string | "SHARE", "DO_NOT_SHARE". | -### Example +### Examples ```json { - "jsonrpc": "2.0", - "method": "client.events.onPinOnPurchaseChanged", + "jsonrpc": 2.0, + "id": 53, + "method": "org.rdk.UserSettings.onPrivacyModeChanged", "params": { - "pinOnPurchase": true + "privacyMode": "" } } ``` - -## *onHighContrastChanged* + +## *onViewingRestrictionsChanged [event](#head.Notifications)* -Triggered after the high contrast settings changes(see `SetHighContrast`). +The ViewingRestrictions setting has changed. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.enabled | boolean | Receive high contrast enabled or not | +| params.viewingRestrictions | string | the changed viewingRestrictions. | -### Example +### Examples ```json { - "jsonrpc": "2.0", - "method": "client.events.onHighContrastChanged", + "jsonrpc": 2.0, + "id": 54, + "method": "org.rdk.UserSettings.onViewingRestrictionsChanged", "params": { - "enabled": true + "viewingRestrictions": "" } } ``` - -## *onVoiceGuidanceChanged* + +## *onViewingRestrictionsWindowChanged [event](#head.Notifications)* -Triggered after the voice guidance enabled settings changes.(see `SetVoiceGuidance`). +The ViewingRestrictionsWindow setting has changed. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.enabled | boolean | Receive voice guidance enabled or not | +| params.viewingRestrictionsWindow | string | the changed viewingRestrictionsWindow. | -### Example +### Examples ```json { - "jsonrpc": "2.0", - "method": "client.events.onVoiceGuidanceChanged", + "jsonrpc": 2.0, + "id": 55, + "method": "org.rdk.UserSettings.onViewingRestrictionsWindowChanged", "params": { - "enabled": true + "viewingRestrictionsWindow": "" } } ``` - -## *onVoiceGuidanceRateChanged* + +## *onVoiceGuidanceChanged [event](#head.Notifications)* -Triggered after the voice guidance rate changed.(see `SetVoiceGuidanceRate`). +Triggered after the voice guidance enabled settings changes. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.rate | number | voice guidance rate value | +| params.enabled | bool | audioDescription enabled or not | -### Example +### Examples ```json { - "jsonrpc": "2.0", - "method": "client.events.onVoiceGuidanceRateChanged", + "jsonrpc": 2.0, + "id": 56, + "method": "org.rdk.UserSettings.onVoiceGuidanceChanged", "params": { - "rate": 0.1 + "enabled": true } } ``` - -## *onVoiceGuidanceHintsChanged* + +## *onVoiceGuidanceHintsChanged [event](#head.Notifications)* -Triggered after the voice guidance hints changes.(see `SetVoiceGuidanceHints`). +Triggered after the voice guidance hints changes. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.hints | boolean | Receive voice guidance hints enabled or not | +| params.hints | bool | voice guidance hints enabled or not. | -### Example +### Examples ```json { - "jsonrpc": "2.0", - "method": "client.events.onVoiceGuidanceHintsChanged", + "jsonrpc": 2.0, + "id": 57, + "method": "org.rdk.UserSettings.onVoiceGuidanceHintsChanged", "params": { "hints": true } } ``` - -## *onContentPinChanged* + +## *onVoiceGuidanceRateChanged [event](#head.Notifications)* -Triggered after the ContentPin changes (see `setContentPin`). +Triggered after the voice guidance rate changed. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.contentPin | string | contentPin | +| params.rate | double | the changed voice guidance rate. | -### Example +### Examples ```json { - "jsonrpc": "2.0", - "method": "client.events.onContentPinChanged", + "jsonrpc": 2.0, + "id": 58, + "method": "org.rdk.UserSettings.onVoiceGuidanceRateChanged", "params": { - "contentPin": "1234" + "rate": 0.0 } } ``` - diff --git a/docs/apis/WarehousePlugin.md b/docs/apis/WarehousePlugin.md index 4049b745..9c964544 100644 --- a/docs/apis/WarehousePlugin.md +++ b/docs/apis/WarehousePlugin.md @@ -1,403 +1,377 @@ - + # Warehouse Plugin -**Version: [1.0.0]()** +**Version: [1.0.0](https://github.com/rdkcentral/rdkservices/blob/main/Warehouse/CHANGELOG.md)** -A org.rdk.Warehouse plugin for Thunder framework. +A Warehouse 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](#head.Abbreviation,_Acronyms_and_Terms) +- [Description](#head.Description) +- [Configuration](#head.Configuration) +- [Methods](#head.Methods) +- [Notifications](#head.Notifications) - + # Abbreviation, Acronyms and Terms -[[Refer to this link](overview/aat.md)] +[[Refer to this link](userguide/aat.md)] - + # Description -The `Warehouse` plugin performs various types of resets (data, warehouse, etc.). +The `Warehouse` plugin provides an interface for Warehouse. -The plugin is designed to be loaded and executed within the Thunder framework. For more information about the framework refer to [[Thunder](#Thunder)]. +The plugin is designed to be loaded and executed within the Thunder framework. For more information about the framework refer to [[Thunder](#ref.Thunder)]. - + # Configuration The table below lists configuration options of the plugin. | Name | Type | Description | | :-------- | :-------- | :-------- | -| callsign | string | Plugin instance name (default: *org.rdk.Warehouse*) | -| classname | string | Class name: *org.rdk.Warehouse* | +| callsign | string | Plugin instance name (default: org.rdk.Warehouse) | +| classname | string | Class name: *Warehouse* | | locator | string | Library name: *libWPEFrameworkWarehouse.so* | | autostart | boolean | Determines if the plugin shall be started automatically along with the framework | - + # Methods -The following methods are provided by the org.rdk.Warehouse plugin: +The following methods are provided by the Warehouse plugin: Warehouse interface methods: | Method | Description | | :-------- | :-------- | -| [executeHardwareTest](#executeHardwareTest) | Starts a hardware test on the device | -| [getHardwareTestResults](#getHardwareTestResults) | Returns the results of the last hardware test | -| [internalReset](#internalReset) | Invokes the internal reset script, which reboots the Warehouse service (`/rebootNow | -| [isClean](#isClean) | Checks the locations on the device where customer data may be stored | -| [lightReset](#lightReset) | Resets the application data | -| [resetDevice](#resetDevice) | Resets the STB to the warehouse state | +| [executeHardwareTest](#method.executeHardwareTest) | Starts a hardware test on the device | +| [getHardwareTestResults](#method.getHardwareTestResults) | Returns the results of the last hardware test. | +| [internalReset](#method.internalReset) | Invokes the internal reset script, which reboots the Warehouse service | +| [isClean](#method.isClean) | Checks the locations on the device where customer data may be stored. | +| [lightReset](#method.lightReset) | Resets the application data. | +| [resetDevice](#method.resetDevice) | Resets the STB to the warehouse state. | + +## *executeHardwareTest [method](#head.Methods)* - -## *executeHardwareTest* - -Starts a hardware test on the device. See `getHardwareTestResults`. +Starts a hardware test on the device ### Events - -No Events - +No events are associated with this method. ### Parameters - This method takes no parameters. - -### Result - +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | object | | -| result.success | boolean | Whether the request succeeded | +| result.success | WarehouseSuccess | - | +| result.success.success | bool | - | + +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 0, "method": "org.rdk.Warehouse.executeHardwareTest" } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 0, "result": { "success": true } } ``` - -## *getHardwareTestResults* + +## *getHardwareTestResults [method](#head.Methods)* Returns the results of the last hardware test. ### Events - -No Events - +No events are associated with this method. ### Parameters - +This method takes no parameters. +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| params | object | | -| params.testResults | string | The test results | - -### Result +| result.success | bool | - in - boolean | +| result.testResults | string | - out - string | -| Name | Type | Description | -| :-------- | :-------- | :-------- | -| result | object | | -| result.success | boolean | Whether the request succeeded | +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "org.rdk.Warehouse.getHardwareTestResults", - "params": { - "testResults": "Timezone: NA 2021-04-15 10:35:06 Test execution start, remote trigger ver. 0011 2021-04-15 10:35:10 Test result: Audio/Video Decoder:PASSED 2021-04-15 10:35:06 Test result: Dynamic RAM:PASSED 2021-04-15 10:35:06 Test result: Flash Memory:PASSED 2021-04-15 10:35:06 Test result: HDMI Output:PASSED 2021-04-15 10:35:38 Test result: IR Remote Interface:WARNING_IR_Not_Detected 2021-04-15 10:35:06 Test result: Bluetooth:PASSED 2021-04-15 10:35:06 Test result: SD Card:PASSED 2021-04-15 10:35:06 Test result: WAN:PASSED 2021-04-15 10:35:38 Test execution completed:PASSED" - } + "jsonrpc": 2.0, + "id": 1, + "method": "org.rdk.Warehouse.getHardwareTestResults" } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 1, "result": { - "success": true + "success": true, + "testResults": "" } } ``` - -## *internalReset* + +## *internalReset [method](#head.Methods)* -Invokes the internal reset script, which reboots the Warehouse service (`/rebootNow.sh -s WarehouseService &`). Note that this method checks the `/version.txt` file for the image name and fails to run if the STB image version is marked as production (`PROD`). +Invokes the internal reset script, which reboots the Warehouse service ### Events - -No Events - +No events are associated with this method. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.passPhrase | string | The passphrase for running the internal reset (`FOR TEST PURPOSES ONLY`) | - -### Result - +| params.passPhrase | string | - in - string | +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | object | | -| result.success | boolean | Whether the request succeeded | -| result?.error | string | *(optional)* An error message in case of a failure | +| result.successErr | WarehouseSuccessErr | - | +| result.successErr.success | bool | - | +| result.successErr.error | string | - | + +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 2, "method": "org.rdk.Warehouse.internalReset", "params": { - "passPhrase": "FOR TEST PURPOSES ONLY" + "passPhrase": "" } } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 2, "result": { "success": true, - "error": "..." + "error": "" } } ``` - -## *isClean* + +## *isClean [method](#head.Methods)* -Checks the locations on the device where customer data may be stored. If there are contents contained in those folders, then the device is not clean. +Checks the locations on the device where customer data may be stored. ### Events - -No Events - +No events are associated with this method. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params?.age | integer | *(optional)* Ignore files/folders for the isClean checkup that were created/updated within the last age (in seconds) when this API is called | - -### Result - +| params.age | int | - in - integer | +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | object | | -| result.clean | boolean | If `true`, then the device has no customer data, otherwise `false` | -| result.files | array | A string [] of file locations for each file that is found that should have been deleted in the cleaning process. If the `clean` property is `true`, then this array is empty or `null` | -| result.files[#] | string | | -| result.success | boolean | Whether the request succeeded | -| result.error | string | An error message in case of a failure | +| result.clean | bool | - out - boolean | +| result.files | IStringIterator | - out - string [] of file locations for each file | +| result.files[#] | string | - | +| result.success | bool | - in - boolean | +| result.error | string | - in - string | + +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 3, "method": "org.rdk.Warehouse.isClean", "params": { - "age": 300 + "age": 0 } } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 3, "result": { - "clean": false, + "clean": true, "files": [ - "/opt/ctrlm.sql" + "" ], "success": true, - "error": "..." + "error": "" } } ``` - -## *lightReset* + +## *lightReset [method](#head.Methods)* Resets the application data. ### Events - -No Events - +No events are associated with this method. ### Parameters - This method takes no parameters. - -### Result - +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | object | | -| result.success | boolean | Whether the request succeeded | -| result?.error | string | *(optional)* An error message in case of a failure | +| result.successErr | WarehouseSuccessErr | - | +| result.successErr.success | bool | - | +| result.successErr.error | string | - | + +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 4, "method": "org.rdk.Warehouse.lightReset" } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 4, "result": { "success": true, - "error": "..." + "error": "" } } ``` - -## *resetDevice* + +## *resetDevice [method](#head.Methods)* Resets the STB to the warehouse state. ### Events - -| Event | Description | -| :-------- | :-------- | -| [resetDone](#resetDone) | Triggers when the device reset is finished indicating a successful reset or failure | +No events are associated with this method. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.suppressReboot | boolean | if `true`, the STB should not be rebooted, otherwise `false`. Only the `WAREHOUSE` reset type supports suppressing the reboot | -| params.resetType | string | The reset type. If `resetType` is not specified, then `WAREHOUSE` is the default. (must be one of the following: *WAREHOUSE*, *FACTORY*, *USERFACTORY*, *COLDFACTORY*) | - -### Result - +| params.suppressReboot | bool | - in - bool | +| params.resetType | string | - in - string | +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | object | | -| result.success | boolean | Whether the request succeeded | -| result?.error | string | *(optional)* An error message in case of a failure | +| result.successErr | WarehouseSuccessErr | - | +| result.successErr.success | bool | - | +| result.successErr.error | string | - | + +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 5, "method": "org.rdk.Warehouse.resetDevice", "params": { "suppressReboot": true, - "resetType": "WAREHOUSE" + "resetType": "" } } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, + "jsonrpc": 2.0, + "id": 5, "result": { "success": true, - "error": "..." + "error": "" } } ``` - + + + # Notifications -Notifications are autonomous events, triggered by the internals of the implementation, and broadcasted via JSON-RPC to all registered observers. Refer to [[Thunder](#Thunder)] for information on how to register for a notification. +Notifications are autonomous events, triggered by the internals of the implementation, and broadcasted via JSON-RPC to all registered observers. Refer to [[Thunder](#ref.Thunder)] for information on how to register for a notification. -The following events are provided by the org.rdk.Warehouse plugin: +The following events are provided by the Warehouse plugin: Warehouse interface events: | Event | Description | | :-------- | :-------- | -| [resetDone](#resetDone) | Notifies subscribers about the status of the warehouse reset operation | +| [resetDone](#event.resetDone) | Notifies subscribers about the status of the warehouse reset operation | + +## *resetDone [event](#head.Notifications)* - -## *resetDone* - -Notifies subscribers about the status of the warehouse reset operation. +Notifies subscribers about the status of the warehouse reset operation ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.success | boolean | Whether the request succeeded | -| params?.error | string | *(optional)* An error message in case of a failure | +| params.success | bool | - in - boolean | +| params.error | string | - in - string | -### Example +### Examples ```json { - "jsonrpc": "2.0", - "method": "client.events.resetDone", + "jsonrpc": 2.0, + "id": 6, + "method": "org.rdk.Warehouse.resetDone", "params": { "success": true, - "error": "..." + "error": "" } } ``` - diff --git a/docs/apis/XCastPlugin.md b/docs/apis/XCastPlugin.md index 466286ec..4f7782de 100644 --- a/docs/apis/XCastPlugin.md +++ b/docs/apis/XCastPlugin.md @@ -1,995 +1,845 @@ - + # XCast Plugin -**Version: [1.0.0]()** +**Version: [1.0.0](https://github.com/rdkcentral/rdkservices/blob/main/XCast/CHANGELOG.md)** -A org.rdk.Xcast plugin for Thunder framework. +A XCast 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](#head.Abbreviation,_Acronyms_and_Terms) +- [Description](#head.Description) +- [Configuration](#head.Configuration) +- [Methods](#head.Methods) - + # Abbreviation, Acronyms and Terms -[[Refer to this link](overview/aat.md)] +[[Refer to this link](userguide/aat.md)] - + # Description -This XCast plugin provides methods and events to support launching applications from an external source (for example, DIAL, Alexa, or WebPA). The RT implementation should use a RT service name that complies to the convention `com.comcast.cast`. For example, `com.comcast.xdialcast` is used by `xdialserver`. +The `XCast` plugin provides an interface for XCast. -The plugin is designed to be loaded and executed within the Thunder framework. For more information about the framework refer to [[Thunder](#Thunder)]. +The plugin is designed to be loaded and executed within the Thunder framework. For more information about the framework refer to [[Thunder](#ref.Thunder)]. - + # Configuration The table below lists configuration options of the plugin. | Name | Type | Description | | :-------- | :-------- | :-------- | -| callsign | string | Plugin instance name (default: *org.rdk.Xcast*) | -| classname | string | Class name: *org.rdk.Xcast* | +| callsign | string | Plugin instance name (default: org.rdk.XCast) | +| classname | string | Class name: *XCast* | | locator | string | Library name: *libWPEFrameworkXCast.so* | | autostart | boolean | Determines if the plugin shall be started automatically along with the framework | - + # Methods -The following methods are provided by the org.rdk.Xcast plugin: +The following methods are provided by the XCast plugin: XCast interface methods: | Method | Description | | :-------- | :-------- | -| [getApiVersionNumber](#getApiVersionNumber) | Gets the API version number | -| [getEnabled](#getEnabled) | Reports whether xcast plugin is enabled or disabled | -| [getFriendlyName](#getFriendlyName) | Returns the friendly name set by setFriendlyName API | -| [getManufacturerName](#getManufacturerName) | Returns the friendly name set by setManufacturerName API | -| [getModelName](#getModelName) | Returns the friendly name set by setModelName API | -| [getProtocolVersion](#getProtocolVersion) | Returns the DIAL protocol version supported by the server | -| [getStandbyBehavior](#getStandbyBehavior) | Return current standby behavior option string set uisng setStandbyBehavior or default value | -| [onApplicationStateChanged](#onApplicationStateChanged) | Provides notification whenever an application changes state due to user activity, an internal error, or other reasons | -| [registerApplications](#registerApplications) | Registers an application | -| [unregisterApplications](#unregisterApplications) | Unregisters an application | -| [setEnabled](#setEnabled) | Enable or disable XCAST service | -| [setFriendlyName](#setFriendlyName) | Sets the friendly name of device | -| [setManufacturerName](#setManufacturerName) | Sets the Manufacturer name of device | -| [setModelName](#setModelName) | Sets the Model name of device | -| [setStandbyBehavior](#setStandbyBehavior) | Sets the expected xcast behavior in standby mode | - - - -## *getApiVersionNumber* - -Gets the API version number. +| [deinitialize](#method.deinitialize) | | +| [initialize](#method.initialize) | | +| [applicationStateChanged](#method.applicationStateChanged) | | +| [enableCastService](#method.enableCastService) | | +| [getManufacturerName](#method.getManufacturerName) | | +| [getModelName](#method.getModelName) | | +| [getProtocolVersion](#method.getProtocolVersion) | | +| [onApplicationHideRequest](#method.onApplicationHideRequest) | | +| [onApplicationLaunchRequest](#method.onApplicationLaunchRequest) | | +| [onApplicationLaunchRequestWithLaunchParam](#method.onApplicationLaunchRequestWithLaunchParam) | | +| [onApplicationResumeRequest](#method.onApplicationResumeRequest) | | +| [onApplicationStateRequest](#method.onApplicationStateRequest) | | +| [onApplicationStopRequest](#method.onApplicationStopRequest) | | +| [onUpdatePowerStateRequest](#method.onUpdatePowerStateRequest) | | +| [registerApplications](#method.registerApplications) | | +| [setManufacturerName](#method.setManufacturerName) | | +| [setModelName](#method.setModelName) | | +| [setNetworkStandbyMode](#method.setNetworkStandbyMode) | | + + +## *deinitialize [method](#head.Methods)* -### Events -No Events +### Events +No events are associated with this method. ### Parameters - This method takes no parameters. +### Results +This method returns no results. -### Result +### Examples -| Name | Type | Description | -| :-------- | :-------- | :-------- | -| result | object | | -| result.version | integer | a version number | -| result.success | boolean | Whether the request succeeded | - -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "org.rdk.Xcast.getApiVersionNumber" + "jsonrpc": 2.0, + "id": 0, + "method": "org.rdk.XCast.deinitialize" } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, - "result": { - "version": 1, - "success": true - } + "jsonrpc": 2.0, + "id": 0, + "result": null } ``` - -## *getEnabled* - -Reports whether xcast plugin is enabled or disabled. + +## *initialize [method](#head.Methods)* -### Events -No Events +### Events +No events are associated with this method. ### Parameters - -This method takes no parameters. - -### Result - | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | object | | -| result.enabled | boolean | `true` for enabled or `false` for disabled | -| result.success | boolean | Whether the request succeeded | +| params | object | | +| params.networkStandbyMode | bool | - | +### Results +This method returns no results. + +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "org.rdk.Xcast.getEnabled" + "jsonrpc": 2.0, + "id": 1, + "method": "org.rdk.XCast.initialize", + "params": { + "networkStandbyMode": true + } } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, - "result": { - "enabled": true, - "success": true - } + "jsonrpc": 2.0, + "id": 1, + "result": null } ``` - -## *getFriendlyName* + +## *applicationStateChanged [method](#head.Methods)* -Returns the friendly name set by setFriendlyName API. -> This API is **deprecated** and may be removed in the future. It is no longer recommended for use in new implementations. [Refer this link for the new api]( https://rdkcentral.github.io/rdkservices/#/api/SystemPlugin?id=getFriendlyName) ### Events - -No Events - +No events are associated with this method. ### Parameters - -This method takes no parameters. - -### Result - | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | object | | -| result.friendlyname | string | The friendly name of the device which used to display on the client device list | -| result.success | boolean | Whether the request succeeded | +| params | object | | +| params.applicationName | string | - | +| params.state | string | - | +| params.applicationId | string | - | +| params.error | string | - | +### Results +This method returns no results. + +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "org.rdk.Xcast.getFriendlyName" + "jsonrpc": 2.0, + "id": 2, + "method": "org.rdk.XCast.applicationStateChanged", + "params": { + "applicationName": "", + "state": "", + "applicationId": "", + "error": "" + } } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, - "result": { - "friendlyname": "Friendly name", - "success": true - } + "jsonrpc": 2.0, + "id": 2, + "result": null } ``` - -## *getManufacturerName* + +## *enableCastService [method](#head.Methods)* -Returns the friendly name set by setManufacturerName API. -### Events - -No Events +### Events +No events are associated with this method. ### Parameters - -This method takes no parameters. - -### Result - | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | object | | -| result.manufacturer | string | The Manufacturer name of the device which used to update in dd.xml | -| result.success | boolean | Whether the request succeeded | +| params | object | | +| params.friendlyname | string | - | +| params.enableService | bool | - | +### Results +This method returns no results. + +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "org.rdk.Xcast.getManufacturerName" + "jsonrpc": 2.0, + "id": 3, + "method": "org.rdk.XCast.enableCastService", + "params": { + "friendlyname": "", + "enableService": true + } } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, - "result": { - "manufacturer": "Manufacturer name", - "success": true - } + "jsonrpc": 2.0, + "id": 3, + "result": null } ``` - -## *getModelName* - -Returns the friendly name set by setModelName API. + +## *getManufacturerName [method](#head.Methods)* -### Events -No Events +### Events +No events are associated with this method. ### Parameters - This method takes no parameters. - -### Result - +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | object | | -| result.model | string | The Model name of the device which used to update in dd.xml | -| result.success | boolean | Whether the request succeeded | +| result.manufacturername | string | - | + +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "org.rdk.Xcast.getModelName" + "jsonrpc": 2.0, + "id": 4, + "method": "org.rdk.XCast.getManufacturerName" } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, - "result": { - "model": "Model name", - "success": true - } + "jsonrpc": 2.0, + "id": 4, + "result": "" } ``` - -## *getProtocolVersion* + +## *getModelName [method](#head.Methods)* -Returns the DIAL protocol version supported by the server. -### Events - -No Events +### Events +No events are associated with this method. ### Parameters - This method takes no parameters. - -### Result - +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | object | | -| result.version | string | DIAL protocol version | -| result.success | boolean | Whether the request succeeded | +| result.modelname | string | - | + +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "org.rdk.Xcast.getProtocolVersion" + "jsonrpc": 2.0, + "id": 5, + "method": "org.rdk.XCast.getModelName" } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, - "result": { - "version": "2.2.1", - "success": true - } + "jsonrpc": 2.0, + "id": 5, + "result": "" } ``` - -## *getStandbyBehavior* + +## *getProtocolVersion [method](#head.Methods)* -Return current standby behavior option string set uisng setStandbyBehavior or default value . -### Events - -No Events +### Events +No events are associated with this method. ### Parameters - This method takes no parameters. - -### Result - +### Results | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | object | | -| result.standbybehavior | string | whether to remain active or inactive during standby mode (must be one of the following: *active*, *inactive*) | -| result.success | boolean | Whether the request succeeded | +| result.protocolVersion | string | - | + +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "org.rdk.Xcast.getStandbyBehavior" + "jsonrpc": 2.0, + "id": 6, + "method": "org.rdk.XCast.getProtocolVersion" } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, - "result": { - "standbybehavior": "active", - "success": true - } + "jsonrpc": 2.0, + "id": 6, + "result": "" } ``` - -## *onApplicationStateChanged* + +## *onApplicationHideRequest [method](#head.Methods)* -Provides notification whenever an application changes state due to user activity, an internal error, or other reasons. For singleton applications, the `applicationId` parameter is optional. If an application request is denied, fails to fulfill, or the state change is triggered by an internal error, then a predefined error string should be included. This error may be translated to an XCast client. -The following table provides a client error mapping example: - -| Error | Description | HTTP Status Codes | -| :-------- | :-------- | :-------- | -| `none` | The request (start/stop) is fulfilled successfully | HTTP 200 OK | -| `forbidden` | The user is not allowed to change the state of the application. This is not related to user account authentication of the native application | HTTP 403 Forbidden | -| `unavailable` | The target native application is not available on the device | HTTP 404 Not Found | -| `invalid` | The request is invalid (bad parameter for example) | HTTP 400 Bad Request | -| `internal` | The server failed to fulfill the request (server error) | HTTP 500 Internal |. ### Events - -No Events - +No events are associated with this method. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.applicationName | string | Registered application name | -| params.state | string | A predefined application state. Either `running`, `stopped`, `hidden`, or `suspended` (introduced in DIAL 2.1, `suspended` is a synonym to `hidden`) | -| params?.applicationId | string | *(optional)* Application instance ID | -| params?.error | string | *(optional)* A predefined error from the cast target application. Either `none`, `forbidden` `unavailable` `invalid` or `internal` | - -### Result +| params.appName | string | - | +| params.appID | string | - | +### Results +This method returns no results. -| Name | Type | Description | -| :-------- | :-------- | :-------- | -| result | object | | -| result.success | boolean | Whether the request succeeded | +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "org.rdk.Xcast.onApplicationStateChanged", + "jsonrpc": 2.0, + "id": 7, + "method": "org.rdk.XCast.onApplicationHideRequest", "params": { - "applicationName": "NetflixApp", - "state": "running", - "applicationId": "1234", - "error": "..." + "appName": "", + "appID": "" } } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, - "result": { - "success": true - } + "jsonrpc": 2.0, + "id": 7, + "result": null } ``` - -## *registerApplications* + +## *onApplicationLaunchRequest [method](#head.Methods)* -Registers an application. This allows to whitelist the apps which support dial service. To dynamically update the app list, same API should be called with the updated list. so that app list will be appended to the existing XCast white list. If a DIAL request for an unregistered application is received by DIAL server, the request will be denied (HTTP 404) per DIAL specification. Optional fields need not be included, or can be included with empty values. -### Events - -No Events +### Events +No events are associated with this method. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.applications | array | Json array with one or more application details to register | -| params.applications[#] | object | | -| params.applications[#].names | array | case-sensitive. Group of acceptable names for a related application. Application name in request URI must have exact match to one of the names. Otherwise, matching prefix is needed. If the application name in request URI does not match any names or prefixes, then the request shall fail | -| params.applications[#].names[#] | string | | -| params.applications[#]?.prefixes | array | *(optional)* If the application name in request URI does not match the list of names, it must contain one of the prefixes.If the application name in request URI does not match any names or prefixes, then the request shall fail | -| params.applications[#]?.prefixes[#] | string | *(optional)* | -| params.applications[#]?.cors | array | *(optional)* a set of origins allowed for the application. This must not be empty | -| params.applications[#]?.cors[#] | string | *(optional)* | -| params.applications[#]?.properties | object | *(optional)* specific application properties applicable to app management. If not present in descriptor, the default value is assumed | -| params.applications[#]?.properties.allowStop | boolean | is the application (matching name list or prefix list) allowed to stop (no PID presence) after launched | -| params.applications[#]?.launchParameters | object | *(optional)* launchParameters that application wants dial-server to append before sending the request to launch application | -| params.applications[#]?.launchParameters.query | string | query string that need to be appended in launch request | -| params.applications[#]?.launchParameters.payload | string | optional payload string that need to be appended in launch request | - -### Result +| params.appName | string | - | +| params.parameter | string | - | +### Results +This method returns no results. -| Name | Type | Description | -| :-------- | :-------- | :-------- | -| result | object | | -| result.success | boolean | Whether the request succeeded | +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "org.rdk.Xcast.registerApplications", + "jsonrpc": 2.0, + "id": 8, + "method": "org.rdk.XCast.onApplicationLaunchRequest", "params": { - "applications": [ - { - "names": [ - "Youtube" - ], - "prefixes": [ - "myYouTube" - ], - "cors": [ - ".youtube.com" - ], - "properties": { - "allowStop": true - }, - "launchParameters": { - "query": "source_type=12", - "payload": "..." - } - } - ] + "appName": "", + "parameter": "" } } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, - "result": { - "success": true - } + "jsonrpc": 2.0, + "id": 8, + "result": null } ``` - -## *unregisterApplications* - -Unregisters an application. This API allows to remove the specified applist from the XCast whitelist. To dynamically delete the specific app list, same API should be called with the app list to remove. so that mentioned app list will be removed from the XCast whitelist. Calling this API with empty list will clear the Xcast Whitelist. + +## *onApplicationLaunchRequestWithLaunchParam [method](#head.Methods)* -### Events -No Events +### Events +No events are associated with this method. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.applications | string | One or more application name to unregister | - -### Result +| params.appName | string | - | +| params.strPayLoad | string | - | +| params.strQuery | string | - | +| params.strAddDataUrl | string | - | +### Results +This method returns no results. -| Name | Type | Description | -| :-------- | :-------- | :-------- | -| result | object | | -| result.success | boolean | Whether the request succeeded | +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "org.rdk.Xcast.unregisterApplications", + "jsonrpc": 2.0, + "id": 9, + "method": "org.rdk.XCast.onApplicationLaunchRequestWithLaunchParam", "params": { - "applications": "['YouTube', 'Netflix']" + "appName": "", + "strPayLoad": "", + "strQuery": "", + "strAddDataUrl": "" } } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, - "result": { - "success": true - } + "jsonrpc": 2.0, + "id": 9, + "result": null } ``` - -## *setEnabled* - -Enable or disable XCAST service. When disabled, the customer should not be able to discover CPE as a cast target for any client application. After enable(true) server application manger must re-register all app that are available for user to cast. The enabled status is not persisted on device after each reboot or reconnect application should call setEnalbed to initialize XCast thunder plugin. + +## *onApplicationResumeRequest [method](#head.Methods)* -### Events -No Events +### Events +No events are associated with this method. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.enabled | boolean | `true` for enabled or `false` for disabled | +| params.appName | string | - | +| params.appID | string | - | +### Results +This method returns no results. -### Result +### Examples -| Name | Type | Description | -| :-------- | :-------- | :-------- | -| result | object | | -| result.success | boolean | Whether the request succeeded | - -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "org.rdk.Xcast.setEnabled", + "jsonrpc": 2.0, + "id": 10, + "method": "org.rdk.XCast.onApplicationResumeRequest", "params": { - "enabled": true + "appName": "", + "appID": "" } } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, - "result": { - "success": true - } + "jsonrpc": 2.0, + "id": 10, + "result": null } ``` - -## *setFriendlyName* + +## *onApplicationStateRequest [method](#head.Methods)* -Sets the friendly name of device. It allows an application to override the default friendly name value with the friendly name passed as an argument. The provided name should not be empty. If a user provided name is not available, the caller of the API should use the default name partnerId+Model (or any other agreed default name) as the parameter. After initialization, XCastService should not be activated until setFriendlyName() is invoked. Frinedly name is not persisted on device after each reboot or reconnect application should call API to update the friendlyName. -> This API is **deprecated** and may be removed in the future. It is no longer recommended for use in new implementations. [Refer this link for the new api]( https://rdkcentral.github.io/rdkservices/#/api/SystemPlugin?id=setFriendlyName) ### Events - -No Events - +No events are associated with this method. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.friendlyname | string | The friendly name of the device which used to display on the client device list | +| params.appName | string | - | +| params.appID | string | - | +### Results +This method returns no results. -### Result +### Examples -| Name | Type | Description | -| :-------- | :-------- | :-------- | -| result | object | | -| result.success | boolean | Whether the request succeeded | - -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "org.rdk.Xcast.setFriendlyName", + "jsonrpc": 2.0, + "id": 11, + "method": "org.rdk.XCast.onApplicationStateRequest", "params": { - "friendlyname": "Friendly name" + "appName": "", + "appID": "" } } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, - "result": { - "success": true - } + "jsonrpc": 2.0, + "id": 11, + "result": null } ``` - -## *setManufacturerName* - -Sets the Manufacturer name of device. It allows an application to override the default manufacturer name value with the manufacturer name passed as an argument. The provided name should not be empty. Manufacturer name is not persisted on device after each reboot or reconnect application should call API to update the manufacturerName. + +## *onApplicationStopRequest [method](#head.Methods)* -### Events -No Events +### Events +No events are associated with this method. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.manufacturer | string | The Manufacturer name of the device which used to update in dd.xml | +| params.appName | string | - | +| params.appID | string | - | +### Results +This method returns no results. -### Result - -| Name | Type | Description | -| :-------- | :-------- | :-------- | -| result | object | | -| result.success | boolean | Whether the request succeeded | +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "org.rdk.Xcast.setManufacturerName", + "jsonrpc": 2.0, + "id": 12, + "method": "org.rdk.XCast.onApplicationStopRequest", "params": { - "manufacturer": "Manufacturer name" + "appName": "", + "appID": "" } } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, - "result": { - "success": true - } + "jsonrpc": 2.0, + "id": 12, + "result": null } ``` - -## *setModelName* + +## *onUpdatePowerStateRequest [method](#head.Methods)* -Sets the Model name of device. It allows an application to override the default model name value with the model name passed as an argument. The provided name should not be empty. Model name is not persisted on device after each reboot or reconnect application should call API to update the modelName. - -### Events -No Events +### Events +No events are associated with this method. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.model | string | The Model name of the device which used to update in dd.xml | +| params.powerState | string | - | +### Results +This method returns no results. -### Result +### Examples -| Name | Type | Description | -| :-------- | :-------- | :-------- | -| result | object | | -| result.success | boolean | Whether the request succeeded | - -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "org.rdk.Xcast.setModelName", + "jsonrpc": 2.0, + "id": 13, + "method": "org.rdk.XCast.onUpdatePowerStateRequest", "params": { - "model": "Model name" + "powerState": "" } } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, - "result": { - "success": true - } + "jsonrpc": 2.0, + "id": 13, + "result": null } ``` - -## *setStandbyBehavior* - -Sets the expected xcast behavior in standby mode. It allows an application to override controls on xcast behavior in standby mode. The default behavior in STANDBY mode is inactive, so client device can not discover the server. When STANDBY behavior is active, client device can discover the CPE device and perform the launch operation. Upon reeiving the launch request device will transitioned from STANDBY to ON mode. + +## *registerApplications [method](#head.Methods)* -### Events -No Events +### Events +No events are associated with this method. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.standbybehavior | string | whether to remain active or inactive during standby mode (must be one of the following: *active*, *inactive*) | - -### Result +| params.appInfoList | IApplicationInfoIterator | - | +| params.appInfoList[#].appName | string | - | +| params.appInfoList[#].prefixes | string | - | +| params.appInfoList[#].cors | string | - | +| params.appInfoList[#].query | string | - | +| params.appInfoList[#].payload | string | - | +| params.appInfoList[#].allowStop | int | - | +### Results +This method returns no results. -| Name | Type | Description | -| :-------- | :-------- | :-------- | -| result | object | | -| result.success | boolean | Whether the request succeeded | +### Examples -### Example #### Request ```json { - "jsonrpc": "2.0", - "id": 42, - "method": "org.rdk.Xcast.setStandbyBehavior", + "jsonrpc": 2.0, + "id": 14, + "method": "org.rdk.XCast.registerApplications", "params": { - "standbybehavior": "active" + "appInfoList": [ + { + "appName": "", + "prefixes": "", + "cors": "", + "query": "", + "payload": "", + "allowStop": 0 + } + ] } } ``` + #### Response ```json { - "jsonrpc": "2.0", - "id": 42, - "result": { - "success": true - } + "jsonrpc": 2.0, + "id": 14, + "result": null } ``` - -# Notifications - -Notifications are autonomous events, triggered by the internals of the implementation, and broadcasted via JSON-RPC to all registered observers. Refer to [[Thunder](#Thunder)] for information on how to register for a notification. - -The following events are provided by the org.rdk.Xcast plugin: + +## *setManufacturerName [method](#head.Methods)* -XCast interface events: -| Event | Description | -| :-------- | :-------- | -| [onApplicationHideRequest](#onApplicationHideRequest) | Triggered when the cast service receives a hide request from a client | -| [onApplicationLaunchRequest](#onApplicationLaunchRequest) | Triggered when the cast service receives a launch request from a client | -| [onApplicationResumeRequest](#onApplicationResumeRequest) | Triggered when the cast service receives a resume request from a client | -| [onApplicationStateRequest](#onApplicationStateRequest) | Triggered when the cast service needs an update of the application state | -| [onApplicationStopRequest](#onApplicationStopRequest) | Triggered when the cast service receives a stop request from a client | - - - -## *onApplicationHideRequest* - -Triggered when the cast service receives a hide request from a client. This is a request to hide an application from the foreground (suspend/run in background). -Upon hiding the application, the resident application is responsible for calling the `onApplicationStateChanged` method if hiding the application changes its running state. +### Events +No events are associated with this method. ### Parameters - | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.applicationName | string | Registered application name | -| params.applicationId | string | Application instance ID | +| params.manufacturername | string | - | +### Results +This method returns no results. + +### Examples -### Example + +#### Request ```json { - "jsonrpc": "2.0", - "method": "client.events.onApplicationHideRequest", + "jsonrpc": 2.0, + "id": 15, + "method": "org.rdk.XCast.setManufacturerName", "params": { - "applicationName": "NetflixApp", - "applicationId": "1234" + "manufacturername": "" } } ``` - -## *onApplicationLaunchRequest* - -Triggered when the cast service receives a launch request from a client. This is a request to launch an application. The resident application can determine if the application should be launched based on the current context. If the application is not already running, the requested application is started. If the application is already running and is in background mode, the requested application enters foreground mode (`optimus::running`, `xcast::running`). If the application is already in foreground mode, the request does not change the application state. -Upon launching the application, the resident application is responsible for calling the `onApplicationStateChanged` method, which sends the notification back to the XCast client (for example, `Dial`). -### Parameters - -| Name | Type | Description | -| :-------- | :-------- | :-------- | -| params | object | | -| params.applicationName | string | Registered application name | -| params.parameters | object | The format and interpretation is determined between the application launcher or cast target and the cast client for each application. For example, a Netflix DIAL-client returns a `pluginURL` parameter with the application launch string. A Youtube DIAL-client returns a `url` parameter with the application launch string | -| params.parameters.pluginUrl | string | Application launch string | - -### Example +#### Response ```json { - "jsonrpc": "2.0", - "method": "client.events.onApplicationLaunchRequest", - "params": { - "applicationName": "NetflixApp", - "parameters": { - "pluginUrl": "https://www.netflix.com" - } - } + "jsonrpc": 2.0, + "id": 15, + "result": null } ``` - -## *onApplicationResumeRequest* + +## *setModelName [method](#head.Methods)* -Triggered when the cast service receives a resume request from a client. This is a request to resume an application. -Upon resuming the application, the resident application is responsible for calling the `onApplicationStateChanged` -### Parameters +### Events +No events are associated with this method. +### Parameters | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.applicationName | string | Registered application name | -| params.applicationId | string | Application instance ID | +| params.modelname | string | - | +### Results +This method returns no results. -### Example +### Examples + + +#### Request ```json { - "jsonrpc": "2.0", - "method": "client.events.onApplicationResumeRequest", + "jsonrpc": 2.0, + "id": 16, + "method": "org.rdk.XCast.setModelName", "params": { - "applicationName": "NetflixApp", - "applicationId": "1234" + "modelname": "" } } ``` - -## *onApplicationStateRequest* -Triggered when the cast service needs an update of the application state. -The resident application is responsible for calling the `onApplicationStateChanged` method indicating the current state. - -### Parameters - -| Name | Type | Description | -| :-------- | :-------- | :-------- | -| params | object | | -| params.applicationName | string | Registered application name | -| params.applicationId | string | Application instance ID | - -### Example +#### Response ```json { - "jsonrpc": "2.0", - "method": "client.events.onApplicationStateRequest", - "params": { - "applicationName": "NetflixApp", - "applicationId": "1234" - } + "jsonrpc": 2.0, + "id": 16, + "result": null } ``` - -## *onApplicationStopRequest* + +## *setNetworkStandbyMode [method](#head.Methods)* -Triggered when the cast service receives a stop request from a client. This is a request to stop an application. If the application is already running and either in foreground or background mode, then the requested application is destroyed (`optimus::destroyed`, `xcast::stopped`). If the application is not running, this request triggers an error `onApplicationStateChanged` message with `Invalid`. -Upon stopping the application, the resident application is responsible for calling the `onApplicationStateChanged` -### Parameters +### Events +No events are associated with this method. +### Parameters | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.applicationName | string | Registered application name | -| params.applicationId | string | Application instance ID | +| params.networkStandbyMode | bool | - | +### Results +This method returns no results. -### Example +### Examples + + +#### Request ```json { - "jsonrpc": "2.0", - "method": "client.events.onApplicationStopRequest", + "jsonrpc": 2.0, + "id": 17, + "method": "org.rdk.XCast.setNetworkStandbyMode", "params": { - "applicationName": "NetflixApp", - "applicationId": "1234" + "networkStandbyMode": true } } ``` + +#### Response + +```json +{ + "jsonrpc": 2.0, + "id": 17, + "result": null +} +``` + + diff --git a/tools/.DS_Store b/tools/.DS_Store new file mode 100644 index 00000000..c8083306 Binary files /dev/null and b/tools/.DS_Store differ diff --git a/tools/md_from_h_generator/.DS_Store b/tools/md_from_h_generator/.DS_Store new file mode 100644 index 00000000..34f00f8d Binary files /dev/null and b/tools/md_from_h_generator/.DS_Store differ diff --git a/tools/md_from_h_generator/README.md b/tools/md_from_h_generator/README.md index d899afb5..92d97475 100644 --- a/tools/md_from_h_generator/README.md +++ b/tools/md_from_h_generator/README.md @@ -9,9 +9,9 @@ This document provides guidelines for using the `md_from_h` documentation tool. The md_from_h tool is currently run automatically on a weekly basis from a Jenkins job. However, to run the tool locally on individual header files, navigate to the top level of the repo, and run: -`python3 ./tools/md_from_h_generator/generate_md_from_header.py ./apis/[header_file_folder]/[header_file]` +`python3 ./tools/md_from_h_generator/generate_md_from_header.py ./apis/[header_file_folder]` -This will create a folder in the current directory named "generated_docs", where "generated_docs" contains the generated markdown file for the header file. +This will create a folder in the current directory named "generated_docs", where "generated_docs" contains the generated markdown file for the header file. The CLI option `--individual` can also be added to generate separte markdowns for individual header files in the folder. --- @@ -42,7 +42,7 @@ virtual uint32_t initialize(); - **Required**: Yes (Mandatory tag for all methods/properties/events) - **Usage**: - Use this tag for a short, one-line description of the method. - - The description following this tag will be shown on the method/property/event table of contents + - The description following this tag will be shown on the method/property/event table of contents ### Example: @@ -98,7 +98,7 @@ virtual uint32_t initialize(); - **Required**: No (Optional tag) - **Usage**: - Use this tag to reference related methods, classes, or external documentation. - - The linked event name should appear exactly as it is declared, without parenthesis + - The linked event name should appear exactly as it is declared, without parenthesis - This tag is optional, but should be used if a corresponding event is defined in INotifications ### Example: @@ -137,31 +137,35 @@ virtual void onInitialize(); - **Usage**: - Use this tag for each parameter of the method. Each parameter and tag must be declared on a new line. - The description following the tag shall be listed in the parameters/results table - - Parameter/symbol examples should be defined here (see [Providing Symbol Examples](#providing_examples)) + - Optional parameters can be specified using `@param [param_name](optional)` + - Parameter/symbol examples should be defined here (see [Providing Symbol Examples](#providing_examples), for providing examples and descriptions for `struct` as well) - Specify the parameter name and its description. Format can include colon i.e. `@param [param_name]: [description]` or `@param [para_name] [description]` - - IMPORTANTLY, in addition to using the param tag, mark each parameter with inline 'in/out' information in the parameter list. If a parameter does not have inline in/out information, it defaults to 'in'. + - IMPORTANTLY, in addition to using the param tag, each parameter that is an output should be marked with an inline '@out' tag in the parameter list. The '@in' tag is optional for input parameters. If a parameter does not have inline in/out information, it defaults to 'in'. + - Additionally a parameter name override can be specified by combining `@in` or `@out` followed by `@text:varible-override-name` in the function declaration. ### Example: ***Header File Example:*** ```cpp -/** +/** ... * @param configPath: The config file path for initialization e.g. "../build/test.conf" * @param status The status of the initialization. Set to true if completed. + * @param configDetails(optional): Details of the configuration */ -virtual uint32_t initialize(const string& configPath /* @in */, bool status /* @out */); +virtual uint32_t initialize(const string& configPath /* @in @text:config-path-override-name */, bool status /* @out @text:status-response */, string& configDetails /* @in */); ``` ***Generated Markdown Example:*** > ### Parameters > | Name | Type | Description | > | :-------- | :-------- | :-------- | -> | config | string | The config file path for initialization | +> | config-path-override-name | string | The config file path for initialization | +> | configDetails | string | (optional) Details of the configuration | > ### Results > | Name | Type | Description | > | :-------- | :-------- | :-------- | -> | status | bool | The status of the initialization. Set to true if completed. | +> | status-response | bool | The status of the initialization. Set to true if completed. | --- @@ -209,13 +213,95 @@ virtual uint32_t internalMethod(); **Example**: ```cpp -/* +/* * @property * @brief Video output port on the STB used for connection to TV * @param name: video output port name */ virtual uint32_t PortName (string& name /* @out */) const = 0; ``` +--- + +### 9. `@plugindescription` +- **Purpose**: Provides option to override the generic plugin description text +- **Required**: No +- **Usage**: + - Use this tag for overriding the generic plugin description. + +**Example**: +```cpp + namespace Exchange + { + /* @json 1.0.0 @text:keep */ + // @plugindescription This plugin provides so and so functionalities + struct EXTERNAL IClassName : virtual public Core::IUnknown + } +``` + +***Generated Markdown Example:*** + +> +> # Description +> +> This plugin provides so and so functionalities +> +> The plugin is designed to be loaded and executed within the Thunder framework. For more information about the framework refer > > to [[Thunder](#ref.Thunder)]. +> +> + +--- + +### 10. `@errors` +- **Purpose**: Describes the errors which this method can return. +- **Required**: No +- **Usage**: + - Use this tag to detail the error code, error message type, and error description + +**Example**: +```cpp + namespace Exchange + { + // @errors 1 ERROR_GENERAL General Error + virtual Core::hresult DefaultResolution(const string& videoDisplay /* @out */) + } +``` + +***Generated Markdown Example:*** +> ### Errors +> | Code | Messafe | Description | +> | :-------- | :-------- | :-------- | +> | 1 | `ERROR_GENERAL` | General error | + +--- + +### 11. `@docs:configuration` +- **Purpose**: Provides option to include the plugin's configuration options +- **Required**: No +- **Usage**: + - Use this to describe a configuration option for the plugin. Include the option's name, type, and description. Do not need to include options for the plugin's callsign, classname, locator, or autostart. + +**Example**: +```cpp + namespace Exchange + { + /* @json 1.0.0 @text:keep */ + // @plugindescription This plugin provides so and so functionalities + // @docs:config configuration string + // @docs:config configuration.loggername string Logger name used by backend + struct EXTERNAL IClassName : virtual public Core::IUnknown + } +``` + +***Generated Markdown Example:*** +> ### Configuration +> | Name | Type | Description | +> | :-------- | :-------- | :-------- | +> | callsign | string | Plugin instance name (default: *org.rdk.Analytics*) | +> | classname | string | Class name: *org.rdk.Analytics* | +> | locator | string | Library name: *libWPEFrameworkAnalytics.so* | +> | autostart | boolean | Determines if the plugin shall be started automatically along with the framework | +> | configuration | object | | +> | configuration.loggername | string | Logger name used by backend | --- @@ -223,7 +309,7 @@ virtual uint32_t PortName (string& name /* @out */) const = 0; -### Providing Symbol Examples +### Providing Symbol Examples In the RDK Services and Entservices APIs, plugins communicate using RPC. To facilitate this, the documentation includes relevant examples of request and response JSON structures. The md_from_h tool automates the creation of these examples by parsing enums, structs, iterators, and basic types declared in the header file, as well as extracting examples from @param Doxygen tags. The tool maintains a global symbol registry to track the names and types of parameters declared in methods, properties, events, enums, and struct members. The goal of the global symbol registry is to make it easier and more consistent to provide examples for symbols which appear multiple times in a header file (such as preferredLanguages in IUserSettings.h). Examples are generated by analyzing the @param tags, where the tool uses a regular expression to extract text following the pattern `e.g. "(.*)"` in the parameter description. The value inside the quotes is then used as the example for that symbol. The pattern `ex: (.*)` is also matched in cases where examples have double-quotes. Additionally, examples can be derived from structs if their members include descriptive comments. @@ -254,13 +340,13 @@ The following demonstrates how examples are set for method parameters: >``` ### Setting Examples for Struct Members -The following demonstrates how examples are set for struct members: +The following demonstrates how examples are set for struct members. Struct members can be commented with single-line comments (`//`) or block-comments (`/*...*/`). ***Header File Example:*** ```cpp -struct USBDevice { - uint8_t deviceClass /* @brief USB class of the device as per USB specification e.g. "10" */ ; - uint8_t deviceSubclass /* @brief USB sub class of the device as per USB specification e.g. "6" */; +struct USBDevice { + uint8_t deviceClass; // @brief USB class of the device as per USB specification e.g. "10" + uint8_t deviceSubclass; // @brief USB sub class of the device as per USB specification e.g. "6" string deviceName /* @brief Name of the USB device e.g. "001/003"*/; string devicePath /* @brief the path to be used for the USB device e.g."/dev/sdX" */; }; diff --git a/tools/md_from_h_generator/generate_md_from_header.py b/tools/md_from_h_generator/generate_md_from_header.py index 14f706e4..6f1f0bf8 100644 --- a/tools/md_from_h_generator/generate_md_from_header.py +++ b/tools/md_from_h_generator/generate_md_from_header.py @@ -23,51 +23,77 @@ import argparse from header_file_parser import HeaderFileParser from logger import Logger -from markdown_templates import generate_header_description_markdown, generate_header_toc, generate_methods_toc, generate_method_markdown, generate_notifications_toc, generate_notification_markdown, generate_properties_toc, generate_property_markdown +from markdown_templates import generate_header_description_markdown, generate_header_toc, generate_methods_toc, generate_method_markdown, generate_notifications_toc, generate_notification_markdown, generate_properties_toc, generate_property_markdown, generate_configuration_options_section -def generate_md_from_header(header_file): +def combine_header_structures(main_structure, additional_structure): + main_structure.methods.update(additional_structure.methods) + main_structure.properties.update(additional_structure.properties) + main_structure.events.update(additional_structure.events) + main_structure.symbols_registry.update(additional_structure.symbols_registry) + main_structure.iterators_registry.update(additional_structure.iterators_registry) + +def generate_md_from_header(plugin_folder_path, individual=False): """ Writes the markdown documentation from the header file. Args: header_file (str): Path to the header file. """ - filename = os.path.basename(header_file) - classname, _ = os.path.splitext(filename) - - # Remove the leading 'I' from the api's class name - output_file_path = './tools/md_from_h_generator/generated_docs/' + classname[1:] + 'Plugin.md' - - log_file_path = './tools/md_from_h_generator/logs/' + classname + '.txt' - logger = Logger(log_file_path) + header_files = [f for f in os.listdir(plugin_folder_path) if f.endswith('.h')] + plugin_name = os.path.basename(plugin_folder_path) - header_structure = HeaderFileParser(header_file, logger) + # if individual flag, then we generate a separate markdown file for each header file in folder + if individual: + for header_file in header_files: + header_file_path = os.path.join(plugin_folder_path, header_file) + classname = os.path.splitext(header_file)[0][1:] + log_file_path = f'./tools/md_from_h_generator/logs/{classname}.txt' + logger = Logger(log_file_path) + header_structure = HeaderFileParser(header_file_path, classname, logger) + generate_md_from_individual_header_file(header_structure, classname, logger) + else: + classname = plugin_name + log_file_path = f'./tools/md_from_h_generator/logs/{classname}.txt' + logger = Logger(log_file_path) + main_header_file_path = os.path.join(plugin_folder_path, header_files[0]) + main_structure = HeaderFileParser(main_header_file_path, classname, logger) + # if folder contains more than one header files, combine their structures + for header_file in header_files[1:]: + header_file_path = os.path.join(plugin_folder_path, header_file) + additional_structure = HeaderFileParser(header_file_path, classname, logger) + combine_header_structures(main_structure, additional_structure) + generate_md_from_individual_header_file(main_structure, classname, logger) +def generate_md_from_individual_header_file(header_structure, classname, logger): + output_file_path = './tools/md_from_h_generator/generated_docs/' + classname + 'Plugin.md' + os.makedirs(os.path.dirname(output_file_path), exist_ok=True) with open(output_file_path, 'w', encoding='utf-8') as file: file.write(generate_header_toc(classname, header_structure)) - file.write(generate_header_description_markdown(classname)) + file.write(generate_header_description_markdown(classname, getattr(header_structure, 'plugindescription', ''))) + file.write(generate_configuration_options_section(header_structure.configuration_options)) if len(header_structure.methods.values()) > 0: file.write(generate_methods_toc(header_structure.methods, classname)) for method_name, method_info in header_structure.methods.items(): file.write(generate_method_markdown( - method_name, method_info, header_structure.symbols_registry)) + method_name, method_info, header_structure.symbols_registry, classname, header_structure.events)) file.write("\n") if len(header_structure.properties.values()) > 0: file.write(generate_properties_toc(header_structure.properties, classname)) for prop_name, prop_info in header_structure.properties.items(): file.write(generate_property_markdown( - prop_name,prop_info, header_structure.symbols_registry)) + prop_name, prop_info, header_structure.symbols_registry, classname)) file.write("\n") if len(header_structure.events.values()) > 0: file.write(generate_notifications_toc(header_structure.events, classname)) for event_name, event_info in header_structure.events.items(): file.write(generate_notification_markdown( - event_name, event_info, header_structure.symbols_registry)) + event_name, event_info, header_structure.symbols_registry, classname)) logger.write_log() logger.close() if __name__ == '__main__': parser = argparse.ArgumentParser(description='Process header file.') - parser.add_argument('header_file', type=str, help='Path to header file') + parser.add_argument('plugin_folder', type=str, help='Path to plugin folder') + parser.add_argument('--individual', action='store_true', help='Specify if output doc should be generated for all headers in folder or if they should be generated individually') args = parser.parse_args() - generate_md_from_header(args.header_file) + generate_md_from_header(args.plugin_folder, args.individual) diff --git a/tools/md_from_h_generator/generated_docs/test.md b/tools/md_from_h_generator/generated_docs/test.md index 9daeafb9..30d74d25 100644 --- a/tools/md_from_h_generator/generated_docs/test.md +++ b/tools/md_from_h_generator/generated_docs/test.md @@ -1 +1 @@ -test +test \ No newline at end of file diff --git a/tools/md_from_h_generator/header_file_parser.py b/tools/md_from_h_generator/header_file_parser.py index 2b1d7c7a..cacabecd 100644 --- a/tools/md_from_h_generator/header_file_parser.py +++ b/tools/md_from_h_generator/header_file_parser.py @@ -31,14 +31,18 @@ class HeaderFileParser: """ # List of regexes to match different components of the header file REGEX_LINE_LIST = [ + ('plugindescription', 'doxygen', re.compile(r'(?:\/\*+|\*|//)\s*@plugindescription\s+(.*?)(?=\s*\*\/|$)')), + ('configuration', 'doxygen', re.compile(r'(?:\/\*+|\*|//)\s*@docs:config\s+([\w\.\?]+)\s+(\w+)\s*(.*?)(?=\s*\*\/|$)')), + ] + [ ('text', 'doxygen', re.compile(r'(?:\/\*+|\*|//) (?:@text|@alt)\s+(.*?)(?=\s*\*\/|$)')), ('brief', 'doxygen', re.compile(r'(?:\/\*+|\*|//) @brief\s*(.*?)(?=\s*\*\/|$)')), ('details', 'doxygen', re.compile(r'(?:\/\*+|\*|//) @details\s*(.*?)(?=\s*\*\/|$)')), - ('params', 'doxygen', re.compile(r'(?:\/\*+|\*|//) @param(?:\[.*\])?\s+(\w+)\s*\:?\s*(.*?)(?=\s*\*\/|$)')), + ('params', 'doxygen', re.compile(r'(?:\/\*+|\*|//)\s*@param(\[.*\])?\s+([^\s:(]+)(?:\(([^)]*)\))?\s*:?\s*(.*?)(?=\s*\*\/|$)')), + ('errors', 'doxygen', re.compile(r'(?:\/\*+|\*|//) @errors\s*(\d+?)\s*(\w+)\s*(.*?)?(?=\s*\*\/|$)')), ('return', 'doxygen', re.compile(r'(?:\/\*+|\*|//) @return(?:s)?\s*(.*?)(?=\s*\*\/|$)')), ('see', 'doxygen', re.compile(r'(?:\/\*+|\*|//) @see\s*(.*?)(?=\s*\*\/|$)')), ('omit', 'doxygen', re.compile(r'(?:\/\*+|\*|//)\s*(@json:omit|@omit)')), - ('property','doxygen', re.compile(r'(?:\/\*+|\*|//) @property\s*(.*)')), + ('property','doxygen', re.compile(r'(?:\/\*+|\*|//) @property\s*(.*)')), ('comment', 'doxygen', re.compile(r'(?:\/\*+|\*|//)\s*(.*)')), ('enum', 'cpp_obj', re.compile(r'enum\s+([\w\d]+)\s*(?:\:\s*([\w\d\:\*]*))?\s*\{?')), ('struct', 'cpp_obj', re.compile(r'struct\s+(EXTERNAL\s+)?([\w\d]+)\s*(?:\{)?(?!.*:)')), @@ -47,15 +51,15 @@ class HeaderFileParser: ] # Basic type examples for generating missing symbol examples BASIC_TYPE_EXAMPLES = { - 'int32_t': '0', - 'uint32_t': '0', - 'int64_t': '0', + 'int32_t': '0', + 'uint32_t': '0', + 'int64_t': '0', 'uint64_t': '0', 'int': '0', - 'float': '0.0', - 'double': '0.0', - 'bool': 'true', - 'char': 'a', + 'float': '0.0', + 'double': '0.0', + 'bool': True, + 'char': 'a', 'string': '' } # List of regexes to match different cpp components of the header file @@ -64,24 +68,25 @@ class HeaderFileParser: 'iter_typedef': re.compile(r'typedef\s+RPC::IIteratorType\s*\<\s*([\w\d\:]+)\s*\,\s*(?:[\w\d\:]+)\s*\>\s*([\w\d]+)\s*;'), 'enum': re.compile(r'enum\s+([\w\d]+)\s*(?:\:\s*([\w\d\:\*]*))?\s*\{(.*)\}\;?'), 'enum_mem': re.compile(r'([\w\d\[\]]+)\s*(?:\=\s*([\w\d]+))?\s*(?:(?:(?:\/\*)|(?:\/\/))(.*)(?:\*\/)?)?'), - 'struct': re.compile(r'struct\s+(?:EXTERNAL\s+)?([\w\d]+)\s*\{(.*)\}\;?'), - 'struct_mem': re.compile(r'([\w\d\:\*]+)\s+([\w\d\[\]]+)\s*(?:(?:(?:\/\*)|(?:\/\/))(.*)(?:\*\/)?)?'), + 'struct': re.compile(r'struct\s+(?:EXTERNAL\s+)?([\w\d]+)\s*\{([\s\S]*?)\}\;?'), + 'struct_mem': re.compile(r'([\w\d\:\*]+)\s+([\w\d\[\]]+)\;?\s*(?:(?:(?:\/\*)|(?:\/\/))(.*)(?:\*\/)?)?'), 'method': re.compile(r'virtual\s+([\w\d\:]+)\s+([\w\d\:]+)\s*\((.*)\)\s*(?:(?:(?:const\s*)?\=\s*0)|(?:{\s*})\s*)\;?'), 'method_param': re.compile(r'([\w\d\:\*]+)\s+([\w\d\[\]]+)\s*(?:\/\*(.*)\*\/)?') } - def __init__(self, header_file_path: str, logger: Logger): + def __init__(self, header_file_path: str, plugin_name: str, logger: Logger, ): """ - Initializes data structures to track different components of a C++ header file, then + Initializes data structures to track different components of a C++ header file, then parses said header file to extract methods, structs, enums, and iterators. - Args: + Args: header_file_path (str): path to the header file logger (Logger): list of regex matching different components of the header file """ # objects to hold the different components and properties of the header file self.header_file_path = header_file_path - self.classname = os.path.splitext(os.path.basename(self.header_file_path))[0] + # All the header files will begin with "I", strip it to get the classname. + self.classname = plugin_name self.methods = {} self.properties = {} self.events = {} @@ -89,6 +94,7 @@ def __init__(self, header_file_path: str, logger: Logger): self.iterators_registry = {} self.enums_registry = {} self.symbols_registry = {} + self.configuration_options = {} self.logger = logger # helper objects for holding doxygen tag information while parsing @@ -127,7 +133,7 @@ def post_process(self): def parse_header_file(self): """ - Parses the header file line-by-line to track and record the file's components, such as + Parses the header file line-by-line to track and record the file's components, such as methods, properties, events, structs, enums, and iterators. Keeps track of these components' associated doxygen tags. """ @@ -186,7 +192,7 @@ def match_line_with_regex(self, line, line_regex_list): return match.groups(), tag, l_type return None, None, None - def process_method(self, line, method_object, within_method_def, method_paren_count, + def process_method(self, line, method_object, within_method_def, method_paren_count, curr_line_num, scope): """ Processes a line within a method definition. @@ -226,7 +232,7 @@ def process_enum(self, line, enum_object, within_enum_def, enum_braces_count, cu enum_object = '' return enum_object, enum_braces_count, within_enum_def - def process_struct(self, line, struct_object, within_struct_def, struct_braces_count, + def process_struct(self, line, struct_object, within_struct_def, struct_braces_count, curr_line_num): """ Processes a line within a struct definition. @@ -236,10 +242,10 @@ def process_struct(self, line, struct_object, within_struct_def, struct_braces_c return line, 0, within_struct_def # accumulate the struct's data members until the closing brace is reached if struct_braces_count > 0: - line = self.clean_and_validate_cpp_obj_line(line, ';', curr_line_num, 'Struct member') - struct_object += line + line = self.clean_and_validate_cpp_obj_line(line, '\n', curr_line_num, 'Struct member') + struct_object += (line + '\n') elif struct_braces_count <= 0: - struct_object += line + struct_object += (line + '\n') self.register_struct(struct_object) # reset the struct helper object once the struct is registered within_struct_def = False @@ -248,32 +254,47 @@ def process_struct(self, line, struct_object, within_struct_def, struct_braces_c def update_doxy_tags(self, groups, line_tag): """ - Updates the doxygen tag object with the given line's information. + Updates the doxygen tag object with the given line's information. + Supports multiline for all tags by accumulating lines until a new tag is found. """ - if line_tag == 'text': - # self.doxy_tags = {} + if line_tag == 'plugindescription': + self.plugindescription = groups[0] + elif line_tag == 'configuration': + self.configuration_options[groups[0]] = {'type': groups[1], 'description': groups[2]} + elif line_tag == 'text': self.doxy_tags['text'] = groups[0] + self.latest_tag = 'text' elif line_tag == 'params': - self.latest_param = groups[0] + self.latest_param = groups[1] self.latest_tag = 'params' - self.doxy_tags.setdefault('params', {})[self.latest_param] = groups[1] + self.doxy_tags.setdefault('params', {})[self.latest_param] = {'description': groups[3], + 'direction': groups[0], + 'optionality': groups[2]} elif line_tag == 'see': self.doxy_tags.setdefault('see', {})[groups[0]] = '' + self.latest_tag = 'see' + elif line_tag == 'errors': + self.doxy_tags.setdefault('errors', {})[groups[1]] = {'code': groups[0], + 'description': groups[2]} + self.latest_tag = 'errors' elif line_tag == 'comment': if groups[0] == '/': return - elif self.latest_tag == 'params': - self.doxy_tags['params'][self.latest_param] += (' ' + groups[0]) - elif self.latest_tag: + # Multiline support: append to last tag + if self.latest_tag == 'params': + self.doxy_tags['params'][self.latest_param]['description'] += (' ' + groups[0]) + elif self.latest_tag and self.latest_tag in self.doxy_tags and self.latest_tag != 'plugindescription': self.doxy_tags[self.latest_tag] += (' ' + groups[0]) line_tag = self.latest_tag else: self.doxy_tags[line_tag] = groups[0] - self.latest_tag = line_tag + self.latest_tag = line_tag + if line_tag != 'plugindescription': + self.latest_tag = line_tag def clean_and_validate_cpp_obj_line(self, line, delimiter, line_num, data_type): """ - Validates a line of a multi-line cpp object by checking that data members are defined on + Validates a line of a multi-line cpp object by checking that data members are defined on separate lines and that comments are formed before the delimiter. """ delim_index = line.find(delimiter) @@ -288,7 +309,7 @@ def clean_and_validate_cpp_obj_line(self, line, delimiter, line_num, data_type): self.logger.log("WARNING", f"Line {line_num + 1} should have only one {data_type} per line.") return line - + def remove_inline_comments(self, line): """ Removes inline comments from a line. @@ -334,7 +355,7 @@ def register_enum(self, enum_object): description = self.clean_description(description) enumerator_value = enumerator_value or len(self.enums_registry[enum_name]) self.enums_registry[enum_name][enumerator_name] = { - 'value': enumerator_value, + 'value': enumerator_value, 'description': description.strip() if description else '' } else: @@ -349,14 +370,15 @@ def register_struct(self, struct_object): struct_name, struct_body = match.groups() self.structs_registry[struct_name] = {} # process each data member - for member_def in struct_body.split(';'): + for member_def in struct_body.split('\n'): member_def = member_def.strip() member_match = self.CPP_COMPONENT_REGEX['struct_mem'].match(member_def) + if member_match: member_type, member_name, description = member_match.groups() description = self.clean_description(description) self.structs_registry[struct_name][member_name] = { - 'type': member_type, + 'type': member_type, 'description': description.strip() if description else '' } # register each data member in the global symbol registry @@ -392,18 +414,19 @@ def register_method(self, method_object, doxy_tags, scope): def build_method_info(self, method_return_type, method_parameters, doxy_tags): """ - Helper to build a method info object. Also registers method parameters in the symbol + Helper to build a method info object. Also registers method parameters in the symbol registry. """ doxy_tag_param_info = doxy_tags.get('params', {}) params, results = self.process_and_register_params(method_parameters, doxy_tag_param_info) method_info = { - 'text': doxy_tags.get('text', ''), - 'brief': doxy_tags.get('brief', ''), + 'text': doxy_tags.get('text', ''), + 'brief': doxy_tags.get('brief', ''), 'details': doxy_tags.get('details', ''), 'events': doxy_tags.get('see', {}), 'params': params, 'results': results, + 'errors': doxy_tags.get('errors', {}), 'return_type': method_return_type } if 'property' in doxy_tags: @@ -415,31 +438,71 @@ def build_method_info(self, method_return_type, method_parameters, doxy_tags): def process_and_register_params(self, method_parameters, doxy_tag_param_info): """ - Helper to build params and results data structures, using the parameter declaration list + Helper to build params and results data structures, using the parameter declaration list and doxygen tags. """ + def normalize_key(key): + return key.replace('_', '-').lower().strip() + + # Build a normalized lookup for param descriptions + normalized_param_info = {normalize_key(k): v for k, v in doxy_tag_param_info.items()} + + # DEBUG: Print the doxygen param info and normalized lookup + self.logger.log("INFO", f"doxy_tag_param_info: {doxy_tag_param_info}") + self.logger.log("INFO", f"normalized_param_info: {normalized_param_info}") + param_list_info = self.get_info_from_param_declaration(method_parameters) + self.logger.log("INFO", f"param_list_info: {param_list_info}") params = [] results = [] - # build the params and results lists using the parameter delcaration list and doxygen tags - for symbol_name, (symbol_type, symbol_inline_comment) in param_list_info.items(): - # register string iterators here b/c they are seldom defined outside of a method param + for symbol_name, (symbol_type, symbol_inline_comment, custom_name, direction) in param_list_info.items(): + self.logger.log("INFO", f"Processing param: symbol_name={symbol_name}, symbol_type={symbol_type}, custom_name={custom_name}, direction={direction}, symbol_inline_comment={symbol_inline_comment}") if symbol_type == 'RPC::IStringIterator': self.register_iterator(symbol_type) - symbol_description = doxy_tag_param_info.get(symbol_name, '') + symbol_description = doxy_tag_param_info.get(symbol_name, {}).get('description', '') + symbol_optionality = doxy_tag_param_info.get(symbol_name, {}).get('optionality', '') + symbol_direction = doxy_tag_param_info.get(symbol_name, {}).get('direction', '') + custom_description = None + if symbol_inline_comment: + text_match = re.search(r'@text\s*:?\s*([\w\-]+)', symbol_inline_comment) + if text_match: + override_name = text_match.group(1) + custom_name = override_name + norm_override = normalize_key(override_name) + self.logger.log("INFO", f"Found @text override: override_name={override_name}, norm_override={norm_override}") + # Prefer description from normalized doxygen @param for override name + if norm_override in normalized_param_info: + custom_description = normalized_param_info[norm_override].get('description', '') + self.logger.log("INFO", f"Found custom_description for override: {custom_description}") + else: + self.logger.log("INFO", f"Override param name '{override_name}' not found in @param tags for method param '{symbol_name}'.") + self.logger.log("WARNING", f"Override param name '{override_name}' not found in @param tags for method param '{symbol_name}'.") + # Fallback to original param name if not found + if not custom_description and normalize_key(symbol_name) in normalized_param_info: + custom_description = normalized_param_info[normalize_key(symbol_name)].get('description', '') + self.logger.log("INFO", f"Fallback to original param name: {custom_description}") + if not custom_description and normalize_key(symbol_name) in normalized_param_info: + custom_description = normalized_param_info[normalize_key(symbol_name)].get('description', '') + self.logger.log("INFO", f"No override, using original param name: {custom_description}") + if custom_description: + custom_description = re.sub(r'e\.g\.\s*\".*?(? (key is override name if present) + 3. If multiple @out, result: { key: , ... } (keys are override names if present) """ response = { "jsonrpc": "2.0", - "id": 42, - "result": "null" + "id": id_num, + "result": None } - if method_info['results'] != []: - response['result'] = {} - for result in method_info['results']: - result_name = result.get('name') - result_type = result.get('type') - result_desc = result.get('description') - response['result'][result_name] = self.get_symbol_example( - f"{result_name}-{result_type}", result_desc) + # Only consider @out results + out_results = [r for r in method_info['results'] if r.get('direction') == 'out'] + if not out_results: + response['result'] = None + elif len(out_results) == 1: + r = out_results[0] + result_name = r.get('custom_name') or r['name'] + unique_id = f"{r['name']}-{r['type']}" + response['result'] = self.get_symbol_example(unique_id, r.get('custom_description') or r.get('description')) + else: + result_obj = {} + for r in out_results: + result_name = r.get('custom_name') or r['name'] + unique_id = f"{r['name']}-{r['type']}" + result_obj[result_name] = self.get_symbol_example(unique_id, r.get('custom_description') or r.get('description')) + response['result'] = result_obj return response def get_symbol_example(self, unique_id, description): """ - Used in generating request/response JSONs. Pulls an example from either the @param tag + Used in generating request/response JSONs. Pulls an example from either the @param tag description or the symbols registry. """ example_from_description = self.generate_example_from_description(description) @@ -621,7 +722,7 @@ def generate_example_from_symbol_type(self, symbol_type): def wrap_example_if_iterator(self, unique_id, example): """ - Wrap the example in a list if the symbol is an iterator, otherwise simply return the + Wrap the example in a list if the symbol is an iterator, otherwise simply return the example. """ if self.symbols_registry[unique_id]['type'] in self.iterators_registry: @@ -639,7 +740,7 @@ def link_method_to_event(self): self.methods[method_name]['events'][event] = self.events[event].get('brief') self.events[event]['associated_method'] = method_name else: - self.logger.log("ERROR", + self.logger.log("ERROR", f"Event {event} tagged with {method_name} does not exist.") def log_unassociated_events(self): @@ -687,11 +788,11 @@ def fill_and_log_missing_symbol_descriptions(self): result['description'] = self.symbols_registry[f"{result['name']}-{result['type']}"].get('description', '') self.logger.log("INFO", f"Filled missing desc for {result['name']} in property {prop_name}") - + def log_missing_method_info(self): """ - At the end of parsing, if there is still information missing for methods, events, and - symbols, log it. + At the end of parsing, if there is still information missing for methods, events, and + symbols, log it. """ for method_name, method_info in self.methods.items(): if not method_info.get('brief') and not method_info.get('details'): @@ -785,6 +886,38 @@ def clean_description(self, description): """ if description: description = description.strip() - description = re.sub(r'^@\S+', '', description) + description = re.sub(r'@\S+', '', description) + description = description[:-1] if description.endswith(';') else description description = description[:-2] if description.endswith("*/") else description + description = re.sub(r'\*/', ' ', description) + description = re.sub(r'/\*', ' ', description) return description + + def build_canonical_dict(self, param_or_result_list): + """ + Build a canonical dict for a list of params or results, applying all override names and descriptions. + Returns a dict: { field_name: { 'type': ..., 'description': ... } } + """ + result = {} + for item in param_or_result_list: + name = item.get('custom_name') or item['name'] + description = item.get('custom_description') or item.get('description', '') + result[name] = { + 'type': item['type'], + 'description': description + } + return result + + def build_all_canonical_dicts(self): + """ + For all methods, build canonical request/response dicts with overrides applied. + """ + for method_name, method_info in self.methods.items(): + method_info['canonical_params'] = self.build_canonical_dict(method_info['params']) + method_info['canonical_results'] = self.build_canonical_dict(method_info['results']) + for event_name, event_info in self.events.items(): + event_info['canonical_params'] = self.build_canonical_dict(event_info['params']) + event_info['canonical_results'] = self.build_canonical_dict(event_info['results']) + for prop_name, prop_info in self.properties.items(): + prop_info['canonical_params'] = self.build_canonical_dict(prop_info['params']) + prop_info['canonical_results'] = self.build_canonical_dict(prop_info['results']) diff --git a/tools/md_from_h_generator/logger.py b/tools/md_from_h_generator/logger.py index 2d715f4c..5b51def2 100644 --- a/tools/md_from_h_generator/logger.py +++ b/tools/md_from_h_generator/logger.py @@ -19,6 +19,9 @@ # logger.py +import os + + class Logger: """ A simple logger class to log messages to a file. @@ -31,6 +34,7 @@ def __init__(self, log_file_path): Args: log_file_path (str): Path to the log file. """ + os.makedirs(os.path.dirname(log_file_path), exist_ok=True) self.log_file_path = log_file_path self.log_file = open(log_file_path, 'w', encoding='utf-8') self.warning_msgs = [] diff --git a/tools/md_from_h_generator/markdown_templates.py b/tools/md_from_h_generator/markdown_templates.py index 8bd56e60..cdcd7249 100644 --- a/tools/md_from_h_generator/markdown_templates.py +++ b/tools/md_from_h_generator/markdown_templates.py @@ -56,7 +56,7 @@ | Name | Type | Description | | :-------- | :-------- | :-------- | -| callsign | string | Plugin instance name (default: *{classname}*) | +| callsign | string | Plugin instance name (default: org.rdk.{classname}) | | classname | string | Class name: *{classname}* | | locator | string | Library name: *libWPEFramework{classname}.so* | | autostart | boolean | Determines if the plugin shall be started automatically along with the framework | @@ -111,7 +111,7 @@ {classname} interface events: -| Method | Description | +| Event | Description | | :-------- | :-------- | """ @@ -129,6 +129,7 @@ ```json {request_json} +``` """ EXAMPLE_RESPONSE_TEMPLATE = """ @@ -137,8 +138,19 @@ ```json {response_json} +``` +""" + +EXAMPLE_NOTIFICATION_TEMPLATE = """ +```json +{request_json} +``` """ +def to_camel_case(name): + """Convert UpperCamelCase to lowerCamelCase.""" + return name[0].lower() + name[1:] if name and name[0].isupper() else name + def generate_header_toc(classname, document_object, version="1.0.0"): """ Generate the header table of contents for the markdown file. @@ -152,11 +164,30 @@ def generate_header_toc(classname, document_object, version="1.0.0"): toc += "- [Notifications](#head.Notifications)\n" return toc -def generate_header_description_markdown(classname): +def generate_header_description_markdown(classname, plugindescription=None): """ Generate the header description markdown for the file. """ - return HEADER_DESCRIPTION_TEMPLATE.format(classname=classname) + description_line = ( + plugindescription.strip() if plugindescription else f'The `{classname}` plugin provides an interface for {classname}.' + ) + return HEADER_DESCRIPTION_TEMPLATE.replace( + 'The `{classname}` plugin provides an interface for {classname}.', + description_line + ).format(classname=classname) + +def generate_configuration_options_section(configuration_options): + """ + Generate the configuration options section for the markdown file. + """ + markdown = '' + if configuration_options: + # markdown += "| Name | Type | Description |\n| :-------- | :-------- | :-------- |\n" + for option_name, option_type_and_desc in configuration_options.items(): + option_type = option_type_and_desc['type'] + option_desc = option_type_and_desc['description'] + markdown += f"| {option_name} | {option_type} | {option_desc} |\n" + return markdown def generate_methods_toc(methods, classname): """ @@ -165,47 +196,64 @@ def generate_methods_toc(methods, classname): toc = METHODS_TOC_TEMPLATE.format(classname=classname) for method in methods: method_body = methods[method] - toc += f"| [{method}](#method.{method}) | {method_body['brief'] or method_body['details']} |\n" + camel_method = to_camel_case(method) + toc += f"| [{camel_method}](#method.{camel_method}) | {method_body['brief'] or method_body['details']} |\n" return toc -def generate_method_markdown(method_name, method_info, symbol_registry): +def flatten_canonical_dict(canonical_dict, parent_prefix): """ - Generate the markdown for a specific method. + Flatten a canonical dict for table output. Returns a list of (name, type, description) tuples. """ - markdown = METHOD_MARKDOWN_TEMPLATE.format(method_name=method_name, method_description=method_info['brief'] or method_info['details']) - markdown += generate_events_section(method_info['events']) - markdown += generate_parameters_section(method_info['params'], symbol_registry) - markdown += generate_results_section(method_info['results'], symbol_registry) - markdown += "\n### Examples\n" - markdown += generate_request_section(method_info['request'], '') - markdown += generate_response_section(method_info['response'], '') + rows = [] + for name, info in canonical_dict.items(): + # Only add if description is not empty, else fallback to type if both are empty + desc = info['description'] if info['description'] else '' + rows.append((f"{parent_prefix}.{name}", info['type'], desc)) + return rows + +def generate_request_section(request, method_type, classname=None): + """ + Generate the request section for a method. + """ + if classname and isinstance(request, dict) and 'method' in request: + parts = request['method'].split('.') + if len(parts) > 2: + parts[2] = classname + request['method'] = '.'.join(parts) + # Set the id + if isinstance(request, dict): + request = dict(request) # shallow copy + request_json = json.dumps(_convert_json_types(request), indent=4) + markdown = EXAMPLE_REQUEST_TEMPLATE.format(request_json=request_json, method_type=method_type) return markdown -def generate_events_section(events): +def generate_response_section(response, method_type, classname=None): """ - Generate the events section for a method. + Generate the response section for a method. """ - markdown = "### Events\n" - if events: - markdown += """| Event | Description |\n| :-------- | :-------- |\n""" - for event in events: - markdown += f"| [{event}](#event.{event}) | {events[event]} |\n" - else: - markdown += "No events are associated with this method.\n" + if isinstance(response, dict): + response = dict(response) + response_json = json.dumps(_convert_json_types(response), indent=4) + markdown = EXAMPLE_RESPONSE_TEMPLATE.format(response_json=response_json, method_type=method_type) return markdown def generate_parameters_section(params, symbol_registry): """ - Generate the parameters section for a method. + Generate the parameters section for a method, showing the parent object and all fields for all params, using override names and descriptions if present. """ markdown = "### Parameters\n" if params: - markdown += """| Name | Type | Description |\n| :-------- | :-------- | :-------- |\n""" + markdown += "| Name | Type | Description |\n| :-------- | :-------- | :-------- |\n" + markdown += f"| params | object | |\n" for param in params: - flattened_params = symbol_registry[f"{param['name']}-{param['type']}"]['flattened_description'] + param_key = f"{param['name']}-{param['type']}" + flattened_params = symbol_registry[param_key]['flattened_description'] for param_name, param_data in flattened_params.items(): cleaned_description = re.sub(r'e\.g\.\s*\".*?(?({param['optionality']})" if param['optionality'] == 'optional' else '' + markdown += f"| params{'?' if optionality else ''}{param_name} | {param_data['type']} | {optionality}{cleaned_description if cleaned_description else ''} |\n" else: markdown += "This method takes no parameters.\n" return markdown @@ -217,31 +265,83 @@ def generate_results_section(results, symbol_registry): markdown = "### Results\n" if results: markdown += """| Name | Type | Description |\n| :-------- | :-------- | :-------- |\n""" + # markdown += f"| result | object | |\n" for result in results: flattened_results = symbol_registry[f"{result['name']}-{result['type']}"]['flattened_description'] for result_name, result_data in flattened_results.items(): cleaned_description = re.sub(r'e\.g\.\s*\".*?(?({result['optionality']})" if result['optionality'] == 'optional' else '' + markdown += f"| result{'?' if optionality else ''}{result_name} | {result_data['type']} | {optionality}{cleaned_description if cleaned_description else ''} |\n" else: markdown += "This method returns no results.\n" return markdown -def generate_request_section(request, method_type): +def generate_errors_section(errors): """ - Generate the request section for a method. + Generate the errors section for a method. """ - request_json = json.dumps(request, indent=4) - markdown = EXAMPLE_REQUEST_TEMPLATE.format(request_json=request_json, method_type=method_type) - markdown += "```" + markdown = '' + if errors: + markdown = "### Errors\n" + markdown += """| Code | Message | Description |\n| :-------- | :-------- | :-------- |\n""" + for error_name, error_code_and_desc in errors.items(): + markdown += f"| {error_code_and_desc['code']} | {error_name} | {error_code_and_desc['description'] if error_code_and_desc['description'] else ''} |\n" + return markdown + +def generate_parameters_section_from_canonical(canonical_params): + markdown = "### Parameters\n" + if canonical_params: + markdown += "| Name | Type | Description |\n| :-------- | :-------- | :-------- |\n" + markdown += f"| params | object | |\n" + for name, type_, desc in flatten_canonical_dict(canonical_params, 'params'): + # If desc is empty, show a placeholder + markdown += f"| {name} | {type_} | {desc if desc else '-'} |\n" + else: + markdown += "This method takes no parameters.\n" return markdown -def generate_response_section(response, method_type): +def generate_results_section_from_canonical(canonical_results): + markdown = "### Results\n" + if canonical_results: + markdown += "| Name | Type | Description |\n| :-------- | :-------- | :-------- |\n" + markdown += f"| result | object | |\n" + for name, type_, desc in flatten_canonical_dict(canonical_results, 'result'): + markdown += f"| {name} | {type_} | {desc if desc else '-'} |\n" + else: + markdown += "This method returns no results.\n" + return markdown + +def generate_method_markdown(method_name, method_info, symbol_registry, classname, all_events=None): """ - Generate the response section for a method. + Generate the markdown for a specific method. """ - response_json = json.dumps(response, indent=4) - markdown = EXAMPLE_RESPONSE_TEMPLATE.format(response_json=response_json, method_type=method_type) - markdown += "```" + camel_method = to_camel_case(method_name) + markdown = METHOD_MARKDOWN_TEMPLATE.format(method_name=camel_method, method_description=method_info['brief'] or method_info['details']) + markdown += generate_events_section(method_info['events'], all_events) + # Use canonical dicts for tables + markdown += generate_parameters_section(method_info['params'], symbol_registry) + markdown += generate_results_section(method_info['results'], symbol_registry) + markdown += generate_errors_section(method_info['errors']) + markdown += "\n### Examples\n" + markdown += generate_request_section(method_info['request'], '', classname) + markdown += generate_response_section(method_info['response'], '', classname) + return markdown + +def generate_events_section(events, all_events=None): + """ + Generate the events section for a method. + all_events: dict of all event definitions (from document_object.events) + """ + markdown = "### Events\n" + if events: + # Only show a list of links to events, not a table + for event in events: + camel_event = to_camel_case(event) + markdown += f"- [{camel_event}](#event.{camel_event})\n" + else: + markdown += "No events are associated with this method.\n" return markdown def generate_properties_toc(properties, classname): @@ -259,7 +359,7 @@ def generate_properties_toc(properties, classname): toc += f"| [{prop}](#property.{prop}){super_script} | {property_body['brief'] or property_body['details']} |\n" return toc -def generate_property_markdown(property_name, property_info, symbol_registry): +def generate_property_markdown(property_name, property_info, symbol_registry, classname): """ Generate the markdown for a specific property. """ @@ -272,11 +372,11 @@ def generate_property_markdown(property_name, property_info, symbol_registry): markdown += generate_values_section((property_info['results'] + property_info['params']), symbol_registry) markdown += "\n### Examples\n" if 'read' in property_info['property']: - markdown += generate_request_section(property_info['get_request'], 'Get ') - markdown += generate_response_section(property_info['get_response'], 'Get ') + markdown += generate_request_section(property_info['get_request'], 'Get ', classname) + markdown += generate_response_section(property_info['get_response'], 'Get ', classname) if 'write' in property_info['property']: - markdown += generate_request_section(property_info['set_request'], 'Set ') - markdown += generate_response_section(property_info['set_response'], 'Set ') + markdown += generate_request_section(property_info['set_request'], 'Set ', classname) + markdown += generate_response_section(property_info['set_response'], 'Set ', classname) return markdown def generate_values_section(values, symbol_registry): @@ -299,18 +399,51 @@ def generate_notifications_toc(events, classname): """ Generate the notifications table of contents for the markdown file. """ - toc = EVENTS_TOC_TEMPLATE.format(classname=classname) + toc = EVENTS_TOC_TEMPLATE.replace('| Method |', '| Event |').format(classname=classname) for event in events: event_body = events[event] - toc += f"| [{event}](#event.{event}) | {event_body['brief'] or event_body['details']} |\n" + camel_event = to_camel_case(event) + toc += f"| [{camel_event}](#event.{camel_event}) | {event_body['brief'] or event_body['details']} |\n" return toc -def generate_notification_markdown(event_name, event_info, symbol_registry): +def generate_notification_markdown(event_name, event_info, symbol_registry, classname): """ Generate the markdown for a specific event. """ - markdown = EVENT_MARKDOWN_TEMPLATE.format(event_name=event_name, event_description=event_info['brief'] or event_info['details']) + camel_event = to_camel_case(event_name) + markdown = EVENT_MARKDOWN_TEMPLATE.format(event_name=camel_event, event_description=event_info['brief'] or event_info['details']) markdown += generate_parameters_section(event_info['params'], symbol_registry) markdown += "\n### Examples\n" - markdown += generate_request_section(event_info['request'], '') + request = event_info['request'] + if classname and isinstance(request, dict) and 'method' in request: + parts = request['method'].split('.') + if len(parts) > 2: + parts[2] = classname + request['method'] = '.'.join(parts) + if isinstance(request, dict): + request = dict(request) + request_json = json.dumps(_convert_json_types(request), indent=4) + markdown += EXAMPLE_NOTIFICATION_TEMPLATE.format(request_json=request_json) return markdown + +def _convert_json_types(obj): + """ + Recursively convert string numbers and 'true'/'false' strings to int/float/bool in a dict or list. + """ + if isinstance(obj, dict): + return {k: _convert_json_types(v) for k, v in obj.items()} + elif isinstance(obj, list): + return [_convert_json_types(i) for i in obj] + elif isinstance(obj, str): + if obj.lower() == 'true': + return True + if obj.lower() == 'false': + return False + try: + if '.' in obj: + return float(obj) + return int(obj) + except ValueError: + return obj + else: + return obj