Device Info Plugin
Version: 1.0
Status:
DeviceInfo plugin for Thunder framework.
Table of Contents
Introduction
Scope
This document describes purpose and functionality of the DeviceInfo plugin. It includes detailed specification of its configuration and properties provided.
Case Sensitivity
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.
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 specification |
JSON-RPC | JSON-RPC 2.0 specification |
JSON | JSON specification |
Thunder | Thunder API Reference |
Description
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].
Configuration
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 |
Properties
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 |
systeminfo property
Provides access to the system general information.
This property is read-only.
Value
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 |
Example
Get Request
{
"jsonrpc": "2.0",
"id": 1234567890,
"method": "DeviceInfo.1.systeminfo"
}
Get Response
{
"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"
}
}
addresses property
Provides access to the network interface addresses.
This property is read-only.
Value
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 |
Example
Get Request
{
"jsonrpc": "2.0",
"id": 1234567890,
"method": "DeviceInfo.1.addresses"
}
Get Response
{
"jsonrpc": "2.0",
"id": 1234567890,
"result": [
{
"name": "lo",
"mac": "00:00:00:00:00",
"ip": [
"127.0.0.1"
]
}
]
}
socketinfo property
Provides access to the socket information.
This property is read-only.
Value
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 |
Example
Get Request
{
"jsonrpc": "2.0",
"id": 1234567890,
"method": "DeviceInfo.1.socketinfo"
}
Get Response
{
"jsonrpc": "2.0",
"id": 1234567890,
"result": {
"total": 0,
"open": 0,
"link": 0,
"exception": 0,
"shutdown": 0,
"runs": 1
}
}