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 ISupplicantCallback; |
| 20 | import ISupplicantIface; |
| 21 | |
| 22 | /** |
| 23 | * Interface exposed by the wpa_supplicant HIDL service registered |
| 24 | * with the hardware service manager. |
| 25 | * This is the root level object for any wpa_supplicant interactions. |
| 26 | */ |
| 27 | interface ISupplicant { |
| 28 | /** |
| 29 | * Debug levels for wpa_supplicant. |
| 30 | * Only log messages with a level greater than the set level |
| 31 | * (via |setDebugParams|) will be logged. |
| 32 | */ |
| 33 | enum DebugLevel : uint32_t { |
| 34 | EXCESSIVE = 0, |
| 35 | MSGDUMP = 1, |
| 36 | DEBUG = 2, |
| 37 | INFO = 3, |
| 38 | WARNING = 4, |
| 39 | ERROR = 5 |
| 40 | }; |
| 41 | |
| 42 | /** |
| 43 | * Registers a wireless interface in wpa_supplicant. |
| 44 | * |
| 45 | * @param ifName Name of the network interface, e.g., wlan0 |
| 46 | * @return status Status of the operation. |
| 47 | * Possible status codes: |
| 48 | * |SupplicantStatusCode.SUCCESS|, |
| 49 | * |SupplicantStatusCode.FAILURE_UNKNOWN|, |
| 50 | * |SupplicantStatusCode.FAILURE_IFACE_EXISTS| |
| 51 | * @return iface HIDL interface object representing the interface if |
| 52 | * successful, null otherwise. |
| 53 | */ |
| 54 | createInterface(string ifName) |
| 55 | generates (SupplicantStatus status, ISupplicantIface iface); |
| 56 | |
| 57 | /** |
| 58 | * Deregisters a wireless interface from wpa_supplicant. |
| 59 | * |
| 60 | * @param ifName Name of the network interface, e.g., wlan0 |
| 61 | * @return status Status of the operation. |
| 62 | * Possible status codes: |
| 63 | * |SupplicantStatusCode.SUCCESS|, |
| 64 | * |SupplicantStatusCode.FAILURE_UNKNOWN|, |
| 65 | * |SupplicantStatusCode.FAILURE_IFACE_UNKOWN| |
| 66 | */ |
| 67 | removeInterface(string ifName) generates (SupplicantStatus status); |
| 68 | |
| 69 | /** |
| 70 | * Gets a HIDL interface object for the interface corresponding to ifName |
| 71 | * which wpa_supplicant already controls. |
| 72 | * |
| 73 | * @param ifName Name of the network interface, e.g., wlan0 |
| 74 | * @return status Status of the operation. |
| 75 | * Possible status codes: |
| 76 | * |SupplicantStatusCode.SUCCESS|, |
| 77 | * |SupplicantStatusCode.FAILURE_UNKNOWN|, |
| 78 | * |SupplicantStatusCode.FAILURE_IFACE_UNKOWN| |
| 79 | * @return iface HIDL interface object representing the interface if |
| 80 | * successful, null otherwise. |
| 81 | */ |
| 82 | getInterface(string ifName) |
| 83 | generates (SupplicantStatus status, ISupplicantIface iface); |
| 84 | |
| 85 | /** |
| 86 | * Retrieve a list of all the interface names controlled by wpa_supplicant. |
| 87 | * |
| 88 | * The corresponding |ISupplicantIface| object for any interface can be |
| 89 | * retrieved using |getInterface| method. |
| 90 | * |
| 91 | * @return status Status of the operation. |
| 92 | * Possible status codes: |
| 93 | * |SupplicantStatusCode.SUCCESS|, |
| 94 | * |SupplicantStatusCode.FAILURE_UNKNOWN| |
| 95 | * @return ifNames List of all interface names controlled by wpa_supplicant. |
| 96 | */ |
| 97 | listInterfaces() generates (SupplicantStatus status, vec<string> ifNames); |
| 98 | |
| 99 | /** |
| 100 | * Register for callbacks from the wpa_supplicant service. |
| 101 | * |
| 102 | * These callbacks are invoked for global events that are not specific |
| 103 | * to any interface or network. Registration of multiple callback |
| 104 | * objects is supported. These objects must be deleted when the corresponding |
| 105 | * client process is dead. |
| 106 | * |
| 107 | * @param callback An instance of the |ISupplicantCallback| HIDL interface |
| 108 | * object. |
| 109 | * @return status Status of the operation. |
| 110 | * Possible status codes: |
| 111 | * |SupplicantStatusCode.SUCCESS|, |
| 112 | * |SupplicantStatusCode.FAILURE_UNKNOWN| |
| 113 | */ |
| 114 | registerCallback(ISupplicantCallback callback) |
| 115 | generates (SupplicantStatus status); |
| 116 | |
| 117 | /** |
| 118 | * Set debug parameters for wpa_supplicant. |
| 119 | * |
| 120 | * @param level Debug logging level for wpa_supplicant. |
| 121 | * (one of |DebugLevel| values). |
| 122 | * @param timestamp Determines whether to show timestamps in logs or |
| 123 | * not. |
| 124 | * @param showKeys Determines whether to show keys in debug logs or |
| 125 | * not. |
| 126 | * CAUTION: Do not set this param in production code! |
| 127 | * @return status Status of the operation. |
| 128 | * Possible status codes: |
| 129 | * |SupplicantStatusCode.SUCCESS|, |
| 130 | * |SupplicantStatusCode.FAILURE_UNKNOWN| |
| 131 | */ |
| 132 | setDebugParams(DebugLevel level, bool showTimestamp, bool showKeys) |
| 133 | generates (SupplicantStatus status); |
| 134 | |
| 135 | /** |
| 136 | * Get the debug level set. |
| 137 | * |
| 138 | * @return level one of |DebugLevel| values. |
| 139 | */ |
| 140 | getDebugLevel() generates (DebugLevel level); |
| 141 | |
| 142 | /** |
| 143 | * Get whether the timestamps are shown in the debug logs or not. |
| 144 | * |
| 145 | * @return enabled true if set, false otherwise. |
| 146 | */ |
| 147 | isDebugShowTimestampEnabled() generates (bool enabled); |
| 148 | |
| 149 | /** |
| 150 | * Get whether the keys are shown in the debug logs or not. |
| 151 | * |
| 152 | * @return enabled true if set, false otherwise. |
| 153 | */ |
| 154 | isDebugShowKeysEnabled() generates (bool enabled); |
| 155 | }; |