This namespace provides access to the Wi-Fi functionality.
- Since:
- Version 1.5 (API level 6)
Classes
Members
-
static, readonly AccessPointState :object
-
This enumeration represents the connection state of mobicontrol.wifi.AccessPoint.
Properties:
Name Type Description CURRENT
object This is the access point we are currently connected to. Note: In some scenarios currently connected access points may be reported as ENABLED
.DISABLED
object The access point is disabled, that is, it won't be considered for auto-connection when in range. ENABLED
object The access point is enabled, that is, it will be considered for auto-connection when in range. UNKNOWN
object The access point is uninstalled or we cannot access its state. - Since:
- Version 1.5 (API level 6)
-
static, readonly WifiStatusCode :object
-
This enumeration represents an error status code of mobicontrol.wifi.WifiError.
Properties:
Name Type Description UNKNOWN
object The exact error could not be determined. OPERATION_NOT_SUPPORTED
object Wi-Fi operation is not supported on this device. NO_PERMISSION
object The agent doesn't have the required permission. LOCATION_SERVICES_OFF
object Location services are turned off, some Wi-Fi functionality might be inaccessible. PROPERTY_NOT_SUPPORTED
object Specific Wi-Fi property is not supported on this device. - Since:
- Version 1.5 (API level 6)
Methods
-
static clearBlacklist() → {boolean}
-
Clear Blacklisted SSIDs. Clear the blacklisted SSIDs and make them available among the accessible networks.
Returns:
boolean -true
if the blacklisted SSIDs were cleared,false
otherwise.- Since:
- Version 1.6 (API level 7)
-
static createWifiConfiguration(ssid) → {mobicontrol.wifi.WifiConfiguration}
-
Create Wi-Fi configuration.
Parameters:
Name Type Description ssid
string Service set identifier - the unique name that identifies a wireless network, must not be empty. Returns:
mobicontrol.wifi.WifiConfiguration - Wi-Fi configuration.- Since:
- Version 1.5 (API level 6)
Example
var config = mobicontrol.wifi.createWifiConfiguration('Test_SSID'); mobicontrol.log.info(config.ssid);
-
static disable(accessPoint)
-
Disable Wi-Fi access point. Disconnect from the Wi-Fi access point if currently connected.
Parameters:
Name Type Description accessPoint
mobicontrol.wifi.AccessPoint The saved Wi-Fi network on the device. Throws:
- Since:
- Version 1.5 (API level 6)
-
static enable(accessPoint)
-
Enable Wi-Fi access point. Initialize connection with the Wi-Fi access point when in range.
Parameters:
Name Type Description accessPoint
mobicontrol.wifi.AccessPoint The saved Wi-Fi network on the device. Throws:
- Since:
- Version 1.5 (API level 6)
-
static install(config) → {mobicontrol.wifi.AccessPoint}
-
Install Wi-Fi configuration.
Parameters:
Name Type Description config
mobicontrol.wifi.WifiConfiguration Wi-Fi configuration. Throws:
Returns:
mobicontrol.wifi.AccessPoint - Wi-Fi access point.- Since:
- Version 1.5 (API level 6)
Example
var config = mobicontrol.wifi.createWifiConfiguration('Test_SSID'); mobicontrol.wifi.install(config);
-
static listAccessPoints() → {Array.<mobicontrol.wifi.AccessPoint>}
-
List installed Wi-Fi access points. This may only work if location services are enabled.
Returns:
Array.<mobicontrol.wifi.AccessPoint> - An array of installed Wi-Fi access points.- Since:
- Version 1.5 (API level 6)
Example
mobicontrol.wifi.listAccessPoints().forEach( ap => { if (!(ap instanceof mobicontrol.wifi.AccessPoint)) { throw 'Error!'; } } );
-
static setBlacklist(wifiSsidsopt) → {boolean}
-
Set the list of blacklisted SSIDs. Add the SSIDs to the blacklist.
Parameters:
Name Type Attributes Description wifiSsids
Array.<string> <optional>
SSIDs list Returns:
boolean -true
if the SSIDs are added to the blacklist,false
otherwise.- Since:
- Version 1.6 (API level 7)
Example
const SSIDS = ["Test-Wi-Fi-1", "Test-Wi-Fi-2"] mobicontrol.wifi.setBlacklist(SSIDS)
-
static uninstall(accessPoint)
-
Remove Wi-Fi configuration.
Parameters:
Name Type Description accessPoint
mobicontrol.wifi.AccessPoint Installed Wi-Fi access point. Throws:
- Since:
- Version 1.5 (API level 6)
Example
var accessPoint = mobicontrol.wifi.listAccessPoints().find(ap => ap.ssid == "QAA"); mobicontrol.wifi.uninstall(accessPoint); mobicontrol.log.info("QAA WiFi access point is uninstalled.");