Wifi Control Plugin
Version: 1.0
Status:
WifiControl plugin for Thunder framework.
Table of Contents
Introduction
Scope
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.
Case Sensitivity
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.
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 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].
Configuration
The table below lists configuration options of the plugin.
Name | Type | M/O | Description |
---|---|---|---|
callsign | string | mandatory | Plugin instance name (default: WifiControl) |
classname | string | mandatory | Class name: WifiControl |
locator | string | mandatory | Library name: libWPEWifiControl.so |
startmode | string | mandatory | Determines in which state the plugin should be moved to at startup of 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 |
Interfaces
This plugin implements the following interfaces:
- IWifiControl (IWifiControl.h) (version 1.0.0) (compliant format)
This interface uses legacy
lowercase
naming convention. With the next major release the naming convention will change tocamelCase
.
Methods
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.
Parameters
This method takes no parameters.
Result
Name | Type | M/O | Description |
---|---|---|---|
result | null | mandatory | Always null |
Example
Request
{
"jsonrpc": "2.0",
"id": 42,
"method": "WifiControl.1.scan"
}
Response
{
"jsonrpc": "2.0",
"id": 42,
"result": null
}
abortscan method
Abort Currentlt running scan.
Parameters
This method takes no parameters.
Result
Name | Type | M/O | Description |
---|---|---|---|
result | null | mandatory | Always null |
Example
Request
{
"jsonrpc": "2.0",
"id": 42,
"method": "WifiControl.1.abortscan"
}
Response
{
"jsonrpc": "2.0",
"id": 42,
"result": null
}
connect method
Connect device to requested SSID.
Parameters
Name | Type | M/O | Description |
---|---|---|---|
params | object | mandatory | ... |
params.configssid | string | mandatory | SSID to be connected |
Result
Name | Type | M/O | Description |
---|---|---|---|
result | null | mandatory | Always null |
Example
Request
{
"jsonrpc": "2.0",
"id": 42,
"method": "WifiControl.1.connect",
"params": {
"configssid": "..."
}
}
Response
{
"jsonrpc": "2.0",
"id": 42,
"result": null
}
disconnect method
Disconnect device from requested SSID.
Parameters
Name | Type | M/O | Description |
---|---|---|---|
params | object | mandatory | ... |
params.configssid | string | mandatory | SSID to be disconnected |
Result
Name | Type | M/O | Description |
---|---|---|---|
result | null | mandatory | Always null |
Example
Request
{
"jsonrpc": "2.0",
"id": 42,
"method": "WifiControl.1.disconnect",
"params": {
"configssid": "..."
}
}
Response
{
"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.
Parameters
This method takes no parameters.
Result
Name | Type | M/O | Description |
---|---|---|---|
result | object | mandatory | ... |
result.connectedssid | string | mandatory | SSID of connected router/ap |
result.isscanning | boolean | mandatory | Scanning is in progress or not |
Example
Request
{
"jsonrpc": "2.0",
"id": 42,
"method": "WifiControl.1.status"
}
Response
{
"jsonrpc": "2.0",
"id": 42,
"result": {
"connectedssid": "...",
"isscanning": false
}
}
Properties
The following properties are provided by the WifiControl plugin:
WifiControl interface properties:
Property | R/W | Description |
---|---|---|
networks | read-only | Provides available networks information |
securities | read-only | Provides security method of requested SSID |
configs | read-only | Provides configs list |
config | read/write | Provide config details for requested SSID |
networks property
Provides access to the provides available networks information.
This property is read-only.
Value
Name | Type | M/O | Description |
---|---|---|---|
(property) | array | mandatory | Provides available networks information |
(property)[#] | object | mandatory | ... |
(property)[#].ssid | string | mandatory | SSID of the network |
(property)[#].bssid | integer | mandatory | BSSID of the network |
(property)[#].frequency | integer | mandatory | Frequency used |
(property)[#].signal | integer | mandatory | Signal strength |
(property)[#].security | array | mandatory | Security method |
(property)[#].security[#] | string | mandatory | ... (must be one of the following: Enterprise, Open, Unknown, WEP, WPA, WPA2, WPA_WPA2, WPS) |
Example
Get Request
{
"jsonrpc": "2.0",
"id": 42,
"method": "WifiControl.1.networks"
}
Get Response
{
"jsonrpc": "2.0",
"id": 42,
"result": [
{
"ssid": "...",
"bssid": 0,
"frequency": 0,
"signal": 0,
"security": [
"WEP"
]
}
]
}
securities property
Provides access to the provides security method of requested SSID.
This property is read-only.
The ssid parameter shall be passed as the index to the property, i.e.
securities@<ssid>
.
Index
Name | Type | M/O | Description |
---|---|---|---|
ssid | string | mandatory | ... |
Value
Name | Type | M/O | Description |
---|---|---|---|
(property) | array | mandatory | Provides security method of requested SSID |
(property)[#] | object | mandatory | ... |
(property)[#].method | string | mandatory | Security method (must be one of the following: Enterprise, Open, Unknown, WEP, WPA, WPA2, WPA_WPA2, WPS) |
(property)[#].keys | array | mandatory | Security Keys |
(property)[#].keys[#] | string | mandatory | ... (must be one of the following: CCMP, EAP, None, PBC, PIN, PSK, PSK_HASHED, Preauth, TKIP) |
Example
Get Request
{
"jsonrpc": "2.0",
"id": 42,
"method": "WifiControl.1.securities@xyz"
}
Get Response
{
"jsonrpc": "2.0",
"id": 42,
"result": [
{
"method": "WEP",
"keys": [
"EAP"
]
}
]
}
configs property
Provides access to the provides configs list.
This property is read-only.
Value
Name | Type | M/O | Description |
---|---|---|---|
(property) | array | mandatory | Provides configs list |
(property)[#] | string | mandatory | ... |
Example
Get Request
{
"jsonrpc": "2.0",
"id": 42,
"method": "WifiControl.1.configs"
}
Get Response
{
"jsonrpc": "2.0",
"id": 42,
"result": [
"..."
]
}
config property
Provides access to the provide config details for requested SSID.
The ssid parameter shall be passed as the index to the property, i.e.
config@<ssid>
.
Index
Name | Type | M/O | Description |
---|---|---|---|
ssid | string | mandatory | ... |
Value
Name | Type | M/O | Description |
---|---|---|---|
(property) | object | mandatory | Provide config details for requested SSID |
(property).value | object | mandatory | ... |
(property).value.hidden | boolean | mandatory | Visibility of the router (hidden or visible) |
(property).value.accesspoint | boolean | mandatory | Accesspoint or not |
(property).value.ssid | string | mandatory | SSID of the router/ap |
(property).value.secret | string | mandatory | Secret key used |
(property).value.identity | string | mandatory | Identity |
(property).value.method | string | mandatory | Security method (must be one of the following: Enterprise, Open, Unknown, WEP, WPA, WPA2, WPA_WPA2, WPS) |
(property).value.key | string | mandatory | Security Info: method and keys (must be one of the following: CCMP, EAP, None, PBC, PIN, PSK, PSK_HASHED, Preauth, TKIP) |
Name | Type | M/O | Description |
---|---|---|---|
(property) | object | mandatory | Details about requested SSID |
(property).hidden | boolean | mandatory | Visibility of the router (hidden or visible) |
(property).accesspoint | boolean | mandatory | Accesspoint or not |
(property).ssid | string | mandatory | SSID of the router/ap |
(property).secret | string | mandatory | Secret key used |
(property).identity | string | mandatory | Identity |
(property).method | string | mandatory | Security method (must be one of the following: Enterprise, Open, Unknown, WEP, WPA, WPA2, WPA_WPA2, WPS) |
(property).key | string | mandatory | Security Info: method and keys (must be one of the following: CCMP, EAP, None, PBC, PIN, PSK, PSK_HASHED, Preauth, TKIP) |
Example
Get Request
{
"jsonrpc": "2.0",
"id": 42,
"method": "WifiControl.1.config@xyz"
}
Get Response
{
"jsonrpc": "2.0",
"id": 42,
"result": {
"hidden": false,
"accesspoint": false,
"ssid": "...",
"secret": "...",
"identity": "...",
"method": "WEP",
"key": "EAP"
}
}
Set Request
{
"jsonrpc": "2.0",
"id": 42,
"method": "WifiControl.1.config@xyz",
"params": {
"value": {
"hidden": false,
"accesspoint": false,
"ssid": "...",
"secret": "...",
"identity": "...",
"method": "WEP",
"key": "EAP"
}
}
}
Set Response
{
"jsonrpc": "2.0",
"id": 42,
"result": "null"
}
Notifications
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:
Notification | Description |
---|---|
networkchange | Notifies that Network were added, removed or modified |
connectionchange | Notifies that wifi connection changes |
networkchange notification
Notifies that Network were added, removed or modified.
Notification Parameters
This notification carries no parameters.
Example
Registration
{
"jsonrpc": "2.0",
"id": 42,
"method": "WifiControl.1.register",
"params": {
"event": "networkchange",
"id": "myid"
}
}
Notification
{
"jsonrpc": "2.0",
"method": "myid.networkchange"
}
The client ID parameter is passed within the notification designator, i.e.
<client-id>.networkchange
.
connectionchange notification
Notifies that wifi connection changes.
Notification Parameters
Name | Type | M/O | Description |
---|---|---|---|
params | object | mandatory | ... |
params.ssid | string | mandatory | SSID of connection changed network |
Example
Registration
{
"jsonrpc": "2.0",
"id": 42,
"method": "WifiControl.1.register",
"params": {
"event": "connectionchange",
"id": "myid"
}
}
Notification
{
"jsonrpc": "2.0",
"method": "myid.connectionchange",
"params": {
"ssid": "..."
}
}
The client ID parameter is passed within the notification designator, i.e.
<client-id>.connectionchange
.