|
1 /* This Source Code Form is subject to the terms of the Mozilla Public |
|
2 * License, v. 2.0. If a copy of the MPL was not distributed with this |
|
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
|
4 |
|
5 #include "nsISupports.idl" |
|
6 #include "nsIDOMDOMRequest.idl" |
|
7 #include "nsIDOMEvent.idl" |
|
8 |
|
9 interface nsIVariant; |
|
10 |
|
11 [scriptable, uuid(cf1ac02b-1f39-446e-815b-651ac78d2233)] |
|
12 interface nsIWifiScanResult : nsISupports { |
|
13 readonly attribute DOMString ssid; |
|
14 readonly attribute DOMString bssid; |
|
15 |
|
16 const int32_t WPA_PSK = 0x01; |
|
17 const int32_t WPA_EAP = 0x02; |
|
18 const int32_t WEP = 0x04; |
|
19 readonly attribute uint32_t capabilities; |
|
20 |
|
21 /** |
|
22 * Strength of the signal to network. |
|
23 */ |
|
24 readonly attribute uint32_t signalStrength; |
|
25 |
|
26 readonly attribute uint32_t relSignalStrength; |
|
27 readonly attribute boolean connected; |
|
28 }; |
|
29 |
|
30 [scriptable, uuid(a6931ebf-8493-4014-90e2-99f406999982)] |
|
31 interface nsIWifiScanResultsReady : nsISupports { |
|
32 |
|
33 /** |
|
34 * Callback with list of networks. |
|
35 */ |
|
36 void onready(in uint32_t count, [array, size_is(count)] in nsIWifiScanResult results); |
|
37 |
|
38 /** |
|
39 * Callback if scanning for networks failed after 3 retry attempts. |
|
40 */ |
|
41 void onfailure(); |
|
42 }; |
|
43 |
|
44 [scriptable, uuid(08dfefed-5c5d-4468-8c5d-2c65c24692d9)] |
|
45 interface nsIWifi : nsISupports |
|
46 { |
|
47 /** |
|
48 * Shutdown the wifi system. |
|
49 */ |
|
50 void shutdown(); |
|
51 |
|
52 /** |
|
53 * Returns the list of currently available networks as well as the list of |
|
54 * currently configured networks. |
|
55 * |
|
56 * On success a callback is notified with the list of networks. |
|
57 * On failure after 3 scan retry attempts a callback is notified of failure. |
|
58 */ |
|
59 void getWifiScanResults(in nsIWifiScanResultsReady callback); |
|
60 }; |