1/*
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 ISupplicantNetwork;
20import ISupplicantP2pNetworkCallback;
21
22/**
23 * Interface exposed by the supplicant for each P2P mode network
24 * configuration it controls.
25 */
26interface ISupplicantP2pNetwork extends ISupplicantNetwork {
27  /**
28   * Register for callbacks from this network.
29   *
30   * These callbacks are invoked for events that are specific to this network.
31   * Registration of multiple callback objects is supported. These objects must
32   * be automatically deleted when the corresponding client process is dead or
33   * if this network is removed.
34   *
35   * @param callback An instance of the |ISupplicantP2pNetworkCallback| HIDL
36   *        interface object.
37   * @return status P2ptus of the operation.
38   *         Possible status codes:
39   *         |SupplicantP2ptusCode.SUCCESS|,
40   *         |SupplicantP2ptusCode.FAILURE_UNKNOWN|,
41   *         |SupplicantP2ptusCode.FAILURE_NETWORK_INVALID|
42   */
43  registerCallback(ISupplicantP2pNetworkCallback callback)
44      generates (SupplicantStatus status);
45
46  /**
47   * Getters for the various network params.
48   */
49  /**
50   * Get SSID for this network.
51   *
52   * @return status Status of the operation.
53   *         Possible status codes:
54   *         |SupplicantStatusCode.SUCCESS|,
55   *         |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
56   * @return ssid value set.
57   */
58  getSsid() generates (SupplicantStatus status, Ssid ssid);
59
60  /**
61   * Get the BSSID set for this network.
62   *
63   * @return status Status of the operation.
64   *         Possible status codes:
65   *         |SupplicantStatusCode.SUCCESS|,
66   *         |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
67   * @return bssid value set.
68   */
69  getBssid() generates (SupplicantStatus status, Bssid bssid);
70
71  /**
72   * Check if the network is currently active one.
73   *
74   * @return status Status of the operation.
75   *         Possible status codes:
76   *         |SupplicantStatusCode.SUCCESS|,
77   *         |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
78   * @return isCurrent true if current, false otherwise.
79   */
80  isCurrent() generates (SupplicantStatus status, bool isCurrent);
81
82  /**
83   * Check if the network is marked persistent.
84   *
85   * @return status Status of the operation.
86   *         Possible status codes:
87   *         |SupplicantStatusCode.SUCCESS|,
88   *         |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
89   * @return isPersistent true if persistent, false otherwise.
90   */
91  isPersistent() generates (SupplicantStatus status, bool isPersistent);
92
93  /**
94   * Check if the device is the group owner of the network.
95   *
96   * @return status Status of the operation.
97   *         Possible status codes:
98   *         |SupplicantStatusCode.SUCCESS|,
99   *         |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
100   * @return isGo true if group owner, false otherwise.
101   */
102  isGo() generates (SupplicantStatus status, bool isGo);
103
104  /**
105   * Set the list of P2P Clients in a persistent group (GO).
106   * This is a list of P2P Clients (P2P Device Address) that have joined
107   * the persistent group. This is maintained on the GO for persistent
108   * group entries (disabled == 2).
109   *
110   * @param clients MAC address of the clients.
111   * @return status Status of the operation.
112   *         Possible status codes:
113   *         |SupplicantStatusCode.SUCCESS|,
114   *         |SupplicantP2ptusCode.FAILURE_UNKNOWN|,
115   *         |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
116   */
117  setClientList(vec<MacAddress> clients) generates (SupplicantStatus status);
118
119  /**
120   * Get the list of P2P Clients in a persistent group (GO).
121   * This is a list of P2P Clients (P2P Device Address) that have joined
122   * the persistent group. This is maintained on the GO for persistent
123   * group entries (disabled == 2).
124   *
125   * @return status Status of the operation.
126   *         Possible status codes:
127   *         |SupplicantStatusCode.SUCCESS|,
128   *         |SupplicantP2ptusCode.FAILURE_UNKNOWN|,
129   *         |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
130   * @return clients MAC address of the clients.
131   */
132  getClientList() generates (SupplicantStatus status, vec<MacAddress> clients);
133};
134