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

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

Summary

The WifiManager API provides access to the wifi device capability.

Interface

interface WifiManager {
  readonly attribute boolean enabled;
  readonly attribute string macAddress;
  readonly attribute object connection;
  readonly attribute object connectionInformation;

  attribute nsIDOMEventListener onenabled;
  attribute nsIDOMEventListener ondisabled;
  attribute nsIDOMEventListener onstatuschange;
  attribute nsIDOMEventListener onconnectioninfoupdate;
  attribute nsIDOMEventListener onstationinfoupdate

  DOMRequest getNetworks();
  DOMRequest getKnownNetworks();
  DOMRequest associate(object network);
  DOMRequest forget(object network);
  DOMRequest wps(object detail);
  DOMRequest setPowerSavingMode(boolean enabled);
  DOMRequest setStaticIpMode(object network, object info)
};

Properties

WifiManager.enabled Read only
A boolean indicating whether the wifi is on (true) or off (false).
WifiManager.macAddress Read only
A string representing the wifi adapter's MAC address.
WifiManager.connection Read only
An object providing information about the current connection (status and network in use).
WifiManager.connectionInformation Read only
An object providing extra information about the current connection or null if the device is not connected to the wifi.

Event handlers

WifiManager.onenabled
A handler for the enabled event; it is triggered when the wifi has been turned on.
WifiManager.ondisabled
A handler for the disabled event; it is triggered when the wifi has been turned off.
WifiManager.onstatuschange
A handler for the statuschange event; the event object is a MozWifiStatusChangeEvent instance.
WifiManager.connectionInfoUpdate Requires Firefox OS 1.4 or below
WifiManager.onconnectionInfoUpdate Requires Firefox OS 2.0 or below
WifiManager.onconnectioninfoupdate Requires Firefox OS 2.1
A handler for the connectioninfoupdate event; triggered any time the connection information changes. The event object is a MozWifiConnectionInfoEvent instance.
WifiManager.onstationInfoUpdate Requires Firefox OS 2.0
WifiManager.onstationinfoupdate Requires Firefox OS 2.1
TBD

Methods

WifiManager.associate()
Allows to associate (and connect) a device with a given network. Returns a DOMRequest.
WifiManager.forget()
Allows to make a device no longer associate with a given network. Returns a DOMRequest.
WifiManager.getKnownNetworks()
Allows to retrieve the list of all the networks the device was associated with. Returns a DOMRequest.
WifiManager.getNetworks()
Allows to retrieve the list of all the networks available in the area surrounding the device. Returns a DOMRequest.
WifiManager.setPowerSavingMode()
Allows the wifi adapter to enter/exit power saving mode. Returns a DOMRequest.
WifiManager.setStaticIpMode()
Allows to configure a static IP address for the device on a given network. Returns a DOMRequest.
WifiManager.wps()
Allows to connect the device to a network using the network's WPS capability (if any). Returns a DOMRequest.

Specification

Not part of any specification

See also

Document Tags and Contributors

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