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 | */ |
Etan Cohen | 073bb99 | 2017-02-09 10:05:59 -0800 | [diff] [blame^] | 82 | oneway notifyStartPublishResponse(CommandIdShort id, WifiNanStatus status, uint8_t sessionId); |
Etan Cohen | f01bcaa | 2016-12-25 09:42:21 -0800 | [diff] [blame] | 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 | */ |
Etan Cohen | 073bb99 | 2017-02-09 10:05:59 -0800 | [diff] [blame^] | 107 | oneway notifyStartSubscribeResponse(CommandIdShort id, WifiNanStatus status, uint8_t sessionId); |
Etan Cohen | f01bcaa | 2016-12-25 09:42:21 -0800 | [diff] [blame] | 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 | /** |
Roshan Pius | 120f94c | 2016-10-13 11:48:42 -0700 | [diff] [blame] | 198 | * Callbacks for the various asynchornous NAN Events. |
| 199 | */ |
Roshan Pius | 120f94c | 2016-10-13 11:48:42 -0700 | [diff] [blame] | 200 | |
Etan Cohen | f01bcaa | 2016-12-25 09:42:21 -0800 | [diff] [blame] | 201 | /** |
| 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 Cohen | 073bb99 | 2017-02-09 10:05:59 -0800 | [diff] [blame^] | 226 | oneway eventPublishTerminated(uint8_t sessionId, WifiNanStatus status); |
Etan Cohen | f01bcaa | 2016-12-25 09:42:21 -0800 | [diff] [blame] | 227 | |
| 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 Cohen | 073bb99 | 2017-02-09 10:05:59 -0800 | [diff] [blame^] | 236 | oneway eventSubscribeTerminated(uint8_t sessionId, WifiNanStatus status); |
Etan Cohen | f01bcaa | 2016-12-25 09:42:21 -0800 | [diff] [blame] | 237 | |
| 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 Pius | 120f94c | 2016-10-13 11:48:42 -0700 | [diff] [blame] | 244 | oneway eventMatch(NanMatchInd event); |
| 245 | |
Etan Cohen | f01bcaa | 2016-12-25 09:42:21 -0800 | [diff] [blame] | 246 | /** |
| 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 Cohen | 073bb99 | 2017-02-09 10:05:59 -0800 | [diff] [blame^] | 252 | oneway eventMatchExpired(uint8_t discoverySessionId, uint32_t peerId); |
Roshan Pius | 120f94c | 2016-10-13 11:48:42 -0700 | [diff] [blame] | 253 | |
Etan Cohen | f01bcaa | 2016-12-25 09:42:21 -0800 | [diff] [blame] | 254 | /** |
| 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 Pius | 120f94c | 2016-10-13 11:48:42 -0700 | [diff] [blame] | 260 | |
Etan Cohen | f01bcaa | 2016-12-25 09:42:21 -0800 | [diff] [blame] | 261 | /** |
| 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 Pius | 120f94c | 2016-10-13 11:48:42 -0700 | [diff] [blame] | 270 | |
Etan Cohen | f01bcaa | 2016-12-25 09:42:21 -0800 | [diff] [blame] | 271 | /** |
| 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 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 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 Pius | 120f94c | 2016-10-13 11:48:42 -0700 | [diff] [blame] | 286 | |
Etan Cohen | f01bcaa | 2016-12-25 09:42:21 -0800 | [diff] [blame] | 287 | /** |
| 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 Pius | 120f94c | 2016-10-13 11:48:42 -0700 | [diff] [blame] | 294 | }; |