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 | 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 |
This plugin implements the following interfaces:
- IWifiControl (IWifiControl.h) (version 1.0.0) (compliant format)
This interface uses legacy
lowercasenaming convention. With the next major release the naming convention will change tocamelCase.
The following methods are provided by the WifiControl plugin:
Built-in methods:
| Method | Description |
|---|---|
| versions | Retrieves a list of JSON-RPC interfaces offered by this service |
| exists | Checks if a JSON-RPC method or property exists |
| register | Registers for an asynchronous JSON-RPC notification |
| unregister | Unregisters from an asynchronous JSON-RPC notification |
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 |
versions method
Retrieves a list of JSON-RPC interfaces offered by this service.
This method takes no parameters.
| Name | Type | M/O | Description |
|---|---|---|---|
| result | array | mandatory | A list ofsinterfaces with their version numbers Array length must be at most 255 elements. |
| result[#] | object | mandatory | ... |
| result[#].name | string | mandatory | Name of the interface |
| result[#].major | integer | mandatory | Major part of version number |
| result[#].minor | integer | mandatory | Minor part of version number |
| result[#].patch | integer | mandatory | Patch part of version version number |
{
"jsonrpc": "2.0",
"id": 42,
"method": "WifiControl.1.versions"
}{
"jsonrpc": "2.0",
"id": 42,
"result": [
{
"name": "JMyInterface",
"major": 1,
"minor": 0,
"patch": 0
}
]
}exists method
Checks if a JSON-RPC method or property exists.
This method will return True for the following methods/properties: networks, securities, configs, config, versions, exists, register, unregister, scan, abortscan, connect, disconnect, status.
| Name | Type | M/O | Description |
|---|---|---|---|
| params | object | mandatory | ... |
| params.method | string | mandatory | Name of the method or property to look up |
| Name | Type | M/O | Description |
|---|---|---|---|
| result | boolean | mandatory | Denotes if the method exists or not |
{
"jsonrpc": "2.0",
"id": 42,
"method": "WifiControl.1.exists",
"params": {
"method": "networks"
}
}{
"jsonrpc": "2.0",
"id": 42,
"result": false
}register method
Registers for an asynchronous JSON-RPC notification.
This method supports the following event names: networkchange, connectionchange.
| Name | Type | M/O | Description |
|---|---|---|---|
| params | object | mandatory | ... |
| params.event | string | mandatory | Name of the notification to register for |
| params.id | string | mandatory | Client identifier |
| Name | Type | M/O | Description |
|---|---|---|---|
| result | null | mandatory | Always null |
| Message | Description |
|---|---|
ERROR_FAILED_REGISTERED |
Failed to register for the notification (e.g. already registered) |
{
"jsonrpc": "2.0",
"id": 42,
"method": "WifiControl.1.register",
"params": {
"event": "networkchange",
"id": "myapp"
}
}{
"jsonrpc": "2.0",
"id": 42,
"result": null
}unregister method
Unregisters from an asynchronous JSON-RPC notification.
This method supports the following event names: networkchange, connectionchange.
| Name | Type | M/O | Description |
|---|---|---|---|
| params | object | mandatory | ... |
| params.event | string | mandatory | Name of the notification to register for |
| params.id | string | mandatory | Client identifier |
| Name | Type | M/O | Description |
|---|---|---|---|
| result | null | mandatory | Always null |
| Message | Description |
|---|---|
ERROR_FAILED_UNREGISTERED |
Failed to unregister from the notification (e.g. not yet registered) |
{
"jsonrpc": "2.0",
"id": 42,
"method": "WifiControl.1.unregister",
"params": {
"event": "networkchange",
"id": "myapp"
}
}{
"jsonrpc": "2.0",
"id": 42,
"result": null
}scan method
Trigger Scanning.
This method takes no parameters.
| Name | Type | M/O | Description |
|---|---|---|---|
| result | null | mandatory | 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 | M/O | Description |
|---|---|---|---|
| result | null | mandatory | 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 | M/O | Description |
|---|---|---|---|
| params | object | mandatory | ... |
| params.configssid | string | mandatory | SSID to be connected |
| Name | Type | M/O | Description |
|---|---|---|---|
| result | null | mandatory | 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 | M/O | Description |
|---|---|---|---|
| params | object | mandatory | ... |
| params.configssid | string | mandatory | SSID to be disconnected |
| Name | Type | M/O | Description |
|---|---|---|---|
| result | null | mandatory | 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 | 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 |
{
"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 | 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.
| Name | Type | M/O | Description |
|---|---|---|---|
| (property) | array | mandatory | Provides available networks information |
| (property)[#] | object | mandatory | ... |
| (property)[#]?.ssid | string | optional | 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) |
{
"jsonrpc": "2.0",
"id": 42,
"method": "WifiControl.1.networks"
}{
"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>.
| Name | Type | M/O | Description |
|---|---|---|---|
| ssid | string | mandatory | ... |
| 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 | optional | Security Keys |
| (property)[#]?.keys[#] | string | mandatory | ... (must be one of the following: CCMP, EAP, None, PBC, PIN, PSK, PSK_HASHED, Preauth, TKIP) |
{
"jsonrpc": "2.0",
"id": 42,
"method": "WifiControl.1.securities@xyz"
}{
"jsonrpc": "2.0",
"id": 42,
"result": [
{
"method": "WEP",
"keys": [
"EAP"
]
}
]
}configs property
Provides access to the provides configs list.
This property is read-only.
| Name | Type | M/O | Description |
|---|---|---|---|
| (property) | array | mandatory | Provides configs list |
| (property)[#] | string | mandatory | ... |
{
"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.
The ssid parameter shall be passed as the index to the property, i.e.
config@<ssid>.
| Name | Type | M/O | Description |
|---|---|---|---|
| ssid | string | mandatory | ... |
| 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 | optional | SSID of the router/ap |
| (property).value?.secret | string | optional | Secret key used |
| (property).value?.identity | string | optional | 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 | optional | 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 | optional | SSID of the router/ap |
| (property)?.secret | string | optional | Secret key used |
| (property)?.identity | string | optional | 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 | optional | Security Info: method and keys (must be one of the following: CCMP, EAP, None, PBC, PIN, PSK, PSK_HASHED, Preauth, TKIP) |
{
"jsonrpc": "2.0",
"id": 42,
"method": "WifiControl.1.config@xyz"
}{
"jsonrpc": "2.0",
"id": 42,
"result": {
"hidden": false,
"accesspoint": false,
"ssid": "...",
"secret": "...",
"identity": "...",
"method": "WEP",
"key": "EAP"
}
}{
"jsonrpc": "2.0",
"id": 42,
"method": "WifiControl.1.config@xyz",
"params": {
"value": {
"hidden": false,
"accesspoint": false,
"ssid": "...",
"secret": "...",
"identity": "...",
"method": "WEP",
"key": "EAP"
}
}
}{
"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:
| 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.
This notification carries no parameters.
{
"jsonrpc": "2.0",
"id": 42,
"method": "WifiControl.1.register",
"params": {
"event": "networkchange",
"id": "myid"
}
}{
"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.
| Name | Type | M/O | Description |
|---|---|---|---|
| params | object | mandatory | ... |
| params.ssid | string | mandatory | SSID of connection changed network |
{
"jsonrpc": "2.0",
"id": 42,
"method": "WifiControl.1.register",
"params": {
"event": "connectionchange",
"id": "myid"
}
}{
"jsonrpc": "2.0",
"method": "myid.connectionchange",
"params": {
"ssid": "..."
}
}The client ID parameter is passed within the notification designator, i.e.
<client-id>.connectionchange.