Roshan Pius | 120f94c | 2016-10-13 11:48:42 -0700 | [diff] [blame] | 1 | /* |
| 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 | |
| 17 | package android.hardware.wifi@1.0; |
| 18 | |
| 19 | /** |
Etan Cohen | f01bcaa | 2016-12-25 09:42:21 -0800 | [diff] [blame] | 20 | * NAN Response and Asynchronous Event Callbacks. |
Etan Cohen | 44983ae | 2017-02-09 09:16:25 -0800 | [diff] [blame^] | 21 | * |
| 22 | * References to "NAN Spec" are to the Wi-Fi Alliance "Wi-Fi Neighbor Awareness |
| 23 | * Networking (NAN) Technical Specification". |
Roshan Pius | 120f94c | 2016-10-13 11:48:42 -0700 | [diff] [blame] | 24 | */ |
| 25 | interface IWifiNanIfaceEventCallback { |
| 26 | /** |
Etan Cohen | 44983ae | 2017-02-09 09:16:25 -0800 | [diff] [blame^] | 27 | * 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 Pius | e03f736 | 2016-10-14 14:53:43 -0700 | [diff] [blame] | 34 | * |
| 35 | * @param cmdId command Id corresponding to the original request. |
Etan Cohen | f01bcaa | 2016-12-25 09:42:21 -0800 | [diff] [blame] | 36 | * @param status WifiNanStatus of the operation. Possible status codes are: |
| 37 | * |NanStatusType.SUCCESS| |
| 38 | * @param capabilities Capability data. |
Roshan Pius | 120f94c | 2016-10-13 11:48:42 -0700 | [diff] [blame] | 39 | */ |
Etan Cohen | f01bcaa | 2016-12-25 09:42:21 -0800 | [diff] [blame] | 40 | oneway notifyCapabilitiesResponse(CommandIdShort id, WifiNanStatus status, |
| 41 | NanCapabilities capabilities); |
Roshan Pius | e03f736 | 2016-10-14 14:53:43 -0700 | [diff] [blame] | 42 | |
| 43 | /** |
Etan Cohen | 44983ae | 2017-02-09 09:16:25 -0800 | [diff] [blame^] | 44 | * Asynchronous callback invoked in response to an enable request |IWifiNanIface.enableRequest|. |
Roshan Pius | e03f736 | 2016-10-14 14:53:43 -0700 | [diff] [blame] | 45 | * |
| 46 | * @param cmdId command Id corresponding to the original request. |
Etan Cohen | f01bcaa | 2016-12-25 09:42:21 -0800 | [diff] [blame] | 47 | * @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 Pius | e03f736 | 2016-10-14 14:53:43 -0700 | [diff] [blame] | 54 | */ |
Etan Cohen | f01bcaa | 2016-12-25 09:42:21 -0800 | [diff] [blame] | 55 | oneway notifyEnableResponse(CommandIdShort id, WifiNanStatus status); |
Roshan Pius | e03f736 | 2016-10-14 14:53:43 -0700 | [diff] [blame] | 56 | |
| 57 | /** |
Etan Cohen | 44983ae | 2017-02-09 09:16:25 -0800 | [diff] [blame^] | 58 | * Asynchronous callback invoked in response to a config request |IWifiNanIface.configRequest|. |
Roshan Pius | e03f736 | 2016-10-14 14:53:43 -0700 | [diff] [blame] | 59 | * |
| 60 | * @param cmdId command Id corresponding to the original request. |
Etan Cohen | f01bcaa | 2016-12-25 09:42:21 -0800 | [diff] [blame] | 61 | * @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 Pius | e03f736 | 2016-10-14 14:53:43 -0700 | [diff] [blame] | 66 | */ |
Etan Cohen | f01bcaa | 2016-12-25 09:42:21 -0800 | [diff] [blame] | 67 | oneway notifyConfigResponse(CommandIdShort id, WifiNanStatus status); |
Roshan Pius | e03f736 | 2016-10-14 14:53:43 -0700 | [diff] [blame] | 68 | |
| 69 | /** |
Etan Cohen | 44983ae | 2017-02-09 09:16:25 -0800 | [diff] [blame^] | 70 | * Asynchronous callback invoked in response to a disable request |IWifiNanIface.disableRequest|. |
Roshan Pius | e03f736 | 2016-10-14 14:53:43 -0700 | [diff] [blame] | 71 | * |
| 72 | * @param cmdId command Id corresponding to the original request. |
Etan Cohen | f01bcaa | 2016-12-25 09:42:21 -0800 | [diff] [blame] | 73 | * @param status WifiNanStatus of the operation. Possible status codes are: |
| 74 | * |NanStatusType.SUCCESS| |
| 75 | * |NanStatusType.PROTOCOL_FAILURE| |
Roshan Pius | e03f736 | 2016-10-14 14:53:43 -0700 | [diff] [blame] | 76 | */ |
Etan Cohen | f01bcaa | 2016-12-25 09:42:21 -0800 | [diff] [blame] | 77 | oneway notifyDisableResponse(CommandIdShort id, WifiNanStatus status); |
| 78 | |
| 79 | /** |
Etan Cohen | 44983ae | 2017-02-09 09:16:25 -0800 | [diff] [blame^] | 80 | * Asynchronous callback invoked to notify the status of the start publish request |
| 81 | * |IWifiNanIface.startPublishRequest|. |
Etan Cohen | f01bcaa | 2016-12-25 09:42:21 -0800 | [diff] [blame] | 82 | * |
| 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 Cohen | 073bb99 | 2017-02-09 10:05:59 -0800 | [diff] [blame] | 92 | oneway notifyStartPublishResponse(CommandIdShort id, WifiNanStatus status, uint8_t sessionId); |
Etan Cohen | f01bcaa | 2016-12-25 09:42:21 -0800 | [diff] [blame] | 93 | |
| 94 | /** |
Etan Cohen | 44983ae | 2017-02-09 09:16:25 -0800 | [diff] [blame^] | 95 | * Asynchronous callback invoked in response to a stop publish request |
| 96 | * |IWifiNanIface.stopPublishRequest|. |
Etan Cohen | f01bcaa | 2016-12-25 09:42:21 -0800 | [diff] [blame] | 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_SESSION_ID| |
| 102 | * |NanStatusType.INTERNAL_FAILURE| |
| 103 | */ |
| 104 | oneway notifyStopPublishResponse(CommandIdShort id, WifiNanStatus status); |
| 105 | |
| 106 | /** |
Etan Cohen | 44983ae | 2017-02-09 09:16:25 -0800 | [diff] [blame^] | 107 | * Asynchronous callback invoked to notify the status of the start subscribe request |
| 108 | * |IWifiNanIface.startSubscribeRequest|. |
Etan Cohen | f01bcaa | 2016-12-25 09:42:21 -0800 | [diff] [blame] | 109 | * |
| 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 Cohen | 073bb99 | 2017-02-09 10:05:59 -0800 | [diff] [blame] | 119 | oneway notifyStartSubscribeResponse(CommandIdShort id, WifiNanStatus status, uint8_t sessionId); |
Etan Cohen | f01bcaa | 2016-12-25 09:42:21 -0800 | [diff] [blame] | 120 | |
| 121 | /** |
Etan Cohen | 44983ae | 2017-02-09 09:16:25 -0800 | [diff] [blame^] | 122 | * Asynchronous callback invoked in response to a stop subscribe request |
| 123 | * |IWifiNanIface.stopSubscribeRequest|. |
Etan Cohen | f01bcaa | 2016-12-25 09:42:21 -0800 | [diff] [blame] | 124 | * |
| 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 Cohen | 44983ae | 2017-02-09 09:16:25 -0800 | [diff] [blame^] | 134 | * Asynchronous callback invoked in response to a transmit followup request |
| 135 | * |IWifiNanIface.transmitFollowupRequest|. |
Etan Cohen | f01bcaa | 2016-12-25 09:42:21 -0800 | [diff] [blame] | 136 | * |
| 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 Cohen | 44983ae | 2017-02-09 09:16:25 -0800 | [diff] [blame^] | 148 | * Asynchronous callback invoked in response to a create data interface request |
| 149 | * |IWifiNanIface.createDataInterfaceRequest|. |
Etan Cohen | f01bcaa | 2016-12-25 09:42:21 -0800 | [diff] [blame] | 150 | * |
| 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 Cohen | 44983ae | 2017-02-09 09:16:25 -0800 | [diff] [blame^] | 160 | * Asynchronous callback invoked in response to a delete data interface request |
| 161 | * |IWifiNanIface.deleteDataInterfaceRequest|. |
Etan Cohen | f01bcaa | 2016-12-25 09:42:21 -0800 | [diff] [blame] | 162 | * |
| 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 Cohen | 44983ae | 2017-02-09 09:16:25 -0800 | [diff] [blame^] | 172 | * Asynchronous callback invoked in response to an initiate data path request |
| 173 | * |IWifiNanIface.initiateDataPathRequest|. |
Etan Cohen | f01bcaa | 2016-12-25 09:42:21 -0800 | [diff] [blame] | 174 | * |
| 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 Cohen | 4bbc209 | 2017-01-30 13:28:37 -0800 | [diff] [blame] | 182 | * @param ndpInstanceId ID of the new data path being negotiated (on successful status). |
Etan Cohen | f01bcaa | 2016-12-25 09:42:21 -0800 | [diff] [blame] | 183 | */ |
Etan Cohen | 4bbc209 | 2017-01-30 13:28:37 -0800 | [diff] [blame] | 184 | oneway notifyInitiateDataPathResponse(CommandIdShort id, WifiNanStatus status, |
| 185 | uint32_t ndpInstanceId ); |
Etan Cohen | f01bcaa | 2016-12-25 09:42:21 -0800 | [diff] [blame] | 186 | |
| 187 | /** |
Etan Cohen | 44983ae | 2017-02-09 09:16:25 -0800 | [diff] [blame^] | 188 | * Asynchronous callback invoked in response to a respond to data path indication request |
| 189 | * |IWifiNanIface.respondToDataPathIndicationRequest|. |
Etan Cohen | f01bcaa | 2016-12-25 09:42:21 -0800 | [diff] [blame] | 190 | * |
| 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 Cohen | f01bcaa | 2016-12-25 09:42:21 -0800 | [diff] [blame] | 198 | */ |
Etan Cohen | 4bbc209 | 2017-01-30 13:28:37 -0800 | [diff] [blame] | 199 | oneway notifyRespondToDataPathIndicationResponse(CommandIdShort id, WifiNanStatus status); |
Etan Cohen | f01bcaa | 2016-12-25 09:42:21 -0800 | [diff] [blame] | 200 | |
| 201 | /** |
Etan Cohen | 44983ae | 2017-02-09 09:16:25 -0800 | [diff] [blame^] | 202 | * Asynchronous callback invoked in response to a terminate data path request |
| 203 | * |IWifiNanIface.terminateDataPathRequest|. |
Etan Cohen | f01bcaa | 2016-12-25 09:42:21 -0800 | [diff] [blame] | 204 | * |
| 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 Pius | 120f94c | 2016-10-13 11:48:42 -0700 | [diff] [blame] | 216 | * Callbacks for the various asynchornous NAN Events. |
| 217 | */ |
Roshan Pius | 120f94c | 2016-10-13 11:48:42 -0700 | [diff] [blame] | 218 | |
Etan Cohen | f01bcaa | 2016-12-25 09:42:21 -0800 | [diff] [blame] | 219 | /** |
| 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 Cohen | 073bb99 | 2017-02-09 10:05:59 -0800 | [diff] [blame] | 244 | oneway eventPublishTerminated(uint8_t sessionId, WifiNanStatus status); |
Etan Cohen | f01bcaa | 2016-12-25 09:42:21 -0800 | [diff] [blame] | 245 | |
| 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 Cohen | 073bb99 | 2017-02-09 10:05:59 -0800 | [diff] [blame] | 254 | oneway eventSubscribeTerminated(uint8_t sessionId, WifiNanStatus status); |
Etan Cohen | f01bcaa | 2016-12-25 09:42:21 -0800 | [diff] [blame] | 255 | |
| 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 Pius | 120f94c | 2016-10-13 11:48:42 -0700 | [diff] [blame] | 262 | oneway eventMatch(NanMatchInd event); |
| 263 | |
Etan Cohen | f01bcaa | 2016-12-25 09:42:21 -0800 | [diff] [blame] | 264 | /** |
| 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 Cohen | 073bb99 | 2017-02-09 10:05:59 -0800 | [diff] [blame] | 270 | oneway eventMatchExpired(uint8_t discoverySessionId, uint32_t peerId); |
Roshan Pius | 120f94c | 2016-10-13 11:48:42 -0700 | [diff] [blame] | 271 | |
Etan Cohen | f01bcaa | 2016-12-25 09:42:21 -0800 | [diff] [blame] | 272 | /** |
| 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 Pius | 120f94c | 2016-10-13 11:48:42 -0700 | [diff] [blame] | 278 | |
Etan Cohen | f01bcaa | 2016-12-25 09:42:21 -0800 | [diff] [blame] | 279 | /** |
| 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 Pius | 120f94c | 2016-10-13 11:48:42 -0700 | [diff] [blame] | 288 | |
Etan Cohen | f01bcaa | 2016-12-25 09:42:21 -0800 | [diff] [blame] | 289 | /** |
| 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 Pius | 120f94c | 2016-10-13 11:48:42 -0700 | [diff] [blame] | 296 | |
Etan Cohen | f01bcaa | 2016-12-25 09:42:21 -0800 | [diff] [blame] | 297 | /** |
| 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 Pius | 120f94c | 2016-10-13 11:48:42 -0700 | [diff] [blame] | 304 | |
Etan Cohen | f01bcaa | 2016-12-25 09:42:21 -0800 | [diff] [blame] | 305 | /** |
| 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 Pius | 120f94c | 2016-10-13 11:48:42 -0700 | [diff] [blame] | 312 | }; |