2 * Copyright (C) 2016 The Android Open Source Project
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 package android.net.wifi;
19 import android.net.wifi.IPnoScanEvent;
20 import android.net.wifi.IScanEvent;
21 import com.android.server.wifi.wificond.NativeScanResult;
22 import com.android.server.wifi.wificond.PnoSettings;
23 import com.android.server.wifi.wificond.SingleScanSettings;
25 interface IWifiScannerImpl {
26 // Returns an array of available frequencies for 2.4GHz channels.
27 // Returrns null on failure.
28 @nullable int[] getAvailable2gChannels();
30 // Returns an array of available frequencies for 5GHz non-DFS channels.
31 // Returrns null on failure.
32 @nullable int[] getAvailable5gNonDFSChannels();
34 // Returns an array of available frequencies for DFS channels.
35 // Returrns null on failure.
36 @nullable int[] getAvailableDFSChannels();
38 // Get the latest single scan results from kernel.
39 NativeScanResult[] getScanResults();
41 // Get the latest pno scan results from the interface which has most recently
42 // completed disconnected mode PNO scans
43 NativeScanResult[] getPnoScanResults();
45 // Request a single scan using a SingleScanSettings parcelable object.
46 boolean scan(in SingleScanSettings scanSettings);
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);
53 // Unsubscribe single scanning events .
54 oneway void unsubscribeScanEvents();
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);
61 // Unsubscribe Pno scanning events .
62 oneway void unsubscribePnoScanEvents();
64 // Request a scheduled scan.
65 boolean startPnoScan(in PnoSettings pnoSettings);
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();
72 // Abort ongoing scan.
75 // TODO(nywang) add more interfaces.