diff --git a/docs/_sidebar.md b/docs/_sidebar.md index 0cf206a1..b3399c4d 100755 --- a/docs/_sidebar.md +++ b/docs/_sidebar.md @@ -6,6 +6,7 @@ - [AVInput](apis/AVInputPlugin.md) - [Bluetooth](apis/BluetoothPlugin.md) - [DeviceDiagnostics](apis/DeviceDiagnosticsPlugin.md) + - [DeviceIdentification](apis/DeviceIdentificationPlugin.md) - [DeviceInfo](apis/DeviceInfoPlugin.md) - [DisplayInfo](apis/DisplayInfoPlugin.md) - [DisplaySettings](apis/DisplaySettingsPlugin.md) @@ -16,13 +17,16 @@ - [HdcpProfile](apis/HdcpProfilePlugin.md) - [HdmiCecSink](apis/HdmiCecSinkPlugin.md) - [HdmiCecSource](apis/HdmiCecSourcePlugin.md) + - [HomeKitTV](apis/HomeKitTVPlugin.md) - [LEDControl](apis/LEDControlPlugin.md) - [LinearPlaybackControl](apis/LinearPlaybackControlPlugin.md) - [MaintenanceManager](apis/MaintenanceManagerPlugin.md) + - [MessageControl](apis/MessageControlPlugin.md) - [MiracastPlayer](apis/MiracastPlayerPlugin.md) - [MiracastService](apis/MiracastServicePlugin.md) - [Monitor](apis/MonitorPlugin.md) - [MotionDetection](apis/MotionDetectionPlugin.md) + - [Netflix](apis/NetflixPlugin.md) - [OCIContainer](apis/OCIContainerPlugin.md) - [OpenCDMi](apis/OpenCDMiPlugin.md) - [Packager](apis/PackagerPlugin.md) diff --git a/docs/apis/DeviceIdentificationPlugin.md b/docs/apis/DeviceIdentificationPlugin.md new file mode 100644 index 00000000..e9a652eb --- /dev/null +++ b/docs/apis/DeviceIdentificationPlugin.md @@ -0,0 +1,98 @@ + + +# DeviceIdentification Plugin + +**Version: [1.0.6](https://github.com/rdkcentral/rdkservices/blob/main/DeviceIdentification/CHANGELOG.md)** + +A DeviceIdentification plugin for Thunder framework. + +### Table of Contents + +- [Abbreviation, Acronyms and Terms](#Abbreviation,_Acronyms_and_Terms) +- [Description](#Description) +- [Configuration](#Configuration) +- [Properties](#Properties) + + +# Abbreviation, Acronyms and Terms + +[[Refer to this link](userguide/aat.md)] + + +# Description + +The `DeviceIdentification` plugin allows you to retrieve various device-related information. + +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: *DeviceIdentification*) | +| classname | string | Class name: *DeviceIdentification* | +| locator | string | Library name: *libWPEFrameworkDeviceIdentification.so* | +| autostart | boolean | Determines if the plugin shall be started automatically along with the framework | + + +# Properties + +The following properties are provided by the DeviceIdentification plugin: + +DeviceIdentification interface properties: + +| Property | Description | +| :-------- | :-------- | +| [deviceidentification](#deviceidentification) RO | Device platform specific information | + + + +## *deviceidentification* + +Provides access to the device platform specific information. + +> This property is **read-only**. + +### Events + +No Events + +### Value + +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| (property) | object | Device platform specific information | +| (property).firmwareversion | string | Version of the device firmware | +| (property).chipset | string | Chipset used for this device | +| (property)?.identifier | string | *(optional)* Device unique identifier | + +### Example + +#### Get Request + +```json +{ + "jsonrpc": "2.0", + "id": 42, + "method": "DeviceIdentification.deviceidentification" +} +``` + +#### Get Response + +```json +{ + "jsonrpc": "2.0", + "id": 42, + "result": { + "firmwareversion": "1.0.0", + "chipset": "BCM2711", + "identifier": "WPEuCfrLF45" + } +} +``` + + diff --git a/docs/apis/HomeKitTVPlugin.md b/docs/apis/HomeKitTVPlugin.md new file mode 100644 index 00000000..1c6eff0e --- /dev/null +++ b/docs/apis/HomeKitTVPlugin.md @@ -0,0 +1,367 @@ + + +# HomeKitTV Plugin + +A HomeKitTV 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 + +[[Refer to this link](overview/aat.md)] + + +# Description + +The HomeKitTV plugin starts the Daemon backend service and provides Thunder Interface APIs/Properties/Events to manage the AirPlay Application life cycle. + +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 | 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: + +| Method | Description | +| :-------- | :-------- | +| [requestAppLaunch](#requestAppLaunch) | The distributor application (example, Immersive UI) running in the HomeKit Television accessory devices (such as TVs, Streaming Boxes and Streaming Sticks) SHALL use this API to request HomeKit to prepare for the launch of AirPlay Application | +| [setCurrentInputSource](#setCurrentInputSource) | The distributor application (example, Immersive UI) running in the HomeKit Television accessory devices (such as TVs, Streaming Boxes and Streaming Sticks) SHALL use this API to inform HomeKit about the change in the currently selected Input Source. | + + +## *requestAppLaunch* + +Launches the AirPlay Application and displays application UI when Airplay icon selected from Settings and/or Input source. + +### Events + +No Events + +### Parameters + +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | An empty parameter object | +| param.origin | string | The origin of the launch request. One of the following string SHALL be used: "EPG" | +| params.reason | string | Sets the reason to launch AirPlay Application:"HomeScreenButton" or "InputSourceSelected" | + +### Result + +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result | boolean | success: true/false | + +### Example + +#### Request + +```json +{ + "jsonrpc": "2.0", + "id": 42, + "method": "HomeKitTV.requestapplaunch", + "params": {"origin": "EPG" ,"reason":"HomeScreenButton"} +} +``` +#### Curl command Form + +curl -H "Authorization: Bearer `WPEFrameworkSecurityUtility | cut -d '"' -f 4`" --header "Content-Type: application/json" --request POST --data '{"jsonrpc":"2.0","id":"3","method": "HomeKitTV.1.requestapplaunch", "params": {"origin": "EPG" ,"reason":"HomeScreenButton"}}' http://127.0.0.1:9998/jsonrpc + +#### Response + +```json +{ + "jsonrpc": "2.0", + "id": 42, + "result": { + "success": true + } +} +``` + + +## *setCurrentInputSource* + +Request Airplay-Daemon to set the current Input-Source + +### Events + +No Events + +### Parameters + +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | An empty parameter object | +| params.sourceName | string | Selected Input-Source using IR Remote "HDMI1" ,"AirPlay" | + +### Result + +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result | boolean | success: true/false | + +### Example + +#### Request + +```json +{ + "jsonrpc": "2.0", + "id": 42, + "method": "HomeKitTV.setcurrentInputsource", + "params": {"sourceName":"AirPlay"} +} +``` + +#### Curl command Form + +curl --header "Content-Type: application/json" -H "Authorization: Bearer `WPEFrameworkSecurityUtility | cut -d '"' -f 4`" --request POST --data '{"jsonrpc": "2.0","id": 4,"method":"HomeKitTV.1.setcurrentinputsource","params": {"sourceName": "AirPlay"}}' http://127.0.0.1:9998/jsonrpc + +#### Response + +```json +{ + "jsonrpc": "2.0", + "id": 42, + "result": 1 +} +``` + + +# Properties + +The following properties are provided by the HomeKitTV plugin: + +HomeKitTV interface properties: +| Property | Description | +| :-------- | :-------- | +| [getConnectionStatus](#getConnectionStatus) | Set/Get property to Returns whether the AirPlay capable Apple companion device is paired (true) or unpaired (false) with this HomeKit Television Accessory device. | +| [getEnabledStatus](#getEnabledStatus) | Returns whether the AirPlay capable Apple companion device is paired (true) or unpaired (false) with this HomeKit Television Accessory device | + + +## *getConnectionStatus* + +Set/Get property to Returns whether the AirPlay capable Apple companion device is paired (true) or unpaired (false) with this HomeKit Television Accessory device. + +### Events + +No Events + +### Parameters + +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| (Property) | object | An empty parameter object | +| (property).getConnectionStatus | Boolean | AirPlay paired status On(true)/Off(false) | + +### Example + +#### Request + +```json +{ + "jsonrpc": "2.0", + "id": 42, + "method": "HomeKitTV.getconnectionstatus" +} +``` + +#### Curl command Form + +curl -H "Authorization: Bearer `WPEFrameworkSecurityUtility | cut -d '"' -f 4`" --header "Content-Type: application/json" --request POST --data '{"jsonrpc":"2.0","id":"3","method": "HomeKitTV.1.getconnectionstatus"}' http://127.0.0.1:9998/jsonrpc + +#### Response + +```json +{ + "jsonrpc": "2.0", + "id": 42, + "result": null +} +``` + + +## *getEnabledStatus* + +Get AirPlay Setting On/Off value. +Default value set by Daemon is On. + +### Events + +No Events + +### Parameters + +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| (Property) | object | An empty parameter object | +| (property).getenabledstatus | Boolean | AirPlay option in AirPlay Settings set as On(true)/Off(false) | + +### Example + +#### Request + +```json +{ + "jsonrpc": "2.0", + "id": 42, + "method": "HomeKitTV.getenabledstatus" +} +``` + +#### Curl command Form + +curl -H "Authorization: Bearer `WPEFrameworkSecurityUtility | cut -d '"' -f 4`" --header "Content-Type: application/json" --request POST --data '{"jsonrpc":"2.0","id":"3","method": "HomeKitTV.1.getenabledstatus"}' http://127.0.0.1:9998/jsonrpc + +#### Response + +```json +{ + "jsonrpc": "2.0", + "id": 42, + "result": + {"success": + true, + "enabled":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 the events generated by AirPlay Daemon to manage AirPlay Application states: + +| Event | Description | +| :-------- | :-------- | +| [onAppStateChangeRequest](#onAppStateChangeRequest) | Raised when HomeKit TV wants the distributor application to switch the state of the AirPlay Application running in the device. | +| [onEnabledStatusChanged](#onEnabledStatusChanged) | AirPlay Daemon raises this event when user changes the AirPlay On/Off from AirPlay Settings | +| [onConnectionStatusChanged](#onConnectionStatusChanged) | AirPlay Daemon raises this event in below cases:Pairing status - When Pairing status changes from pair to unpair or vice-a-versa from Homekit | +| [OninputSourceChanged](#OninputSourceChanged) | AirPlay Daemon raises this event when input source changes via Home Application in Sender's Apple devices (iPhone/iPad/iPod)o | + + +## *onAppStateChangeRequest* + +Raised when HomeKit TV wants the distributor application to switch the state of the AirPlay Application running in the device. + +### Parameters + +| Name | Type | Description | M/O | +| :-------- | :-------- | :-------- | :-------- | +| params | object | | | +| params.origin | string | the state of Airplay application requested. "AppStart, AppSuspend, AppResume, AppStop" | | +| params.intent | object | Input Parameters to be passed to RDKShell APIs. | | +| params.intent.action | String | One of the following string:For "starting" or "resuming" the app: section For "suspending" the app: close For "stopping" the app: destroy | | +| params.intent.data | object | App State Change Intent "Data Object" associated with the requested action. Applicable only for the "section" action. | Mandatory for intent action "section" Don't care for other actions. | +| params.intent.data.sectionName | boolean | String representing launch parameters that needs to be passed to the AirPlay Application in case of "section" action. | Mandatory for intent action "section" Don't care for other actions. | +| params.intent.context | Object | App State Change Intent "Context Object" associated with the requested action. Applicable only for the "section" action. | Mandatory for intent action "section" Don't care for other actions. | +| params.intent.context.source | String | String representing the reason for triggering the "section" action from the given origin. Value of the String SHALL be one of the following: HomeScreenButton, InputSourceSelected | Mandatory for intent action "section"Don't care for other actions | + +### Example + +#### Start or Resume AirPlay App: +```json +{ + "jsonrpc":"2.0", + "id":"3", + "method": "org.rdk.HomeKitTV.onAppStateChangeRequest", + "params": {"origin":"AirPlay", + "intent":{"action":"section", + "data":{"sectionName":"uejhfeufeuifbuefbiejfief"}, + "context":{"source":"HomeScreenButton"} + } + } +} +``` + +#### Suspend AirPlay App +```json +{ + "jsonrpc":"2.0", + "id":"3", + "method": "org.rdk.HomeKitTV.onAppStateChangeRequest", + "params": {"origin":"AirPlay", "intent":{"action":"close"} + } +} +``` + +#### Stop AirPlay App: +```json +{ + "jsonrpc":"2.0", + "id":"3", + "method": "org.rdk.HomeKitTV.onAppStateChangeRequest", + "params": {"origin":"AirPlay", "intent":{"action":"destroy"} + } +} +``` + + +## *onEnabledStatusChanged* + +AirPlay Daemon raises this event when user changes the AirPlay On/Off from AirPlay Settings + +### Parameters + +| Name | Type | Description | M/O | +| :-------- | :-------- | :-------- | :-------- | +| params | object | Notification / Event Object | Mandatory | +| params.enabled | Boolean | true if Airplay Status is enabled or false if disabled | Mandatory | + + +## *onConnectionStatusChanged* + +AirPlay Daemon raises this event in below cases: +Pairing status - When Pairing status changes from pair to unpair or vice-a-versa from Homekit + +### Parameters + +| Name | Type | Description | M/O | +| :-------- | :-------- | :-------- | :-------- | +| params | object | Notification / Event Object | Mandatory | +| params.enabled | Boolean | true if Airplay Status is enabled or false if disabled | Mandatory | + + +## *onInputSourceChanged* + +Raised when input source is changed via Home Application running in Apple devices. + +### Parameters + +| Name | Type | Description | M/O | +| :-------- | :-------- | :-------- | :-------- | +| params | object | Notification / Event Object | Mandatory | +| params.sourceType | string | Name of the Input Source Type. e.g., HDMI, Composite, etc. | Mandatory | +| params.portId | Number | Port ID of the input source e.g., 0, 1 | Mandatory | + +### Example +```json +{ + "jsonrpc":"2.0", + "id":"3", + "method": "org.rdk.HomeKitTV.onAppStateChangeRequest", + "params": +} + diff --git a/docs/apis/MessageControlPlugin.md b/docs/apis/MessageControlPlugin.md new file mode 100644 index 00000000..8239c46e --- /dev/null +++ b/docs/apis/MessageControlPlugin.md @@ -0,0 +1,217 @@ + + +# MessageControl Plugin + +**Version: 1.0** + +**Status: :black_circle::white_circle::white_circle:** + +MessageControl plugin for Thunder framework. + +### Table of Contents + +- [Introduction](#Introduction) +- [Description](#Description) +- [Configuration](#Configuration) +- [Interfaces](#Interfaces) +- [Methods](#Methods) +- [Properties](#Properties) + + +# Introduction + + +## Scope + +This document describes purpose and functionality of the MessageControl plugin. It includes detailed specification about its configuration, methods and properties provided. + + +## Case Sensitivity + +All identifiers of the interfaces described in this document are case-sensitive. Thus, unless stated otherwise, all keywords, entities, properties, relations and actions should be treated as such. + + +## Acronyms, Abbreviations and Terms + +The table below provides and overview of acronyms used in this document and their definitions. + +| Acronym | Description | +| :-------- | :-------- | +| API | Application Programming Interface | +| HTTP | Hypertext Transfer Protocol | +| JSON | JavaScript Object Notation; a data interchange format | +| JSON-RPC | A remote procedure call protocol encoded in JSON | + +The table below provides and overview of terms and abbreviations used in this document and their definitions. + +| Term | Description | +| :-------- | :-------- | +| callsign | The name given to an instance of a plugin. One plugin can be instantiated multiple times, but each instance the instance name, callsign, must be unique. | + + +## References + +| Ref ID | Description | +| :-------- | :-------- | +| [HTTP](http://www.w3.org/Protocols) | HTTP specification | +| [JSON-RPC](https://www.jsonrpc.org/specification) | JSON-RPC 2.0 specification | +| [JSON](http://www.json.org/) | JSON specification | +| [Thunder](https://github.com/WebPlatformForEmbedded/Thunder/blob/master/doc/WPE%20-%20API%20-%20WPEFramework.docx) | Thunder API Reference | + + +# Description + +The MessageControl plugin allows reading of the traces from WPEFramework, and controlling them tracing and logging. Allows for outputting logging messages to the websocket. + +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: *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 | +| console | boolean | *(optional)* Enables message output messages to the console | +| syslog | boolean | *(optional)* Enables message ouutput to syslog | +| filepath | string | *(optional)* Path to file (inside VolatilePath) where messages will be stored | +| abbreviated | boolean | *(optional)* Denotes if the messages should be abbreviated | +| maxexportconnections | number | *(optional)* Specifies to how many websockets can the messages be outputted | +| remote | object | *(optional)* | +| remote.port | number | Port | +| remote?.bindig | string | *(optional)* Binding address | + + +# Interfaces + +This plugin implements the following interfaces: + +- Exchange::IMessageControl ([IMessageControl.h](https://github.com/rdkcentral/ThunderInterfaces/blob/master/interfaces/IMessageControl.h)) (version 1.0.0) (compliant format) + + +# Methods + +The following methods are provided by the MessageControl plugin: + +MessageControl interface methods: + +| Method | Description | +| :-------- | :-------- | +| [enable](#enable) | Enables/disables a message control | + + + +## *enable* + +Enables/disables a message control. + +### Parameters + +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.type | string | Message type (must be one of the following: *Tracing*, *Logging*) | +| params.category | string | Name of the message category | +| params.module | string | Name of the module the message is originating from | +| params.enabled | boolean | Denotes if control should be enabled (true) or disabled (false) | + +### Result + +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result | null | Always null | + +### Example + +#### Request + +```json +{ + "jsonrpc": "2.0", + "id": 42, + "method": "MessageControl.1.enable", + "params": { + "type": "Tracing", + "category": "Information", + "module": "Plugin_BluetoothControl", + "enabled": false + } +} +``` + +#### Response + +```json +{ + "jsonrpc": "2.0", + "id": 42, + "result": null +} +``` + + +# Properties + +The following properties are provided by the MessageControl plugin: + +MessageControl interface properties: + +| Property | Description | +| :-------- | :-------- | +| [controls](#controls) RO | Retrieves a list of current message controls | + + + +## *controls* + +Provides access to the retrieves a list of current message controls. + +> This property is **read-only**. + +### Value + +### Result + +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result | array | Retrieves a list of current message controls | +| result[#] | object | | +| result[#].type | string | Type of message (must be one of the following: *Tracing*, *Logging*) | +| result[#].category | string | Name of the message category | +| result[#].module | string | Name of the module the message is originating from | +| result[#].enabled | boolean | Denotes if the control is enabled (true) or disabled (false) | + +### Example + +#### Get Request + +```json +{ + "jsonrpc": "2.0", + "id": 42, + "method": "MessageControl.1.controls" +} +``` + +#### Get Response + +```json +{ + "jsonrpc": "2.0", + "id": 42, + "result": [ + { + "type": "Tracing", + "category": "Information", + "module": "Plugin_BluetoothControl", + "enabled": false + } + ] +} +``` + + diff --git a/docs/apis/NetflixPlugin.md b/docs/apis/NetflixPlugin.md new file mode 100644 index 00000000..61993060 --- /dev/null +++ b/docs/apis/NetflixPlugin.md @@ -0,0 +1,421 @@ + + +# Netflix Plugin + +A Netflix 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 + +[[Refer to this link](overview/aat.md)] + + +# Description + +The Netflix plugin allows applications to interact with the Netflix application that is running on a set-top device. + +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: *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](#factoryreset) | Performs a Netflix factory reset | +| [systemcommand](#systemcommand) | Executes the specified Netflix system command | +| [voicecommand](#voicecommand) | Executes the specified Netflix voice command | + + +## *factoryreset* + +Performs a Netflix factory reset. + +### Events + +No Events + +### Parameters + +This method takes no parameters. + +### Result + +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result | null | Always null | + +### Errors + +| Code | Message | Description | +| :-------- | :-------- | :-------- | +| 2 | ERROR_UNAVAILABLE | Netflix is unavailable | + +### Example + +#### Request + +```json +{ + "jsonrpc": "2.0", + "id": 42, + "method": "Netflix.1.factoryreset" +} +``` + +#### Response + +```json +{ + "jsonrpc": "2.0", + "id": 42, + "result": null +} +``` + + +## *systemcommand* + +Executes the specified Netflix system command. + +### Events + +No Events + +### Parameters + +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.command | string | The system command to send to the Netflix application | + +### Result + +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result | null | Always null | + +### Errors + +| Code | Message | Description | +| :-------- | :-------- | :-------- | +| 2 | ERROR_UNAVAILABLE | Netflix is unavailable | +| 22 | ERROR_UNKNOWN_KEY | Command is not set | + +### Example + +#### Request + +```json +{ + "jsonrpc": "2.0", + "id": 42, + "method": "Netflix.1.systemcommand", + "params": { + "command": "config" + } +} +``` + +#### Response + +```json +{ + "jsonrpc": "2.0", + "id": 42, + "result": null +} +``` + + +## *voicecommand* + +Executes the specified Netflix voice command. + +### Events + +No Events + +### Parameters + +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.assistant | string | The voice assistant | +| params.lang | string | The uttered language | +| params.micType | string | The microphone type | +| params.timeout | Integer | The duration, in milliseconds, to wait for execution | +| params.utteranceStructured | object | The structure of the utterance | +| params.utteranceStructured.command | string | The command to send to the Netflix application | +| params.utteranceStructured.intents | array | A string array of intents | +| params.utteranceStructured.intents[#] | string | | +| params.utteranceStructured.resources | array | The structured utterances to be executed | +| params.utteranceStructured.resources[#] | object | | +| params.utteranceStructured.resources[#].type | string | The resources type | +| params.utteranceStructured.resources[#].value | string | The resources value | +| params.utterancetext | string | The uttered text | + +### Result + +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result | null | Always null | + +### Errors + +| Code | Message | Description | +| :-------- | :-------- | :-------- | +| 2 | ERROR_UNAVAILABLE | Netflix is unavailable | +| 22 | ERROR_UNKNOWN_KEY | Command is not set | + +### Example + +#### Request + +```json +{ + "jsonrpc": "2.0", + "id": 42, + "method": "Netflix.1.voicecommand", + "params": { + "assistant": "XFINITY", + "lang": "en-US", + "micType": "NEAR_FIELD", + "timeout": 15000, + "utteranceStructured": { + "command": "search", + "intents": [ + "..." + ], + "resources": [ + { + "type": "Query", + "value": "Comedy Movies" + } + ] + }, + "utterancetext": "Find Comedy Movies" + } +} +``` + +#### Response + +```json +{ + "jsonrpc": "2.0", + "id": 42, + "result": null +} +``` + + +# Properties + +The following properties are provided by the Netflix plugin: + +Netflix interface properties: +| Property | Description | +| :-------- | :-------- | +| [esn](#esn) | ESN value| +| [visibility](#visibility) | Current Netflix visibility | + + +## *esn* + +Provides access to the ESN value. +This property is read-only. + +### Value + +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| (property) | string | ESN value | + +### Errors + +| Code | Message | Description | +| :-------- | :-------- | :-------- | +| 2 | ERROR_UNAVAILABLE | Netflix is unavailable | + +### Example + +#### Request + +```json +{ + "jsonrpc": "2.0", + "id": 42, + "method": "Netflix.1.esn" +} +``` + +#### Response + +```json +{ + "jsonrpc": "2.0", + "id": 42, + "result": "DADDAUFV2=00000000000000000000000000000001" +} +``` + + +## *visibility* + +Provides access to the current Netflix visibility. + +This property is write-only. + +### Description + +Use this property to return current visibilty status of Netflix. + +### Events + +| Event | Description | +| :-------- | :-------- | +| visibilitychange | Triggered if the Netflix visibility changed. | + +### Value + +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| (property) | string | Current Netflix visibility. (must be one of the following: visible, hidden) | + +### Example + +#### Request + +```json +{ + "jsonrpc": "2.0", + "id": 42, + "method": "Netflix.1.visibility", + "params": "visible" +} +``` + +#### 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 Netflix plugin: + +Netflix interface events: +| Event | Description | +| :-------- | :-------- | +| [visibilitychange](#visibilitychange) | Triggered when the Netflix service visibility changes | +| [playbackchange](#playbackchange) | Triggered when Netflix playback changes | + +StateControl interface events: +| Event | Description | +| :-------- | :-------- | +| [statechange](#statechange) | Signals a state change of the service | + + +## *visibilitychange* + +Triggered when the Netflix service visibility changes. + +### Parameters + +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.hidden | boolean | Whether Netflix has been hidden (true) or made visible (false) | + +### Example + +```json +{ + "jsonrpc": "2.0", + "method": "client.events.1.visibilitychange", + "params": { + "hidden": false + } +} +``` + + +## *playbackchange* + +Triggered when Netflix playback changes. + +### Parameters + +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.playing | boolean | Whether Netflix is playing (true) or not playing (false) | + +### Example + +```json +{ + "jsonrpc": "2.0", + "method": "client.events.1.playbackchange", + "params": { + "playing": true + } +} +``` + + +## *statechange* + +Signals a state change of the service. + +### Parameters + +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.suspended | boolean | Determines if the service has entered suspended state (true) or resumed state (false) | + +### Example + +```json +{ + "jsonrpc": "2.0", + "method": "client.events.1.statechange", + "params": { + "suspended": false + } +} +```