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