blob: 80d67ce248f6f806ec580a9c3617ddf869aa9a38 [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|
144 */
145 oneway notifyTransmitFollowupResponse(CommandIdShort id, WifiNanStatus status);
146
147 /**
Etan Cohen44983ae2017-02-09 09:16:25 -0800148 * Asynchronous callback invoked in response to a create data interface request
149 * |IWifiNanIface.createDataInterfaceRequest|.
Etan Cohenf01bcaa2016-12-25 09:42:21 -0800150 *
151 * @param cmdId command Id corresponding to the original request.
152 * @param status WifiNanStatus of the operation. Possible status codes are:
153 * |NanStatusType.SUCCESS|
154 * |NanStatusType.INVALID_ARGS|
155 * |NanStatusType.INTERNAL_FAILURE|
156 */
157 oneway notifyCreateDataInterfaceResponse(CommandIdShort id, WifiNanStatus status);
158
159 /**
Etan Cohen44983ae2017-02-09 09:16:25 -0800160 * Asynchronous callback invoked in response to a delete data interface request
161 * |IWifiNanIface.deleteDataInterfaceRequest|.
Etan Cohenf01bcaa2016-12-25 09:42:21 -0800162 *
163 * @param cmdId command Id corresponding to the original request.
164 * @param status WifiNanStatus of the operation. Possible status codes are:
165 * |NanStatusType.SUCCESS|
166 * |NanStatusType.INVALID_ARGS|
167 * |NanStatusType.INTERNAL_FAILURE|
168 */
169 oneway notifyDeleteDataInterfaceResponse(CommandIdShort id, WifiNanStatus status);
170
171 /**
Etan Cohen44983ae2017-02-09 09:16:25 -0800172 * Asynchronous callback invoked in response to an initiate data path request
173 * |IWifiNanIface.initiateDataPathRequest|.
Etan Cohenf01bcaa2016-12-25 09:42:21 -0800174 *
175 * @param cmdId command Id corresponding to the original request.
176 * @param status WifiNanStatus of the operation. Possible status codes are:
177 * |NanStatusType.SUCCESS|
178 * |NanStatusType.INVALID_ARGS|
179 * |NanStatusType.INTERNAL_FAILURE|
180 * |NanStatusType.PROTOCOL_FAILURE|
181 * |NanStatusType.INVALID_PEER_ID|
Etan Cohen4bbc2092017-01-30 13:28:37 -0800182 * @param ndpInstanceId ID of the new data path being negotiated (on successful status).
Etan Cohenf01bcaa2016-12-25 09:42:21 -0800183 */
Etan Cohen4bbc2092017-01-30 13:28:37 -0800184 oneway notifyInitiateDataPathResponse(CommandIdShort id, WifiNanStatus status,
185 uint32_t ndpInstanceId );
Etan Cohenf01bcaa2016-12-25 09:42:21 -0800186
187 /**
Etan Cohen44983ae2017-02-09 09:16:25 -0800188 * Asynchronous callback invoked in response to a respond to data path indication request
189 * |IWifiNanIface.respondToDataPathIndicationRequest|.
Etan Cohenf01bcaa2016-12-25 09:42:21 -0800190 *
191 * @param cmdId command Id corresponding to the original request.
192 * @param status WifiNanStatus of the operation. Possible status codes are:
193 * |NanStatusType.SUCCESS|
194 * |NanStatusType.INVALID_ARGS|
195 * |NanStatusType.INTERNAL_FAILURE|
196 * |NanStatusType.PROTOCOL_FAILURE|
197 * |NanStatusType.INVALID_NDP_ID|
Etan Cohenf01bcaa2016-12-25 09:42:21 -0800198 */
Etan Cohen4bbc2092017-01-30 13:28:37 -0800199 oneway notifyRespondToDataPathIndicationResponse(CommandIdShort id, WifiNanStatus status);
Etan Cohenf01bcaa2016-12-25 09:42:21 -0800200
201 /**
Etan Cohen44983ae2017-02-09 09:16:25 -0800202 * Asynchronous callback invoked in response to a terminate data path request
203 * |IWifiNanIface.terminateDataPathRequest|.
Etan Cohenf01bcaa2016-12-25 09:42:21 -0800204 *
205 * @param cmdId command Id corresponding to the original request.
206 * @param status WifiNanStatus of the operation. Possible status codes are:
207 * |NanStatusType.SUCCESS|
208 * |NanStatusType.INVALID_ARGS|
209 * |NanStatusType.INTERNAL_FAILURE|
210 * |NanStatusType.PROTOCOL_FAILURE|
211 * |NanStatusType.INVALID_NDP_ID|
212 */
213 oneway notifyTerminateDataPathResponse(CommandIdShort id, WifiNanStatus status);
214
215 /**
Roshan Pius120f94c2016-10-13 11:48:42 -0700216 * Callbacks for the various asynchornous NAN Events.
217 */
Roshan Pius120f94c2016-10-13 11:48:42 -0700218
Etan Cohenf01bcaa2016-12-25 09:42:21 -0800219 /**
220 * Asynchronous callback indicating that a cluster event has been received.
221 *
222 * @param event: NanClusterEventInd containing event details.
223 */
224 oneway eventClusterEvent(NanClusterEventInd event);
225
226 /**
227 * Asynchronous callback indicating that a NAN has been disabled.
228 *
229 * @param status: WifiNanStatus describing the reason for the disable event.
230 * Possible status codes are:
231 * |NanStatusType.SUCCESS|
232 * |NanStatusType.UNSUPPORTED_CONCURRENCY_NAN_DISABLED|
233 */
234 oneway eventDisabled(WifiNanStatus status);
235
236 /**
237 * Asynchronous callback indicating that an active publish session has terminated.
238 *
239 * @param sessionId: The discovery session ID of the terminated session.
240 * @param status: WifiNanStatus describing the reason for the session termination.
241 * Possible status codes are:
242 * |NanStatusType.SUCCESS|
243 */
Etan Cohen073bb992017-02-09 10:05:59 -0800244 oneway eventPublishTerminated(uint8_t sessionId, WifiNanStatus status);
Etan Cohenf01bcaa2016-12-25 09:42:21 -0800245
246 /**
247 * Asynchronous callback indicating that an active subscribe session has terminated.
248 *
249 * @param sessionId: The discovery session ID of the terminated session.
250 * @param status: WifiNanStatus describing the reason for the session termination.
251 * Possible status codes are:
252 * |NanStatusType.SUCCESS|
253 */
Etan Cohen073bb992017-02-09 10:05:59 -0800254 oneway eventSubscribeTerminated(uint8_t sessionId, WifiNanStatus status);
Etan Cohenf01bcaa2016-12-25 09:42:21 -0800255
256 /**
257 * Asynchronous callback indicating that a match has occurred: i.e. a service has been
258 * discovered.
259 *
260 * @param event: NanMatchInd containing event details.
261 */
Roshan Pius120f94c2016-10-13 11:48:42 -0700262 oneway eventMatch(NanMatchInd event);
263
Etan Cohenf01bcaa2016-12-25 09:42:21 -0800264 /**
265 * Asynchronous callback indicating that a previously discovered match (service) has expired.
266 *
267 * @param discoverySessionId: The discovery session ID of the expired match.
268 * @param peerId: The peer ID of the expired match.
269 */
Etan Cohen073bb992017-02-09 10:05:59 -0800270 oneway eventMatchExpired(uint8_t discoverySessionId, uint32_t peerId);
Roshan Pius120f94c2016-10-13 11:48:42 -0700271
Etan Cohenf01bcaa2016-12-25 09:42:21 -0800272 /**
273 * Asynchronous callback indicating that a followup message has been received from a peer.
274 *
275 * @param event: NanFollowupReceivedInd containing event details.
276 */
277 oneway eventFollowupReceived(NanFollowupReceivedInd event);
Roshan Pius120f94c2016-10-13 11:48:42 -0700278
Etan Cohenf01bcaa2016-12-25 09:42:21 -0800279 /**
280 * Asynchronous callback providing status on a completed followup message transmit operation.
281 *
282 * @param cmdId command Id corresponding to the original |transmitFollowupRequest| request.
283 * @param status WifiNanStatus of the operation. Possible status codes are:
284 * |NanStatusType.NO_OTA_ACK|
285 * |NanStatusType.FOLLOWUP_TX_QUEUE_FULL|
286 */
287 oneway eventTransmitFollowup(CommandIdShort id, WifiNanStatus status);
Roshan Pius120f94c2016-10-13 11:48:42 -0700288
Etan Cohenf01bcaa2016-12-25 09:42:21 -0800289 /**
290 * Asynchronous callback indicating a data-path (NDP) setup has been requested by an Initiator
291 * peer (received by the intended Respodner).
292 *
293 * @param event: NanDataPathRequestInd containing event details.
294 */
295 oneway eventDataPathRequest(NanDataPathRequestInd event);
Roshan Pius120f94c2016-10-13 11:48:42 -0700296
Etan Cohenf01bcaa2016-12-25 09:42:21 -0800297 /**
298 * Asynchronous callback indicating a data-path (NDP) setup has been completed: received by
299 * both Initiator and Responder.
300 *
301 * @param event: NanDataPathConfirmInd containing event details.
302 */
303 oneway eventDataPathConfirm(NanDataPathConfirmInd event);
Roshan Pius120f94c2016-10-13 11:48:42 -0700304
Etan Cohenf01bcaa2016-12-25 09:42:21 -0800305 /**
306 * Asynchronous callback indicating a list of data-paths (NDP) have been terminated: received by
307 * both Initiator and Responder.
308 *
309 * @param ndpInstanceId: data-path ID of the terminated data-path.
310 */
311 oneway eventDataPathTerminated(uint32_t ndpInstanceId);
Roshan Pius120f94c2016-10-13 11:48:42 -0700312};