Version: 1.0
Status: ⚫⚫⚪
WifiControl plugin for Thunder framework.
This document describes purpose and functionality of the WifiControl plugin. It includes detailed specification about its configuration, methods and properties as well as sent notifications.
All identifiers of the interfaces 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 WiFi Control plugin allows to manage various aspects of wireless connectivity.
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: WifiControl) |
classname | string | Class name: WifiControl |
locator | string | Library name: libWPEWifiControl.so |
startmode | string | Determines if the plugin shall be started automatically along with the framework |
configuration | object | (optional) |
configuration?.connector | string | (optional) Connector name |
configuration?.interface | string | (optional) Interface name |
configuration?.application | string | (optional) Application name |
configuration?.autoconnect | string | (optional) Enable autoconnect |
configuration?.retryinterval | string | (optional) Retry interval |
This plugin implements the following interfaces:
- IWifiControl (IWifiControl.h) (version 1.0.0) (compliant format)
The following methods are provided by the WifiControl plugin:
WifiControl interface methods:
Method | Description |
---|---|
scan | Trigger Scanning |
abortscan | Abort Currentlt running scan |
connect | Connect device to requested SSID |
disconnect | Disconnect device from requested SSID |
status | Status of current device, like which SSID is connected and it is in scanning state or not |
scan method
Trigger Scanning.
This method takes no parameters.
Name | Type | Description |
---|---|---|
result | null | Always null |
{
"jsonrpc": "2.0",
"id": 42,
"method": "WifiControl.1.scan"
}
{
"jsonrpc": "2.0",
"id": 42,
"result": null
}
abortscan method
Abort Currentlt running scan.
This method takes no parameters.
Name | Type | Description |
---|---|---|
result | null | Always null |
{
"jsonrpc": "2.0",
"id": 42,
"method": "WifiControl.1.abortscan"
}
{
"jsonrpc": "2.0",
"id": 42,
"result": null
}
connect method
Connect device to requested SSID.
Name | Type | Description |
---|---|---|
params | object | |
params.configssid | string |
Name | Type | Description |
---|---|---|
result | null | Always null |
{
"jsonrpc": "2.0",
"id": 42,
"method": "WifiControl.1.connect",
"params": {
"configssid": "..."
}
}
{
"jsonrpc": "2.0",
"id": 42,
"result": null
}
disconnect method
Disconnect device from requested SSID.
Name | Type | Description |
---|---|---|
params | object | |
params.configssid | string |
Name | Type | Description |
---|---|---|
result | null | Always null |
{
"jsonrpc": "2.0",
"id": 42,
"method": "WifiControl.1.disconnect",
"params": {
"configssid": "..."
}
}
{
"jsonrpc": "2.0",
"id": 42,
"result": null
}
status method
Status of current device, like which SSID is connected and it is in scanning state or not.
This method takes no parameters.
Name | Type | Description |
---|---|---|
result | object | |
result.connectedssid | string | |
result.isscanning | boolean |
{
"jsonrpc": "2.0",
"id": 42,
"method": "WifiControl.1.status"
}
{
"jsonrpc": "2.0",
"id": 42,
"result": {
"connectedssid": "...",
"isscanning": false
}
}
The following properties are provided by the WifiControl plugin:
WifiControl interface properties:
Property | Description |
---|---|
networks RO | Provides available networks information |
securities RO | Provides security method of requested SSID |
configs RO | Provides configs list |
config | Provide config details for requested SSID |
networks property
Provides access to the provides available networks information.
This property is read-only.
Name | Type | Description |
---|---|---|
result | array | Provides available networks information |
result[#] | object | |
result[#].ssid | string | |
result[#].bssid | integer | |
result[#].frequency | integer | |
result[#].signal | integer | |
result[#].security | array | |
result[#].security[#] | string | (must be one of the following: Open, WEP, WPA, WPA2, WPS, Enterprise, WPA_WPA2, Unknown) |
{
"jsonrpc": "2.0",
"id": 42,
"method": "WifiControl.1.networks"
}
{
"jsonrpc": "2.0",
"id": 42,
"result": [
{
"ssid": "...",
"bssid": 0,
"frequency": 0,
"signal": 0,
"security": [
"Open"
]
}
]
}
securities property
Provides access to the provides security method of requested SSID.
This property is read-only.
The ssid argument shall be passed as the index to the property, e.g. WifiControl.1.securities@xyz.
Name | Type | Description |
---|---|---|
result | array | Provides security method of requested SSID |
result[#] | object | |
result[#].method | string | (must be one of the following: Open, WEP, WPA, WPA2, WPS, Enterprise, WPA_WPA2, Unknown) |
result[#].keys | array | |
result[#].keys[#] | string | (must be one of the following: PSK, EAP, CCMP, TKIP, Preauth, PBC, PIN, PSK_HASHED, None) |
{
"jsonrpc": "2.0",
"id": 42,
"method": "WifiControl.1.securities@xyz"
}
{
"jsonrpc": "2.0",
"id": 42,
"result": [
{
"method": "Open",
"keys": [
"PSK"
]
}
]
}
configs property
Provides access to the provides configs list.
This property is read-only.
Name | Type | Description |
---|---|---|
result | array | Provides configs list |
result[#] | string |
{
"jsonrpc": "2.0",
"id": 42,
"method": "WifiControl.1.configs"
}
{
"jsonrpc": "2.0",
"id": 42,
"result": [
"..."
]
}
config property
Provides access to the provide config details for requested SSID.
Name | Type | Description |
---|---|---|
(property) | object | Provide config details for requested SSID |
(property).value | object | |
(property).value.hidden | boolean | |
(property).value.accesspoint | boolean | |
(property).value.ssid | string | |
(property).value.secret | string | |
(property).value.identity | string | |
(property).value.method | string | (must be one of the following: Open, WEP, WPA, WPA2, WPS, Enterprise, WPA_WPA2, Unknown) |
(property).value.key | string | (must be one of the following: PSK, EAP, CCMP, TKIP, Preauth, PBC, PIN, PSK_HASHED, None) |
The ssid argument shall be passed as the index to the property, e.g. WifiControl.1.config@xyz.
Name | Type | Description |
---|---|---|
result | object | |
result.hidden | boolean | |
result.accesspoint | boolean | |
result.ssid | string | |
result.secret | string | |
result.identity | string | |
result.method | string | (must be one of the following: Open, WEP, WPA, WPA2, WPS, Enterprise, WPA_WPA2, Unknown) |
result.key | string | (must be one of the following: PSK, EAP, CCMP, TKIP, Preauth, PBC, PIN, PSK_HASHED, None) |
{
"jsonrpc": "2.0",
"id": 42,
"method": "WifiControl.1.config@xyz"
}
{
"jsonrpc": "2.0",
"id": 42,
"result": {
"hidden": false,
"accesspoint": false,
"ssid": "...",
"secret": "...",
"identity": "...",
"method": "Open",
"key": "PSK"
}
}
{
"jsonrpc": "2.0",
"id": 42,
"method": "WifiControl.1.config@xyz",
"params": {
"value": {
"hidden": false,
"accesspoint": false,
"ssid": "...",
"secret": "...",
"identity": "...",
"method": "Open",
"key": "PSK"
}
}
}
{
"jsonrpc": "2.0",
"id": 42,
"result": "null"
}
Notifications are autonomous events triggered by the internals of the implementation and broadcasted via JSON-RPC to all registered observers. Refer to [Thunder] for information on how to register for a notification.
The following events are provided by the WifiControl plugin:
WifiControl interface events:
Event | Description |
---|---|
networkchange | Notifies that Network were added, removed or modified |
connectionchange | Notifies that wifi connection changes |
networkchange event
Notifies that Network were added, removed or modified.
This event carries no parameters.
{
"jsonrpc": "2.0",
"method": "client.events.1.networkchange"
}
connectionchange event
Notifies that wifi connection changes.
Name | Type | Description |
---|---|---|
params | object | |
params.ssid | string |
{
"jsonrpc": "2.0",
"method": "client.events.1.connectionchange",
"params": {
"ssid": "..."
}
}