blob: cd5a7c5c4cf09d3483a7df3f6d5ce4cea32d394c [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 */
360 configureExtListen(bool enable,
361 uint32_t periodInMillis,
362 uint32_t intervalInMillis)
363 generates (SupplicantStatus status);
364
365 /**
366 * Set P2P Listen channel.
367 *
368 * When specifying a social channel on the 2.4 GHz band (1/6/11) there is no
369 * need to specify the operating class since it defaults to 81. When
370 * specifying a social channel on the 60 GHz band (2), specify the 60 GHz
371 * operating class (180).
372 *
373 * @param channel Wifi channel. eg, 1, 6, 11.
374 * @param operatingClass Operating Class indicates the channel set of the AP
375 * indicated by this BSSID
376 * @return status Status of the operation.
377 * Possible status codes:
378 * |SupplicantStatusCode.SUCCESS|,
379 * |SupplicantStatusCode.FAILURE_UNKNOWN|,
380 * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
381 */
382 setListenChannel(uint32_t channel, uint32_t operatingClass)
383 generates (SupplicantStatus status);
384
385 /**
Roshan Pius282a0b32016-12-08 11:08:14 -0800386 * Set P2P disallowed frequency ranges.
387 *
388 * Specify ranges of frequencies that are disallowed for any p2p operations.
389
390 * @param ranges List of ranges which needs to be disallowed.
391 * @return status Status of the operation.
392 * Possible status codes:
393 * |SupplicantStatusCode.SUCCESS|,
394 * |SupplicantStatusCode.FAILURE_UNKNOWN|,
395 * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
396 */
397 setDisallowedFrequencies(vec<FreqRange> ranges)
398 generates (SupplicantStatus status);
399
400 /**
Roshan Pius756ad992016-11-07 10:29:48 -0800401 * Gets the operational SSID of the device.
402 *
403 * @param peerAddress MAC address of the peer.
404 * @return status Status of the operation.
405 * Possible status codes:
406 * |SupplicantStatusCode.SUCCESS|,
407 * |SupplicantStatusCode.FAILURE_UNKNOWN|,
408 * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
409 * @return ssid SSID of the device
410 */
411 getSsid(MacAddress peerAddress)
412 generates (SupplicantStatus status, Ssid ssid);
413
414 /**
415 * Gets the capability of the group which the device is a
416 * member of.
417 *
418 * @param peerAddress MAC address of the peer.
419 * @return status Status of the operation.
420 * Possible status codes:
421 * |SupplicantStatusCode.SUCCESS|,
422 * |SupplicantStatusCode.FAILURE_UNKNOWN|,
423 * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
424 * @return capabilityMask Combination of |GroupCapabilityMask| values.
425 */
426 getGroupCapability(MacAddress peerAddress)
427 generates (SupplicantStatus status, uint32_t capabilities);
428
429 /**
430 * This command can be used to add a bonjour service.
431 *
432 * @param query Hex dump of the query data.
433 * @param return Hex dump of the response data.
434 * @return status Status of the operation.
435 * Possible status codes:
436 * |SupplicantStatusCode.SUCCESS|,
437 * |SupplicantStatusCode.FAILURE_UNKNOWN|,
438 * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
439 */
440 addBonjourService(vec<uint8_t> query, vec<uint8_t> response)
441 generates (SupplicantStatus status);
442
443 /**
444 * This command can be used to remove a bonjour service.
445 *
446 * @param query Hex dump of the query data.
447 * @return status Status of the operation.
448 * Possible status codes:
449 * |SupplicantStatusCode.SUCCESS|,
450 * |SupplicantStatusCode.FAILURE_UNKNOWN|,
451 * |SupplicantStatusCode.FAILURE_NOT_STARTED|,
452 * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
453 */
454 removeBonjourService(vec<uint8_t> query) generates (SupplicantStatus status);
455
456 /**
457 * This command can be used to add a UPNP service.
458 *
459 * @param version Version to be used.
460 * @package serviceName Service name to be used.
461 * @return status Status of the operation.
462 * Possible status codes:
463 * |SupplicantStatusCode.SUCCESS|,
464 * |SupplicantStatusCode.FAILURE_UNKNOWN|,
465 * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
466 */
467 addUpnpService(uint32_t version, string serviceName)
468 generates (SupplicantStatus status);
469
470 /**
471 * This command can be used to remove a UPNP service.
472 *
473 * @param version Version to be used.
474 * @package serviceName Service name to be used.
475 * @return status Status of the operation.
476 * Possible status codes:
477 * |SupplicantStatusCode.SUCCESS|,
478 * |SupplicantStatusCode.FAILURE_UNKNOWN|,
479 * |SupplicantStatusCode.FAILURE_NOT_STARTED|,
480 * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
481 */
482 removeUpnpService(uint32_t version, string serviceName)
483 generates (SupplicantStatus status);
484
485 /**
486 * This command can be used to flush all services from the
487 * device.
488 *
489 * @return status Status of the operation.
490 * Possible status codes:
491 * |SupplicantStatusCode.SUCCESS|,
492 * |SupplicantStatusCode.FAILURE_UNKNOWN|,
493 * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
494 */
495 flushServices(uint32_t version, string serviceName)
496 generates (SupplicantStatus status);
497
498 /**
499 * Schedule a P2P service discovery request. The parameters for this command
500 * are the device address of the peer device (or 00:00:00:00:00:00 for
501 * wildcard query that is sent to every discovered P2P peer that supports
502 * service discovery) and P2P Service Query TLV(s) as hexdump.
503 *
504 * @param peerAddress MAC address of the device to discover.
505 * @param query Hex dump of the query data.
506 * @return status Status of the operation.
507 * Possible status codes:
508 * |SupplicantStatusCode.SUCCESS|,
509 * |SupplicantStatusCode.FAILURE_UNKNOWN|,
510 * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
511 * @return identifier Identifier for the request. Can be used to cancel the
512 * request.
513 */
514 requestServiceDiscovery(MacAddress peerAddress, vec<uint8_t> query)
515 generates (SupplicantStatus status, uint64_t identifier);
516
517 /**
518 * Cancel a previous service discovery request.
519 *
520 * @return identifier Identifier for the request to cancel.
521 * @return status Status of the operation.
522 * Possible status codes:
523 * |SupplicantStatusCode.SUCCESS|,
524 * |SupplicantStatusCode.FAILURE_NOT_STARTED|,
525 * |SupplicantStatusCode.FAILURE_UNKNOWN|,
526 * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
527 */
528 cancelServiceDiscovery(uint64_t identifier)
529 generates (SupplicantStatus status);
Roshan Pius3f050c12016-12-14 08:06:58 -0800530
531 /**
532 * Send driver command to set Miracast mode.
533 *
534 * @param mode Mode of Miracast.
535 * @return status Status of the operation.
536 * Possible status codes:
537 * |SupplicantStatusCode.SUCCESS|,
538 * |SupplicantStatusCode.FAILURE_UNKNOWN|
539 */
540 setMiracastMode(MiracastMode mode)
541 generates (SupplicantStatus status);
Roshan Pius39f588f2016-10-31 14:51:27 -0700542};