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 | |
| 19 | import ISupplicantIfaceCallback; |
| 20 | import ISupplicantNetwork; |
| 21 | |
| 22 | /** |
| 23 | * Interface exposed by wpa_supplicant for each network interface (e.g wlan0) |
| 24 | * it controls. |
| 25 | */ |
| 26 | interface ISupplicantIface { |
| 27 | /** |
| 28 | * Retrieves the name of the network interface. |
| 29 | * |
| 30 | * @return status Status of the operation. |
| 31 | * Possible status codes: |
| 32 | * |SupplicantStatusCode.SUCCESS|, |
| 33 | * |SupplicantStatusCode.FAILURE_IFACE_INVALID| |
| 34 | * @return name Name of the network interface, e.g., wlan0 |
| 35 | */ |
| 36 | getName() generates (SupplicantStatus status, string name); |
| 37 | |
| 38 | /** |
| 39 | * Add a new network to the interface. |
| 40 | * |
| 41 | * @return status Status of the operation. |
| 42 | * Possible status codes: |
| 43 | * |SupplicantStatusCode.SUCCESS|, |
| 44 | * |SupplicantStatusCode.FAILURE_UNKNOWN|, |
| 45 | * |SupplicantStatusCode.FAILURE_IFACE_INVALID| |
| 46 | * @return network HIDL interface object representing the new network if |
| 47 | * successful, null otherwise. |
| 48 | */ |
| 49 | addNetwork() |
| 50 | generates (SupplicantStatus status, ISupplicantNetwork network); |
| 51 | |
| 52 | /** |
| 53 | * Remove a network from the interface. |
| 54 | * |
| 55 | * Use |ISupplicantNetwork.getId()| on the corresponding network HIDL |
| 56 | * interface object to retrieve the ID. |
| 57 | * |
| 58 | * @param id Network ID allocated to the corresponding network. |
| 59 | * @return status Status of the operation. |
| 60 | * Possible status codes: |
| 61 | * |SupplicantStatusCode.SUCCESS|, |
| 62 | * |SupplicantStatusCode.FAILURE_UNKNOWN|, |
| 63 | * |SupplicantStatusCode.FAILURE_IFACE_INVALID|, |
| 64 | * |SupplicantStatusCode.FAILURE_NETWORK_UNKNOWN| |
| 65 | */ |
| 66 | removeNetwork(SupplicantNetworkId id) |
| 67 | generates (SupplicantStatus status); |
| 68 | |
| 69 | /** |
| 70 | * Gets a HIDL interface object for the network corresponding to the |
| 71 | * |SupplicantNetworkId|. |
| 72 | * |
| 73 | * Use |ISupplicantNetwork.getId()| on the corresponding network HIDL |
| 74 | * interface object to retrieve the ID. |
| 75 | * |
| 76 | * @param id Network ID allocated to the corresponding network. |
| 77 | * @return status Status of the operation. |
| 78 | * Possible status codes: |
| 79 | * |SupplicantStatusCode.SUCCESS|, |
| 80 | * |SupplicantStatusCode.FAILURE_UNKNOWN|, |
| 81 | * |SupplicantStatusCode.FAILURE_IFACE_INVALID|, |
| 82 | * |SupplicantStatusCode.FAILURE_NETWORK_UNKNOWN| |
| 83 | * @return network HIDL interface object representing the new network if |
| 84 | * successful, null otherwise. |
| 85 | */ |
| 86 | getNetwork(SupplicantNetworkId id) |
| 87 | generates (SupplicantStatus status, ISupplicantNetwork network); |
| 88 | |
| 89 | /** |
| 90 | * Retrieve a list of all the network Id's controlled by wpa_supplicant. |
| 91 | * |
| 92 | * The corresponding |ISupplicantNetwork| object for any network can be |
| 93 | * retrieved using |getNetwork| method. |
| 94 | * |
| 95 | * @return status Status of the operation. |
| 96 | * Possible status codes: |
| 97 | * |SupplicantStatusCode.SUCCESS|, |
| 98 | * |SupplicantStatusCode.FAILURE_UNKNOWN| |
| 99 | * @return networkIds List of all network Id's controlled by wpa_supplicant. |
| 100 | */ |
| 101 | listNetworks() |
| 102 | generates (SupplicantStatus status, vec<SupplicantNetworkId> networkIds); |
| 103 | |
| 104 | /** |
| 105 | * Register for callbacks from this interface. |
| 106 | * |
| 107 | * These callbacks are invoked for events that are specific to this interface. |
| 108 | * Registration of multiple callback objects is supported. These objects must |
| 109 | * be automatically deleted when the corresponding client process is dead or |
| 110 | * if this interface is removed. |
| 111 | * |
| 112 | * @param callback An instance of the |ISupplicantIfaceCallback| HIDL |
| 113 | * interface object. |
| 114 | * @return status Status of the operation. |
| 115 | * Possible status codes: |
| 116 | * |SupplicantStatusCode.SUCCESS|, |
| 117 | * |SupplicantStatusCode.FAILURE_UNKNOWN|, |
| 118 | * |SupplicantStatusCode.FAILURE_IFACE_INVALID| |
| 119 | */ |
| 120 | registerCallback(ISupplicantIfaceCallback callback) |
| 121 | generates (SupplicantStatus status); |
| 122 | |
| 123 | /** |
| 124 | * Reconnect to the currently active network, even if we are already |
| 125 | * connected. |
| 126 | * |
| 127 | * @return status Status of the operation. |
| 128 | * Possible status codes: |
| 129 | * |SupplicantStatusCode.SUCCESS|, |
| 130 | * |SupplicantStatusCode.FAILURE_UNKNOWN|, |
| 131 | * |SupplicantStatusCode.FAILURE_IFACE_INVALID|, |
| 132 | * |SupplicantStatusCode.FAILURE_IFACE_DISABLED| |
| 133 | */ |
| 134 | reassociate() generates (SupplicantStatus status); |
| 135 | |
| 136 | /** |
| 137 | * Reconnect to the currently active network, if we are currently |
| 138 | * disconnected. |
| 139 | * |
| 140 | * @return status Status of the operation. |
| 141 | * Possible status codes: |
| 142 | * |SupplicantStatusCode.SUCCESS|, |
| 143 | * |SupplicantStatusCode.FAILURE_UNKNOWN|, |
| 144 | * |SupplicantStatusCode.FAILURE_IFACE_INVALID|, |
| 145 | * |SupplicantStatusCode.FAILURE_IFACE_DISABLED|, |
| 146 | * |SupplicantStatusCode.FAILURE_IFACE_NOT_DISCONNECTED| |
| 147 | */ |
| 148 | reconnect() generates (SupplicantStatus status); |
| 149 | |
| 150 | /** |
| 151 | * Disconnect from the current active network. |
| 152 | * |
| 153 | * @return status Status of the operation. |
| 154 | * Possible status codes: |
| 155 | * |SupplicantStatusCode.SUCCESS|, |
| 156 | * |SupplicantStatusCode.FAILURE_UNKNOWN|, |
| 157 | * |SupplicantStatusCode.FAILURE_IFACE_INVALID|, |
| 158 | * |SupplicantStatusCode.FAILURE_IFACE_DISABLED| |
| 159 | */ |
| 160 | disconnect() generates (SupplicantStatus status); |
| 161 | |
| 162 | /** |
| 163 | * Turn on/off power save mode for the interface. |
| 164 | * |
| 165 | * @param enable Indicate if power save is to be turned on/off. |
| 166 | * @return status Status of the operation. |
| 167 | * Possible status codes: |
| 168 | * |SupplicantStatusCode.SUCCESS|, |
| 169 | * |SupplicantStatusCode.FAILURE_UNKNOWN|, |
| 170 | * |SupplicantStatusCode.FAILURE_IFACE_INVALID|, |
| 171 | * |SupplicantStatusCode.FAILURE_IFACE_DISABLED| |
| 172 | */ |
| 173 | setPowerSave(bool enable) generates (SupplicantStatus status); |
| 174 | |
| 175 | /** |
| 176 | * Initiate TDLS discover with the provided peer mac address. |
| 177 | * |
| 178 | * @param macAddress MAC address of the peer. |
| 179 | * @return status Status of the operation. |
| 180 | * Possible status codes: |
| 181 | * |SupplicantStatusCode.SUCCESS|, |
| 182 | * |SupplicantStatusCode.FAILURE_UNKNOWN|, |
| 183 | * |SupplicantStatusCode.FAILURE_IFACE_INVALID| |
| 184 | */ |
| 185 | initiateTdlsDiscover(MacAddress macAddress) |
| 186 | generates (SupplicantStatus status); |
| 187 | |
| 188 | /** |
| 189 | * Initiate TDLS setup with the provided peer mac address. |
| 190 | * |
| 191 | * @param macAddress MAC address of the peer. |
| 192 | * @return status Status of the operation. |
| 193 | * Possible status codes: |
| 194 | * |SupplicantStatusCode.SUCCESS|, |
| 195 | * |SupplicantStatusCode.FAILURE_UNKNOWN|, |
| 196 | * |SupplicantStatusCode.FAILURE_IFACE_INVALID| |
| 197 | */ |
| 198 | initiateTdlsSetup(MacAddress macAddress) |
| 199 | generates (SupplicantStatus status); |
| 200 | |
| 201 | /** |
| 202 | * Initiate TDLS teardown with the provided peer mac address. |
| 203 | * |
| 204 | * @param macAddress MAC address of the peer. |
| 205 | * @return status Status of the operation. |
| 206 | * Possible status codes: |
| 207 | * |SupplicantStatusCode.SUCCESS|, |
| 208 | * |SupplicantStatusCode.FAILURE_UNKNOWN|, |
| 209 | * |SupplicantStatusCode.FAILURE_IFACE_INVALID| |
| 210 | */ |
| 211 | initiateTdlsTeardown(MacAddress macAddress) |
| 212 | generates (SupplicantStatus status); |
| 213 | }; |