1 /* 2 * Copyright (C) 2022 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 com.android.server.wifi.hal; 18 19 import android.net.MacAddress; 20 21 import java.util.List; 22 23 /** Abstraction of WifiApIface */ 24 public interface IWifiApIface { 25 /** 26 * Get the name of this interface. 27 * 28 * @return Name of this interface, or null on error. 29 */ getName()30 String getName(); 31 32 /** 33 * Get the names of the bridged AP instances. 34 * 35 * @return List containing the names of the bridged AP instances, 36 * or an empty vector for a non-bridged AP. Returns null 37 * if an error occurred. 38 */ getBridgedInstances()39 List<String> getBridgedInstances(); 40 41 /** 42 * Gets the factory MAC address of the interface. 43 * 44 * @return Factory MAC address of the interface, or null on error. 45 */ getFactoryMacAddress()46 MacAddress getFactoryMacAddress(); 47 48 /** 49 * Set the country code for this interface. 50 * 51 * @param countryCode two-letter country code (as ISO 3166). 52 * @return true if successful, false otherwise. 53 */ setCountryCode(byte[] countryCode)54 boolean setCountryCode(byte[] countryCode); 55 56 /** 57 * Reset all the AP interfaces' MAC address to the factory MAC address. 58 * 59 * @return true if successful, false otherwise. 60 */ resetToFactoryMacAddress()61 boolean resetToFactoryMacAddress(); 62 63 /** 64 * Check whether {@link #setMacAddress(MacAddress)} is supported by this HAL. 65 * 66 * @return true if supported, false otherwise. 67 */ isSetMacAddressSupported()68 boolean isSetMacAddressSupported(); 69 70 /** 71 * Changes the MAC address of the interface to the given MAC address. 72 * 73 * @param mac MAC address to change to. 74 * @return true if successful, false otherwise. 75 */ setMacAddress(MacAddress mac)76 boolean setMacAddress(MacAddress mac); 77 } 78