michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include "nsISupports.idl" michael@0: #include "nsIDOMDOMRequest.idl" michael@0: #include "nsIDOMEvent.idl" michael@0: michael@0: interface nsIVariant; michael@0: michael@0: [scriptable, uuid(cf1ac02b-1f39-446e-815b-651ac78d2233)] michael@0: interface nsIWifiScanResult : nsISupports { michael@0: readonly attribute DOMString ssid; michael@0: readonly attribute DOMString bssid; michael@0: michael@0: const int32_t WPA_PSK = 0x01; michael@0: const int32_t WPA_EAP = 0x02; michael@0: const int32_t WEP = 0x04; michael@0: readonly attribute uint32_t capabilities; michael@0: michael@0: /** michael@0: * Strength of the signal to network. michael@0: */ michael@0: readonly attribute uint32_t signalStrength; michael@0: michael@0: readonly attribute uint32_t relSignalStrength; michael@0: readonly attribute boolean connected; michael@0: }; michael@0: michael@0: [scriptable, uuid(a6931ebf-8493-4014-90e2-99f406999982)] michael@0: interface nsIWifiScanResultsReady : nsISupports { michael@0: michael@0: /** michael@0: * Callback with list of networks. michael@0: */ michael@0: void onready(in uint32_t count, [array, size_is(count)] in nsIWifiScanResult results); michael@0: michael@0: /** michael@0: * Callback if scanning for networks failed after 3 retry attempts. michael@0: */ michael@0: void onfailure(); michael@0: }; michael@0: michael@0: [scriptable, uuid(08dfefed-5c5d-4468-8c5d-2c65c24692d9)] michael@0: interface nsIWifi : nsISupports michael@0: { michael@0: /** michael@0: * Shutdown the wifi system. michael@0: */ michael@0: void shutdown(); michael@0: michael@0: /** michael@0: * Returns the list of currently available networks as well as the list of michael@0: * currently configured networks. michael@0: * michael@0: * On success a callback is notified with the list of networks. michael@0: * On failure after 3 scan retry attempts a callback is notified of failure. michael@0: */ michael@0: void getWifiScanResults(in nsIWifiScanResultsReady callback); michael@0: };