Roshan Pius | adcfba4 | 2016-10-05 10:19:06 -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 | import IWifiIface; |
Roshan Pius | 120f94c | 2016-10-13 11:48:42 -0700 | [diff] [blame] | 20 | import IWifiNanIfaceEventCallback; |
Roshan Pius | adcfba4 | 2016-10-05 10:19:06 -0700 | [diff] [blame] | 21 | |
| 22 | /** |
Roshan Pius | 120f94c | 2016-10-13 11:48:42 -0700 | [diff] [blame] | 23 | * Interface used to represent a single NAN(Neighbour Aware Network) iface. |
Etan Cohen | 44983ae | 2017-02-09 09:16:25 -0800 | [diff] [blame] | 24 | * |
| 25 | * References to "NAN Spec" are to the Wi-Fi Alliance "Wi-Fi Neighbor Awareness |
| 26 | * Networking (NAN) Technical Specification". |
Roshan Pius | adcfba4 | 2016-10-05 10:19:06 -0700 | [diff] [blame] | 27 | */ |
| 28 | interface IWifiNanIface extends IWifiIface { |
Roshan Pius | 120f94c | 2016-10-13 11:48:42 -0700 | [diff] [blame] | 29 | /** |
| 30 | * Requests notifications of significant events on this iface. Multiple calls |
| 31 | * to this must register multiple callbacks each of which must receive all |
| 32 | * events. |
| 33 | * |
| 34 | * @param callback An instance of the |IWifiNanIfaceEventCallback| HIDL interface |
| 35 | * object. |
| 36 | * @return status WifiStatus of the operation. |
| 37 | * Possible status codes: |
| 38 | * |WifiStatusCode.SUCCESS|, |
| 39 | * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID| |
| 40 | */ |
| 41 | registerEventCallback(IWifiNanIfaceEventCallback callback) |
| 42 | generates (WifiStatus status); |
| 43 | |
| 44 | /** |
Etan Cohen | 44983ae | 2017-02-09 09:16:25 -0800 | [diff] [blame] | 45 | * Get NAN capabilities. Asynchronous response is with |
| 46 | * |IWifiNanIfaceEventCallback.notifyCapabilitiesResponse|. |
Etan Cohen | f01bcaa | 2016-12-25 09:42:21 -0800 | [diff] [blame] | 47 | * |
| 48 | * @param cmdId command Id to use for this invocation. |
| 49 | * @return status WifiStatus of the operation. |
| 50 | * Possible status codes: |
| 51 | * |WifiStatusCode.SUCCESS|, |
| 52 | * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, |
| 53 | * |WifiStatusCode.ERROR_UNKNOWN| |
| 54 | */ |
| 55 | getCapabilitiesRequest(CommandIdShort cmdId) generates (WifiStatus status); |
| 56 | |
| 57 | /** |
| 58 | * Enable NAN: configures and activates NAN clustering (does not start |
| 59 | * a discovery session or set up data-interfaces or data-paths). Use the |
Etan Cohen | 44983ae | 2017-02-09 09:16:25 -0800 | [diff] [blame] | 60 | * |IWifiNanIface.configureRequest| method to change the configuration of an already enabled |
Etan Cohen | f01bcaa | 2016-12-25 09:42:21 -0800 | [diff] [blame] | 61 | * NAN interface. |
Etan Cohen | 44983ae | 2017-02-09 09:16:25 -0800 | [diff] [blame] | 62 | * Asynchronous response is with |IWifiNanIfaceEventCallback.notifyEnableResponse|. |
Roshan Pius | 120f94c | 2016-10-13 11:48:42 -0700 | [diff] [blame] | 63 | * |
| 64 | * @param cmdId command Id to use for this invocation. |
| 65 | * @param msg Instance of |NanEnableRequest|. |
| 66 | * @return status WifiStatus of the operation. |
| 67 | * Possible status codes: |
| 68 | * |WifiStatusCode.SUCCESS|, |
| 69 | * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, |
| 70 | * |WifiStatusCode.ERROR_INVALID_ARGS|, |
| 71 | * |WifiStatusCode.ERROR_UNKNOWN| |
| 72 | */ |
Etan Cohen | f01bcaa | 2016-12-25 09:42:21 -0800 | [diff] [blame] | 73 | enableRequest(CommandIdShort cmdId, NanEnableRequest msg) |
| 74 | generates (WifiStatus status); |
| 75 | |
| 76 | /** |
| 77 | * Configure NAN: configures an existing NAN functionality (i.e. assumes |
Etan Cohen | 44983ae | 2017-02-09 09:16:25 -0800 | [diff] [blame] | 78 | * |IWifiNanIface.enableRequest| already submitted and succeeded). |
| 79 | * Asynchronous response is with |IWifiNanIfaceEventCallback.notifyConfigResponse|. |
Etan Cohen | f01bcaa | 2016-12-25 09:42:21 -0800 | [diff] [blame] | 80 | * |
| 81 | * @param cmdId command Id to use for this invocation. |
| 82 | * @param msg Instance of |NanConfigRequest|. |
| 83 | * @return status WifiStatus of the operation. |
| 84 | * Possible status codes: |
| 85 | * |WifiStatusCode.SUCCESS|, |
| 86 | * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, |
| 87 | * |WifiStatusCode.ERROR_INVALID_ARGS|, |
| 88 | * |WifiStatusCode.ERROR_UNKNOWN| |
| 89 | */ |
| 90 | configRequest(CommandIdShort cmdId, NanConfigRequest msg) |
Roshan Pius | 120f94c | 2016-10-13 11:48:42 -0700 | [diff] [blame] | 91 | generates (WifiStatus status); |
| 92 | |
| 93 | /** |
| 94 | * Disable NAN functionality. |
Etan Cohen | 44983ae | 2017-02-09 09:16:25 -0800 | [diff] [blame] | 95 | * Asynchronous response is with |IWifiNanIfaceEventCallback.notifyDisableResponse|. |
Roshan Pius | 120f94c | 2016-10-13 11:48:42 -0700 | [diff] [blame] | 96 | * |
| 97 | * @param cmdId command Id to use for this invocation. |
| 98 | * @return status WifiStatus of the operation. |
| 99 | * Possible status codes: |
| 100 | * |WifiStatusCode.SUCCESS|, |
| 101 | * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, |
| 102 | * |WifiStatusCode.ERROR_UNKNOWN| |
| 103 | */ |
Etan Cohen | f01bcaa | 2016-12-25 09:42:21 -0800 | [diff] [blame] | 104 | disableRequest(CommandIdShort cmdId) generates (WifiStatus status); |
Roshan Pius | 120f94c | 2016-10-13 11:48:42 -0700 | [diff] [blame] | 105 | |
| 106 | /** |
Etan Cohen | f01bcaa | 2016-12-25 09:42:21 -0800 | [diff] [blame] | 107 | * Publish request to start advertising a discovery service. |
Etan Cohen | 44983ae | 2017-02-09 09:16:25 -0800 | [diff] [blame] | 108 | * Asynchronous response is with |IWifiNanIfaceEventCallback.notifyStartPublishResponse|. |
Roshan Pius | 120f94c | 2016-10-13 11:48:42 -0700 | [diff] [blame] | 109 | * |
| 110 | * @param cmdId command Id to use for this invocation. |
| 111 | * @param msg Instance of |NanPublishRequest|. |
| 112 | * @return status WifiStatus of the operation. |
| 113 | * Possible status codes: |
| 114 | * |WifiStatusCode.SUCCESS|, |
| 115 | * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, |
| 116 | * |WifiStatusCode.ERROR_INVALID_ARGS|, |
| 117 | * |WifiStatusCode.ERROR_UNKNOWN| |
| 118 | */ |
Etan Cohen | f01bcaa | 2016-12-25 09:42:21 -0800 | [diff] [blame] | 119 | startPublishRequest(CommandIdShort cmdId, NanPublishRequest msg) |
Roshan Pius | 120f94c | 2016-10-13 11:48:42 -0700 | [diff] [blame] | 120 | generates (WifiStatus status); |
| 121 | |
| 122 | /** |
Etan Cohen | f01bcaa | 2016-12-25 09:42:21 -0800 | [diff] [blame] | 123 | * Stop publishing a discovery service. |
Etan Cohen | 44983ae | 2017-02-09 09:16:25 -0800 | [diff] [blame] | 124 | * Asynchronous response is with |IWifiNanIfaceEventCallback.notifyStopPublishResponse|. |
Roshan Pius | 120f94c | 2016-10-13 11:48:42 -0700 | [diff] [blame] | 125 | * |
| 126 | * @param cmdId command Id to use for this invocation. |
Etan Cohen | f01bcaa | 2016-12-25 09:42:21 -0800 | [diff] [blame] | 127 | * @param sessionId ID of the publish discovery session to be stopped. |
Roshan Pius | 120f94c | 2016-10-13 11:48:42 -0700 | [diff] [blame] | 128 | * @return status WifiStatus of the operation. |
| 129 | * Possible status codes: |
| 130 | * |WifiStatusCode.SUCCESS|, |
| 131 | * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, |
Roshan Pius | 120f94c | 2016-10-13 11:48:42 -0700 | [diff] [blame] | 132 | * |WifiStatusCode.ERROR_UNKNOWN| |
| 133 | */ |
Etan Cohen | 073bb99 | 2017-02-09 10:05:59 -0800 | [diff] [blame] | 134 | stopPublishRequest(CommandIdShort cmdId, uint8_t sessionId) |
Roshan Pius | 120f94c | 2016-10-13 11:48:42 -0700 | [diff] [blame] | 135 | generates (WifiStatus status); |
| 136 | |
| 137 | /** |
Etan Cohen | f01bcaa | 2016-12-25 09:42:21 -0800 | [diff] [blame] | 138 | * Subscribe request to start searching for a discovery service. |
Etan Cohen | 44983ae | 2017-02-09 09:16:25 -0800 | [diff] [blame] | 139 | * Asynchronous response is with |IWifiNanIfaceEventCallback.notifyStartSubscribeResponse|. |
Roshan Pius | 120f94c | 2016-10-13 11:48:42 -0700 | [diff] [blame] | 140 | * |
| 141 | * @param cmdId command Id to use for this invocation. |
| 142 | * @param msg Instance of |NanSubscribeRequest|. |
| 143 | * @return status WifiStatus of the operation. |
| 144 | * Possible status codes: |
| 145 | * |WifiStatusCode.SUCCESS|, |
| 146 | * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, |
| 147 | * |WifiStatusCode.ERROR_INVALID_ARGS|, |
| 148 | * |WifiStatusCode.ERROR_UNKNOWN| |
| 149 | */ |
Etan Cohen | f01bcaa | 2016-12-25 09:42:21 -0800 | [diff] [blame] | 150 | startSubscribeRequest(CommandIdShort cmdId, NanSubscribeRequest msg) |
Roshan Pius | 120f94c | 2016-10-13 11:48:42 -0700 | [diff] [blame] | 151 | generates (WifiStatus status); |
| 152 | |
| 153 | /** |
Etan Cohen | f01bcaa | 2016-12-25 09:42:21 -0800 | [diff] [blame] | 154 | * Stop subscribing to a discovery service. |
Etan Cohen | 44983ae | 2017-02-09 09:16:25 -0800 | [diff] [blame] | 155 | * Asynchronous response is with |IWifiNanIfaceEventCallback.notifyStopSubscribeResponse|. |
Roshan Pius | 120f94c | 2016-10-13 11:48:42 -0700 | [diff] [blame] | 156 | * |
| 157 | * @param cmdId command Id to use for this invocation. |
Etan Cohen | f01bcaa | 2016-12-25 09:42:21 -0800 | [diff] [blame] | 158 | * @param sessionId ID of the subscribe discovery session to be stopped. |
Roshan Pius | 120f94c | 2016-10-13 11:48:42 -0700 | [diff] [blame] | 159 | * @return status WifiStatus of the operation. |
| 160 | * Possible status codes: |
| 161 | * |WifiStatusCode.SUCCESS|, |
| 162 | * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, |
Roshan Pius | 120f94c | 2016-10-13 11:48:42 -0700 | [diff] [blame] | 163 | * |WifiStatusCode.ERROR_UNKNOWN| |
| 164 | */ |
Etan Cohen | 073bb99 | 2017-02-09 10:05:59 -0800 | [diff] [blame] | 165 | stopSubscribeRequest(CommandIdShort cmdId, uint8_t sessionId) |
Roshan Pius | 120f94c | 2016-10-13 11:48:42 -0700 | [diff] [blame] | 166 | generates (WifiStatus status); |
| 167 | |
| 168 | /** |
Etan Cohen | f01bcaa | 2016-12-25 09:42:21 -0800 | [diff] [blame] | 169 | * NAN transmit follow up message request. |
Etan Cohen | 44983ae | 2017-02-09 09:16:25 -0800 | [diff] [blame] | 170 | * Asynchronous response is with |IWifiNanIfaceEventCallback.notifyTransmitFollowupResponse|. |
Roshan Pius | 120f94c | 2016-10-13 11:48:42 -0700 | [diff] [blame] | 171 | * |
| 172 | * @param cmdId command Id to use for this invocation. |
| 173 | * @param msg Instance of |NanTransmitFollowupRequest|. |
| 174 | * @return status WifiStatus of the operation. |
| 175 | * Possible status codes: |
| 176 | * |WifiStatusCode.SUCCESS|, |
| 177 | * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, |
| 178 | * |WifiStatusCode.ERROR_INVALID_ARGS|, |
| 179 | * |WifiStatusCode.ERROR_UNKNOWN| |
| 180 | */ |
Etan Cohen | f01bcaa | 2016-12-25 09:42:21 -0800 | [diff] [blame] | 181 | transmitFollowupRequest(CommandIdShort cmdId, NanTransmitFollowupRequest msg) |
Roshan Pius | 120f94c | 2016-10-13 11:48:42 -0700 | [diff] [blame] | 182 | generates (WifiStatus status); |
| 183 | |
| 184 | /** |
Etan Cohen | f01bcaa | 2016-12-25 09:42:21 -0800 | [diff] [blame] | 185 | * Create a NAN Data Interface. |
Etan Cohen | 44983ae | 2017-02-09 09:16:25 -0800 | [diff] [blame] | 186 | * Asynchronous response is with |IWifiNanIfaceEventCallback.notifyCreateDataInterfaceResponse|. |
Roshan Pius | 120f94c | 2016-10-13 11:48:42 -0700 | [diff] [blame] | 187 | * |
| 188 | * @param cmdId command Id to use for this invocation. |
Etan Cohen | f01bcaa | 2016-12-25 09:42:21 -0800 | [diff] [blame] | 189 | * @return status WifiStatus of the operation. |
| 190 | * Possible status codes: |
| 191 | * |WifiStatusCode.SUCCESS|, |
| 192 | * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, |
| 193 | * |WifiStatusCode.ERROR_UNKNOWN| |
| 194 | */ |
| 195 | createDataInterfaceRequest(CommandIdShort cmdId, string ifaceName) |
| 196 | generates (WifiStatus status); |
| 197 | |
| 198 | /** |
| 199 | * Delete a NAN Data Interface. |
Etan Cohen | 44983ae | 2017-02-09 09:16:25 -0800 | [diff] [blame] | 200 | * Asynchronous response is with |IWifiNanIfaceEventCallback.notifyDeleteDataInterfaceResponse|. |
Etan Cohen | f01bcaa | 2016-12-25 09:42:21 -0800 | [diff] [blame] | 201 | * |
| 202 | * @param cmdId command Id to use for this invocation. |
| 203 | * @return status WifiStatus of the operation. |
| 204 | * Possible status codes: |
| 205 | * |WifiStatusCode.SUCCESS|, |
| 206 | * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, |
| 207 | * |WifiStatusCode.ERROR_UNKNOWN| |
| 208 | */ |
| 209 | deleteDataInterfaceRequest(CommandIdShort cmdId, string ifaceName) |
| 210 | generates (WifiStatus status); |
| 211 | |
| 212 | /** |
| 213 | * Initiate a data-path (NDP) setup operation: Initiator. |
Etan Cohen | 44983ae | 2017-02-09 09:16:25 -0800 | [diff] [blame] | 214 | * Asynchronous response is with |IWifiNanIfaceEventCallback.notifyInitiateDataPathResponse|. |
Etan Cohen | f01bcaa | 2016-12-25 09:42:21 -0800 | [diff] [blame] | 215 | * |
| 216 | * @param cmdId command Id to use for this invocation. |
| 217 | * @param msg Instance of |NanInitiateDataPathRequest|. |
Roshan Pius | 120f94c | 2016-10-13 11:48:42 -0700 | [diff] [blame] | 218 | * @return status WifiStatus of the operation. |
| 219 | * Possible status codes: |
| 220 | * |WifiStatusCode.SUCCESS|, |
| 221 | * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, |
| 222 | * |WifiStatusCode.ERROR_INVALID_ARGS|, |
| 223 | * |WifiStatusCode.ERROR_UNKNOWN| |
| 224 | */ |
Etan Cohen | f01bcaa | 2016-12-25 09:42:21 -0800 | [diff] [blame] | 225 | initiateDataPathRequest(CommandIdShort cmdId, NanInitiateDataPathRequest msg) |
Roshan Pius | 120f94c | 2016-10-13 11:48:42 -0700 | [diff] [blame] | 226 | generates (WifiStatus status); |
| 227 | |
| 228 | /** |
Etan Cohen | f01bcaa | 2016-12-25 09:42:21 -0800 | [diff] [blame] | 229 | * Respond to a received data indication as part of a data-path (NDP) setup operation. An |
| 230 | * indication is received by the Responder from the Initiator. |
Etan Cohen | 44983ae | 2017-02-09 09:16:25 -0800 | [diff] [blame] | 231 | * Asynchronous response is with |
| 232 | * |IWifiNanIfaceEventCallback.notifyRespondToDataPathIndicationResponse|. |
Etan Cohen | f01bcaa | 2016-12-25 09:42:21 -0800 | [diff] [blame] | 233 | * |
| 234 | * @param cmdId command Id to use for this invocation. |
| 235 | * @param msg Instance of |NanRespondToDataPathIndicationRequest|. |
| 236 | * @return status WifiStatus of the operation. |
| 237 | * Possible status codes: |
| 238 | * |WifiStatusCode.SUCCESS|, |
| 239 | * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, |
| 240 | * |WifiStatusCode.ERROR_INVALID_ARGS|, |
| 241 | * |WifiStatusCode.ERROR_UNKNOWN| |
| 242 | */ |
| 243 | respondToDataPathIndicationRequest(CommandIdShort cmdId, |
| 244 | NanRespondToDataPathIndicationRequest msg) |
| 245 | generates (WifiStatus status); |
| 246 | |
| 247 | /** |
| 248 | * Data-path (NDP) termination request: executed by either Initiator or Responder. |
Etan Cohen | 44983ae | 2017-02-09 09:16:25 -0800 | [diff] [blame] | 249 | * Asynchronous response is with |IWifiNanIfaceEventCallback.notifyTerminateDataPathResponse|. |
Etan Cohen | f01bcaa | 2016-12-25 09:42:21 -0800 | [diff] [blame] | 250 | * |
| 251 | * @param cmdId command Id to use for this invocation. |
| 252 | * @param ndpInstanceId Data-path instance ID to be terminated. |
| 253 | * @return status WifiStatus of the operation. |
| 254 | * Possible status codes: |
| 255 | * |WifiStatusCode.SUCCESS|, |
| 256 | * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, |
| 257 | * |WifiStatusCode.ERROR_UNKNOWN| |
| 258 | */ |
| 259 | terminateDataPathRequest(CommandIdShort cmdId, uint32_t ndpInstanceId) |
| 260 | generates (WifiStatus status); |
Roshan Pius | adcfba4 | 2016-10-05 10:19:06 -0700 | [diff] [blame] | 261 | }; |