blob: cb4b04342106b9f1ef73e8d0b0428423cee38099 [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.
Roshan Pius120f94c2016-10-13 11:48:42 -070021 */
22interface IWifiNanIfaceEventCallback {
23 /**
Etan Cohenf01bcaa2016-12-25 09:42:21 -080024 * Callback invoked in response to a capability request |getCapabilitiesRequest|.
Roshan Piuse03f7362016-10-14 14:53:43 -070025 *
26 * @param cmdId command Id corresponding to the original request.
Etan Cohenf01bcaa2016-12-25 09:42:21 -080027 * @param status WifiNanStatus of the operation. Possible status codes are:
28 * |NanStatusType.SUCCESS|
29 * @param capabilities Capability data.
Roshan Pius120f94c2016-10-13 11:48:42 -070030 */
Etan Cohenf01bcaa2016-12-25 09:42:21 -080031 oneway notifyCapabilitiesResponse(CommandIdShort id, WifiNanStatus status,
32 NanCapabilities capabilities);
Roshan Piuse03f7362016-10-14 14:53:43 -070033
34 /**
Etan Cohenf01bcaa2016-12-25 09:42:21 -080035 * Callback invoked in response to an enable request |enableRequest|.
Roshan Piuse03f7362016-10-14 14:53:43 -070036 *
37 * @param cmdId command Id corresponding to the original request.
Etan Cohenf01bcaa2016-12-25 09:42:21 -080038 * @param status WifiNanStatus of the operation. Possible status codes are:
39 * |NanStatusType.SUCCESS|
40 * |NanStatusType.ALREADY_ENABLED|
41 * |NanStatusType.INVALID_ARGS|
42 * |NanStatusType.INTERNAL_FAILURE|
43 * |NanStatusType.PROTOCOL_FAILURE|
44 * |NanStatusType.NAN_NOT_ALLOWED|
Roshan Piuse03f7362016-10-14 14:53:43 -070045 */
Etan Cohenf01bcaa2016-12-25 09:42:21 -080046 oneway notifyEnableResponse(CommandIdShort id, WifiNanStatus status);
Roshan Piuse03f7362016-10-14 14:53:43 -070047
48 /**
Etan Cohenf01bcaa2016-12-25 09:42:21 -080049 * Callback invoked in response to a config request |configRequest|.
Roshan Piuse03f7362016-10-14 14:53:43 -070050 *
51 * @param cmdId command Id corresponding to the original request.
Etan Cohenf01bcaa2016-12-25 09:42:21 -080052 * @param status WifiNanStatus of the operation. Possible status codes are:
53 * |NanStatusType.SUCCESS|
54 * |NanStatusType.INVALID_ARGS|
55 * |NanStatusType.INTERNAL_FAILURE|
56 * |NanStatusType.PROTOCOL_FAILURE|
Roshan Piuse03f7362016-10-14 14:53:43 -070057 */
Etan Cohenf01bcaa2016-12-25 09:42:21 -080058 oneway notifyConfigResponse(CommandIdShort id, WifiNanStatus status);
Roshan Piuse03f7362016-10-14 14:53:43 -070059
60 /**
Etan Cohenf01bcaa2016-12-25 09:42:21 -080061 * Callback invoked in response to a disable request |disableRequest|.
Roshan Piuse03f7362016-10-14 14:53:43 -070062 *
63 * @param cmdId command Id corresponding to the original request.
Etan Cohenf01bcaa2016-12-25 09:42:21 -080064 * @param status WifiNanStatus of the operation. Possible status codes are:
65 * |NanStatusType.SUCCESS|
66 * |NanStatusType.PROTOCOL_FAILURE|
Roshan Piuse03f7362016-10-14 14:53:43 -070067 */
Etan Cohenf01bcaa2016-12-25 09:42:21 -080068 oneway notifyDisableResponse(CommandIdShort id, WifiNanStatus status);
69
70 /**
71 * Callback invoked to notify the status of the start publish request |startPublishRequest|.
72 *
73 * @param cmdId command Id corresponding to the original request.
74 * @param status WifiNanStatus of the operation. Possible status codes are:
75 * |NanStatusType.SUCCESS|
76 * |NanStatusType.INVALID_ARGS|
77 * |NanStatusType.PROTOCOL_FAILURE|
78 * |NanStatusType.NO_RESOURCES_AVAILABLE|
79 * |NanStatusType.INVALID_SESSION_ID|
80 * @param sessionId ID of the new publish session (if successfully created).
81 */
82 oneway notifyStartPublishResponse(CommandIdShort id, WifiNanStatus status, uint16_t sessionId);
83
84 /**
85 * Callback invoked in response to a stop publish request |stopPublishRequest|.
86 *
87 * @param cmdId command Id corresponding to the original request.
88 * @param status WifiNanStatus of the operation. Possible status codes are:
89 * |NanStatusType.SUCCESS|
90 * |NanStatusType.INVALID_SESSION_ID|
91 * |NanStatusType.INTERNAL_FAILURE|
92 */
93 oneway notifyStopPublishResponse(CommandIdShort id, WifiNanStatus status);
94
95 /**
96 * Callback invoked to notify the status of the start subscribe request |startSubscribeRequest|.
97 *
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_ARGS|
102 * |NanStatusType.PROTOCOL_FAILURE|
103 * |NanStatusType.NO_RESOURCES_AVAILABLE|
104 * |NanStatusType.INVALID_SESSION_ID|
105 * @param sessionId ID of the new subscribe session (if successfully created).
106 */
107 oneway notifyStartSubscribeResponse(CommandIdShort id, WifiNanStatus status, uint16_t sessionId);
108
109 /**
110 * Callback invoked in response to a stop subscribe request |stopSubscribeRequest|.
111 *
112 * @param cmdId command Id corresponding to the original request.
113 * @param status WifiNanStatus of the operation. Possible status codes are:
114 * |NanStatusType.SUCCESS|
115 * |NanStatusType.INVALID_SESSION_ID|
116 * |NanStatusType.INTERNAL_FAILURE|
117 */
118 oneway notifyStopSubscribeResponse(CommandIdShort id, WifiNanStatus status);
119
120 /**
121 * Callback invoked in response to a transmit followup request |transmitFollowupRequest|.
122 *
123 * @param cmdId command Id corresponding to the original request.
124 * @param status WifiNanStatus of the operation. Possible status codes are:
125 * |NanStatusType.SUCCESS|
126 * |NanStatusType.INVALID_ARGS|
127 * |NanStatusType.INTERNAL_FAILURE|
128 * |NanStatusType.INVALID_SESSION_ID|
129 * |NanStatusType.INVALID_PEER_ID|
130 */
131 oneway notifyTransmitFollowupResponse(CommandIdShort id, WifiNanStatus status);
132
133 /**
134 * Callback invoked in response to a create data interface request |createDataInterfaceRequest|.
135 *
136 * @param cmdId command Id corresponding to the original request.
137 * @param status WifiNanStatus of the operation. Possible status codes are:
138 * |NanStatusType.SUCCESS|
139 * |NanStatusType.INVALID_ARGS|
140 * |NanStatusType.INTERNAL_FAILURE|
141 */
142 oneway notifyCreateDataInterfaceResponse(CommandIdShort id, WifiNanStatus status);
143
144 /**
145 * Callback invoked in response to a delete data interface request |deleteDataInterfaceRequest|.
146 *
147 * @param cmdId command Id corresponding to the original request.
148 * @param status WifiNanStatus of the operation. Possible status codes are:
149 * |NanStatusType.SUCCESS|
150 * |NanStatusType.INVALID_ARGS|
151 * |NanStatusType.INTERNAL_FAILURE|
152 */
153 oneway notifyDeleteDataInterfaceResponse(CommandIdShort id, WifiNanStatus status);
154
155 /**
156 * Callback invoked in response to an initiate data path request |initiateDataPathRequest|.
157 *
158 * @param cmdId command Id corresponding to the original request.
159 * @param status WifiNanStatus of the operation. Possible status codes are:
160 * |NanStatusType.SUCCESS|
161 * |NanStatusType.INVALID_ARGS|
162 * |NanStatusType.INTERNAL_FAILURE|
163 * |NanStatusType.PROTOCOL_FAILURE|
164 * |NanStatusType.INVALID_PEER_ID|
Etan Cohen4bbc2092017-01-30 13:28:37 -0800165 * @param ndpInstanceId ID of the new data path being negotiated (on successful status).
Etan Cohenf01bcaa2016-12-25 09:42:21 -0800166 */
Etan Cohen4bbc2092017-01-30 13:28:37 -0800167 oneway notifyInitiateDataPathResponse(CommandIdShort id, WifiNanStatus status,
168 uint32_t ndpInstanceId );
Etan Cohenf01bcaa2016-12-25 09:42:21 -0800169
170 /**
171 * Callback invoked in response to a respond to data path indication request
172 * |respondToDataPathIndicationRequest|.
173 *
174 * @param cmdId command Id corresponding to the original request.
175 * @param status WifiNanStatus of the operation. Possible status codes are:
176 * |NanStatusType.SUCCESS|
177 * |NanStatusType.INVALID_ARGS|
178 * |NanStatusType.INTERNAL_FAILURE|
179 * |NanStatusType.PROTOCOL_FAILURE|
180 * |NanStatusType.INVALID_NDP_ID|
Etan Cohenf01bcaa2016-12-25 09:42:21 -0800181 */
Etan Cohen4bbc2092017-01-30 13:28:37 -0800182 oneway notifyRespondToDataPathIndicationResponse(CommandIdShort id, WifiNanStatus status);
Etan Cohenf01bcaa2016-12-25 09:42:21 -0800183
184 /**
185 * Callback invoked in response to a terminate data path request |terminateDataPathRequest|.
186 *
187 * @param cmdId command Id corresponding to the original request.
188 * @param status WifiNanStatus of the operation. Possible status codes are:
189 * |NanStatusType.SUCCESS|
190 * |NanStatusType.INVALID_ARGS|
191 * |NanStatusType.INTERNAL_FAILURE|
192 * |NanStatusType.PROTOCOL_FAILURE|
193 * |NanStatusType.INVALID_NDP_ID|
194 */
195 oneway notifyTerminateDataPathResponse(CommandIdShort id, WifiNanStatus status);
196
197 /**
198 * Callback invoked in response to a request to include vendor-specific payload in beacon or SDF
199 * frames |beaconSdfPayloadRequest|.
200 *
201 * @param cmdId command Id corresponding to the original request.
202 * @param status WifiNanStatus of the operation. Possible status codes are:
203 * |NanStatusType.SUCCESS|
204 * |NanStatusType.INVALID_ARGS|
205 * |NanStatusType.INTERNAL_FAILURE|
206 */
207 oneway notifyBeaconSdfPayloadResponse(CommandIdShort id, WifiNanStatus status);
Roshan Pius120f94c2016-10-13 11:48:42 -0700208
209 /**
210 * Callbacks for the various asynchornous NAN Events.
211 */
Roshan Pius120f94c2016-10-13 11:48:42 -0700212
Etan Cohenf01bcaa2016-12-25 09:42:21 -0800213 /**
214 * Asynchronous callback indicating that a cluster event has been received.
215 *
216 * @param event: NanClusterEventInd containing event details.
217 */
218 oneway eventClusterEvent(NanClusterEventInd event);
219
220 /**
221 * Asynchronous callback indicating that a NAN has been disabled.
222 *
223 * @param status: WifiNanStatus describing the reason for the disable event.
224 * Possible status codes are:
225 * |NanStatusType.SUCCESS|
226 * |NanStatusType.UNSUPPORTED_CONCURRENCY_NAN_DISABLED|
227 */
228 oneway eventDisabled(WifiNanStatus status);
229
230 /**
231 * Asynchronous callback indicating that an active publish session has terminated.
232 *
233 * @param sessionId: The discovery session ID of the terminated session.
234 * @param status: WifiNanStatus describing the reason for the session termination.
235 * Possible status codes are:
236 * |NanStatusType.SUCCESS|
237 */
238 oneway eventPublishTerminated(uint16_t sessionId, WifiNanStatus status);
239
240 /**
241 * Asynchronous callback indicating that an active subscribe session has terminated.
242 *
243 * @param sessionId: The discovery session ID of the terminated session.
244 * @param status: WifiNanStatus describing the reason for the session termination.
245 * Possible status codes are:
246 * |NanStatusType.SUCCESS|
247 */
248 oneway eventSubscribeTerminated(uint16_t sessionId, WifiNanStatus status);
249
250 /**
251 * Asynchronous callback indicating that a match has occurred: i.e. a service has been
252 * discovered.
253 *
254 * @param event: NanMatchInd containing event details.
255 */
Roshan Pius120f94c2016-10-13 11:48:42 -0700256 oneway eventMatch(NanMatchInd event);
257
Etan Cohenf01bcaa2016-12-25 09:42:21 -0800258 /**
259 * Asynchronous callback indicating that a previously discovered match (service) has expired.
260 *
261 * @param discoverySessionId: The discovery session ID of the expired match.
262 * @param peerId: The peer ID of the expired match.
263 */
264 oneway eventMatchExpired(uint16_t discoverySessionId, uint32_t peerId);
Roshan Pius120f94c2016-10-13 11:48:42 -0700265
Etan Cohenf01bcaa2016-12-25 09:42:21 -0800266 /**
267 * Asynchronous callback indicating that a followup message has been received from a peer.
268 *
269 * @param event: NanFollowupReceivedInd containing event details.
270 */
271 oneway eventFollowupReceived(NanFollowupReceivedInd event);
Roshan Pius120f94c2016-10-13 11:48:42 -0700272
Etan Cohenf01bcaa2016-12-25 09:42:21 -0800273 /**
274 * Asynchronous callback providing status on a completed followup message transmit operation.
275 *
276 * @param cmdId command Id corresponding to the original |transmitFollowupRequest| request.
277 * @param status WifiNanStatus of the operation. Possible status codes are:
278 * |NanStatusType.NO_OTA_ACK|
279 * |NanStatusType.FOLLOWUP_TX_QUEUE_FULL|
280 */
281 oneway eventTransmitFollowup(CommandIdShort id, WifiNanStatus status);
Roshan Pius120f94c2016-10-13 11:48:42 -0700282
Etan Cohenf01bcaa2016-12-25 09:42:21 -0800283 /**
284 * Asynchronous callback indicating a data-path (NDP) setup has been requested by an Initiator
285 * peer (received by the intended Respodner).
286 *
287 * @param event: NanDataPathRequestInd containing event details.
288 */
289 oneway eventDataPathRequest(NanDataPathRequestInd event);
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 completed: received by
293 * both Initiator and Responder.
294 *
295 * @param event: NanDataPathConfirmInd containing event details.
296 */
297 oneway eventDataPathConfirm(NanDataPathConfirmInd event);
Roshan Pius120f94c2016-10-13 11:48:42 -0700298
Etan Cohenf01bcaa2016-12-25 09:42:21 -0800299 /**
300 * Asynchronous callback indicating a list of data-paths (NDP) have been terminated: received by
301 * both Initiator and Responder.
302 *
303 * @param ndpInstanceId: data-path ID of the terminated data-path.
304 */
305 oneway eventDataPathTerminated(uint32_t ndpInstanceId);
306
307 /**
308 * Asynchronous callback indicating vendor-specific payload received in NAN beacon or SDF frame.
309 *
310 * @param event: NanBeaconSdfPayloadInd containing event details.
311 */
Roshan Pius120f94c2016-10-13 11:48:42 -0700312 oneway eventBeaconSdfPayload(NanBeaconSdfPayloadInd event);
Roshan Pius120f94c2016-10-13 11:48:42 -0700313};