TV Device Information
Service URI - luna://com.webos.service.tv.systemproperty
Provides a method for retrieving TV system information. This API is used to check the version of webOS TV and its features.
Methods
Method | Description | Supported in Emulator |
---|---|---|
getSystemInfo | Retrieves the system information with keys. | Yes |
getSystemInfo
Description
Retrieves the system information with keys that are specified in an array as a parameter. Following keys are available:
Key Name | Description | Type | User Agreements | Supported webOS TV Version |
---|---|---|---|---|
boardType | Board type is used to check the chipset. The result string has the following format.
Note. This property is not supported in the emulator. | String | Not required | Since webOS TV 2.0 |
firmwareVersion | Firmware version | String | Required | Since webOS TV 1.2 |
modelName | Model name
| String | Required | Since webOS TV 1.2 |
sdkVersion | webOS TV SDK version
| String | Not required | Since webOS TV 1.2 |
UHD | Whether supports Ultra HD resolution
| String | Not required | Since webOS TV 1.2 |
_3d | Whether supports 3D video
| String | Not required | Since webOS TV 1.2 |
Parameters
Name | Required | Type | Description |
---|---|---|---|
keys | Required | String array | An array of key names for retrieving system information.
|
subscribe | Optional | Boolean | Flag that decides whether to subscribe or not. If you enabled the subscription, you will get an event when every system information you specified is changed.
|
Call returns
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Flag that indicates success/failure of the request.
|
errorCode | Optional | String | errorCode contains the error code if the method fails. The method will return errorCode only if it fails. See the Error Codes Reference of this method for more details. |
errorText | Optional | String | errorText contains the error text if the method fails. The method will return errorText only if it fails. See the Error Codes Reference of this method for more details. |
[key name]* | Optional | String | If getSystemInfo method succeeds, the paired key-value that you specified will be returned. |
Remarks
- If you used a wrong key or error occurs, no result data will be returned for that key.
- If you subscribe more than one key, you will receive the result data for whole keys at the first return. After the first return, you will receive the result data for each key when corresponding system information is changed.
Error reference
Error Code | Error Message |
---|---|
ERROR_06 | Invalid argument |
ERROR_10 | Resource temporarily unavailable |
ERROR_99 | JSON format error |
Example
// One-time call
var request = webOS.service.request(
'luna://com.webos.service.tv.systemproperty',
{
method: 'getSystemInfo',
parameters: {
keys: ['modelName', 'firmwareVersion', 'UHD', 'sdkVersion'],
},
onComplete: function (inResponse) {
var isSucceeded = inResponse.returnValue;
if (isSucceeded) {
console.log('Result: ' + JSON.stringify(inResponse));
// To-Do something
} else {
console.log('Failed to get TV device information');
// To-Do something
return;
}
},
}
);
// Subscription
var subscriptionHandle;
subscriptionHandle = webOS.service.request(
'luna://com.webos.service.tv.systemproperty',
{
method: 'getSystemInfo',
parameters: {
keys: ['modelName', 'firmwareVersion', 'UHD', 'sdkVersion'],
subscribe: true,
},
onComplete: function (inResponse) {
var isSucceeded = inResponse.returnValue;
if (typeof inResponse.subscribed != 'undefined') {
if (!inResponse.subscribed) {
console.log('Failed to subscribe TV device information');
return;
}
}
if (isSucceeded) {
console.log('Result: ' + JSON.stringify(inResponse));
// To-Do something
} else {
console.log('Failed to TV device information');
// To-Do something
return;
}
},
}
);
...
// If you need to unsubscribe the data, use cancel() method as below
subscriptionHandle.cancel();
Return example
// Success return
{
"returnValue" : true,
"modelName" : "WEBOS1",
"firmwareVersion" : "3.00.00",
"UHD":"true",
"sdkVersion":"1.05.00"
}
// Failure return
{
"returnValue" : false,
"errorCode" : "ERROR_06",
"errorText" : "Invalid argument."
}
// Subscription example
// First response
{
"returnValue" : true,
"modelName" : "WEBOS1",
"firmwareVersion" : "3.00.00"
}
// When modelName is changed to "WEBOS2"
{
"returnValue" : true,
"modelName" : "WEBOS2"
}
// When firmwareVersion is changed to "3.02.00"
{
"returnValue": true,
"firmwareVersion" : "3.02.00"
}
See also
None
No Headings