JavaScript Systeminfo Service API

The SystemInfo API is supported since WRT 1.0.

The widget engine provides a set of system information (SystemInfo) API services. The SystemInfo Service API allows a widget to access a device's properties and to control certain device features. The API is implemented in a plug-in module and it is integrated into the WRT environment.

To use the SystemInfo APIs, each widget must load the plug-in module explicitly by defining the following HTML code in its main HTML document:

<embed type="application/x-systeminfo-widget" hidden="yes"></embed>

Then the reference to the object must be retrieved via a JavaScript code as shown below:

var sysinfo = document.embeds[0];

Note: In the code above, it is assumed that the embedded systeminfo is the first embed element in the HTML file.

Throughout the following sections where syntax and example codes illustrate the usage of the SystemInfo API, it is assumed that the plug-in module is loaded and the reference to the object is defined as sysinfo as implemented above.

The services provided by the plug-in SystemInfo API can be divided into seven main categories: