WinWifiScanner.h (1074B)
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 #pragma once 6 7 #include "mozilla/UniquePtr.h" 8 #include "WlanLibrary.h" 9 #include "WifiScanner.h" 10 11 class nsIWifiAccessPoint; 12 13 namespace mozilla { 14 15 class WifiScannerImpl final : public WifiScanner { 16 public: 17 WifiScannerImpl(); 18 ~WifiScannerImpl(); 19 20 /** 21 * True if there is a wifi adapter present that can perform a scan. 22 */ 23 bool HasWifiAdapter() { return !!mWlanLibrary; } 24 25 /** 26 * GetAccessPointsFromWLAN 27 * 28 * Scans the available wireless interfaces for nearby access points and 29 * populates the supplied collection with them 30 * 31 * @param accessPoints The collection to populate with available APs 32 * @return NS_OK on success, failure codes on failure 33 */ 34 nsresult GetAccessPointsFromWLAN( 35 nsTArray<RefPtr<nsIWifiAccessPoint>>& accessPoints); 36 37 private: 38 mozilla::UniquePtr<WinWLANLibrary> mWlanLibrary; 39 }; 40 41 } // namespace mozilla