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. |
Roshan Pius | 120f94c | 2016-10-13 11:48:42 -0700 | [diff] [blame] | 21 | */ |
| 22 | interface IWifiNanIfaceEventCallback { |
| 23 | /** |
Etan Cohen | f01bcaa | 2016-12-25 09:42:21 -0800 | [diff] [blame] | 24 | * Callback invoked in response to a capability request |getCapabilitiesRequest|. |
Roshan Pius | e03f736 | 2016-10-14 14:53:43 -0700 | [diff] [blame] | 25 | * |
| 26 | * @param cmdId command Id corresponding to the original request. |
Etan Cohen | f01bcaa | 2016-12-25 09:42:21 -0800 | [diff] [blame] | 27 | * @param status WifiNanStatus of the operation. Possible status codes are: |
| 28 | * |NanStatusType.SUCCESS| |
| 29 | * @param capabilities Capability data. |
Roshan Pius | 120f94c | 2016-10-13 11:48:42 -0700 | [diff] [blame] | 30 | */ |
Etan Cohen | f01bcaa | 2016-12-25 09:42:21 -0800 | [diff] [blame] | 31 | oneway notifyCapabilitiesResponse(CommandIdShort id, WifiNanStatus status, |
| 32 | NanCapabilities capabilities); |
Roshan Pius | e03f736 | 2016-10-14 14:53:43 -0700 | [diff] [blame] | 33 | |
| 34 | /** |
Etan Cohen | f01bcaa | 2016-12-25 09:42:21 -0800 | [diff] [blame] | 35 | * Callback invoked in response to an enable request |enableRequest|. |
Roshan Pius | e03f736 | 2016-10-14 14:53:43 -0700 | [diff] [blame] | 36 | * |
| 37 | * @param cmdId command Id corresponding to the original request. |
Etan Cohen | f01bcaa | 2016-12-25 09:42:21 -0800 | [diff] [blame] | 38 | * @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 Pius | e03f736 | 2016-10-14 14:53:43 -0700 | [diff] [blame] | 45 | */ |
Etan Cohen | f01bcaa | 2016-12-25 09:42:21 -0800 | [diff] [blame] | 46 | oneway notifyEnableResponse(CommandIdShort id, WifiNanStatus status); |
Roshan Pius | e03f736 | 2016-10-14 14:53:43 -0700 | [diff] [blame] | 47 | |
| 48 | /** |
Etan Cohen | f01bcaa | 2016-12-25 09:42:21 -0800 | [diff] [blame] | 49 | * Callback invoked in response to a config request |configRequest|. |
Roshan Pius | e03f736 | 2016-10-14 14:53:43 -0700 | [diff] [blame] | 50 | * |
| 51 | * @param cmdId command Id corresponding to the original request. |
Etan Cohen | f01bcaa | 2016-12-25 09:42:21 -0800 | [diff] [blame] | 52 | * @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 Pius | e03f736 | 2016-10-14 14:53:43 -0700 | [diff] [blame] | 57 | */ |
Etan Cohen | f01bcaa | 2016-12-25 09:42:21 -0800 | [diff] [blame] | 58 | oneway notifyConfigResponse(CommandIdShort id, WifiNanStatus status); |
Roshan Pius | e03f736 | 2016-10-14 14:53:43 -0700 | [diff] [blame] | 59 | |
| 60 | /** |
Etan Cohen | f01bcaa | 2016-12-25 09:42:21 -0800 | [diff] [blame] | 61 | * Callback invoked in response to a disable request |disableRequest|. |
Roshan Pius | e03f736 | 2016-10-14 14:53:43 -0700 | [diff] [blame] | 62 | * |
| 63 | * @param cmdId command Id corresponding to the original request. |
Etan Cohen | f01bcaa | 2016-12-25 09:42:21 -0800 | [diff] [blame] | 64 | * @param status WifiNanStatus of the operation. Possible status codes are: |
| 65 | * |NanStatusType.SUCCESS| |
| 66 | * |NanStatusType.PROTOCOL_FAILURE| |
Roshan Pius | e03f736 | 2016-10-14 14:53:43 -0700 | [diff] [blame] | 67 | */ |
Etan Cohen | f01bcaa | 2016-12-25 09:42:21 -0800 | [diff] [blame] | 68 | 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 Cohen | 4bbc209 | 2017-01-30 13:28:37 -0800 | [diff] [blame^] | 165 | * @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] | 166 | */ |
Etan Cohen | 4bbc209 | 2017-01-30 13:28:37 -0800 | [diff] [blame^] | 167 | oneway notifyInitiateDataPathResponse(CommandIdShort id, WifiNanStatus status, |
| 168 | uint32_t ndpInstanceId ); |
Etan Cohen | f01bcaa | 2016-12-25 09:42:21 -0800 | [diff] [blame] | 169 | |
| 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 Cohen | f01bcaa | 2016-12-25 09:42:21 -0800 | [diff] [blame] | 181 | */ |
Etan Cohen | 4bbc209 | 2017-01-30 13:28:37 -0800 | [diff] [blame^] | 182 | oneway notifyRespondToDataPathIndicationResponse(CommandIdShort id, WifiNanStatus status); |
Etan Cohen | f01bcaa | 2016-12-25 09:42:21 -0800 | [diff] [blame] | 183 | |
| 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 Pius | 120f94c | 2016-10-13 11:48:42 -0700 | [diff] [blame] | 208 | |
| 209 | /** |
| 210 | * Callbacks for the various asynchornous NAN Events. |
| 211 | */ |
Roshan Pius | 120f94c | 2016-10-13 11:48:42 -0700 | [diff] [blame] | 212 | |
Etan Cohen | f01bcaa | 2016-12-25 09:42:21 -0800 | [diff] [blame] | 213 | /** |
| 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 Pius | 120f94c | 2016-10-13 11:48:42 -0700 | [diff] [blame] | 256 | oneway eventMatch(NanMatchInd event); |
| 257 | |
Etan Cohen | f01bcaa | 2016-12-25 09:42:21 -0800 | [diff] [blame] | 258 | /** |
| 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 Pius | 120f94c | 2016-10-13 11:48:42 -0700 | [diff] [blame] | 265 | |
Etan Cohen | f01bcaa | 2016-12-25 09:42:21 -0800 | [diff] [blame] | 266 | /** |
| 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 Pius | 120f94c | 2016-10-13 11:48:42 -0700 | [diff] [blame] | 272 | |
Etan Cohen | f01bcaa | 2016-12-25 09:42:21 -0800 | [diff] [blame] | 273 | /** |
| 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 Pius | 120f94c | 2016-10-13 11:48:42 -0700 | [diff] [blame] | 282 | |
Etan Cohen | f01bcaa | 2016-12-25 09:42:21 -0800 | [diff] [blame] | 283 | /** |
| 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 Pius | 120f94c | 2016-10-13 11:48:42 -0700 | [diff] [blame] | 290 | |
Etan Cohen | f01bcaa | 2016-12-25 09:42:21 -0800 | [diff] [blame] | 291 | /** |
| 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 Pius | 120f94c | 2016-10-13 11:48:42 -0700 | [diff] [blame] | 298 | |
Etan Cohen | f01bcaa | 2016-12-25 09:42:21 -0800 | [diff] [blame] | 299 | /** |
| 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 Pius | 120f94c | 2016-10-13 11:48:42 -0700 | [diff] [blame] | 312 | oneway eventBeaconSdfPayload(NanBeaconSdfPayloadInd event); |
Roshan Pius | 120f94c | 2016-10-13 11:48:42 -0700 | [diff] [blame] | 313 | }; |