Jimmy Chen | 6c207ed | 2018-11-09 10:27:49 +0800 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright 2018 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 | |
| 17 | package android.hardware.wifi.supplicant@1.2; |
| 18 | |
| 19 | import @1.0::ISupplicantP2pIface; |
| 20 | import @1.0::MacAddress; |
| 21 | import @1.0::Ssid; |
| 22 | import @1.0::SupplicantStatus; |
| 23 | |
| 24 | /** |
| 25 | * Interface exposed by the supplicant for each P2P mode network |
| 26 | * interface (e.g p2p0) it controls. |
| 27 | * To use 1.2 features you must cast specific interfaces returned from the |
| 28 | * 1.2 HAL. For example V1_2::ISupplicant::addIface() adds V1_2::ISupplicantIface, |
| 29 | * which can be cast to V1_2::ISupplicantP2pIface. |
| 30 | */ |
| 31 | interface ISupplicantP2pIface extends @1.0::ISupplicantP2pIface { |
| 32 | /** |
| 33 | * Set up a P2P group owner or join a group as a group client |
| 34 | * with the specified configuration. |
| 35 | * |
| 36 | * If joinExistingGroup is false, this device sets up a P2P group owner manually (i.e., |
| 37 | * without group owner negotiation with a specific peer) with the specified SSID, |
| 38 | * passphrase, persistent mode, and frequency/band. |
| 39 | * |
| 40 | * If joinExistingGroup is true, this device acts as a group client and joins the group |
| 41 | * whose network name and group owner's MAC address matches the specified SSID |
| 42 | * and peer address without WPS process. If peerAddress is 00:00:00:00:00:00, the first found |
| 43 | * group whose network name matches the specified SSID is joined. |
| 44 | * |
| 45 | * @param ssid The SSID of this group. |
| 46 | * @param pskPassphrase The passphrase of this group. |
| 47 | * @param persistent Used to request a persistent group to be formed, |
| 48 | * only applied for the group owner. |
| 49 | * @param freq The required frequency or band for this group. |
| 50 | * only applied for the group owner. |
| 51 | * The following values are supported: |
| 52 | * 0: automatic channel selection, |
| 53 | * 2: for 2.4GHz channels |
| 54 | * 5: for 5GHz channels |
| 55 | * specific frequency, i.e., 2412, 5500, etc. |
| 56 | * If an invalid band or unsupported frequency are specified, it fails. |
| 57 | * @param peerAddress the group owner's MAC address, only applied for the group client. |
| 58 | * If the MAC is "00:00:00:00:00:00", the device must try to find a peer |
| 59 | * whose network name matches the specified SSID. |
| 60 | * @param joinExistingGroup if true, join a group as a group client; otherwise, |
| 61 | * create a group as a group owner. |
| 62 | * @return status Status of the operation. |
| 63 | * Possible status codes: |
| 64 | * |SupplicantStatusCode.SUCCESS|, |
| 65 | * |SupplicantStatusCode.FAILURE_UNKNOWN|, |
| 66 | * |SupplicantStatusCode.FAILURE_IFACE_INVALID| |
| 67 | */ |
| 68 | addGroup_1_2(Ssid ssid, string pskPassphrase, bool persistent, |
| 69 | uint32_t freq, MacAddress peerAddress, bool joinExistingGroup) |
| 70 | generates (SupplicantStatus status); |
| 71 | }; |