17971782245f5f5b8c7a13fbd1f5a753040e01377Christopher Wiley/*
27971782245f5f5b8c7a13fbd1f5a753040e01377Christopher Wiley * Copyright (C) 2016 The Android Open Source Project
37971782245f5f5b8c7a13fbd1f5a753040e01377Christopher Wiley *
47971782245f5f5b8c7a13fbd1f5a753040e01377Christopher Wiley * Licensed under the Apache License, Version 2.0 (the "License");
57971782245f5f5b8c7a13fbd1f5a753040e01377Christopher Wiley * you may not use this file except in compliance with the License.
67971782245f5f5b8c7a13fbd1f5a753040e01377Christopher Wiley * You may obtain a copy of the License at
77971782245f5f5b8c7a13fbd1f5a753040e01377Christopher Wiley *
87971782245f5f5b8c7a13fbd1f5a753040e01377Christopher Wiley *      http://www.apache.org/licenses/LICENSE-2.0
97971782245f5f5b8c7a13fbd1f5a753040e01377Christopher Wiley *
107971782245f5f5b8c7a13fbd1f5a753040e01377Christopher Wiley * Unless required by applicable law or agreed to in writing, software
117971782245f5f5b8c7a13fbd1f5a753040e01377Christopher Wiley * distributed under the License is distributed on an "AS IS" BASIS,
127971782245f5f5b8c7a13fbd1f5a753040e01377Christopher Wiley * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
137971782245f5f5b8c7a13fbd1f5a753040e01377Christopher Wiley * See the License for the specific language governing permissions and
147971782245f5f5b8c7a13fbd1f5a753040e01377Christopher Wiley * limitations under the License.
157971782245f5f5b8c7a13fbd1f5a753040e01377Christopher Wiley */
167971782245f5f5b8c7a13fbd1f5a753040e01377Christopher Wiley
177971782245f5f5b8c7a13fbd1f5a753040e01377Christopher Wileypackage android.net.wifi;
187971782245f5f5b8c7a13fbd1f5a753040e01377Christopher Wiley
19c2b0dce5c32b4e6baf5d923b604529ea0ed97c5fNingyuan Wangimport android.net.wifi.IWifiScannerImpl;
20e5d0d670dc5a22816a2ec944e2384fd42634aa06Ningyuan Wang
217971782245f5f5b8c7a13fbd1f5a753040e01377Christopher Wiley// IClientInterface represents a network interface that can be used to connect
227971782245f5f5b8c7a13fbd1f5a753040e01377Christopher Wiley// to access points and obtain internet connectivity.
237971782245f5f5b8c7a13fbd1f5a753040e01377Christopher Wileyinterface IClientInterface {
24a12253e46c1328548c4b37d7f365b4009a6e5776Ningyuan Wang  // Get packet counters for this interface.
25a12253e46c1328548c4b37d7f365b4009a6e5776Ningyuan Wang  // First element in array is the number of successfully transmitted packets.
26a12253e46c1328548c4b37d7f365b4009a6e5776Ningyuan Wang  // Second element in array is the number of tramsmission failure.
27b52f635f890b0370349014890fcb6bc49ebabd66Ningyuan Wang  // This call is valid only when interface is associated with an AP, otherwise
28b52f635f890b0370349014890fcb6bc49ebabd66Ningyuan Wang  // it returns an empty array.
29a12253e46c1328548c4b37d7f365b4009a6e5776Ningyuan Wang  int[] getPacketCounters();
30cc77f636f4c790dd8a7ecefc3bbe8568fc8b040bNingyuan Wang
31b52f635f890b0370349014890fcb6bc49ebabd66Ningyuan Wang  // Do signal poll for this interface.
32b52f635f890b0370349014890fcb6bc49ebabd66Ningyuan Wang  // First element in array is the RSSI value in dBM.
33b52f635f890b0370349014890fcb6bc49ebabd66Ningyuan Wang  // Second element in array is the transmission bit rate in Mbps.
34903b9d029cbb2897fc3b2c2b731bf9e1bc7bb4a0Ningyuan Wang  // Third element in array is the association frequency in MHz.
35b52f635f890b0370349014890fcb6bc49ebabd66Ningyuan Wang  // This call is valid only when interface is associated with an AP, otherwise
36b52f635f890b0370349014890fcb6bc49ebabd66Ningyuan Wang  // it returns an empty array.
37b52f635f890b0370349014890fcb6bc49ebabd66Ningyuan Wang  int[] signalPoll();
38b52f635f890b0370349014890fcb6bc49ebabd66Ningyuan Wang
39cc77f636f4c790dd8a7ecefc3bbe8568fc8b040bNingyuan Wang  // Get the MAC address of this interface.
40cc77f636f4c790dd8a7ecefc3bbe8568fc8b040bNingyuan Wang  byte[] getMacAddress();
41223dfaafe0214c54ac6eb6ab0dc6899b3f2c58c3Christopher Wiley
42223dfaafe0214c54ac6eb6ab0dc6899b3f2c58c3Christopher Wiley  // Retrieve the name of the network interface corresponding to this
43223dfaafe0214c54ac6eb6ab0dc6899b3f2c58c3Christopher Wiley  // IClientInterface instance (e.g. "wlan0")
44223dfaafe0214c54ac6eb6ab0dc6899b3f2c58c3Christopher Wiley  @utf8InCpp
45223dfaafe0214c54ac6eb6ab0dc6899b3f2c58c3Christopher Wiley  String getInterfaceName();
46223dfaafe0214c54ac6eb6ab0dc6899b3f2c58c3Christopher Wiley
47c2b0dce5c32b4e6baf5d923b604529ea0ed97c5fNingyuan Wang  // Get a WifiScanner interface associated with this interface.
48c2b0dce5c32b4e6baf5d923b604529ea0ed97c5fNingyuan Wang  // Returns null when the underlying interface object is destroyed.
49c2b0dce5c32b4e6baf5d923b604529ea0ed97c5fNingyuan Wang  @nullable IWifiScannerImpl getWifiScannerImpl();
50c2b0dce5c32b4e6baf5d923b604529ea0ed97c5fNingyuan Wang
511a9144930ef7582e9a0cd17fa2691ae3d03dfb06Glen Kuhne  // Set the MAC address of this interface
521a9144930ef7582e9a0cd17fa2691ae3d03dfb06Glen Kuhne  // Returns true if the set was successful
531a9144930ef7582e9a0cd17fa2691ae3d03dfb06Glen Kuhne  boolean setMacAddress(in byte[] mac);
547971782245f5f5b8c7a13fbd1f5a753040e01377Christopher Wiley}
55