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
17package android.net.wifi;
18
19import android.net.wifi.IPnoScanEvent;
20import android.net.wifi.IScanEvent;
21import com.android.server.wifi.wificond.NativeScanResult;
22import com.android.server.wifi.wificond.PnoSettings;
23import com.android.server.wifi.wificond.SingleScanSettings;
24
25interface IWifiScannerImpl {
26  // Returns an array of available frequencies for 2.4GHz channels.
27  // Returrns null on failure.
28  @nullable int[] getAvailable2gChannels();
29
30  // Returns an array of available frequencies for 5GHz non-DFS channels.
31  // Returrns null on failure.
32  @nullable int[] getAvailable5gNonDFSChannels();
33
34  // Returns an array of available frequencies for DFS channels.
35  // Returrns null on failure.
36  @nullable int[] getAvailableDFSChannels();
37
38  // Get the latest single scan results from kernel.
39  NativeScanResult[] getScanResults();
40
41  // Get the latest pno scan results from the interface which has most recently
42  // completed disconnected mode PNO scans
43  NativeScanResult[] getPnoScanResults();
44
45  // Request a single scan using a SingleScanSettings parcelable object.
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|.
51  oneway void subscribeScanEvents(IScanEvent handler);
52
53  // Unsubscribe single scanning events .
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|.
59  oneway void subscribePnoScanEvents(IPnoScanEvent handler);
60
61  // Unsubscribe Pno scanning events .
62  oneway void unsubscribePnoScanEvents();
63
64  // Request a scheduled scan.
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.
70  boolean stopPnoScan();
71
72  // Abort ongoing scan.
73  void abortScan();
74
75  // TODO(nywang) add more interfaces.
76}
77