Wifi Manager Service
Summary
The WIFI Manager API provides support to client applications that wish to enable WIFI communications on a STB.
Version: 4
Adds one new event: onWifiSignalThresholdChanged
API Name
org.rdk.wifiManager_4
Methods
name | arguments | return value | description |
---|---|---|---|
getCurrentState | none | enum | gets the current WIFI state (see onWIFIStateChanged for state definitions) |
getAvailableSSIDs | none | array | gets the currently available networks. Each element of the array is an object containing the following properties: ssid (string) security (int) – supported values are NONE – 0, WPA – 1, WEP – 2 signalStrength(int) – the RSSI signal strength value for this endpoint. A zero value indicates the device is not in range. frequency (double) – the supported frequency for this ssid, measured in GHz |
getConnectedSSID | none | object | Returns the properties of the currently connected SSID which include: ssid (string) – the name of the SSID bssid (string) – the Basic Service Set ID (mac address) rate (float) – the Physical data rate in Mbps noise (float) – the average noise strength in dBm signalStrength (float) – the RSSI value in dBm |
setEnabled | enable: boolean | none | when true, enables the wifi adapter for this device. When false, disables the wifi adapter. |
connect | ssid :: string passphrase :: string securityMode :: int | boolean | attempts to connect to the specified ssid with the given passphrase. Passphrase can be null when the network security is NONE. See “Security Modes” section below. Returns true if the connection was successful. |
connect | none | boolean | Internally calls connect(ssid, passphrase, securityMode) with the stored stored/paired SSID and passphrase. |
initiateWPSPairing | timeout :: int | none | Initiates the connection via WPS. This should fire CONNECTING and CONNECTED state change events if successful or CONNECTION_FAILED error events if unsuccessful. If WPS pairing has not been completed by the specified timeout, it should result in a CONNECTION_FAILED state change. timeout – the period of time to wait for the WPS pairing to complete in seconds |
saveSSID | ssid :: string passphrase :: string securityMode :: int | boolean | Saves the ssid, passphrase and security mode for future sessions. If an SSID was previously saved, the new SSID and passphrase will overwrite the existing one. Returns false if the save failed, and true if the save was successful. |
clearSSID | none | boolean | Clears the saved SSID and BSSID. Returns false if the SSIDs could not be cleared, or true if the clear operation was successful. |
getPairedSSID | none | string | returns the SSID if one was previously saved through saveSSID, otherwise returns NULL. |
getPairedSSIDInfo | none | object | This is intended to replace getPairedSSID. Returns an object with the following k/v pairs: “SSID” – The SSID that the device is paired to. “BSSID” – The radio BSSID that the device is paired to. |
isPaired | none | boolean | returns true if this device has been previously paired ( calling saveSSID marks this device as paired ) |
Security Modes
value | description |
---|---|
0 | NONE – No security |
1 | WEP_64 |
2 | WEP_128 |
3 | WPA_PSK_TKIP |
4 | WPA_PSK_AES |
5 | WPA2_PSK_TKIP |
6 | WPA2_PSK_AES |
7 | WPA_ENTERPRISE_TKIP |
8 | WPA_ENTERPRISE_AES |
9 | WPA2_ENTERPRISE_TKIP |
10 | WPA2_ENTERPRISE_AES |
15 | NOT_SUPPORTED |
Events
name | payload | description |
---|---|---|
onWIFIStateChanged | state (int), isLNF (int) | indicates that the state has changed state indicates the current wifi state: 0 – UNINSTALLED – the device was in an installed state and was uninstalled; OR the device does not have a wifi radio installed 1 – DISABLED – the device is installed (or was just installed) and has not yet been enabled 2 – DISCONNECTED – the device is installed and enabled, but not yet connected to a network 3 – PAIRING – the device is in the process of pairing, but not yet connected to a network 4 – CONNECTING – the device is attempting to connect to a network 5 – CONNECTED – the device is successfully connected to a network 6 – FAILED – the device has encountered an unrecoverable error with the wifi adapter isLNF : Not in use. |
onError | code (int) | a recoverable, unexcpected error occurred, as defined by one of the following values: |
0 – SSID_CHANGED | the SSID of the network changed | |
1 – CONNECTION_LOST | the connection to the network was lost | |
2 – CONNECTION_FAILED | the connection failed for an unknown reason | |
3 – CONNECTION_INTERRUPTED | the connection was interrupted | |
4 – INVALID_CREDENTIALS | the connection failed due to invalid credentials | |
5 – NO_SSID | the SSID does not exist | |
6 – UNKNOWN | any other error | |
7 – WIFI_AUTH_FAILED | The connection failed due to auth failure | |
onSSIDsChanged | none | fired when a new SSID becomes available or an existing SSID is no longer available |
onPairingStateChanged | state | fired when the pairing state changes and can be one of the values below: UNPAIRED – If the device is in a paired state, and the SSID is cleared, the device becomes unpaired PAIRING_STARTED – The pairing has started. This can happen when the user presses the pairing button on the wireless device, when initiateWPSPairing is invoked, or when connect(ssid, passphrase) is invoked. onWifiStateChanged(PAIRING) will occur between PAIRING_STARTED and PAIRED. PAIRED – Pairing has completed. The device is paired. |
type | String – the type of pairing (WPS, WPA, WEP, WPA2, NONE). NONE is the only value that can be received when state is UNPAIRED(0) | |
onWPSPairingButtonPressed | none | indicates that the WPS pairing button was pressed |
onWifiSignalThresholdChanged | signalStrength (float) strength (string) | signalStrength – float value in dBm strength – string value of “Excellent”, “Good”, “Fair” or “Weak” |
Version: 3
Adds methods getPairedSSIDInfo, getSwitchToPrivateResults, setAutoSwitchToPrivateEnabled, isAutoSwitchToPrivateEnabled, setStopLNFWhileDisconnected, isStopLNFWhileDisconnected. Adds isLNF attribute to onWIFIStateChanged event.
API Name
org.rdk.wifiManager_3
Methods
name | arguments | return value | description |
---|---|---|---|
getCurrentState | none | enum | gets the current WIFI state (see onWIFIStateChanged for state definitions) |
getAvailableSSIDs | none | array | gets the currently available networks. Each element of the array is an object containing the following properties: ssid (string) security (int) – supported values are NONE – 0, WPA – 1, WEP – 2 signalStrength(int) – the RSSI signal strength value for this endpoint. A zero value indicates the device is not in range. frequency (double) – the supported frequency for this ssid, measured in GHz |
getConnectedSSID | none | object | Returns the properties of the currently connected SSID which include: ssid (string) – the name of the SSID bssid (string) – the Basic Service Set ID (mac address) rate (float) – the Physical data rate in Mbps noise (float) – the average noise strength in dBm signalStrength (float) – the RSSI value in dBm |
setEnabled | enable: boolean | none | when true, enables the wifi adapter for this device. When false, disables the wifi adapter. |
connect | ssid :: string passphrase :: string securityMode :: int | boolean | attempts to connect to the specified ssid with the given passphrase. Passphrase can be null when the network security is NONE. See “Security Modes” section below. Returns true if the connection was successful. |
connect | none | boolean | Internally calls connect(ssid, passphrase, securityMode) with the stored stored/paired SSID and passphrase. |
initiateWPSPairing | timeout :: int | none | Initiates the connection via WPS. This should fire CONNECTING and CONNECTED state change events if successful or CONNECTION_FAILED error events if unsuccessful. If WPS pairing has not been completed by the specified timeout, it should result in a CONNECTION_FAILED state change. timeout – the period of time to wait for the WPS pairing to complete in seconds |
saveSSID | ssid :: string passphrase :: string securityMode :: int | boolean | Saves the ssid, passphrase and security mode for future sessions. If an SSID was previously saved, the new SSID and passphrase will overwrite the existing one. Returns false if the save failed, and true if the save was successful. |
clearSSID | none | boolean | Clears the saved SSID and BSSID. Returns false if the SSIDs could not be cleared, or true if the clear operation was successful. |
getPairedSSID | none | string | returns the SSID if one was previously saved through saveSSID, otherwise returns NULL. |
getPairedSSIDInfo | none | object | This is intended to replace getPairedSSID. Returns an object with the following k/v pairs: “SSID” – The SSID that the device is paired to. “BSSID” – The radio BSSID that the device is paired to. |
isPaired | none | boolean | returns true if this device has been previously paired ( calling saveSSID marks this device as paired ) |
Security Modes
value | description |
---|---|
0 | NONE – No security |
1 | WEP_64 |
2 | WEP_128 |
3 | WPA_PSK_TKIP |
4 | WPA_PSK_AES |
5 | WPA2_PSK_TKIP |
6 | WPA2_PSK_AES |
7 | WPA_ENTERPRISE_TKIP |
8 | WPA_ENTERPRISE_AES |
9 | WPA2_ENTERPRISE_TKIP |
10 | WPA2_ENTERPRISE_AES |
15 | NOT_SUPPORTED |
Events
name | payload | description |
---|---|---|
onWifiStateChanged | state (int), isLNF (int) | indicates that the state has changed state indicates the current wifi state: 0 – UNINSTALLED – the device was in an installed state and was uninstalled; OR the device does not have a wifi radio installed 1 – DISABLED – the device is installed (or was just installed) and has not yet been enabled 2 – DISCONNECTED – the device is installed and enabled, but not yet connected to a network 3 – PAIRING – the device is in the process of pairing, but not yet connected to a network 4 – CONNECTING – the device is attempting to connect to a network 5 – CONNECTED – the device is successfully connected to a network 6 – FAILED – the device has encountered an unrecoverable error with the wifi adapter isLNF : Not in Use |
onError | code (int) | a recoverable, unexcpected error occurred, as defined by one of the following values: |
0 – SSID_CHANGED | the SSID of the network changed | |
1 – CONNECTION_LOST | the connection to the network was lost | |
2 – CONNECTION_FAILED | the connection failed for an unknown reason | |
3 – CONNECTION_INTERRUPTED | the connection was interrupted | |
4 – INVALID_CREDENTIALS | the connection failed due to invalid credentials | |
5 – NO_SSID | the SSID does not exist | |
6 – UNKNOWN | any other error | |
7 – WIFI_AUTH_FAILED | The connection failed due to auth failure | |
onSSIDsChanged | none | fired when a new SSID becomes available or an existing SSID is no longer available |
onPairingStateChanged | state | fired when the pairing state changes and can be one of the values below: UNPAIRED – If the device is in a paired state, and the SSID is cleared, the device becomes unpaired PAIRING_STARTED – The pairing has started. This can happen when the user presses the pairing button on the wireless device, when initiateWPSPairing is invoked, or when connect(ssid, passphrase) is invoked. onWifiStateChanged(PAIRING) will occur between PAIRING_STARTED and PAIRED. PAIRED – Pairing has completed. The device is paired. |
type | String – the type of pairing (WPS, WPA, WEP, WPA2, NONE). NONE is the only value that can be received when state is UNPAIRED(0) | |
onWPSPairingButtonPressed | none | indicates that the WPS pairing button was pressed |
Version: 2
This version adds the switchToPrivate call, which invokes the Lost and Found process to switch to the private SSID.
API Name
org.rdk.wifiManager_2
Methods
name | arguments | return value | description |
---|---|---|---|
getCurrentState | none | enum | gets the current WIFI state (see onWIFIStateChanged for state definitions) |
getAvailableSSIDs | none | array | gets the currently available networks. Each element of the array is an object containing the following properties: ssid (string) – the name of the SSID bssid (string) – the Basic Service Set ID (mac address) security (int) – supported values are defined in the Security Modes table below signalStrength(float) – the RSSI value in dBm frequency (float) – the supported frequency for this ssid, measured in GHz |
getConnectedSSID | none | object | Returns the properties of the currently connected SSID which include: ssid (string) – the name of the SSID bssid (string) – the Basic Service Set ID (mac address) rate (float) – the Physical data rate in Mbps noise (float) – the average noise strength in dBm signalStrength (float) – the RSSI value in dBm |
setEnabled | enable: boolean | none | when true, enables the wifi adapter for this device. When false, disables the wifi adapter. |
connect | ssid :: string passphrase :: string securityMode :: int | boolean | attempts to connect to the specified ssid with the given passphrase. Passphrase can be null when the network security is NONE. See “Security Modes” section below. Returns true if the connection was successful. |
connect | none | boolean | Internally calls connect(ssid, passphrase, securityMode) with the stored stored/paired SSID and passphrase. |
initiateWPSPairing | none | none | Initiates the connection via WPS. This should fire CONNECTING and CONNECTED state change events if successful or CONNECTION_FAILED error events if unsuccessful. |
saveSSID | ssid :: string passphrase :: string securityMode :: int | boolean | Saves the ssid, passphrase and security mode for future sessions. If an SSID was previously saved, the new SSID and passphrase will overwrite the existing one. Returns false if the save failed, and true if the save was successful. |
clearSSID | none | boolean | Clears the saved SSID. Returns false if the could not be cleared, and true if the clear operation was successful. |
getPairedSSID | none | string | returns the SSID if one was previously saved through saveSSID, otherwise returns NULL |
isPaired | none | boolean | returns true if this device has been previously paired ( calling saveSSID marks this device as paired ) |
Security Modes
value | description |
---|---|
0 | NONE – No security |
1 | WEP_64 |
2 | WEP_128 |
3 | WPA_PSK_TKIP |
4 | WPA_PSK_AES |
5 | WPA2_PSK_TKIP |
6 | WPA2_PSK_AES |
7 | WPA_ENTERPRISE_TKIP |
8 | WPA_ENTERPRISE_AES |
9 | WPA2_ENTERPRISE_TKIP |
10 | WPA2_ENTERPRISE_AES |
15 | NOT_SUPPORTED |
Events
name | payload | description |
---|---|---|
onWIFIStateChanged | state (int) | indicates that the state has changed, state can be one of the following values: |
0 – UNINSTALLED | the device was in an installed state and was uninstalled; OR the device does not have a wifi radio installed | |
1 – DISABLED | the device is installed (or was just installed) and has not yet been enabled | |
2 – DISCONNECTED | the device is installed and enabled, but not yet connected to a network | |
3 – PAIRING | the device is in the process of pairing, but not yet connected to a network | |
4 – CONNECTING | the device is attempting to connect to a network | |
5 – CONNECTED | the device is successfully connected to a network | |
6 – FAILED | the device has encountered an unrecoverable error with the wifi adapter | |
onError | code (int) | a recoverable, unexcpected error occurred, as defined by one of the following values: |
0 – SSID_CHANGED | the SSID of the network changed | |
1 – CONNECTION_LOST | the connection to the network was lost | |
2 – CONNECTION_FAILED | the connection failed for an unknown reason | |
3 – CONNECTION_INTERRUPTED | the connection was interrupted | |
4 – INVALID_CREDENTIALS | the connection failed due to invalid credentials | |
5 – NO_SSID | the SSID does not exist | |
6 – UNKNOWN | any other error | |
7 – WIFI_AUTH_FAILED | The connection failed due to auth failure | |
onSSIDsChanged | none | fired when a new SSID becomes available or an existing SSID is no longer available |
onPairingStateChanged | state | fired when the pairing state changes and can be one of the values below: |
0 – UNPAIRED | If the device is in a paired state, and the SSID is cleared, the device becomes unpaired | |
1 – PAIRING_STARTED | The pairing has started. This can happen when the user presses the pairing button on the wireless device, when initiateWPSPairing is invoked, or when connect(ssid, passphrase) is invoked. onWifiStateChanged(PAIRING) will occur between PAIRING_STARTED and PAIRED. | |
2 – PAIRED | Pairing has completed. The device is paired. | |
type | String – the type of pairing (WPS, WPA, WEP, WPA2, NONE). NONE is the only value that can be received when state is UNPAIRED(0) |
Version: 1
API Name
org.rdk.wifiManager_1
Methods
name | arguments | return value | description |
---|---|---|---|
getCurrentState | none | enum | gets the current WIFI state (see onWIFIStateChanged for state definitions) |
getAvailableSSIDs | none | array | gets the currently available networks. Each element of the array is an object containing the following properties: ssid (string) security (int) – supported values are defined in the Security Modes table below signalStrength(float) – the RSSI value in dBm frequency (float) – the supported frequency for this ssid, measured in GHz |
setEnabled | enable: boolean | none | when true, enables the wifi adapter for this device. When false, disables the wifi adapter. |
connect | ssid :: string passphrase :: string securityMode :: int | boolean | attempts to connect to the specified ssid with the given passphrase. Passphrase can be null when the network security is NONE. See “Security Modes” section below. Returns true if the connection was successful. |
connect | none | boolean | Internally calls connect(ssid, passphrase, securityMode) with the stored stored/paired SSID and passphrase. |
initiateWPSPairing | none | none | Initiates the connection via WPS. This should fire CONNECTING and CONNECTED state change events if successful or CONNECTION_FAILED error events if unsuccessful. |
saveSSID | ssid :: string passphrase :: string securityMode :: int | boolean | Saves the ssid, passphrase and security mode for future sessions. If an SSID was previously saved, the new SSID and passphrase will overwrite the existing one. Returns false if the save failed, and true if the save was successful. |
clearSSID | none | boolean | Clears the saved SSID. Returns false if the could not be cleared, and true if the clear operation was successful. |
getPairedSSID | none | string | returns the SSID if one was previously saved through saveSSID, otherwise returns NULL |
isPaired | none | boolean | returns true if this device has been previously paired ( calling saveSSID marks this device as paired ) |
Security Modes
value | description |
---|---|
0 | NONE – No security |
1 | WEP_64 |
2 | WEP_128 |
3 | WPA_PSK_TKIP |
4 | WPA_PSK_AES |
5 | WPA2_PSK_TKIP |
6 | WPA2_PSK_AES |
7 | WPA_ENTERPRISE_TKIP |
8 | WPA_ENTERPRISE_AES |
9 | WPA2_ENTERPRISE_TKIP |
10 | WPA2_ENTERPRISE_AES |
15 | NOT_SUPPORTED |
Events
name | payload | description |
---|---|---|
onWIFIStateChanged | state (int) | indicates that the state has changed, state can be one of the following values: |
0 – UNINSTALLED | the device was in an installed state and was uninstalled; OR the device does not have a wifi radio installed | |
1 – DISABLED | the device is installed (or was just installed) and has not yet been enabled | |
2 – DISCONNECTED | the device is installed and enabled, but not yet connected to a network | |
3 – PAIRING | the device is in the process of pairing, but not yet connected to a network | |
4 – CONNECTING | the device is attempting to connect to a network | |
5 – CONNECTED | the device is successfully connected to a network | |
6 – FAILED | the device has encountered an unrecoverable error with the wifi adapter | |
onError | code (int) | a recoverable, unexcpected error occurred, as defined by one of the following values: |
0 – SSID_CHANGED | the SSID of the network changed | |
1 – CONNECTION_LOST | the connection to the network was lost | |
2 – CONNECTION_FAILED | the connection failed for an unknown reason | |
3 – CONNECTION_INTERRUPTED | the connection was interrupted | |
4 – INVALID_CREDENTIALS | the connection failed due to invalid credentials | |
5 – NO_SSID | the SSID does not exist | |
6 – UNKNOWN | any other error | |
7 – WIFI_AUTH_FAILED | The connection failed due to auth failure | |
onSSIDsChanged | none | fired when a new SSID becomes available or an existing SSID is no longer available |
onPairingStateChanged | state | fired when the pairing state changes and can be one of the values below: |
0 – UNPAIRED | If the device is in a paired state, and the SSID is cleared, the device becomes unpaired | |
1 – PAIRING_STARTED | The pairing has started. This can happen when the user presses the pairing button on the wireless device, when initiateWPSPairing is invoked, or when connect(ssid, passphrase) is invoked. onWifiStateChanged(PAIRING) will occur between PAIRING_STARTED and PAIRED. | |
2 – PAIRED | Pairing has completed. The device is paired. | |
type | String – the type of pairing (WPS, WPA, WEP, WPA2, NONE). NONE is the only value that can be received when state is UNPAIRED(0) |