blob: dd956d64c9aa2599773da29f6e6dce8d8351301f [file] [log] [blame]
Roshan Pius120f94c2016-10-13 11:48:42 -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
19/**
Etan Cohenf01bcaa2016-12-25 09:42:21 -080020 * NAN Response and Asynchronous Event Callbacks.
Etan Cohen44983ae2017-02-09 09:16:25 -080021 *
22 * References to "NAN Spec" are to the Wi-Fi Alliance "Wi-Fi Neighbor Awareness
23 * Networking (NAN) Technical Specification".
Roshan Pius120f94c2016-10-13 11:48:42 -070024 */
25interface IWifiNanIfaceEventCallback {
26 /**
Etan Cohen44983ae2017-02-09 09:16:25 -080027 * Notify callbacks are asynchronous callbacks - but in response to |IWifiNanIface| method calls.
28 * Each method will receive a notify callback to return results (on success) or failure status.
29 */
30
31 /**
32 * Asynchronous callback invoked in response to a capability request
33 * |IWifiNanIface.getCapabilitiesRequest|.
Roshan Piuse03f7362016-10-14 14:53:43 -070034 *
35 * @param cmdId command Id corresponding to the original request.
Etan Cohenf01bcaa2016-12-25 09:42:21 -080036 * @param status WifiNanStatus of the operation. Possible status codes are:
37 * |NanStatusType.SUCCESS|
38 * @param capabilities Capability data.
Roshan Pius120f94c2016-10-13 11:48:42 -070039 */
Etan Cohenf01bcaa2016-12-25 09:42:21 -080040 oneway notifyCapabilitiesResponse(CommandIdShort id, WifiNanStatus status,
41 NanCapabilities capabilities);
Roshan Piuse03f7362016-10-14 14:53:43 -070042
43 /**
Etan Cohen44983ae2017-02-09 09:16:25 -080044 * Asynchronous callback invoked in response to an enable request |IWifiNanIface.enableRequest|.
Roshan Piuse03f7362016-10-14 14:53:43 -070045 *
46 * @param cmdId command Id corresponding to the original request.
Etan Cohenf01bcaa2016-12-25 09:42:21 -080047 * @param status WifiNanStatus of the operation. Possible status codes are:
48 * |NanStatusType.SUCCESS|
49 * |NanStatusType.ALREADY_ENABLED|
50 * |NanStatusType.INVALID_ARGS|
51 * |NanStatusType.INTERNAL_FAILURE|
52 * |NanStatusType.PROTOCOL_FAILURE|
53 * |NanStatusType.NAN_NOT_ALLOWED|
Roshan Piuse03f7362016-10-14 14:53:43 -070054 */
Etan Cohenf01bcaa2016-12-25 09:42:21 -080055 oneway notifyEnableResponse(CommandIdShort id, WifiNanStatus status);
Roshan Piuse03f7362016-10-14 14:53:43 -070056
57 /**
Etan Cohen44983ae2017-02-09 09:16:25 -080058 * Asynchronous callback invoked in response to a config request |IWifiNanIface.configRequest|.
Roshan Piuse03f7362016-10-14 14:53:43 -070059 *
60 * @param cmdId command Id corresponding to the original request.
Etan Cohenf01bcaa2016-12-25 09:42:21 -080061 * @param status WifiNanStatus of the operation. Possible status codes are:
62 * |NanStatusType.SUCCESS|
63 * |NanStatusType.INVALID_ARGS|
64 * |NanStatusType.INTERNAL_FAILURE|
65 * |NanStatusType.PROTOCOL_FAILURE|
Roshan Piuse03f7362016-10-14 14:53:43 -070066 */
Etan Cohenf01bcaa2016-12-25 09:42:21 -080067 oneway notifyConfigResponse(CommandIdShort id, WifiNanStatus status);
Roshan Piuse03f7362016-10-14 14:53:43 -070068
69 /**
Etan Cohen44983ae2017-02-09 09:16:25 -080070 * Asynchronous callback invoked in response to a disable request |IWifiNanIface.disableRequest|.
Roshan Piuse03f7362016-10-14 14:53:43 -070071 *
72 * @param cmdId command Id corresponding to the original request.
Etan Cohenf01bcaa2016-12-25 09:42:21 -080073 * @param status WifiNanStatus of the operation. Possible status codes are:
74 * |NanStatusType.SUCCESS|
75 * |NanStatusType.PROTOCOL_FAILURE|
Roshan Piuse03f7362016-10-14 14:53:43 -070076 */
Etan Cohenf01bcaa2016-12-25 09:42:21 -080077 oneway notifyDisableResponse(CommandIdShort id, WifiNanStatus status);
78
79 /**
Etan Cohen44983ae2017-02-09 09:16:25 -080080 * Asynchronous callback invoked to notify the status of the start publish request
81 * |IWifiNanIface.startPublishRequest|.
Etan Cohenf01bcaa2016-12-25 09:42:21 -080082 *
83 * @param cmdId command Id corresponding to the original request.
84 * @param status WifiNanStatus of the operation. Possible status codes are:
85 * |NanStatusType.SUCCESS|
86 * |NanStatusType.INVALID_ARGS|
87 * |NanStatusType.PROTOCOL_FAILURE|
88 * |NanStatusType.NO_RESOURCES_AVAILABLE|
89 * |NanStatusType.INVALID_SESSION_ID|
90 * @param sessionId ID of the new publish session (if successfully created).
91 */
Etan Cohen073bb992017-02-09 10:05:59 -080092 oneway notifyStartPublishResponse(CommandIdShort id, WifiNanStatus status, uint8_t sessionId);
Etan Cohenf01bcaa2016-12-25 09:42:21 -080093
94 /**
Etan Cohen44983ae2017-02-09 09:16:25 -080095 * Asynchronous callback invoked in response to a stop publish request
96 * |IWifiNanIface.stopPublishRequest|.
Etan Cohenf01bcaa2016-12-25 09:42:21 -080097 *
98 * @param cmdId command Id corresponding to the original request.
99 * @param status WifiNanStatus of the operation. Possible status codes are:
100 * |NanStatusType.SUCCESS|
101 * |NanStatusType.INVALID_SESSION_ID|
102 * |NanStatusType.INTERNAL_FAILURE|
103 */
104 oneway notifyStopPublishResponse(CommandIdShort id, WifiNanStatus status);
105
106 /**
Etan Cohen44983ae2017-02-09 09:16:25 -0800107 * Asynchronous callback invoked to notify the status of the start subscribe request
108 * |IWifiNanIface.startSubscribeRequest|.
Etan Cohenf01bcaa2016-12-25 09:42:21 -0800109 *
110 * @param cmdId command Id corresponding to the original request.
111 * @param status WifiNanStatus of the operation. Possible status codes are:
112 * |NanStatusType.SUCCESS|
113 * |NanStatusType.INVALID_ARGS|
114 * |NanStatusType.PROTOCOL_FAILURE|
115 * |NanStatusType.NO_RESOURCES_AVAILABLE|
116 * |NanStatusType.INVALID_SESSION_ID|
117 * @param sessionId ID of the new subscribe session (if successfully created).
118 */
Etan Cohen073bb992017-02-09 10:05:59 -0800119 oneway notifyStartSubscribeResponse(CommandIdShort id, WifiNanStatus status, uint8_t sessionId);
Etan Cohenf01bcaa2016-12-25 09:42:21 -0800120
121 /**
Etan Cohen44983ae2017-02-09 09:16:25 -0800122 * Asynchronous callback invoked in response to a stop subscribe request
123 * |IWifiNanIface.stopSubscribeRequest|.
Etan Cohenf01bcaa2016-12-25 09:42:21 -0800124 *
125 * @param cmdId command Id corresponding to the original request.
126 * @param status WifiNanStatus of the operation. Possible status codes are:
127 * |NanStatusType.SUCCESS|
128 * |NanStatusType.INVALID_SESSION_ID|
129 * |NanStatusType.INTERNAL_FAILURE|
130 */
131 oneway notifyStopSubscribeResponse(CommandIdShort id, WifiNanStatus status);
132
133 /**
Etan Cohen44983ae2017-02-09 09:16:25 -0800134 * Asynchronous callback invoked in response to a transmit followup request
135 * |IWifiNanIface.transmitFollowupRequest|.
Etan Cohenf01bcaa2016-12-25 09:42:21 -0800136 *
137 * @param cmdId command Id corresponding to the original request.
138 * @param status WifiNanStatus of the operation. Possible status codes are:
139 * |NanStatusType.SUCCESS|
140 * |NanStatusType.INVALID_ARGS|
141 * |NanStatusType.INTERNAL_FAILURE|
142 * |NanStatusType.INVALID_SESSION_ID|
143 * |NanStatusType.INVALID_PEER_ID|
Etan Cohend5d6e372017-02-16 08:29:35 -0800144 * |NanStatusType.FOLLOWUP_TX_QUEUE_FULL|
Etan Cohenf01bcaa2016-12-25 09:42:21 -0800145 */
146 oneway notifyTransmitFollowupResponse(CommandIdShort id, WifiNanStatus status);
147
148 /**
Etan Cohen44983ae2017-02-09 09:16:25 -0800149 * Asynchronous callback invoked in response to a create data interface request
150 * |IWifiNanIface.createDataInterfaceRequest|.
Etan Cohenf01bcaa2016-12-25 09:42:21 -0800151 *
152 * @param cmdId command Id corresponding to the original request.
153 * @param status WifiNanStatus of the operation. Possible status codes are:
154 * |NanStatusType.SUCCESS|
155 * |NanStatusType.INVALID_ARGS|
156 * |NanStatusType.INTERNAL_FAILURE|
157 */
158 oneway notifyCreateDataInterfaceResponse(CommandIdShort id, WifiNanStatus status);
159
160 /**
Etan Cohen44983ae2017-02-09 09:16:25 -0800161 * Asynchronous callback invoked in response to a delete data interface request
162 * |IWifiNanIface.deleteDataInterfaceRequest|.
Etan Cohenf01bcaa2016-12-25 09:42:21 -0800163 *
164 * @param cmdId command Id corresponding to the original request.
165 * @param status WifiNanStatus of the operation. Possible status codes are:
166 * |NanStatusType.SUCCESS|
167 * |NanStatusType.INVALID_ARGS|
168 * |NanStatusType.INTERNAL_FAILURE|
169 */
170 oneway notifyDeleteDataInterfaceResponse(CommandIdShort id, WifiNanStatus status);
171
172 /**
Etan Cohen44983ae2017-02-09 09:16:25 -0800173 * Asynchronous callback invoked in response to an initiate data path request
174 * |IWifiNanIface.initiateDataPathRequest|.
Etan Cohenf01bcaa2016-12-25 09:42:21 -0800175 *
176 * @param cmdId command Id corresponding to the original request.
177 * @param status WifiNanStatus of the operation. Possible status codes are:
178 * |NanStatusType.SUCCESS|
179 * |NanStatusType.INVALID_ARGS|
180 * |NanStatusType.INTERNAL_FAILURE|
181 * |NanStatusType.PROTOCOL_FAILURE|
182 * |NanStatusType.INVALID_PEER_ID|
Etan Cohen4bbc2092017-01-30 13:28:37 -0800183 * @param ndpInstanceId ID of the new data path being negotiated (on successful status).
Etan Cohenf01bcaa2016-12-25 09:42:21 -0800184 */
Etan Cohen4bbc2092017-01-30 13:28:37 -0800185 oneway notifyInitiateDataPathResponse(CommandIdShort id, WifiNanStatus status,
186 uint32_t ndpInstanceId );
Etan Cohenf01bcaa2016-12-25 09:42:21 -0800187
188 /**
Etan Cohen44983ae2017-02-09 09:16:25 -0800189 * Asynchronous callback invoked in response to a respond to data path indication request
190 * |IWifiNanIface.respondToDataPathIndicationRequest|.
Etan Cohenf01bcaa2016-12-25 09:42:21 -0800191 *
192 * @param cmdId command Id corresponding to the original request.
193 * @param status WifiNanStatus of the operation. Possible status codes are:
194 * |NanStatusType.SUCCESS|
195 * |NanStatusType.INVALID_ARGS|
196 * |NanStatusType.INTERNAL_FAILURE|
197 * |NanStatusType.PROTOCOL_FAILURE|
198 * |NanStatusType.INVALID_NDP_ID|
Etan Cohenf01bcaa2016-12-25 09:42:21 -0800199 */
Etan Cohen4bbc2092017-01-30 13:28:37 -0800200 oneway notifyRespondToDataPathIndicationResponse(CommandIdShort id, WifiNanStatus status);
Etan Cohenf01bcaa2016-12-25 09:42:21 -0800201
202 /**
Etan Cohen44983ae2017-02-09 09:16:25 -0800203 * Asynchronous callback invoked in response to a terminate data path request
204 * |IWifiNanIface.terminateDataPathRequest|.
Etan Cohenf01bcaa2016-12-25 09:42:21 -0800205 *
206 * @param cmdId command Id corresponding to the original request.
207 * @param status WifiNanStatus of the operation. Possible status codes are:
208 * |NanStatusType.SUCCESS|
209 * |NanStatusType.INVALID_ARGS|
210 * |NanStatusType.INTERNAL_FAILURE|
211 * |NanStatusType.PROTOCOL_FAILURE|
212 * |NanStatusType.INVALID_NDP_ID|
213 */
214 oneway notifyTerminateDataPathResponse(CommandIdShort id, WifiNanStatus status);
215
216 /**
Roshan Pius120f94c2016-10-13 11:48:42 -0700217 * Callbacks for the various asynchornous NAN Events.
218 */
Roshan Pius120f94c2016-10-13 11:48:42 -0700219
Etan Cohenf01bcaa2016-12-25 09:42:21 -0800220 /**
221 * Asynchronous callback indicating that a cluster event has been received.
222 *
223 * @param event: NanClusterEventInd containing event details.
224 */
225 oneway eventClusterEvent(NanClusterEventInd event);
226
227 /**
228 * Asynchronous callback indicating that a NAN has been disabled.
229 *
230 * @param status: WifiNanStatus describing the reason for the disable event.
231 * Possible status codes are:
232 * |NanStatusType.SUCCESS|
233 * |NanStatusType.UNSUPPORTED_CONCURRENCY_NAN_DISABLED|
234 */
235 oneway eventDisabled(WifiNanStatus status);
236
237 /**
238 * Asynchronous callback indicating that an active publish session has terminated.
239 *
240 * @param sessionId: The discovery session ID of the terminated session.
241 * @param status: WifiNanStatus describing the reason for the session termination.
242 * Possible status codes are:
243 * |NanStatusType.SUCCESS|
244 */
Etan Cohen073bb992017-02-09 10:05:59 -0800245 oneway eventPublishTerminated(uint8_t sessionId, WifiNanStatus status);
Etan Cohenf01bcaa2016-12-25 09:42:21 -0800246
247 /**
248 * Asynchronous callback indicating that an active subscribe session has terminated.
249 *
250 * @param sessionId: The discovery session ID of the terminated session.
251 * @param status: WifiNanStatus describing the reason for the session termination.
252 * Possible status codes are:
253 * |NanStatusType.SUCCESS|
254 */
Etan Cohen073bb992017-02-09 10:05:59 -0800255 oneway eventSubscribeTerminated(uint8_t sessionId, WifiNanStatus status);
Etan Cohenf01bcaa2016-12-25 09:42:21 -0800256
257 /**
258 * Asynchronous callback indicating that a match has occurred: i.e. a service has been
259 * discovered.
260 *
261 * @param event: NanMatchInd containing event details.
262 */
Roshan Pius120f94c2016-10-13 11:48:42 -0700263 oneway eventMatch(NanMatchInd event);
264
Etan Cohenf01bcaa2016-12-25 09:42:21 -0800265 /**
266 * Asynchronous callback indicating that a previously discovered match (service) has expired.
267 *
268 * @param discoverySessionId: The discovery session ID of the expired match.
269 * @param peerId: The peer ID of the expired match.
270 */
Etan Cohen073bb992017-02-09 10:05:59 -0800271 oneway eventMatchExpired(uint8_t discoverySessionId, uint32_t peerId);
Roshan Pius120f94c2016-10-13 11:48:42 -0700272
Etan Cohenf01bcaa2016-12-25 09:42:21 -0800273 /**
274 * Asynchronous callback indicating that a followup message has been received from a peer.
275 *
276 * @param event: NanFollowupReceivedInd containing event details.
277 */
278 oneway eventFollowupReceived(NanFollowupReceivedInd event);
Roshan Pius120f94c2016-10-13 11:48:42 -0700279
Etan Cohenf01bcaa2016-12-25 09:42:21 -0800280 /**
281 * Asynchronous callback providing status on a completed followup message transmit operation.
282 *
283 * @param cmdId command Id corresponding to the original |transmitFollowupRequest| request.
284 * @param status WifiNanStatus of the operation. Possible status codes are:
Etan Cohend5d6e372017-02-16 08:29:35 -0800285 * |NanStatusType.SUCCESS|
Etan Cohenf01bcaa2016-12-25 09:42:21 -0800286 * |NanStatusType.NO_OTA_ACK|
Etan Cohend5d6e372017-02-16 08:29:35 -0800287 * |NanStatusType.PROTOCOL_FAILURE|
Etan Cohenf01bcaa2016-12-25 09:42:21 -0800288 */
289 oneway eventTransmitFollowup(CommandIdShort id, WifiNanStatus status);
Roshan Pius120f94c2016-10-13 11:48:42 -0700290
Etan Cohenf01bcaa2016-12-25 09:42:21 -0800291 /**
292 * Asynchronous callback indicating a data-path (NDP) setup has been requested by an Initiator
293 * peer (received by the intended Respodner).
294 *
295 * @param event: NanDataPathRequestInd containing event details.
296 */
297 oneway eventDataPathRequest(NanDataPathRequestInd event);
Roshan Pius120f94c2016-10-13 11:48:42 -0700298
Etan Cohenf01bcaa2016-12-25 09:42:21 -0800299 /**
300 * Asynchronous callback indicating a data-path (NDP) setup has been completed: received by
301 * both Initiator and Responder.
302 *
303 * @param event: NanDataPathConfirmInd containing event details.
304 */
305 oneway eventDataPathConfirm(NanDataPathConfirmInd event);
Roshan Pius120f94c2016-10-13 11:48:42 -0700306
Etan Cohenf01bcaa2016-12-25 09:42:21 -0800307 /**
308 * Asynchronous callback indicating a list of data-paths (NDP) have been terminated: received by
309 * both Initiator and Responder.
310 *
311 * @param ndpInstanceId: data-path ID of the terminated data-path.
312 */
313 oneway eventDataPathTerminated(uint32_t ndpInstanceId);
Roshan Pius120f94c2016-10-13 11:48:42 -0700314};