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 | /** |
Roshan Pius | 8c6a877 | 2016-11-03 09:37:57 -0700 | [diff] [blame] | 23 | * Interface exposed by the supplicant HIDL service registered |
Roshan Pius | 9a3a84f | 2016-09-15 13:02:25 -0700 | [diff] [blame] | 24 | * with the hardware service manager. |
Roshan Pius | 8c6a877 | 2016-11-03 09:37:57 -0700 | [diff] [blame] | 25 | * This is the root level object for any the supplicant interactions. |
Roshan Pius | 9a3a84f | 2016-09-15 13:02:25 -0700 | [diff] [blame] | 26 | */ |
| 27 | interface ISupplicant { |
| 28 | /** |
Roshan Pius | 8c6a877 | 2016-11-03 09:37:57 -0700 | [diff] [blame] | 29 | * Debug levels for the supplicant. |
Roshan Pius | 9a3a84f | 2016-09-15 13:02:25 -0700 | [diff] [blame] | 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 | /** |
Roshan Pius | 7c636f8 | 2016-11-01 17:03:55 -0700 | [diff] [blame] | 43 | * Structure describing the type and name of an iface |
Roshan Pius | 8c6a877 | 2016-11-03 09:37:57 -0700 | [diff] [blame] | 44 | * controlled by the supplicant. |
Roshan Pius | 9a3a84f | 2016-09-15 13:02:25 -0700 | [diff] [blame] | 45 | */ |
Roshan Pius | 7c636f8 | 2016-11-01 17:03:55 -0700 | [diff] [blame] | 46 | struct IfaceInfo { |
| 47 | /** |
| 48 | * Type of the network interface. |
| 49 | */ |
| 50 | IfaceType type; |
| 51 | /** |
| 52 | * Name of the network interface, e.g., wlan0 |
| 53 | */ |
| 54 | string name; |
| 55 | }; |
Roshan Pius | 9a3a84f | 2016-09-15 13:02:25 -0700 | [diff] [blame] | 56 | |
| 57 | /** |
Roshan Pius | 7c636f8 | 2016-11-01 17:03:55 -0700 | [diff] [blame] | 58 | * Gets a HIDL interface object for the interface corresponding to iface |
Roshan Pius | 8c6a877 | 2016-11-03 09:37:57 -0700 | [diff] [blame] | 59 | * name which the supplicant already controls. |
Roshan Pius | 9a3a84f | 2016-09-15 13:02:25 -0700 | [diff] [blame] | 60 | * |
Roshan Pius | 7c636f8 | 2016-11-01 17:03:55 -0700 | [diff] [blame] | 61 | * @param ifaceInfo Combination of the iface type and name retrieved |
| 62 | * using |listInterfaces|. |
Roshan Pius | 9a3a84f | 2016-09-15 13:02:25 -0700 | [diff] [blame] | 63 | * @return status Status of the operation. |
| 64 | * Possible status codes: |
| 65 | * |SupplicantStatusCode.SUCCESS|, |
| 66 | * |SupplicantStatusCode.FAILURE_UNKNOWN|, |
| 67 | * |SupplicantStatusCode.FAILURE_IFACE_UNKOWN| |
| 68 | * @return iface HIDL interface object representing the interface if |
| 69 | * successful, null otherwise. |
| 70 | */ |
Roshan Pius | 7c636f8 | 2016-11-01 17:03:55 -0700 | [diff] [blame] | 71 | getInterface(IfaceInfo ifaceInfo) |
Roshan Pius | 9a3a84f | 2016-09-15 13:02:25 -0700 | [diff] [blame] | 72 | generates (SupplicantStatus status, ISupplicantIface iface); |
| 73 | |
| 74 | /** |
Roshan Pius | 8c6a877 | 2016-11-03 09:37:57 -0700 | [diff] [blame] | 75 | * Retrieve a list of all the interfaces controlled by the supplicant. |
Roshan Pius | 9a3a84f | 2016-09-15 13:02:25 -0700 | [diff] [blame] | 76 | * |
| 77 | * The corresponding |ISupplicantIface| object for any interface can be |
| 78 | * retrieved using |getInterface| method. |
| 79 | * |
| 80 | * @return status Status of the operation. |
| 81 | * Possible status codes: |
| 82 | * |SupplicantStatusCode.SUCCESS|, |
| 83 | * |SupplicantStatusCode.FAILURE_UNKNOWN| |
Roshan Pius | 8c6a877 | 2016-11-03 09:37:57 -0700 | [diff] [blame] | 84 | * @return ifaces List of all interfaces controlled by the supplicant. |
Roshan Pius | 9a3a84f | 2016-09-15 13:02:25 -0700 | [diff] [blame] | 85 | */ |
Roshan Pius | 7c636f8 | 2016-11-01 17:03:55 -0700 | [diff] [blame] | 86 | listInterfaces() generates (SupplicantStatus status, vec<IfaceInfo> ifaces); |
Roshan Pius | 9a3a84f | 2016-09-15 13:02:25 -0700 | [diff] [blame] | 87 | |
| 88 | /** |
Roshan Pius | 8c6a877 | 2016-11-03 09:37:57 -0700 | [diff] [blame] | 89 | * Register for callbacks from the supplicant service. |
Roshan Pius | 9a3a84f | 2016-09-15 13:02:25 -0700 | [diff] [blame] | 90 | * |
| 91 | * These callbacks are invoked for global events that are not specific |
| 92 | * to any interface or network. Registration of multiple callback |
| 93 | * objects is supported. These objects must be deleted when the corresponding |
| 94 | * client process is dead. |
| 95 | * |
| 96 | * @param callback An instance of the |ISupplicantCallback| HIDL interface |
| 97 | * object. |
| 98 | * @return status Status of the operation. |
| 99 | * Possible status codes: |
| 100 | * |SupplicantStatusCode.SUCCESS|, |
| 101 | * |SupplicantStatusCode.FAILURE_UNKNOWN| |
| 102 | */ |
| 103 | registerCallback(ISupplicantCallback callback) |
| 104 | generates (SupplicantStatus status); |
| 105 | |
| 106 | /** |
Roshan Pius | 8c6a877 | 2016-11-03 09:37:57 -0700 | [diff] [blame] | 107 | * Set debug parameters for the supplicant. |
Roshan Pius | 9a3a84f | 2016-09-15 13:02:25 -0700 | [diff] [blame] | 108 | * |
Roshan Pius | 8c6a877 | 2016-11-03 09:37:57 -0700 | [diff] [blame] | 109 | * @param level Debug logging level for the supplicant. |
Roshan Pius | 9a3a84f | 2016-09-15 13:02:25 -0700 | [diff] [blame] | 110 | * (one of |DebugLevel| values). |
| 111 | * @param timestamp Determines whether to show timestamps in logs or |
| 112 | * not. |
| 113 | * @param showKeys Determines whether to show keys in debug logs or |
| 114 | * not. |
| 115 | * CAUTION: Do not set this param in production code! |
| 116 | * @return status Status of the operation. |
| 117 | * Possible status codes: |
| 118 | * |SupplicantStatusCode.SUCCESS|, |
| 119 | * |SupplicantStatusCode.FAILURE_UNKNOWN| |
| 120 | */ |
| 121 | setDebugParams(DebugLevel level, bool showTimestamp, bool showKeys) |
| 122 | generates (SupplicantStatus status); |
| 123 | |
| 124 | /** |
| 125 | * Get the debug level set. |
| 126 | * |
| 127 | * @return level one of |DebugLevel| values. |
| 128 | */ |
| 129 | getDebugLevel() generates (DebugLevel level); |
| 130 | |
| 131 | /** |
| 132 | * Get whether the timestamps are shown in the debug logs or not. |
| 133 | * |
| 134 | * @return enabled true if set, false otherwise. |
| 135 | */ |
| 136 | isDebugShowTimestampEnabled() generates (bool enabled); |
| 137 | |
| 138 | /** |
| 139 | * Get whether the keys are shown in the debug logs or not. |
| 140 | * |
| 141 | * @return enabled true if set, false otherwise. |
| 142 | */ |
| 143 | isDebugShowKeysEnabled() generates (bool enabled); |
Roshan Pius | 756ad99 | 2016-11-07 10:29:48 -0800 | [diff] [blame] | 144 | |
| 145 | /** |
| 146 | * Set concurrency priority. |
| 147 | * |
| 148 | * When both P2P and STA mode ifaces are active, this must be used |
| 149 | * to prioritize either STA or P2P connection to resolve conflicts |
| 150 | * arising during single channel concurrency. |
| 151 | * |
| 152 | * @param type The type of iface to prioritize. |
| 153 | * @return status Status of the operation. |
| 154 | * Possible status codes: |
| 155 | * |SupplicantStatusCode.SUCCESS|, |
| 156 | * |SupplicantStatusCode.FAILURE_UNKNOWN| |
| 157 | */ |
| 158 | setConcurrencyPriority(IfaceType type) generates (SupplicantStatus status); |
Roshan Pius | 9a3a84f | 2016-09-15 13:02:25 -0700 | [diff] [blame] | 159 | }; |