Please note, this is a STATIC archive of website developer.mozilla.org from November 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

WifiManager.associate()

This API is available on Firefox OS for internal applications only.

Summary

The associate method is used to associate (and connect) a device with a given WiFi network.

Syntax

var request = navigator.mozWifiManager.associate(network);

Parameters

network
A network object as the ones provided by the getNetworks or getKnownNetworks methods.

Associating a secured network with the device requires setting some extra properties on the network object passed to the method:

  • For network with WEP encryption method:
    • wep: This property must be set with the proper password to access the network.
  • For network with WPA-PSK encryption method:
    • psk: This property must be set with the proper password to access the network.
  • For network with WPA-EAP encryption method:
    • eap: A string representing the EAP method to use.
    • password: A string representing the password to access the network.
    • identity: A string representing the identity to access the network.
    • pin: A string representing the pin code required to access the network.

Returns

It returns a DOMRequest to handle the success or error of the operation. A successful operation means than the device enters the connection workflow to the provided network. The success or failure of the connection itself can be tracked through the statuschange event by attaching an event handler to WifiManager.onstatuschange.

Specification

Not part of any specification.

See also

Document Tags and Contributors

 Contributors to this page: chrisdavidmills, teoli, kscarfone, Jeremie
 Last updated by: chrisdavidmills,