• 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.ISendMgmtFrameEvent;
20 import android.net.wifi.nl80211.IWifiScannerImpl;
21 
22 /**
23  * IClientInterface represents a network interface that can be used to connect
24  * to access points and obtain internet connectivity.
25  * @hide
26  */
27 interface IClientInterface {
28   // Get packet counters for this interface.
29   // First element in array is the number of successfully transmitted packets.
30   // Second element in array is the number of tramsmission failure.
31   // This call is valid only when interface is associated with an AP, otherwise
32   // it returns an empty array.
getPacketCounters()33   int[] getPacketCounters();
34 
35   // Do signal poll for this interface.
36   // First element in array is the RSSI value in dBM.
37   // Second element in array is the transmission bit rate in Mbps.
38   // Third element in array is the association frequency in MHz.
39   // Fourth element in array is the last received packet bit rate in Mbps.
40   // This call is valid only when interface is associated with an AP, otherwise
41   // it returns an empty array.
signalPoll()42   int[] signalPoll();
43 
44   // Get the MAC address of this interface.
getMacAddress()45   byte[] getMacAddress();
46 
47   // Retrieve the name of the network interface corresponding to this
48   // IClientInterface instance (e.g. "wlan0")
49   @utf8InCpp
getInterfaceName()50   String getInterfaceName();
51 
52   // Get a WifiScanner interface associated with this interface.
53   // Returns null when the underlying interface object is destroyed.
getWifiScannerImpl()54   @nullable IWifiScannerImpl getWifiScannerImpl();
55 
56   // Sends an arbitrary 802.11 management frame on the current channel.
57   // @param frame Bytes of the 802.11 management frame to be sent, including the
58   //     header, but not including the frame check sequence (FCS).
59   // @param Callback triggered when the transmitted frame is ACKed or the
60   //     transmission fails.
61   // @param mcs MCS rate which the management frame will be sent at. If mcs < 0,
62   //     the driver will select the rate automatically. If the device does not
63   //     support sending the frame at a specified MCS rate, the transmission
64   //     will be aborted and ISendMgmtFrameEvent.OnFailure() will be called with
65   //     reason ISendMgmtFrameEvent.SEND_MGMT_FRAME_ERROR_MCS_UNSUPPORTED.
SendMgmtFrame( in byte[] frame, in ISendMgmtFrameEvent callback, int mcs)66   oneway void SendMgmtFrame(
67       in byte[] frame, in ISendMgmtFrameEvent callback, int mcs);
68 }
69