blob: 32d73da68a4c4f945cd64704af82dc5b28af1dc5 [file] [log] [blame]
Roshan Pius9a3a84f2016-09-15 13:02:25 -07001/*
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 Pius22ab8b22016-09-28 13:35:42 -070017package android.hardware.wifi.supplicant@1.0;
Roshan Pius9a3a84f2016-09-15 13:02:25 -070018
19import ISupplicantCallback;
20import ISupplicantIface;
21
22/**
Roshan Pius8c6a8772016-11-03 09:37:57 -070023 * Interface exposed by the supplicant HIDL service registered
Roshan Pius9a3a84f2016-09-15 13:02:25 -070024 * with the hardware service manager.
Roshan Pius8c6a8772016-11-03 09:37:57 -070025 * This is the root level object for any the supplicant interactions.
Roshan Pius9a3a84f2016-09-15 13:02:25 -070026 */
27interface ISupplicant {
28 /**
Roshan Pius8c6a8772016-11-03 09:37:57 -070029 * Debug levels for the supplicant.
Roshan Pius9a3a84f2016-09-15 13:02:25 -070030 * 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 Pius7c636f82016-11-01 17:03:55 -070043 * Structure describing the type and name of an iface
Roshan Pius8c6a8772016-11-03 09:37:57 -070044 * controlled by the supplicant.
Roshan Pius9a3a84f2016-09-15 13:02:25 -070045 */
Roshan Pius7c636f82016-11-01 17:03:55 -070046 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 Pius9a3a84f2016-09-15 13:02:25 -070056
57 /**
Roshan Pius7c636f82016-11-01 17:03:55 -070058 * Gets a HIDL interface object for the interface corresponding to iface
Roshan Pius8c6a8772016-11-03 09:37:57 -070059 * name which the supplicant already controls.
Roshan Pius9a3a84f2016-09-15 13:02:25 -070060 *
Roshan Pius7c636f82016-11-01 17:03:55 -070061 * @param ifaceInfo Combination of the iface type and name retrieved
62 * using |listInterfaces|.
Roshan Pius9a3a84f2016-09-15 13:02:25 -070063 * @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 Pius7c636f82016-11-01 17:03:55 -070071 getInterface(IfaceInfo ifaceInfo)
Roshan Pius9a3a84f2016-09-15 13:02:25 -070072 generates (SupplicantStatus status, ISupplicantIface iface);
73
74 /**
Roshan Pius8c6a8772016-11-03 09:37:57 -070075 * Retrieve a list of all the interfaces controlled by the supplicant.
Roshan Pius9a3a84f2016-09-15 13:02:25 -070076 *
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 Pius8c6a8772016-11-03 09:37:57 -070084 * @return ifaces List of all interfaces controlled by the supplicant.
Roshan Pius9a3a84f2016-09-15 13:02:25 -070085 */
Roshan Pius7c636f82016-11-01 17:03:55 -070086 listInterfaces() generates (SupplicantStatus status, vec<IfaceInfo> ifaces);
Roshan Pius9a3a84f2016-09-15 13:02:25 -070087
88 /**
Roshan Pius8c6a8772016-11-03 09:37:57 -070089 * Register for callbacks from the supplicant service.
Roshan Pius9a3a84f2016-09-15 13:02:25 -070090 *
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 Pius8c6a8772016-11-03 09:37:57 -0700107 * Set debug parameters for the supplicant.
Roshan Pius9a3a84f2016-09-15 13:02:25 -0700108 *
Roshan Pius8c6a8772016-11-03 09:37:57 -0700109 * @param level Debug logging level for the supplicant.
Roshan Pius9a3a84f2016-09-15 13:02:25 -0700110 * (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 Pius756ad992016-11-07 10:29:48 -0800144
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 Pius9a3a84f2016-09-15 13:02:25 -0700159};