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.enabledRead only- A boolean indicating whether the wifi is on (
true) or off (false). WifiManager.macAddressRead only- A string representing the wifi adapter's MAC address.
WifiManager.connectionRead only- An object providing information about the current connection (status and network in use).
WifiManager.connectionInformationRead only- An object providing extra information about the current connection or
nullif the device is not connected to the wifi.
Event handlers
WifiManager.onenabled- A handler for the
enabledevent; it is triggered when the wifi has been turned on. WifiManager.ondisabled- A handler for the
disabledevent; it is triggered when the wifi has been turned off. WifiManager.onstatuschange- A handler for the
statuschangeevent; the event object is aMozWifiStatusChangeEventinstance. WifiManager.connectionInfoUpdateRequires Firefox OS 1.4 or belowWifiManager.onconnectionInfoUpdateRequires Firefox OS 2.0 or belowWifiManager.onconnectioninfoupdateRequires Firefox OS 2.1- A handler for the
connectioninfoupdateevent; triggered any time the connection information changes. The event object is aMozWifiConnectionInfoEventinstance. WifiManager.onstationInfoUpdateRequires Firefox OS 2.0WifiManager.onstationinfoupdateRequires 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
navigator.mozWifiManagerMozWifiConnectionInfoEventMozWifiStatusChangeEvent- The WiFi Information API article
- Pages with the tag WiFi