blob: c9fea8f72a182a1c498a165a12b899afa2b068b9 [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 */
Etan Cohen073bb992017-02-09 10:05:59 -080082 oneway notifyStartPublishResponse(CommandIdShort id, WifiNanStatus status, uint8_t sessionId);
Etan Cohenf01bcaa2016-12-25 09:42:21 -080083
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 */
Etan Cohen073bb992017-02-09 10:05:59 -0800107 oneway notifyStartSubscribeResponse(CommandIdShort id, WifiNanStatus status, uint8_t sessionId);
Etan Cohenf01bcaa2016-12-25 09:42:21 -0800108
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 /**
Roshan Pius120f94c2016-10-13 11:48:42 -0700198 * Callbacks for the various asynchornous NAN Events.
199 */
Roshan Pius120f94c2016-10-13 11:48:42 -0700200
Etan Cohenf01bcaa2016-12-25 09:42:21 -0800201 /**
202 * Asynchronous callback indicating that a cluster event has been received.
203 *
204 * @param event: NanClusterEventInd containing event details.
205 */
206 oneway eventClusterEvent(NanClusterEventInd event);
207
208 /**
209 * Asynchronous callback indicating that a NAN has been disabled.
210 *
211 * @param status: WifiNanStatus describing the reason for the disable event.
212 * Possible status codes are:
213 * |NanStatusType.SUCCESS|
214 * |NanStatusType.UNSUPPORTED_CONCURRENCY_NAN_DISABLED|
215 */
216 oneway eventDisabled(WifiNanStatus status);
217
218 /**
219 * Asynchronous callback indicating that an active publish session has terminated.
220 *
221 * @param sessionId: The discovery session ID of the terminated session.
222 * @param status: WifiNanStatus describing the reason for the session termination.
223 * Possible status codes are:
224 * |NanStatusType.SUCCESS|
225 */
Etan Cohen073bb992017-02-09 10:05:59 -0800226 oneway eventPublishTerminated(uint8_t sessionId, WifiNanStatus status);
Etan Cohenf01bcaa2016-12-25 09:42:21 -0800227
228 /**
229 * Asynchronous callback indicating that an active subscribe session has terminated.
230 *
231 * @param sessionId: The discovery session ID of the terminated session.
232 * @param status: WifiNanStatus describing the reason for the session termination.
233 * Possible status codes are:
234 * |NanStatusType.SUCCESS|
235 */
Etan Cohen073bb992017-02-09 10:05:59 -0800236 oneway eventSubscribeTerminated(uint8_t sessionId, WifiNanStatus status);
Etan Cohenf01bcaa2016-12-25 09:42:21 -0800237
238 /**
239 * Asynchronous callback indicating that a match has occurred: i.e. a service has been
240 * discovered.
241 *
242 * @param event: NanMatchInd containing event details.
243 */
Roshan Pius120f94c2016-10-13 11:48:42 -0700244 oneway eventMatch(NanMatchInd event);
245
Etan Cohenf01bcaa2016-12-25 09:42:21 -0800246 /**
247 * Asynchronous callback indicating that a previously discovered match (service) has expired.
248 *
249 * @param discoverySessionId: The discovery session ID of the expired match.
250 * @param peerId: The peer ID of the expired match.
251 */
Etan Cohen073bb992017-02-09 10:05:59 -0800252 oneway eventMatchExpired(uint8_t discoverySessionId, uint32_t peerId);
Roshan Pius120f94c2016-10-13 11:48:42 -0700253
Etan Cohenf01bcaa2016-12-25 09:42:21 -0800254 /**
255 * Asynchronous callback indicating that a followup message has been received from a peer.
256 *
257 * @param event: NanFollowupReceivedInd containing event details.
258 */
259 oneway eventFollowupReceived(NanFollowupReceivedInd event);
Roshan Pius120f94c2016-10-13 11:48:42 -0700260
Etan Cohenf01bcaa2016-12-25 09:42:21 -0800261 /**
262 * Asynchronous callback providing status on a completed followup message transmit operation.
263 *
264 * @param cmdId command Id corresponding to the original |transmitFollowupRequest| request.
265 * @param status WifiNanStatus of the operation. Possible status codes are:
266 * |NanStatusType.NO_OTA_ACK|
267 * |NanStatusType.FOLLOWUP_TX_QUEUE_FULL|
268 */
269 oneway eventTransmitFollowup(CommandIdShort id, WifiNanStatus status);
Roshan Pius120f94c2016-10-13 11:48:42 -0700270
Etan Cohenf01bcaa2016-12-25 09:42:21 -0800271 /**
272 * Asynchronous callback indicating a data-path (NDP) setup has been requested by an Initiator
273 * peer (received by the intended Respodner).
274 *
275 * @param event: NanDataPathRequestInd containing event details.
276 */
277 oneway eventDataPathRequest(NanDataPathRequestInd event);
Roshan Pius120f94c2016-10-13 11:48:42 -0700278
Etan Cohenf01bcaa2016-12-25 09:42:21 -0800279 /**
280 * Asynchronous callback indicating a data-path (NDP) setup has been completed: received by
281 * both Initiator and Responder.
282 *
283 * @param event: NanDataPathConfirmInd containing event details.
284 */
285 oneway eventDataPathConfirm(NanDataPathConfirmInd event);
Roshan Pius120f94c2016-10-13 11:48:42 -0700286
Etan Cohenf01bcaa2016-12-25 09:42:21 -0800287 /**
288 * Asynchronous callback indicating a list of data-paths (NDP) have been terminated: received by
289 * both Initiator and Responder.
290 *
291 * @param ndpInstanceId: data-path ID of the terminated data-path.
292 */
293 oneway eventDataPathTerminated(uint32_t ndpInstanceId);
Roshan Pius120f94c2016-10-13 11:48:42 -0700294};