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