Roshan Pius | 9a3a84f | 2016-09-15 13:02:25 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 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 | |
Roshan Pius | 22ab8b2 | 2016-09-28 13:35:42 -0700 | [diff] [blame] | 17 | package android.hardware.wifi.supplicant@1.0; |
Roshan Pius | 9a3a84f | 2016-09-15 13:02:25 -0700 | [diff] [blame] | 18 | |
Roshan Pius | 9a3a84f | 2016-09-15 13:02:25 -0700 | [diff] [blame] | 19 | import ISupplicantNetwork; |
| 20 | |
| 21 | /** |
| 22 | * Interface exposed by wpa_supplicant for each network interface (e.g wlan0) |
| 23 | * it controls. |
| 24 | */ |
| 25 | interface ISupplicantIface { |
| 26 | /** |
| 27 | * Retrieves the name of the network interface. |
| 28 | * |
| 29 | * @return status Status of the operation. |
| 30 | * Possible status codes: |
| 31 | * |SupplicantStatusCode.SUCCESS|, |
| 32 | * |SupplicantStatusCode.FAILURE_IFACE_INVALID| |
| 33 | * @return name Name of the network interface, e.g., wlan0 |
| 34 | */ |
| 35 | getName() generates (SupplicantStatus status, string name); |
| 36 | |
| 37 | /** |
Roshan Pius | 39f588f | 2016-10-31 14:51:27 -0700 | [diff] [blame] | 38 | * Retrieves the type of the network interface. |
| 39 | * |
| 40 | * @return status Status of the operation. |
| 41 | * Possible status codes: |
| 42 | * |SupplicantStatusCode.SUCCESS|, |
| 43 | * |SupplicantStatusCode.FAILURE_IFACE_INVALID| |
| 44 | * @return type Type of the network interface, e.g., STA. |
| 45 | */ |
| 46 | getType() generates (SupplicantStatus status, IfaceType type); |
| 47 | |
| 48 | /** |
Roshan Pius | 9a3a84f | 2016-09-15 13:02:25 -0700 | [diff] [blame] | 49 | * Add a new network to the interface. |
| 50 | * |
| 51 | * @return status Status of the operation. |
| 52 | * Possible status codes: |
| 53 | * |SupplicantStatusCode.SUCCESS|, |
| 54 | * |SupplicantStatusCode.FAILURE_UNKNOWN|, |
| 55 | * |SupplicantStatusCode.FAILURE_IFACE_INVALID| |
| 56 | * @return network HIDL interface object representing the new network if |
| 57 | * successful, null otherwise. |
| 58 | */ |
| 59 | addNetwork() |
| 60 | generates (SupplicantStatus status, ISupplicantNetwork network); |
| 61 | |
| 62 | /** |
| 63 | * Remove a network from the interface. |
| 64 | * |
| 65 | * Use |ISupplicantNetwork.getId()| on the corresponding network HIDL |
| 66 | * interface object to retrieve the ID. |
| 67 | * |
| 68 | * @param id Network ID allocated to the corresponding network. |
| 69 | * @return status Status of the operation. |
| 70 | * Possible status codes: |
| 71 | * |SupplicantStatusCode.SUCCESS|, |
| 72 | * |SupplicantStatusCode.FAILURE_UNKNOWN|, |
| 73 | * |SupplicantStatusCode.FAILURE_IFACE_INVALID|, |
| 74 | * |SupplicantStatusCode.FAILURE_NETWORK_UNKNOWN| |
| 75 | */ |
| 76 | removeNetwork(SupplicantNetworkId id) |
| 77 | generates (SupplicantStatus status); |
| 78 | |
| 79 | /** |
| 80 | * Gets a HIDL interface object for the network corresponding to the |
| 81 | * |SupplicantNetworkId|. |
| 82 | * |
| 83 | * Use |ISupplicantNetwork.getId()| on the corresponding network HIDL |
| 84 | * interface object to retrieve the ID. |
| 85 | * |
| 86 | * @param id Network ID allocated to the corresponding network. |
| 87 | * @return status Status of the operation. |
| 88 | * Possible status codes: |
| 89 | * |SupplicantStatusCode.SUCCESS|, |
| 90 | * |SupplicantStatusCode.FAILURE_UNKNOWN|, |
| 91 | * |SupplicantStatusCode.FAILURE_IFACE_INVALID|, |
| 92 | * |SupplicantStatusCode.FAILURE_NETWORK_UNKNOWN| |
| 93 | * @return network HIDL interface object representing the new network if |
| 94 | * successful, null otherwise. |
| 95 | */ |
| 96 | getNetwork(SupplicantNetworkId id) |
| 97 | generates (SupplicantStatus status, ISupplicantNetwork network); |
| 98 | |
| 99 | /** |
| 100 | * Retrieve a list of all the network Id's controlled by wpa_supplicant. |
| 101 | * |
| 102 | * The corresponding |ISupplicantNetwork| object for any network can be |
| 103 | * retrieved using |getNetwork| method. |
| 104 | * |
| 105 | * @return status Status of the operation. |
| 106 | * Possible status codes: |
| 107 | * |SupplicantStatusCode.SUCCESS|, |
| 108 | * |SupplicantStatusCode.FAILURE_UNKNOWN| |
| 109 | * @return networkIds List of all network Id's controlled by wpa_supplicant. |
| 110 | */ |
| 111 | listNetworks() |
| 112 | generates (SupplicantStatus status, vec<SupplicantNetworkId> networkIds); |
Roshan Pius | 9a3a84f | 2016-09-15 13:02:25 -0700 | [diff] [blame] | 113 | }; |