• 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 
34   // Scan request status
35   // Request succeeded
36   const int SCAN_STATUS_SUCCESS = 0;
37   // All other standard error codes are mapped to this
38   const int SCAN_STATUS_FAILED_GENERIC = 1;
39   //Device or resource busy - Due to connection in progress, processing another scan request etc.
40   const int SCAN_STATUS_FAILED_BUSY = 2;
41   // Aborted - Due to another high priority operation like roaming, offload scan etc
42   const int SCAN_STATUS_FAILED_ABORT = 3;
43   // No such device - Due to wrong interface or interface doesn't exist
44   const int SCAN_STATUS_FAILED_NODEV = 4;
45   // Invalid argument - Due to wrong/unsupported argument passed in scan params
46   const int SCAN_STATUS_FAILED_INVALID_ARGS = 5;
47   // Scan type used internally if the device does not support
48   // the type specified in |SingleScanSettings.scan_type|.
49   // Scan requests from framework with this type will be rejected.
50   const int SCAN_TYPE_DEFAULT = -1;
51 
52   // Get the latest single scan results from kernel.
getScanResults()53   NativeScanResult[] getScanResults();
54 
55   // Get the latest pno scan results from the interface which has most recently
56   // completed disconnected mode PNO scans
getPnoScanResults()57   NativeScanResult[] getPnoScanResults();
58 
59   // Get the max number of SSIDs that the driver supports per scan.
getMaxSsidsPerScan()60   int getMaxSsidsPerScan();
61 
62   // Request a single scan using a SingleScanSettings parcelable object.
63   // This interface is deprecated from Android 14, newer wificond implementation should call
64   // scanRequest() which can return the scan request status.
scan(in SingleScanSettings scanSettings)65   boolean scan(in SingleScanSettings scanSettings);
66 
67   // Request a single scan using a SingleScanSettings parcelable object.
scanRequest(in SingleScanSettings scanSettings)68   int scanRequest(in SingleScanSettings scanSettings);
69 
70   // Subscribe single scanning events.
71   // Scanner assumes there is only one subscriber.
72   // This call will replace any existing |handler|.
subscribeScanEvents(IScanEvent handler)73   oneway void subscribeScanEvents(IScanEvent handler);
74 
75   // Unsubscribe single scanning events .
unsubscribeScanEvents()76   oneway void unsubscribeScanEvents();
77 
78   // Subscribe Pno scanning events.
79   // Scanner assumes there is only one subscriber.
80   // This call will replace any existing |handler|.
subscribePnoScanEvents(IPnoScanEvent handler)81   oneway void subscribePnoScanEvents(IPnoScanEvent handler);
82 
83   // Unsubscribe Pno scanning events .
unsubscribePnoScanEvents()84   oneway void unsubscribePnoScanEvents();
85 
86   // Request a scheduled scan.
startPnoScan(in PnoSettings pnoSettings)87   boolean startPnoScan(in PnoSettings pnoSettings);
88 
89   // Stop any existing scheduled scan.
90   // Returns true on success.
91   // Returns false on failure or there is no existing scheduled scan.
stopPnoScan()92   boolean stopPnoScan();
93 
94   // Abort ongoing scan.
abortScan()95   void abortScan();
96 
97   // add more interfaces.
98 }
99