• 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;
18 
19 import android.net.wifi.IANQPDoneCallback;
20 import android.net.wifi.IWifiScannerImpl;
21 
22 // IClientInterface represents a network interface that can be used to connect
23 // to access points and obtain internet connectivity.
24 interface IClientInterface {
25 
26   // Enable a wpa_supplicant instance running against this interface.
27   // Returns true if supplicant was successfully enabled, or is already enabled.
enableSupplicant()28   boolean enableSupplicant();
29 
30   // Remove this interface from wpa_supplicant's control.
31   // Returns true if removal was successful.
disableSupplicant()32   boolean disableSupplicant();
33 
34   // Get packet counters for this interface.
35   // First element in array is the number of successfully transmitted packets.
36   // Second element in array is the number of tramsmission failure.
37   // This call is valid only when interface is associated with an AP, otherwise
38   // it returns an empty array.
getPacketCounters()39   int[] getPacketCounters();
40 
41   // Do signal poll for this interface.
42   // First element in array is the RSSI value in dBM.
43   // Second element in array is the transmission bit rate in Mbps.
44   // Third element in array is the association frequency in MHz.
45   // This call is valid only when interface is associated with an AP, otherwise
46   // it returns an empty array.
signalPoll()47   int[] signalPoll();
48 
49   // Get the MAC address of this interface.
getMacAddress()50   byte[] getMacAddress();
51 
52   // Retrieve the name of the network interface corresponding to this
53   // IClientInterface instance (e.g. "wlan0")
54   @utf8InCpp
getInterfaceName()55   String getInterfaceName();
56 
57   // Get a WifiScanner interface associated with this interface.
58   // Returns null when the underlying interface object is destroyed.
getWifiScannerImpl()59   @nullable IWifiScannerImpl getWifiScannerImpl();
60 
61   // Query specified ANQP elements from an AP (specified by BSSID)
62   // and provide a callback for ANQP response.
63   // Returns true if request is sent successfully, false otherwise.
requestANQP(in byte[] bssid, IANQPDoneCallback callback)64   boolean requestANQP(in byte[] bssid, IANQPDoneCallback callback);
65 }
66