mozilla

Revision 433503 of WifiManager

  • Revision slug: Web/API/WifiManager
  • Revision title: WifiManager
  • Revision id: 433503
  • Created:
  • Creator: dbruant
  • Is current revision? No
  • Comment props

Revision Content

{{ non-standard_header() }}

{{ B2GOnlyHeader2('installed') }}

Summary

The WifiManager API provides access to the wifi device capability

Interface

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

    attribute nsIDOMEventListener onstatuschange;
    attribute nsIDOMEventListener connectionInfoUpdate;
    attribute nsIDOMEventListener onenabled;
    attribute nsIDOMEventListener ondisabled;

    DOMRequest getNetworks();
    DOMRequest getKnownNetworks();
    DOMRequest associate( ? network);
    DOMRequest forget( ? network);
    DOMRequest wps( ? detail);
    DOMRequest setPowerSavingMode(boolean enabled);
};

Properties

{{domxref("WifiManager.enabled")}}
Indicates whether the wifi is on.
{{domxref("WifiManager.macAddress")}}
The wifi adapter MAC address
{{domxref("WifiManager.connection")}}
A non-null object containing the following information:
status (one of "disconnected", "connecting", "associated" or "connected")
network
{{domxref("WifiManager.connectionInformation")}}
A connectionInformation object with the same information found in an MozWifiConnectionInfoEvent (but without the network). This will be null if the device is not connected to the Wifi.

Event handlers

{{domxref("WifiManager.onenabled")}}
A handler for the {{event("enabled")}} event; It is triggered when the wifi has been turned on.

Methods

{{domxref("WifiManager.enable()")}}
Turns on the wifi on. Returns a {{domxref("DOMRequest")}} for the success or error of the operation.

Revision Source

<p>{{ non-standard_header() }}</p>
<p>{{ B2GOnlyHeader2('installed') }}</p>
<h2 id="Summary">Summary</h2>
<p>The WifiManager API provides access to the wifi device capability</p>
<h2 id="Interface">Interface</h2>
<pre>
interface WifiManager {
    readonly attribute boolean enabled;
    readonly attribute string macAddress;
    readonly attribute ? connection;
    readonly attribute ? connectionInformation;

    attribute nsIDOMEventListener onstatuschange;
    attribute nsIDOMEventListener connectionInfoUpdate;
    attribute nsIDOMEventListener onenabled;
    attribute nsIDOMEventListener ondisabled;

    DOMRequest getNetworks();
    DOMRequest getKnownNetworks();
    DOMRequest associate( ? network);
    DOMRequest forget( ? network);
    DOMRequest wps( ? detail);
    DOMRequest setPowerSavingMode(boolean enabled);
};
</pre>
<h2 id="Properties">Properties</h2>
<dl>
  <dt>
    {{domxref("WifiManager.enabled")}}</dt>
  <dd>
    Indicates whether the wifi is on.</dd>
  <dt>
    {{domxref("WifiManager.macAddress")}}</dt>
  <dd>
    The wifi adapter <a href="http://en.wikipedia.org/wiki/MAC_address" title="http://en.wikipedia.org/wiki/MAC_address">MAC address</a></dd>
  <dt>
    {{domxref("WifiManager.connection")}}</dt>
  <dd>
    A non-<code>null</code> object containing the following information:</dd>
  <dd>
    <strong>status</strong> (one of<code> "disconnected"</code>, <code>"connecting"</code>, <code>"associated"</code> or <code>"connected"</code>)<br />
    <strong>network</strong></dd>
  <dt>
    {{domxref("WifiManager.connectionInformation")}}</dt>
  <dd>
    A connectionInformation object with the same information found in an <code>MozWifiConnectionInfoEvent</code> (but without the <code>network</code>). This will be <code>null</code> if the device is not connected to the Wifi.</dd>
</dl>
<h3 id="Event_handlers">Event handlers</h3>
<dl>
  <dt>
    {{domxref("WifiManager.onenabled")}}</dt>
  <dd>
    A handler for the {{event("enabled")}} event; It is triggered when the wifi has been turned on.</dd>
</dl>
<h2 id="Methods">Methods</h2>
<dl>
  <dt>
    {{domxref("WifiManager.enable()")}}</dt>
  <dd>
    Turns on the wifi on. Returns a {{domxref("DOMRequest")}} for the success or error of the operation.</dd>
</dl>
Revert to this revision