Skip to content

Commit a842277

Browse files
Merge branch 'develop' into topic/RDKEMW-6924
2 parents e00deba + 1c720ad commit a842277

File tree

2 files changed

+85
-173
lines changed

2 files changed

+85
-173
lines changed

docs/apis/XCastPlugin.md

Lines changed: 29 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,13 @@ XCast interface methods:
4545

4646
| Method | Description |
4747
| :-------- | :-------- |
48-
| [getApiVersionNumber](#getApiVersionNumber) | Gets the API version number |
4948
| [getEnabled](#getEnabled) | Reports whether xcast plugin is enabled or disabled |
5049
| [getFriendlyName](#getFriendlyName) | Returns the friendly name set by setFriendlyName API |
5150
| [getManufacturerName](#getManufacturerName) | Returns the friendly name set by setManufacturerName API |
5251
| [getModelName](#getModelName) | Returns the friendly name set by setModelName API |
5352
| [getProtocolVersion](#getProtocolVersion) | Returns the DIAL protocol version supported by the server |
5453
| [getStandbyBehavior](#getStandbyBehavior) | Return current standby behavior option string set uisng setStandbyBehavior or default value |
55-
| [onApplicationStateChanged](#onApplicationStateChanged) | Provides notification whenever an application changes state due to user activity, an internal error, or other reasons |
54+
| [setApplicationState](#setApplicationState) | Provides notification whenever an application changes state due to user activity, an internal error, or other reasons |
5655
| [registerApplications](#registerApplications) | Registers an application |
5756
| [unregisterApplications](#unregisterApplications) | Unregisters an application |
5857
| [setEnabled](#setEnabled) | Enable or disable XCAST service |
@@ -62,52 +61,6 @@ XCast interface methods:
6261
| [setStandbyBehavior](#setStandbyBehavior) | Sets the expected xcast behavior in standby mode |
6362

6463

65-
<a name="getApiVersionNumber"></a>
66-
## *getApiVersionNumber*
67-
68-
Gets the API version number.
69-
70-
### Events
71-
72-
No Events
73-
74-
### Parameters
75-
76-
This method takes no parameters.
77-
78-
### Result
79-
80-
| Name | Type | Description |
81-
| :-------- | :-------- | :-------- |
82-
| result | object | |
83-
| result.version | integer | a version number |
84-
| result.success | boolean | Whether the request succeeded |
85-
86-
### Example
87-
88-
#### Request
89-
90-
```json
91-
{
92-
"jsonrpc": "2.0",
93-
"id": 42,
94-
"method": "org.rdk.Xcast.getApiVersionNumber"
95-
}
96-
```
97-
98-
#### Response
99-
100-
```json
101-
{
102-
"jsonrpc": "2.0",
103-
"id": 42,
104-
"result": {
105-
"version": 1,
106-
"success": true
107-
}
108-
}
109-
```
110-
11164
<a name="getEnabled"></a>
11265
## *getEnabled*
11366

@@ -386,8 +339,8 @@ This method takes no parameters.
386339
}
387340
```
388341

389-
<a name="onApplicationStateChanged"></a>
390-
## *onApplicationStateChanged*
342+
<a name="setApplicationState"></a>
343+
## *setApplicationState*
391344

392345
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.
393346

@@ -430,7 +383,7 @@ No Events
430383
{
431384
"jsonrpc": "2.0",
432385
"id": 42,
433-
"method": "org.rdk.Xcast.onApplicationStateChanged",
386+
"method": "org.rdk.Xcast.setApplicationState",
434387
"params": {
435388
"applicationName": "NetflixApp",
436389
"state": "running",
@@ -468,17 +421,12 @@ No Events
468421
| params | object | |
469422
| params.applications | array | Json array with one or more application details to register |
470423
| params.applications[#] | object | |
471-
| 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 |
472-
| params.applications[#].names[#] | string | |
473-
| params.applications[#]?.prefixes | array | <sup>*(optional)*</sup> 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 |
474-
| params.applications[#]?.prefixes[#] | string | <sup>*(optional)*</sup> |
475-
| params.applications[#]?.cors | array | <sup>*(optional)*</sup> a set of origins allowed for the application. This must not be empty |
476-
| params.applications[#]?.cors[#] | string | <sup>*(optional)*</sup> |
477-
| params.applications[#]?.properties | object | <sup>*(optional)*</sup> specific application properties applicable to app management. If not present in descriptor, the default value is assumed |
478-
| params.applications[#]?.properties.allowStop | boolean | is the application (matching name list or prefix list) allowed to stop (no PID presence) after launched |
479-
| params.applications[#]?.launchParameters | object | <sup>*(optional)*</sup> launchParameters that application wants dial-server to append before sending the request to launch application |
480-
| params.applications[#]?.launchParameters.query | string | query string that need to be appended in launch request |
481-
| params.applications[#]?.launchParameters.payload | string | optional payload string that need to be appended in launch request |
424+
| params.applications[#]?.name | string | <sup>*(optional)*</sup> case-sensitive. 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 |
425+
| params.applications[#]?.prefix | string | <sup>*(optional)*</sup> 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 |
426+
| params.applications[#]?.cors | string | <sup>*(optional)*</sup> a set of origins allowed for the application. This must not be empty |
427+
| params.applications[#]?.query | string | <sup>*(optional)*</sup> query string that need to be appended in launch request |
428+
| params.applications[#]?.payload | string | <sup>*(optional)*</sup> optional payload string that need to be appended in launch request |
429+
| params.applications[#]?.allowStop | boolean | <sup>*(optional)*</sup> is the application (matching name list or prefix list) allowed to stop (no PID presence) after launched |
482430

483431
### Result
484432

@@ -499,22 +447,12 @@ No Events
499447
"params": {
500448
"applications": [
501449
{
502-
"names": [
503-
"Youtube"
504-
],
505-
"prefixes": [
506-
"myYouTube"
507-
],
508-
"cors": [
509-
".youtube.com"
510-
],
511-
"properties": {
512-
"allowStop": true
513-
},
514-
"launchParameters": {
515-
"query": "source_type=12",
516-
"payload": "..."
517-
}
450+
"name": "Youtube",
451+
"prefix": "myYouTube",
452+
"cors": ".youtube.com",
453+
"query": "source_type=12",
454+
"payload": "...",
455+
"allowStop": true
518456
}
519457
]
520458
}
@@ -547,7 +485,8 @@ No Events
547485
| Name | Type | Description |
548486
| :-------- | :-------- | :-------- |
549487
| params | object | |
550-
| params.applications | string | One or more application name to unregister |
488+
| params.applications | array | case-sensitive. Group of Application names 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 |
489+
| params.applications[#] | string | |
551490

552491
### Result
553492

@@ -566,7 +505,9 @@ No Events
566505
"id": 42,
567506
"method": "org.rdk.Xcast.unregisterApplications",
568507
"params": {
569-
"applications": "['YouTube', 'Netflix']"
508+
"applications": [
509+
"Youtube"
510+
]
570511
}
571512
}
572513
```
@@ -892,8 +833,10 @@ Upon launching the application, the resident application is responsible for call
892833
| :-------- | :-------- | :-------- |
893834
| params | object | |
894835
| params.applicationName | string | Registered application name |
895-
| 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 |
896-
| params.parameters.pluginUrl | string | Application launch string |
836+
| params?.strPayLoad | string | <sup>*(optional)*</sup> optional payload string that need to be appended in launch request |
837+
| params?.strQuery | string | <sup>*(optional)*</sup> query string that need to be appended in launch request |
838+
| params?.strAddDataUrl | string | <sup>*(optional)*</sup> optional Additional data URL to be passed to the application |
839+
| params?.parameters | string | <sup>*(optional)*</sup> Application launch string AND The format and interpretation is determined between the application launcher or cast target and the cast client for each application |
897840

898841
### Example
899842

@@ -903,9 +846,10 @@ Upon launching the application, the resident application is responsible for call
903846
"method": "client.events.onApplicationLaunchRequest",
904847
"params": {
905848
"applicationName": "NetflixApp",
906-
"parameters": {
907-
"pluginUrl": "https://www.netflix.com"
908-
}
849+
"strPayLoad": "...",
850+
"strQuery": "source_type=12",
851+
"strAddDataUrl": "...",
852+
"parameters": "https://www.netflix.com"
909853
}
910854
}
911855
```

tools/json_generator/output/XCast/XCast.json

Lines changed: 56 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,13 @@
4949
"type": "string",
5050
"example": "active"
5151
},
52-
"names": {
53-
"summary": "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.",
52+
"appname": {
53+
"summary": "case-sensitive. 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.",
54+
"type": "string",
55+
"example": "Youtube"
56+
},
57+
"appnames": {
58+
"summary": "case-sensitive. Group of Application names 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.",
5459
"type": "array",
5560
"items": {
5661
"type": "string",
@@ -59,75 +64,58 @@
5964
},
6065
"prefixes": {
6166
"summary": "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.",
62-
"type": "array",
63-
"items": {
64-
"type": "string",
65-
"example": "myYouTube"
66-
}
67+
"type": "string",
68+
"example": "myYouTube"
6769
},
6870
"cors": {
6971
"summary": "a set of origins allowed for the application. This must not be empty",
70-
"type": "array",
71-
"items": {
72-
"type": "string",
73-
"example": ".youtube.com"
74-
}
72+
"type": "string",
73+
"example": ".youtube.com"
7574
},
76-
"properties": {
77-
"summary": "specific application properties applicable to app management. If not present in descriptor, the default value is assumed",
78-
"type": "object",
79-
"properties": {
80-
"allowStop": {
81-
"summary": "is the application (matching name list or prefix list) allowed to stop (no PID presence) after launched",
82-
"type": "boolean",
83-
"example": true
84-
}
85-
},
86-
"required":[
87-
"allowStop"
88-
]
89-
},
90-
"launchParameters": {
91-
"summary": "launchParameters that application wants dial-server to append before sending the request to launch application",
92-
"type": "object",
93-
"properties": {
94-
"query": {
95-
"summary": "query string that need to be appended in launch request",
96-
"type": "string",
97-
"example": "source_type=12"
98-
},
99-
"payload": {
100-
"summary": "optional payload string that need to be appended in launch request",
101-
"type": "string",
102-
"example": ""
103-
}
104-
},
105-
"required":[
106-
"query",
107-
"payload"
108-
]
75+
"query": {
76+
"summary": "query string that need to be appended in launch request",
77+
"type": "string",
78+
"example": "source_type=12"
79+
},
80+
"payload": {
81+
"summary": "optional payload string that need to be appended in launch request",
82+
"type": "string",
83+
"example": ""
84+
},
85+
"AddDataUrl": {
86+
"summary": "optional Additional data URL to be passed to the application",
87+
"type": "string",
88+
"example": ""
89+
},
90+
"allowStop": {
91+
"summary": "is the application (matching name list or prefix list) allowed to stop (no PID presence) after launched",
92+
"type": "boolean",
93+
"example": true
10994
},
11095
"applicationsList": {
11196
"summary": "Json array with one or more application details to register",
11297
"type": "array",
11398
"items": {
11499
"type": "object",
115100
"properties": {
116-
"names": {
117-
"$ref": "#/definitions/names"
101+
"name": {
102+
"$ref": "#/definitions/appname"
118103
},
119-
"prefixes": {
104+
"prefix": {
120105
"$ref": "#/definitions/prefixes"
121106
},
122107
"cors": {
123108
"$ref": "#/definitions/cors"
124109
},
125-
"properties": {
126-
"$ref": "#/definitions/properties"
110+
"query": {
111+
"$ref": "#/definitions/query"
127112
},
128-
"launchParameters": {
129-
"$ref": "#/definitions/launchParameters"
130-
}
113+
"payload": {
114+
"$ref": "#/definitions/payload"
115+
},
116+
"allowStop": {
117+
"$ref": "#/definitions/allowStop"
118+
}
131119
},
132120
"required":[
133121
"names",
@@ -142,26 +130,6 @@
142130
}
143131
},
144132
"methods": {
145-
"getApiVersionNumber":{
146-
"summary": "Gets the API version number.",
147-
"result": {
148-
"type":"object",
149-
"properties": {
150-
"version": {
151-
"description": "a version number",
152-
"type":"integer",
153-
"example": 1
154-
},
155-
"success": {
156-
"$ref": "#/common/success"
157-
}
158-
},
159-
"required": [
160-
"version",
161-
"success"
162-
]
163-
}
164-
},
165133
"getEnabled":{
166134
"summary": "Reports whether xcast plugin is enabled or disabled.",
167135
"result": {
@@ -272,7 +240,7 @@
272240
]
273241
}
274242
},
275-
"onApplicationStateChanged":{
243+
"setApplicationState":{
276244
"summary": "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. \n\nThe following table provides a client error mapping example: \n\n| Error | Description | HTTP Status Codes | \n| :-------- | :-------- | :-------- | \n| `none` | The request (start/stop) is fulfilled successfully | HTTP 200 OK | \n| `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 | \n| `unavailable` | The target native application is not available on the device | HTTP 404 Not Found | \n| `invalid` | The request is invalid (bad parameter for example) | HTTP 400 Bad Request | \n| `internal` | The server failed to fulfill the request (server error) | HTTP 500 Internal |",
277245
"params": {
278246
"type":"object",
@@ -323,9 +291,7 @@
323291
"type":"object",
324292
"properties": {
325293
"applications": {
326-
"summary": "One or more application name to unregister",
327-
"type": "string",
328-
"example": ["YouTube","Netflix"]
294+
"$ref": "#/definitions/appnames"
329295
}
330296
},
331297
"required": [
@@ -451,21 +417,23 @@
451417
"applicationName": {
452418
"$ref": "#/definitions/applicationName"
453419
},
420+
"strPayLoad": {
421+
"$ref": "#/definitions/payload"
422+
},
423+
"strQuery": {
424+
"$ref": "#/definitions/query"
425+
},
426+
"strAddDataUrl": {
427+
"$ref": "#/definitions/AddDataUrl"
428+
},
454429
"parameters": {
455-
"summary":"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.",
456-
"type":"object",
457-
"properties": {
458-
"pluginUrl":{
459-
"summary":"Application launch string",
460-
"type":"string",
461-
"example": "https://www.netflix.com"
462-
}
463-
}
430+
"summary":"Application launch string AND The format and interpretation is determined between the application launcher or cast target and the cast client for each application.",
431+
"type":"string",
432+
"example": "https://www.netflix.com"
464433
}
465434
},
466435
"required": [
467-
"applicationName",
468-
"parameters"
436+
"applicationName"
469437
]
470438
}
471439
},

0 commit comments

Comments
 (0)