Version: 1.0
Status: ⚫⚫⚫
DeviceInfo plugin for Thunder framework.
This document describes purpose and functionality of the DeviceInfo plugin. It includes detailed specification of its configuration and properties provided.
All identifiers on the interface described in this document are case-sensitive. Thus, unless stated otherwise, all keywords, entities, properties, relations and actions should be treated as such.
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. |
Ref ID | Description |
---|---|
HTTP | HTTP specification |
JSON-RPC | JSON-RPC 2.0 specification |
JSON | JSON specification |
Thunder | Thunder API Reference |
The DeviceInfo plugin allows retrieving of 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].
The table below lists configuration options of the plugin.
Name | Type | Description |
---|---|---|
callsign | string | Plugin instance name (default: DeviceInfo) |
classname | string | Class name: DeviceInfo |
locator | string | Library name: libWPEFrameworkDeviceInfo.so |
autostart | boolean | Determines if the plugin is to be started automatically along with the framework |
The following properties are provided by the DeviceInfo plugin:
DeviceInfo interface properties:
Property | Description |
---|---|
systeminfo RO | System general information |
addresses RO | Network interface addresses |
socketinfo RO | Socket information |
Provides access to the system general information.
This property is read-only.
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).devicename | string | Host name |
(property).cpuload | string | Current CPU load (percentage) |
(property).serialnumber | string | Device serial number |
(property).time | string | Current system date and time |
{
"jsonrpc": "2.0",
"id": 1234567890,
"method": "DeviceInfo.1.systeminfo"
}
{
"jsonrpc": "2.0",
"id": 1234567890,
"result": {
"version": "1.0#14452f612c3747645d54974255d11b8f3b4faa54",
"uptime": 120,
"totalram": 655757312,
"freeram": 563015680,
"devicename": "buildroot",
"cpuload": "2",
"serialnumber": "WPEuCfrLF45",
"time": "Mon, 11 Mar 2019 14:38:18"
}
}
Provides access to the network interface addresses.
This property is read-only.
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 |
{
"jsonrpc": "2.0",
"id": 1234567890,
"method": "DeviceInfo.1.addresses"
}
{
"jsonrpc": "2.0",
"id": 1234567890,
"result": [
{
"name": "lo",
"mac": "00:00:00:00:00",
"ip": [
"127.0.0.1"
]
}
]
}
Provides access to the socket information.
This property is read-only.
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 |
{
"jsonrpc": "2.0",
"id": 1234567890,
"method": "DeviceInfo.1.socketinfo"
}
{
"jsonrpc": "2.0",
"id": 1234567890,
"result": {
"total": 0,
"open": 0,
"link": 0,
"exception": 0,
"shutdown": 0,
"runs": 1
}
}