summaryrefslogtreecommitdiffstats
blob: 8bb8c9700282e72ad4e76de956ecf5b68cdb5bed (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
/*
 * Copyright 2016 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package android.hardware.wifi.supplicant@1.0;

import ISupplicantNetwork;

/**
 * Interface exposed by the supplicant for each network interface (e.g wlan0)
 * it controls.
 */
interface ISupplicantIface {
  /**
   * Size limits for some of the params used in this interface.
   */
  enum ParamSizeLimits : uint32_t {
      WPS_DEVICE_NAME_MAX_LEN = 32,
      WPS_MANUFACTURER_MAX_LEN = 64,
      WPS_MODEL_NAME_MAX_LEN = 32,
      WPS_MODEL_NUMBER_MAX_LEN = 32,
      WPS_SERIAL_NUMBER_MAX_LEN = 32
  };

  /**
   * Retrieves the name of the network interface.
   *
   * @return status Status of the operation.
   *         Possible status codes:
   *         |SupplicantStatusCode.SUCCESS|,
   *         |SupplicantStatusCode.FAILURE_IFACE_INVALID|
   * @return name Name of the network interface, e.g., wlan0
   */
  getName() generates (SupplicantStatus status, string name);

  /**
   * Retrieves the type of the network interface.
   *
   * @return status Status of the operation.
   *         Possible status codes:
   *         |SupplicantStatusCode.SUCCESS|,
   *         |SupplicantStatusCode.FAILURE_IFACE_INVALID|
   * @return type Type of the network interface, e.g., STA.
   */
  getType() generates (SupplicantStatus status, IfaceType type);

  /**
   * Add a new network to the interface.
   *
   * @return status Status of the operation.
   *         Possible status codes:
   *         |SupplicantStatusCode.SUCCESS|,
   *         |SupplicantStatusCode.FAILURE_UNKNOWN|,
   *         |SupplicantStatusCode.FAILURE_IFACE_INVALID|
   * @return network HIDL interface object representing the new network if
   *         successful, null otherwise.
   */
  addNetwork()
      generates (SupplicantStatus status, ISupplicantNetwork network);

  /**
   * Remove a network from the interface.
   *
   * Use |ISupplicantNetwork.getId()| on the corresponding network HIDL
   * interface object to retrieve the ID.
   *
   * @param id Network ID allocated to the corresponding network.
   * @return status Status of the operation.
   *         Possible status codes:
   *         |SupplicantStatusCode.SUCCESS|,
   *         |SupplicantStatusCode.FAILURE_UNKNOWN|,
   *         |SupplicantStatusCode.FAILURE_IFACE_INVALID|,
   *         |SupplicantStatusCode.FAILURE_NETWORK_UNKNOWN|
   */
  removeNetwork(SupplicantNetworkId id)
      generates (SupplicantStatus status);

  /**
   * Gets a HIDL interface object for the network corresponding to the
   * |SupplicantNetworkId|.
   *
   * Use |ISupplicantNetwork.getId()| on the corresponding network HIDL
   * interface object to retrieve the ID.
   *
   * @param id Network ID allocated to the corresponding network.
   * @return status Status of the operation.
   *         Possible status codes:
   *         |SupplicantStatusCode.SUCCESS|,
   *         |SupplicantStatusCode.FAILURE_UNKNOWN|,
   *         |SupplicantStatusCode.FAILURE_IFACE_INVALID|,
   *         |SupplicantStatusCode.FAILURE_NETWORK_UNKNOWN|
   * @return network HIDL interface object representing the new network if
   *         successful, null otherwise.
   */
  getNetwork(SupplicantNetworkId id)
      generates (SupplicantStatus status, ISupplicantNetwork network);

  /**
   * Retrieve a list of all the network Id's controlled by the supplicant.
   *
   * The corresponding |ISupplicantNetwork| object for any network can be
   * retrieved using |getNetwork| method.
   *
   * @return status Status of the operation.
   *         Possible status codes:
   *         |SupplicantStatusCode.SUCCESS|,
   *         |SupplicantStatusCode.FAILURE_IFACE_INVALID|,
   *         |SupplicantStatusCode.FAILURE_UNKNOWN|
   * @return networkIds List of all network Id's controlled by the supplicant.
   */
  listNetworks()
      generates (SupplicantStatus status, vec<SupplicantNetworkId> networkIds);

  /**
   * Set the device name for WPS operations.
   * User-friendly description of device (up to |WPS_DEVICE_NAME_MAX_LEN|
   * octets encoded in UTF-8).
   *
   * @parm name Name to be set.
   * @return status Status of the operation.
   *         Possible status codes:
   *         |SupplicantStatusCode.SUCCESS|,
   *         |SupplicantStatusCode.FAILURE_IFACE_INVALID|,
   *         |SupplicantStatusCode.FAILURE_UNKNOWN|
   */
  setWpsDeviceName(string name) generates (SupplicantStatus status);

  /**
   * Set the device type for WPS operations.
   *
   * @parm type Type of device. Refer to section B.1 of Wifi P2P
   *       Technical specification v1.2.
   * @return status Status of the operation.
   *         Possible status codes:
   *         |SupplicantStatusCode.SUCCESS|,
   *         |SupplicantStatusCode.FAILURE_IFACE_INVALID|,
   *         |SupplicantStatusCode.FAILURE_UNKNOWN|
   */
  setWpsDeviceType(uint8_t[8] type) generates (SupplicantStatus status);

  /**
   * Set the manufacturer for WPS operations.
   * The manufacturer of the device (up to |WPS_MANUFACTURER_MAX_LEN| ASCII
   * characters).
   *
   * @parm manufacturer Manufacture to be set.
   * @return status Status of the operation.
   *         Possible status codes:
   *         |SupplicantStatusCode.SUCCESS|,
   *         |SupplicantStatusCode.FAILURE_IFACE_INVALID|,
   *         |SupplicantStatusCode.FAILURE_UNKNOWN|
   */
  setWpsManufacturer(string manufacturer) generates (SupplicantStatus status);

  /**
   * Set the model name for WPS operations.
   * Model of the device (up to |WPS_MODEL_NAME_MAX_LEN| ASCII characters).
   *
   * @parm modelName Model name to be set.
   * @return status Status of the operation.
   *         Possible status codes:
   *         |SupplicantStatusCode.SUCCESS|,
   *         |SupplicantStatusCode.FAILURE_IFACE_INVALID|,
   *         |SupplicantStatusCode.FAILURE_UNKNOWN|
   */
  setWpsModelName(string modelName) generates (SupplicantStatus status);

  /**
   * Set the model number for WPS operations.
   * Additional device description (up to |WPS_MODEL_NUMBER_MAX_LEN| ASCII
   * characters).
   *
   * @parm modelNumber Model number to be set.
   * @return status Status of the operation.
   *         Possible status codes:
   *         |SupplicantStatusCode.SUCCESS|,
   *         |SupplicantStatusCode.FAILURE_IFACE_INVALID|,
   *         |SupplicantStatusCode.FAILURE_UNKNOWN|
   */
  setWpsModelNumber(string modelNumber) generates (SupplicantStatus status);

  /**
   * Set the serial number for WPS operations.
   * Serial number of the device (up to |WPS_SERIAL_NUMBER_MAX_LEN| characters)
   *
   * @parm serialNumber Serial number to be set.
   * @return status Status of the operation.
   *         Possible status codes:
   *         |SupplicantStatusCode.SUCCESS|,
   *         |SupplicantStatusCode.FAILURE_IFACE_INVALID|,
   *         |SupplicantStatusCode.FAILURE_UNKNOWN|
   */
  setWpsSerialNumber(string serialNumber) generates (SupplicantStatus status);

  /**
   * Set the list of supported config methods for WPS operations.
   *
   * @param configMethods Mask of WPS configuration methods supported by the
   *        device.
   * @return status Status of the operation.
   *         Possible status codes:
   *         |SupplicantStatusCode.SUCCESS|,
   *         |SupplicantStatusCode.FAILURE_IFACE_INVALID|,
   *         |SupplicantStatusCode.FAILURE_UNKNOWN|
   */
  setWpsConfigMethods(bitfield<WpsConfigMethods> configMethods)
      generates (SupplicantStatus status);
};