• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2016 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 package android.net.wifi.nl80211;
18 
19 import android.net.wifi.nl80211.IPnoScanEvent;
20 import android.net.wifi.nl80211.IScanEvent;
21 import android.net.wifi.nl80211.NativeScanResult;
22 import android.net.wifi.nl80211.PnoSettings;
23 import android.net.wifi.nl80211.SingleScanSettings;
24 
25 /**
26  * @hide
27  */
28 interface IWifiScannerImpl {
29   // Type of scan request. This is used in |SingleScanSettings.scan_type|.
30   const int SCAN_TYPE_LOW_SPAN = 0;
31   const int SCAN_TYPE_LOW_POWER = 1;
32   const int SCAN_TYPE_HIGH_ACCURACY = 2;
33   // Scan type used internally if the device does not support
34   // the type specified in |SingleScanSettings.scan_type|.
35   // Scan requests from framework with this type will be rejected.
36   const int SCAN_TYPE_DEFAULT = -1;
37 
38   // Get the latest single scan results from kernel.
getScanResults()39   NativeScanResult[] getScanResults();
40 
41   // Get the latest pno scan results from the interface which has most recently
42   // completed disconnected mode PNO scans
getPnoScanResults()43   NativeScanResult[] getPnoScanResults();
44 
45   // Request a single scan using a SingleScanSettings parcelable object.
scan(in SingleScanSettings scanSettings)46   boolean scan(in SingleScanSettings scanSettings);
47 
48   // Subscribe single scanning events.
49   // Scanner assumes there is only one subscriber.
50   // This call will replace any existing |handler|.
subscribeScanEvents(IScanEvent handler)51   oneway void subscribeScanEvents(IScanEvent handler);
52 
53   // Unsubscribe single scanning events .
unsubscribeScanEvents()54   oneway void unsubscribeScanEvents();
55 
56   // Subscribe Pno scanning events.
57   // Scanner assumes there is only one subscriber.
58   // This call will replace any existing |handler|.
subscribePnoScanEvents(IPnoScanEvent handler)59   oneway void subscribePnoScanEvents(IPnoScanEvent handler);
60 
61   // Unsubscribe Pno scanning events .
unsubscribePnoScanEvents()62   oneway void unsubscribePnoScanEvents();
63 
64   // Request a scheduled scan.
startPnoScan(in PnoSettings pnoSettings)65   boolean startPnoScan(in PnoSettings pnoSettings);
66 
67   // Stop any existing scheduled scan.
68   // Returns true on success.
69   // Returns false on failure or there is no existing scheduled scan.
stopPnoScan()70   boolean stopPnoScan();
71 
72   // Abort ongoing scan.
abortScan()73   void abortScan();
74 
75   // TODO(nywang) add more interfaces.
76 }
77