blob: 48a4f5b41d7e9dacb0dd65b19bf45fe6745d0478 [file] [log] [blame]
Roshan Pius39f588f2016-10-31 14:51:27 -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
17package android.hardware.wifi.supplicant@1.0;
18
19import ISupplicantIface;
20import ISupplicantP2pIfaceCallback;
21
22/**
Roshan Pius8c6a8772016-11-03 09:37:57 -070023 * Interface exposed by the supplicant for each P2P mode network
Roshan Pius39f588f2016-10-31 14:51:27 -070024 * interface (e.g p2p0) it controls.
25 */
26interface ISupplicantP2pIface extends ISupplicantIface {
Roshan Pius756ad992016-11-07 10:29:48 -080027 enum WpsProvisionMethod : uint32_t {
28 /**
29 * Push button method.
30 */
31 PBC,
32 /**
33 * Display pin method configuration - pin is generated and displayed on
34 * device.
35 */
36 DISPLAY,
37 /**
38 * Keypad pin method configuration - pin is entered on device.
39 */
40 KEYPAD,
41 /**
42 * Label pin method configuration - pin is labelled on device.
43 */
44 LABEL
45 };
46
47 enum GroupCapabilityMask : uint32_t {
48 GROUP_OWNER = 1 << 0,
49 PERSISTENT_GROUP = 1 << 1,
50 GROUP_LIMIT = 1 << 2,
51 INTRA_BSS_DIST = 1 << 3,
52 CROSS_CONN = 1 << 4,
53 PERSISTENT_RECONN = 1 << 5,
54 GROUP_FORMATION = 1 << 6
55 };
56
Roshan Pius39f588f2016-10-31 14:51:27 -070057 /**
58 * Register for callbacks from this interface.
59 *
60 * These callbacks are invoked for events that are specific to this interface.
61 * Registration of multiple callback objects is supported. These objects must
62 * be automatically deleted when the corresponding client process is dead or
63 * if this interface is removed.
64 *
65 * @param callback An instance of the |ISupplicantP2pIfaceCallback| HIDL
66 * interface object.
67 * @return status Status of the operation.
68 * Possible status codes:
69 * |SupplicantStatusCode.SUCCESS|,
70 * |SupplicantStatusCode.FAILURE_UNKNOWN|,
71 * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
72 */
73 registerCallback(ISupplicantP2pIfaceCallback callback)
74 generates (SupplicantStatus status);
Roshan Pius756ad992016-11-07 10:29:48 -080075
76 /**
77 * Gets the MAC address of the device.
78 *
79 * @return status Status of the operation.
80 * Possible status codes:
81 * |SupplicantStatusCode.SUCCESS|,
82 * |SupplicantStatusCode.FAILURE_UNKNOWN|,
83 * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
84 * @return deviceAddress MAC address of the device.
85 */
86 getDeviceAddress()
87 generates (SupplicantStatus status, MacAddress deviceAddress);
88
89 /**
90 * Set the postfix to be used for P2P SSID's.
91 *
92 * @param postfix String to be appended to SSID.
93 * @return status Status of the operation.
94 * Possible status codes:
95 * |SupplicantStatusCode.SUCCESS|,
96 * |SupplicantStatusCode.FAILURE_ARGS_INVALID|,
97 * |SupplicantStatusCode.FAILURE_UNKNOWN|,
98 * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
99 */
100 setSsidPostfix(string postfix) generates (SupplicantStatus status);
101
102 /**
103 * Set the Maximum idle time in seconds for P2P groups.
104 * This value controls how long a P2P group is maintained after there
105 * is no other members in the group. As a group owner, this means no
106 * associated stations in the group. As a P2P client, this means no
107 * group owner seen in scan results.
108 *
109 * @param timeoutInSec Timeout value in seconds.
110 * @return status Status of the operation.
111 * Possible status codes:
112 * |SupplicantStatusCode.SUCCESS|,
113 * |SupplicantStatusCode.FAILURE_UNKNOWN|,
114 * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
115 */
116 setGroupIdle(uint32_t timeoutInSec) generates (SupplicantStatus status);
117
118 /**
119 * Turn on/off power save mode for the interface.
120 *
121 * @param enable Indicate if power save is to be turned on/off.
122 * @return status Status of the operation.
123 * Possible status codes:
124 * |SupplicantStatusCode.SUCCESS|,
125 * |SupplicantStatusCode.FAILURE_UNKNOWN|,
126 * |SupplicantStatusCode.FAILURE_IFACE_INVALID|,
127 * |SupplicantStatusCode.FAILURE_IFACE_DISABLED|
128 */
129 setPowerSave(bool enable) generates (SupplicantStatus status);
130
131 /**
132 * Initiate a P2P service discovery with an optional timeout.
133 *
134 * @param timeoutInSec Max time to be spent is peforming discovery.
135 * Set to 0 to indefinely continue discovery untill and explicit
136 * |stopFind| is sent.
137 * @return status Status of the operation.
138 * Possible status codes:
139 * |SupplicantStatusCode.SUCCESS|,
140 * |SupplicantStatusCode.FAILURE_UNKNOWN|,
141 * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
142 */
143 find(uint32_t timeoutInSec) generates (SupplicantStatus status);
144
145 /**
146 * Stop an ongoing P2P service discovery.
147 *
148 * @return status Status of the operation.
149 * Possible status codes:
150 * |SupplicantStatusCode.SUCCESS|,
151 * |SupplicantStatusCode.FAILURE_UNKNOWN|,
152 * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
153 */
154 stopFind() generates (SupplicantStatus status);
155
156 /**
157 * Flush P2P peer table and state.
158 *
159 * @return status Status of the operation.
160 * Possible status codes:
161 * |SupplicantStatusCode.SUCCESS|,
162 * |SupplicantStatusCode.FAILURE_UNKNOWN|,
163 * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
164 */
165 flush() generates (SupplicantStatus status);
166
167 /**
168 * Start P2P group formation with a discovered P2P peer. This includes
169 * optional group owner negotiation, group interface setup, provisioning,
170 * and establishing data connection.
171 *
172 * @param peerAddress MAC address of the device to connect to.
173 * @method provisionMethod Provisioning method to use.
174 * @param preSelectedPin Pin to be used, if |provisionMethod| uses one of the
175 * preselected |PIN*| methods.
176 * @param joinExistingGroup Indicates that this is a command to join an
177 * existing group as a client. It skips the group owner negotiation
178 * part. This must send a Provision Discovery Request message to the
179 * target group owner before associating for WPS provisioning.
180 * @param persistent Used to request a persistent group to be formed.
181 * @param goIntent Used to override the default Intent for this group owner
182 * negotiation (Values from 1-15). Refer to section 4.1.6 in
183 * Wi-Fi Peer-to-Peer (P2P) Technical Specification Version 1.7.
184 * @return status Status of the operation.
185 * Possible status codes:
186 * |SupplicantStatusCode.SUCCESS|,
187 * |SupplicantStatusCode.FAILURE_ARGS_INVALID|,
188 * |SupplicantStatusCode.FAILURE_UNKNOWN|,
189 * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
190 * @return generatedPin Pin generated, if |provisionMethod| uses one of the
191 * generated |PIN*| methods.
192 */
193 connect(MacAddress peerAddress,
194 WpsProvisionMethod provisionMethod,
195 vec<uint8_t> preSelectedPin,
196 bool joinExistingGroup,
197 bool persistent,
198 uint32_t goIntent)
199 generates (SupplicantStatus status, vec<uint8_t> generatedPin);
200
201 /**
202 * Cancel an ongoing P2P group formation and joining-a-group related
203 * operation. This operation unauthorizes the specific peer device (if any
204 * had been authorized to start group formation), stops P2P find (if in
205 * progress), stops pending operations for join-a-group, and removes the
206 * P2P group interface (if one was used) that is in the WPS provisioning
207 * step. If the WPS provisioning step has been completed, the group is not
208 * terminated.
209 *
210 * @return status Status of the operation.
211 * Possible status codes:
212 * |SupplicantStatusCode.SUCCESS|,
213 * |SupplicantStatusCode.FAILURE_NOT_STARTED|,
214 * |SupplicantStatusCode.FAILURE_UNKNOWN|,
215 * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
216 */
217 cancelConnect() generates (SupplicantStatus status);
218
219 /**
220 * Send P2P provision discovery request to the specified peer. The
221 * parameters for this command are the P2P device address of the peer and the
222 * desired configuration method.
223 *
224 * @param peerAddress MAC address of the device to send discovery.
225 * @method provisionMethod Provisioning method to use.
226 * @return status Status of the operation.
227 * Possible status codes:
228 * |SupplicantStatusCode.SUCCESS|,
229 * |SupplicantStatusCode.FAILURE_UNKNOWN|,
230 * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
231 */
232 provisionDiscovery(MacAddress peerAddress,
233 WpsProvisionMethod provisionMethod)
234 generates (SupplicantStatus status);
235
236 /**
237 * Set up a P2P group owner manually (i.e., without group owner
238 * negotiation with a specific peer). This is also known as autonomous
239 * group owner. Optional |persistent| may be used to specify restart of a
240 * persistent group.
241 *
242 * @param persistent Used to request a persistent group to be formed.
243 * @param persistentNetworkId Used to specify the restart of a persistent
244 * group.
245 * @return status Status of the operation.
246 * Possible status codes:
247 * |SupplicantStatusCode.SUCCESS|,
248 * |SupplicantStatusCode.FAILURE_UNKNOWN|,
249 * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
250 */
251 addGroup(bool persistent, SupplicantNetworkId persistentNetworkId)
252 generates (SupplicantStatus status);
253
254 /**
255 * Terminate a P2P group. If a new virtual network interface was used for
256 * the group, it must also be removed. The network interface name of the
257 * group interface is used as a parameter for this command.
258 *
259 * @param groupIfName Group interface name to use.
260 * @return status Status of the operation.
261 * Possible status codes:
262 * |SupplicantStatusCode.SUCCESS|,
263 * |SupplicantStatusCode.FAILURE_UNKNOWN|,
264 * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
265 */
266 removeGroup(string groupIfName) generates (SupplicantStatus status);
267
268 /**
269 * Reject connection attempt from a peer (specified with a device
270 * address). This is a mechanism to reject a pending group owner negotiation
271 * with a peer and request to automatically block any further connection or
272 * discovery of the peer.
273 *
274 * @param peerAddress MAC address of the device to reject.
275 * @return status Status of the operation.
276 * Possible status codes:
277 * |SupplicantStatusCode.SUCCESS|,
278 * |SupplicantStatusCode.FAILURE_UNKNOWN|,
279 * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
280 */
281 reject(MacAddress peerAddress) generates (SupplicantStatus status);
282
283 /**
284 * Invite a device to a persistent group.
285 * If the peer device is the group owner of the persistent group, the peer
286 * parameter is not needed. Otherwise it is used to specify which
287 * device to invite. |goDeviceAddress| parameter may be used to override
288 * the group owner device address for Invitation Request should it not be
289 * known for some reason (this should not be needed in most cases).
290 *
291 * @param groupIfName Group interface name to use.
292 * @param goDeviceAddress MAC address of the group owner device.
293 * @param peerAddress MAC address of the device to invite.
294 * @return status Status of the operation.
295 * Possible status codes:
296 * |SupplicantStatusCode.SUCCESS|,
297 * |SupplicantStatusCode.FAILURE_UNKNOWN|,
298 * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
299 */
300 invite(string groupIfName, MacAddress goDeviceAddress, MacAddress peerAddress)
301 generates (SupplicantStatus status);
302
303 /**
304 * Reinvoke a device from a persistent group.
305 *
306 * @param persistentNetworkId Used to specify the persistent group.
307 * @param peerAddress MAC address of the device to reinvoke.
308 * @return status Status of the operation.
309 * Possible status codes:
310 * |SupplicantStatusCode.SUCCESS|,
311 * |SupplicantStatusCode.FAILURE_UNKNOWN|,
312 * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
313 */
314 reinvoke(SupplicantNetworkId persistentNetworkId, MacAddress peerAddress)
315 generates (SupplicantStatus status);
316
317 /**
318 * Configure Extended Listen Timing.
319 *
320 * If enabled, listen state must be entered every |intervalInMillis| for at
321 * least |periodInMillis|. Both values have acceptable range of 1-65535
322 * (with interval obviously having to be larger than or equal to duration).
323 * If the P2P module is not idle at the time the Extended Listen Timing
324 * timeout occurs, the Listen State operation must be skipped.
325 *
326 * @param periodInMillis Period in milliseconds.
327 * @param intervalInMillis Interval in milliseconds.
328 * @return status Status of the operation.
329 * Possible status codes:
330 * |SupplicantStatusCode.SUCCESS|,
331 * |SupplicantStatusCode.FAILURE_ARGS_INVALID|,
332 * |SupplicantStatusCode.FAILURE_UNKNOWN|,
333 * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
334 */
335 configureExtListen(bool enable,
336 uint32_t periodInMillis,
337 uint32_t intervalInMillis)
338 generates (SupplicantStatus status);
339
340 /**
341 * Set P2P Listen channel.
342 *
343 * When specifying a social channel on the 2.4 GHz band (1/6/11) there is no
344 * need to specify the operating class since it defaults to 81. When
345 * specifying a social channel on the 60 GHz band (2), specify the 60 GHz
346 * operating class (180).
347 *
348 * @param channel Wifi channel. eg, 1, 6, 11.
349 * @param operatingClass Operating Class indicates the channel set of the AP
350 * indicated by this BSSID
351 * @return status Status of the operation.
352 * Possible status codes:
353 * |SupplicantStatusCode.SUCCESS|,
354 * |SupplicantStatusCode.FAILURE_UNKNOWN|,
355 * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
356 */
357 setListenChannel(uint32_t channel, uint32_t operatingClass)
358 generates (SupplicantStatus status);
359
360 /**
361 * Gets the operational SSID of the device.
362 *
363 * @param peerAddress MAC address of the peer.
364 * @return status Status of the operation.
365 * Possible status codes:
366 * |SupplicantStatusCode.SUCCESS|,
367 * |SupplicantStatusCode.FAILURE_UNKNOWN|,
368 * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
369 * @return ssid SSID of the device
370 */
371 getSsid(MacAddress peerAddress)
372 generates (SupplicantStatus status, Ssid ssid);
373
374 /**
375 * Gets the capability of the group which the device is a
376 * member of.
377 *
378 * @param peerAddress MAC address of the peer.
379 * @return status Status of the operation.
380 * Possible status codes:
381 * |SupplicantStatusCode.SUCCESS|,
382 * |SupplicantStatusCode.FAILURE_UNKNOWN|,
383 * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
384 * @return capabilityMask Combination of |GroupCapabilityMask| values.
385 */
386 getGroupCapability(MacAddress peerAddress)
387 generates (SupplicantStatus status, uint32_t capabilities);
388
389 /**
390 * This command can be used to add a bonjour service.
391 *
392 * @param query Hex dump of the query data.
393 * @param return Hex dump of the response data.
394 * @return status Status of the operation.
395 * Possible status codes:
396 * |SupplicantStatusCode.SUCCESS|,
397 * |SupplicantStatusCode.FAILURE_UNKNOWN|,
398 * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
399 */
400 addBonjourService(vec<uint8_t> query, vec<uint8_t> response)
401 generates (SupplicantStatus status);
402
403 /**
404 * This command can be used to remove a bonjour service.
405 *
406 * @param query Hex dump of the query data.
407 * @return status Status of the operation.
408 * Possible status codes:
409 * |SupplicantStatusCode.SUCCESS|,
410 * |SupplicantStatusCode.FAILURE_UNKNOWN|,
411 * |SupplicantStatusCode.FAILURE_NOT_STARTED|,
412 * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
413 */
414 removeBonjourService(vec<uint8_t> query) generates (SupplicantStatus status);
415
416 /**
417 * This command can be used to add a UPNP service.
418 *
419 * @param version Version to be used.
420 * @package serviceName Service name to be used.
421 * @return status Status of the operation.
422 * Possible status codes:
423 * |SupplicantStatusCode.SUCCESS|,
424 * |SupplicantStatusCode.FAILURE_UNKNOWN|,
425 * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
426 */
427 addUpnpService(uint32_t version, string serviceName)
428 generates (SupplicantStatus status);
429
430 /**
431 * This command can be used to remove a UPNP service.
432 *
433 * @param version Version to be used.
434 * @package serviceName Service name to be used.
435 * @return status Status of the operation.
436 * Possible status codes:
437 * |SupplicantStatusCode.SUCCESS|,
438 * |SupplicantStatusCode.FAILURE_UNKNOWN|,
439 * |SupplicantStatusCode.FAILURE_NOT_STARTED|,
440 * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
441 */
442 removeUpnpService(uint32_t version, string serviceName)
443 generates (SupplicantStatus status);
444
445 /**
446 * This command can be used to flush all services from the
447 * device.
448 *
449 * @return status Status of the operation.
450 * Possible status codes:
451 * |SupplicantStatusCode.SUCCESS|,
452 * |SupplicantStatusCode.FAILURE_UNKNOWN|,
453 * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
454 */
455 flushServices(uint32_t version, string serviceName)
456 generates (SupplicantStatus status);
457
458 /**
459 * Schedule a P2P service discovery request. The parameters for this command
460 * are the device address of the peer device (or 00:00:00:00:00:00 for
461 * wildcard query that is sent to every discovered P2P peer that supports
462 * service discovery) and P2P Service Query TLV(s) as hexdump.
463 *
464 * @param peerAddress MAC address of the device to discover.
465 * @param query Hex dump of the query data.
466 * @return status Status of the operation.
467 * Possible status codes:
468 * |SupplicantStatusCode.SUCCESS|,
469 * |SupplicantStatusCode.FAILURE_UNKNOWN|,
470 * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
471 * @return identifier Identifier for the request. Can be used to cancel the
472 * request.
473 */
474 requestServiceDiscovery(MacAddress peerAddress, vec<uint8_t> query)
475 generates (SupplicantStatus status, uint64_t identifier);
476
477 /**
478 * Cancel a previous service discovery request.
479 *
480 * @return identifier Identifier for the request to cancel.
481 * @return status Status of the operation.
482 * Possible status codes:
483 * |SupplicantStatusCode.SUCCESS|,
484 * |SupplicantStatusCode.FAILURE_NOT_STARTED|,
485 * |SupplicantStatusCode.FAILURE_UNKNOWN|,
486 * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
487 */
488 cancelServiceDiscovery(uint64_t identifier)
489 generates (SupplicantStatus status);
Roshan Pius39f588f2016-10-31 14:51:27 -0700490};