blob: 93b3d925612eb2de9ca124ad5a924f0b7d597186 [file] [log] [blame]
Roshan Piusfcbf9232016-10-06 11:08:17 -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@1.0;
18
19import IWifiIface;
Roshan Pius18eec812016-10-14 11:29:30 -070020import IWifiRttControllerEventCallback;
Roshan Piusfcbf9232016-10-06 11:08:17 -070021
22/**
Roshan Pius18eec812016-10-14 11:29:30 -070023 * Interface used to perform RTT(Round trip time) operations.
Roshan Piusfcbf9232016-10-06 11:08:17 -070024 */
25interface IWifiRttController {
26 /**
Roshan Pius18eec812016-10-14 11:29:30 -070027 * Get the iface on which the RTT operations must be performed.
Roshan Piusfcbf9232016-10-06 11:08:17 -070028 *
Roshan Piusa52dc732016-10-10 11:53:07 -070029 * @return status WifiStatus of the operation.
Roshan Pius1f9073c2016-10-10 10:32:22 -070030 * Possible status codes:
Roshan Piusa52dc732016-10-10 11:53:07 -070031 * |WifiStatusCode.SUCCESS|,
32 * |WifiStatusCode.ERROR_WIFI_RTT_CONTROLLER_INVALID|
Roshan Piusfcbf9232016-10-06 11:08:17 -070033 * @return boundIface HIDL interface object representing the iface if bound
34 * to a specific iface, null otherwise
35 */
Roshan Piusa52dc732016-10-10 11:53:07 -070036 getBoundIface() generates (WifiStatus status, IWifiIface boundIface);
Roshan Pius18eec812016-10-14 11:29:30 -070037
38 /**
39 * Requests notifications of significant events on this rtt controller.
40 * Multiple calls to this must register multiple callbacks each of which must
41 * receive all events.
42 *
43 * @param callback An instance of the |IWifiRttControllerEventCallback| HIDL
44 * interface object.
45 * @return status WifiStatus of the operation.
46 * Possible status codes:
47 * |WifiStatusCode.SUCCESS|,
48 * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|
49 */
50 registerEventCallback(IWifiRttControllerEventCallback callback)
51 generates (WifiStatus status);
52
53 /**
54 * API to request RTT measurement.
55 *
56 * @param cmdId command Id to use for this invocation.
57 * @param rttConfigs Vector of |RttConfig| parameters.
58 * @return status WifiStatus of the operation.
59 * Possible status codes:
60 * |WifiStatusCode.SUCCESS|,
61 * |WifiStatusCode.ERROR_WIFI_RTT_CONTROLLER_INVALID|,
62 * |WifiStatusCode.ERROR_INVALID_ARGS|,
63 * |WifiStatusCode.ERROR_NOT_AVAILABLE|,
64 * |WifiStatusCode.ERROR_UNKNOWN|
65 */
66 rangeRequest(CommandId cmdId, vec<RttConfig> rttConfigs)
67 generates (WifiStatus status);
68
69 /**
70 * API to cancel RTT measurements.
71 *
72 * @param cmdId command Id corresponding to the original request.
73 * @param addrs Vector of addresses for which to cancel.
74 * @return status WifiStatus of the operation.
75 * Possible status codes:
76 * |WifiStatusCode.SUCCESS|,
77 * |WifiStatusCode.ERROR_WIFI_RTT_CONTROLLER_INVALID|,
78 * |WifiStatusCode.ERROR_INVALID_ARGS|,
79 * |WifiStatusCode.ERROR_NOT_AVAILABLE|,
80 * |WifiStatusCode.ERROR_UNKNOWN|
81 */
82 rangeCancel(CommandId cmdId, vec<MacAddress> addrs)
83 generates (WifiStatus status);
84
85 /**
86 * API to start publishing the channel map on responder device in an NBD
87 * cluster.
88 * Responder device must take this request and schedule broadcasting the
89 * channel map in a NBD ranging attribute in a Service Discovery Frame.
90 * DE must automatically remove the ranging attribute from the OTA queue
91 * after number of Discovery Window specified by numDw where each
92 * Discovery Window is 512 TUs apart.
93 *
94 * @param cmdId command Id to use for this invocation.
95 * @param params Instance of |RttChannelMap|.
96 * @return status WifiStatus of the operation.
97 * Possible status codes:
98 * |WifiStatusCode.SUCCESS|,
99 * |WifiStatusCode.ERROR_WIFI_RTT_CONTROLLER_INVALID|,
100 * |WifiStatusCode.ERROR_INVALID_ARGS|,
101 * |WifiStatusCode.ERROR_NOT_AVAILABLE|,
102 * |WifiStatusCode.ERROR_UNKNOWN|
103 */
104 setChannelMap(CommandId cmdId, RttChannelMap params, uint32_t numDw)
105 generates (WifiStatus status);
106
107 /**
108 * API to clear the channel map on the responder device in an NBD cluster.
109 * Responder device must cancel future ranging channel request, starting from
110 * next Discovery Window interval and must also stop broadcasting NBD
111 * ranging attribute in Service Discovery Frame.
112 *
113 * @param cmdId command Id corresponding to the original request.
114 * @return status WifiStatus of the operation.
115 * Possible status codes:
116 * |WifiStatusCode.SUCCESS|,
117 * |WifiStatusCode.ERROR_WIFI_RTT_CONTROLLER_INVALID|,
118 * |WifiStatusCode.ERROR_INVALID_ARGS|,
119 * |WifiStatusCode.ERROR_NOT_AVAILABLE|,
120 * |WifiStatusCode.ERROR_UNKNOWN|
121 */
122 clearChannelMap(CommandId cmdId) generates (WifiStatus status);
123
124 /**
125 * RTT capabilities of the device.
126 *
127 * @return status WifiStatus of the operation.
128 * Possible status codes:
129 * |WifiStatusCode.SUCCESS|,
130 * |WifiStatusCode.ERROR_WIFI_RTT_CONTROLLER_INVALID|,
131 * |WifiStatusCode.ERROR_UNKNOWN|
132 * @return capabilities Instance of |RttCapabilities|.
133 */
134 getCapabilities() generates (WifiStatus status, RttCapabilities capabilities);
135
136 /**
137 * Set configuration for debug.
138 *
139 * @param type debug level to be set.
140 * @return status WifiStatus of the operation.
141 * Possible status codes:
142 * |WifiStatusCode.SUCCESS|,
143 * |WifiStatusCode.ERROR_WIFI_RTT_CONTROLLER_INVALID|,
144 * |WifiStatusCode.ERROR_INVALID_ARGS|,
145 * |WifiStatusCode.ERROR_NOT_AVAILABLE|,
146 * |WifiStatusCode.ERROR_UNKNOWN|
147 */
148 setDebugCfg(RttDebugType Type) generates (WifiStatus status);
149
150 /**
151 * Get the debug information.
152 *
153 * @return status WifiStatus of the operation.
154 * Possible status codes:
155 * |WifiStatusCode.ERROR_WIFI_RTT_CONTROLLER_INVALID|,
156 * |WifiStatusCode.ERROR_NOT_AVAILABLE|,
157 * |WifiStatusCode.ERROR_UNKNOWN|
158 * @return info Instance of |RttDebugInfo|.
159 */
160 getDebugInfo() generates (WifiStatus status, RttDebugInfo info);
161
162 /**
163 * API to configure the LCI(Location civic information).
164 * Used in RTT Responder mode only.
165 *
166 * @param cmdId command Id to use for this invocation.
167 * @param lci Instance of |RttLciInformation|.
168 * @return status WifiStatus of the operation.
169 * Possible status codes:
170 * |WifiStatusCode.SUCCESS|,
171 * |WifiStatusCode.ERROR_WIFI_RTT_CONTROLLER_INVALID|,
172 * |WifiStatusCode.ERROR_INVALID_ARGS|,
173 * |WifiStatusCode.ERROR_NOT_AVAILABLE|,
174 * |WifiStatusCode.ERROR_UNKNOWN|
175 */
176 setLci(CommandId cmdId, RttLciInformation lci) generates (WifiStatus status);
177
178 /**
179 * API to configure the LCR(Location civic records).
180 * Used in RTT Responder mode only.
181 *
182 * @param cmdId command Id to use for this invocation.
183 * @param lcr Instance of |RttLcrInformation|.
184 * @return status WifiStatus of the operation.
185 * Possible status codes:
186 * |WifiStatusCode.SUCCESS|,
187 * |WifiStatusCode.ERROR_WIFI_RTT_CONTROLLER_INVALID|,
188 * |WifiStatusCode.ERROR_INVALID_ARGS|,
189 * |WifiStatusCode.ERROR_NOT_AVAILABLE|,
190 * |WifiStatusCode.ERROR_UNKNOWN|
191 */
192 setLcr(CommandId cmdId, RttLcrInformation lcr) generates (WifiStatus status);
193
194 /**
195 * Get RTT responder information e.g. WiFi channel to enable responder on.
196 *
197 * @return status WifiStatus of the operation.
198 * Possible status codes:
199 * |WifiStatusCode.SUCCESS|,
200 * |WifiStatusCode.ERROR_WIFI_RTT_CONTROLLER_INVALID|,
201 * |WifiStatusCode.ERROR_NOT_AVAILABLE|,
202 * |WifiStatusCode.ERROR_UNKNOWN|
203 * @return info Instance of |RttResponderInfo|.
204 */
205 getResponderInfo() generates (WifiStatus status, RttResponder info);
206
207 /**
208 * Enable RTT responder mode.
209 *
210 * @param cmdId command Id to use for this invocation.
211 * @parm channelHint Hint of the channel information where RTT responder must
212 * be enabled on.
213 * @param maxDurationInSeconds Timeout of responder mode.
214 * @param info Instance of |RttResponderInfo|.
215 * @return status WifiStatus of the operation.
216 * Possible status codes:
217 * |WifiStatusCode.SUCCESS|,
218 * |WifiStatusCode.ERROR_WIFI_RTT_CONTROLLER_INVALID|,
219 * |WifiStatusCode.ERROR_INVALID_ARGS|,
220 * |WifiStatusCode.ERROR_NOT_AVAILABLE|,
221 * |WifiStatusCode.ERROR_UNKNOWN|
222 */
223 enableResponder(CommandId cmdId,
224 WifiChannelInfo channelHint,
225 uint32_t maxDurationSeconds,
226 RttResponder info)
227 generates (WifiStatus status);
228
229 /**
230 * Disable RTT responder mode.
231 *
232 * @param cmdId command Id corresponding to the original request.
233 * @return status WifiStatus of the operation.
234 * Possible status codes:
235 * |WifiStatusCode.SUCCESS|,
236 * |WifiStatusCode.ERROR_WIFI_RTT_CONTROLLER_INVALID|,
237 * |WifiStatusCode.ERROR_NOT_AVAILABLE|,
238 * |WifiStatusCode.ERROR_UNKNOWN|
239 */
240 disableResponder(CommandId cmdId) generates (WifiStatus status);
Roshan Piusfcbf9232016-10-06 11:08:17 -0700241};