Gabriel Biren | 910d5df | 2022-04-08 18:21:22 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2022 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; |
| 18 | |
| 19 | import android.hardware.wifi.IWifiStaIfaceEventCallback; |
| 20 | import android.hardware.wifi.StaApfPacketFilterCapabilities; |
| 21 | import android.hardware.wifi.StaBackgroundScanCapabilities; |
| 22 | import android.hardware.wifi.StaBackgroundScanParameters; |
| 23 | import android.hardware.wifi.StaLinkLayerStats; |
| 24 | import android.hardware.wifi.StaRoamingCapabilities; |
| 25 | import android.hardware.wifi.StaRoamingConfig; |
| 26 | import android.hardware.wifi.StaRoamingState; |
| 27 | import android.hardware.wifi.WifiBand; |
| 28 | import android.hardware.wifi.WifiDebugRxPacketFateReport; |
| 29 | import android.hardware.wifi.WifiDebugTxPacketFateReport; |
| 30 | |
| 31 | /** |
| 32 | * Interface used to represent a single STA iface. |
| 33 | */ |
| 34 | @VintfStability |
| 35 | interface IWifiStaIface { |
| 36 | /** |
| 37 | * Mask of capabilities supported by this iface. |
| 38 | */ |
| 39 | @VintfStability |
| 40 | @Backing(type="int") |
| 41 | enum StaIfaceCapabilityMask { |
| 42 | /** |
| 43 | * Support for APF APIs. APF (Android Packet Filter) is a |
| 44 | * BPF-like packet filtering bytecode executed by the firmware. |
| 45 | */ |
| 46 | APF = 1 << 0, |
| 47 | /** |
| 48 | * Support for Background Scan APIs. Background scan allows the host |
| 49 | * to send a number of buckets down to the firmware. Each bucket |
| 50 | * contains a set of channels, a period, and some parameters about |
| 51 | * how and when to report results. |
| 52 | */ |
| 53 | BACKGROUND_SCAN = 1 << 1, |
| 54 | /** |
| 55 | * Support for link layer stats APIs. |
| 56 | */ |
| 57 | LINK_LAYER_STATS = 1 << 2, |
| 58 | /** |
| 59 | * Support for RSSI monitor APIs. |
| 60 | */ |
| 61 | RSSI_MONITOR = 1 << 3, |
| 62 | /** |
| 63 | * Support for roaming APIs. |
| 64 | */ |
| 65 | CONTROL_ROAMING = 1 << 4, |
| 66 | /** |
| 67 | * Support for Probe IE allow-listing. |
| 68 | */ |
| 69 | PROBE_IE_ALLOWLIST = 1 << 5, |
| 70 | /** |
| 71 | * Support for MAC & Probe Sequence Number randomization. |
| 72 | */ |
| 73 | SCAN_RAND = 1 << 6, |
| 74 | /** |
| 75 | * Support for 5 GHz Band. |
| 76 | */ |
| 77 | STA_5G = 1 << 7, |
| 78 | /** |
| 79 | * Support for GAS/ANQP queries. |
| 80 | */ |
| 81 | HOTSPOT = 1 << 8, |
| 82 | /** |
| 83 | * Support for Preferred Network Offload. |
| 84 | */ |
| 85 | PNO = 1 << 9, |
| 86 | /** |
| 87 | * Support for Tunneled Direct Link Setup. |
| 88 | */ |
| 89 | TDLS = 1 << 10, |
| 90 | /** |
| 91 | * Support for Tunneled Direct Link Setup off channel. |
| 92 | */ |
| 93 | TDLS_OFFCHANNEL = 1 << 11, |
| 94 | /** |
| 95 | * Support for neighbour discovery offload. |
| 96 | */ |
| 97 | ND_OFFLOAD = 1 << 12, |
| 98 | /** |
| 99 | * Support for keep alive packet offload. |
| 100 | */ |
| 101 | KEEP_ALIVE = 1 << 13, |
| 102 | /** |
| 103 | * Support for tracking connection packets' fate. |
| 104 | */ |
| 105 | DEBUG_PACKET_FATE = 1 << 14, |
| 106 | } |
| 107 | |
| 108 | /** |
| 109 | * Get the name of this iface. |
| 110 | * |
| 111 | * @return Name of this iface. |
| 112 | * @throws ServiceSpecificException with one of the following values: |
| 113 | * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID| |
| 114 | */ |
| 115 | String getName(); |
| 116 | |
| 117 | /** |
| 118 | * Configure roaming control parameters. |
| 119 | * Must fail if |StaIfaceCapabilityMask.CONTROL_ROAMING| is not set. |
| 120 | * |
| 121 | * @param config Instance of |StaRoamingConfig|. |
| 122 | * @throws ServiceSpecificException with one of the following values: |
| 123 | * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, |
| 124 | * |WifiStatusCode.ERROR_NOT_SUPPORTED|, |
| 125 | * |WifiStatusCode.ERROR_UNKNOWN| |
| 126 | */ |
| 127 | void configureRoaming(in StaRoamingConfig config); |
| 128 | |
| 129 | /** |
| 130 | * Disable link layer stats collection. |
| 131 | * Must fail if |StaIfaceCapabilityMask.LINK_LAYER_STATS| is not set. |
| 132 | * |
| 133 | * @throws ServiceSpecificException with one of the following values: |
| 134 | * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, |
| 135 | * |WifiStatusCode.ERROR_NOT_SUPPORTED|, |
| 136 | * |WifiStatusCode.ERROR_NOT_STARTED|, |
| 137 | * |WifiStatusCode.ERROR_NOT_AVAILABLE|, |
| 138 | * |WifiStatusCode.ERROR_UNKNOWN| |
| 139 | */ |
| 140 | void disableLinkLayerStatsCollection(); |
| 141 | |
| 142 | /** |
| 143 | * Enable link layer stats collection. |
| 144 | * Must fail if |StaIfaceCapabilityMask.LINK_LAYER_STATS| is not set. |
| 145 | * |
| 146 | * Radio statistics (once started) must not stop until disabled. |
| 147 | * Iface statistics (once started) reset and start afresh after each |
| 148 | * connection until disabled. |
| 149 | * |
| 150 | * @param debug true to enable field debug mode, false to disable. Driver |
| 151 | * must collect all statistics regardless of performance impact. |
| 152 | * @throws ServiceSpecificException with one of the following values: |
| 153 | * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, |
| 154 | * |WifiStatusCode.ERROR_NOT_SUPPORTED|, |
| 155 | * |WifiStatusCode.ERROR_NOT_AVAILABLE|, |
| 156 | * |WifiStatusCode.ERROR_UNKNOWN| |
| 157 | */ |
| 158 | void enableLinkLayerStatsCollection(in boolean debug); |
| 159 | |
| 160 | /** |
| 161 | * Enable/Disable neighbour discovery offload functionality in the firmware. |
| 162 | * |
| 163 | * @param enable true to enable, false to disable. |
| 164 | * @throws ServiceSpecificException with one of the following values: |
| 165 | * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, |
| 166 | * |WifiStatusCode.ERROR_UNKNOWN| |
| 167 | */ |
| 168 | void enableNdOffload(in boolean enable); |
| 169 | |
| 170 | /** |
| 171 | * Used to query additional information about the chip's APF capabilities. |
| 172 | * Must fail if |StaIfaceCapabilityMask.APF| is not set. |
| 173 | * |
| 174 | * @return Instance of |StaApfPacketFilterCapabilities|. |
| 175 | * @throws ServiceSpecificException with one of the following values: |
| 176 | * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, |
| 177 | * |WifiStatusCode.ERROR_NOT_SUPPORTED|, |
| 178 | * |WifiStatusCode.ERROR_NOT_AVAILABLE|, |
| 179 | * |WifiStatusCode.ERROR_UNKNOWN| |
| 180 | */ |
| 181 | StaApfPacketFilterCapabilities getApfPacketFilterCapabilities(); |
| 182 | |
| 183 | /** |
| 184 | * Used to query additional information about the chip's Background Scan capabilities. |
| 185 | * Must fail if |StaIfaceCapabilityMask.BACKGROUND_SCAN| is not set. |
| 186 | * |
| 187 | * @return Instance of |StaBackgroundScanCapabilities| |
| 188 | * @throws ServiceSpecificException with one of the following values: |
| 189 | * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, |
| 190 | * |WifiStatusCode.ERROR_NOT_SUPPORTED|, |
| 191 | * |WifiStatusCode.ERROR_NOT_AVAILABLE|, |
| 192 | * |WifiStatusCode.ERROR_UNKNOWN| |
| 193 | */ |
| 194 | StaBackgroundScanCapabilities getBackgroundScanCapabilities(); |
| 195 | |
| 196 | /** |
| 197 | * Get the capabilities supported by this STA iface. |
| 198 | * |
| 199 | * @return Bitset of |StaIfaceCapabilityMask| values. |
| 200 | * @throws ServiceSpecificException with one of the following values: |
| 201 | * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, |
| 202 | * |WifiStatusCode.ERROR_NOT_AVAILABLE|, |
| 203 | * |WifiStatusCode.ERROR_UNKNOWN| |
| 204 | */ |
| 205 | StaIfaceCapabilityMask getCapabilities(); |
| 206 | |
| 207 | /** |
| 208 | * API to retrieve the fates of inbound packets. |
| 209 | * - HAL implementation must return the fates of |
| 210 | * all the frames received for the most recent association. |
| 211 | * The fate reports must follow the same order as their respective |
| 212 | * packets. |
| 213 | * - HAL implementation may choose (but is not required) to include |
| 214 | * reports for management frames. |
| 215 | * - Packets reported by firmware, but not recognized by driver, |
| 216 | * must be included. However, the ordering of the corresponding |
| 217 | * reports is at the discretion of HAL implementation. |
| 218 | * - Framework must be able to call this API multiple times for the same |
| 219 | * association. |
| 220 | * |
| 221 | * @return Vector of |WifiDebugRxPacketFateReport| instances corresponding |
| 222 | * to the packet fates. |
| 223 | * @throws ServiceSpecificException with one of the following values: |
| 224 | * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, |
| 225 | * |WifiStatusCode.ERROR_NOT_SUPPORTED|, |
| 226 | * |WifiStatusCode.ERROR_NOT_STARTED|, |
| 227 | * |WifiStatusCode.ERROR_NOT_AVAILABLE|, |
| 228 | * |WifiStatusCode.ERROR_UNKNOWN| |
| 229 | */ |
| 230 | WifiDebugRxPacketFateReport[] getDebugRxPacketFates(); |
| 231 | |
| 232 | /** |
| 233 | * API to retrieve fates of outbound packets. |
| 234 | * - HAL implementation must return the fates of |
| 235 | * all the frames transmitted for the most recent association. |
| 236 | * The fate reports must follow the same order as their respective |
| 237 | * packets. |
| 238 | * - HAL implementation may choose (but is not required) to include |
| 239 | * reports for management frames. |
| 240 | * - Packets reported by firmware, but not recognized by driver, |
| 241 | * must be included. However, the ordering of the corresponding |
| 242 | * reports is at the discretion of HAL implementation. |
| 243 | * - Framework must be able to call this API multiple times for the same |
| 244 | * association. |
| 245 | * |
| 246 | * @return Vector of |WifiDebugTxPacketFateReport| instances corresponding |
| 247 | * to the packet fates. |
| 248 | * @throws ServiceSpecificException with one of the following values: |
| 249 | * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, |
| 250 | * |WifiStatusCode.ERROR_NOT_SUPPORTED|, |
| 251 | * |WifiStatusCode.ERROR_NOT_STARTED|, |
| 252 | * |WifiStatusCode.ERROR_NOT_AVAILABLE|, |
| 253 | * |WifiStatusCode.ERROR_UNKNOWN| |
| 254 | */ |
| 255 | WifiDebugTxPacketFateReport[] getDebugTxPacketFates(); |
| 256 | |
| 257 | /** |
| 258 | * Gets the factory MAC address of the STA interface. |
| 259 | * |
| 260 | * @return Factory MAC address of the STA interface. |
| 261 | * @throws ServiceSpecificException with one of the following values: |
| 262 | * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, |
| 263 | * |WifiStatusCode.ERROR_UNKNOWN| |
| 264 | */ |
| 265 | byte[6] getFactoryMacAddress(); |
| 266 | |
| 267 | /** |
| 268 | * Retrieve the latest link layer stats. |
| 269 | * Must fail if |StaIfaceCapabilityMask.LINK_LAYER_STATS| is not set or if |
| 270 | * link layer stats collection hasn't been explicitly enabled. |
| 271 | * |
| 272 | * @return Instance of |LinkLayerStats|. |
| 273 | * @throws ServiceSpecificException with one of the following values: |
| 274 | * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, |
| 275 | * |WifiStatusCode.ERROR_NOT_SUPPORTED|, |
| 276 | * |WifiStatusCode.ERROR_NOT_STARTED|, |
| 277 | * |WifiStatusCode.ERROR_NOT_AVAILABLE|, |
| 278 | * |WifiStatusCode.ERROR_UNKNOWN| |
| 279 | */ |
| 280 | StaLinkLayerStats getLinkLayerStats(); |
| 281 | |
| 282 | /** |
| 283 | * Get roaming control capabilities. |
| 284 | * Must fail if |StaIfaceCapabilityMask.CONTROL_ROAMING| is not set. |
| 285 | * |
| 286 | * @return Instance of |StaRoamingCapabilities|. |
| 287 | * @throws ServiceSpecificException with one of the following values: |
| 288 | * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, |
| 289 | * |WifiStatusCode.ERROR_NOT_SUPPORTED|, |
| 290 | * |WifiStatusCode.ERROR_UNKNOWN| |
| 291 | */ |
| 292 | StaRoamingCapabilities getRoamingCapabilities(); |
| 293 | |
| 294 | /** |
| 295 | * Used to query the list of valid frequencies (depending on the country |
| 296 | * code set) for the provided band. These channels may be specified in the |
| 297 | * |BackgroundScanBucketParameters.frequenciesInMhz| for a background scan |
| 298 | * request. |
| 299 | * |
| 300 | * @param band Band for which the frequency list is being generated. |
| 301 | * @return Vector of valid frequencies for the provided band. |
| 302 | * @throws ServiceSpecificException with one of the following values: |
| 303 | * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, |
| 304 | * |WifiStatusCode.ERROR_NOT_SUPPORTED|, |
| 305 | * |WifiStatusCode.ERROR_NOT_AVAILABLE|, |
| 306 | * |WifiStatusCode.ERROR_UNKNOWN| |
| 307 | */ |
| 308 | int[] getValidFrequenciesForBand(in WifiBand band); |
| 309 | |
| 310 | /** |
| 311 | * Installs an APF program on this iface, replacing an existing |
| 312 | * program if present. |
| 313 | * Must fail if |StaIfaceCapabilityMask.APF| is not set. |
| 314 | * |
| 315 | * APF docs |
| 316 | * ========================================================================== |
| 317 | * APF functionality, instructions and bytecode/binary format is described in: |
| 318 | * http://android.googlesource.com/platform/hardware/google/apf/ |
| 319 | * +/b75c9f3714cfae3dad3d976958e063150781437e/apf.h |
| 320 | * |
| 321 | * The interpreter API is described here: |
| 322 | * http://android.googlesource.com/platform/hardware/google/apf/+/ |
| 323 | * b75c9f3714cfae3dad3d976958e063150781437e/apf_interpreter.h#32 |
| 324 | * |
| 325 | * The assembler/generator API is described in javadocs here: |
| 326 | * http://android.googlesource.com/platform/frameworks/base/+/ |
| 327 | * 4456f33a958a7f09e608399da83c4d12b2e7d191/services/net/java/android/net/ |
| 328 | * apf/ApfGenerator.java |
| 329 | * |
| 330 | * Disassembler usage is described here: |
| 331 | * http://android.googlesource.com/platform/hardware/google/apf/+/ |
| 332 | * b75c9f3714cfae3dad3d976958e063150781437e/apf_disassembler.c#65 |
| 333 | * |
| 334 | * The BPF to APF translator usage is described here: |
| 335 | * http://android.googlesource.com/platform/frameworks/base/+/ |
| 336 | * 4456f33a958a7f09e608399da83c4d12b2e7d191/tests/net/java/android/net/ |
| 337 | * apf/Bpf2Apf.java |
| 338 | * ========================================================================== |
| 339 | * |
| 340 | * @param program APF Program to be set. |
| 341 | * @throws ServiceSpecificException with one of the following values: |
| 342 | * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, |
| 343 | * |WifiStatusCode.ERROR_INVALID_ARGS|, |
| 344 | * |WifiStatusCode.ERROR_NOT_SUPPORTED|, |
| 345 | * |WifiStatusCode.ERROR_NOT_AVAILABLE|, |
| 346 | * |WifiStatusCode.ERROR_UNKNOWN| |
| 347 | */ |
| 348 | void installApfPacketFilter(in byte[] program); |
| 349 | |
| 350 | /** |
| 351 | * Fetches a consistent snapshot of the entire APF program and working |
| 352 | * memory buffer and returns it to the host. The returned buffer contains |
| 353 | * both code and data. Its length must match the most recently returned |
| 354 | * |StaApfPacketFilterCapabilities.maxLength|. |
| 355 | * |
| 356 | * While the snapshot is being fetched, the APF interpreter must not execute |
| 357 | * and all incoming packets must be passed to the host as if there was no |
| 358 | * APF program installed. |
| 359 | * |
| 360 | * Must fail with |WifiStatusCode.ERROR_NOT_SUPPORTED| if |
| 361 | * |StaIfaceCapabilityMask.APF| is not set. |
| 362 | * |
| 363 | * @return The entire APF working memory buffer when status is |
| 364 | * |WifiStatusCode.SUCCESS|, empty otherwise. |
| 365 | * @throws ServiceSpecificException with one of the following values: |
| 366 | * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, |
| 367 | * |WifiStatusCode.ERROR_NOT_SUPPORTED|, |
| 368 | * |WifiStatusCode.ERROR_NOT_AVAILABLE|, |
| 369 | * |WifiStatusCode.ERROR_UNKNOWN| |
| 370 | * @see getApfPacketFilterCapabilities() |
| 371 | * @see installApfPacketFilter() |
| 372 | */ |
| 373 | byte[] readApfPacketFilterData(); |
| 374 | |
| 375 | /** |
| 376 | * Requests notifications of significant events on this iface. Multiple calls |
| 377 | * to this must register multiple callbacks, each of which must receive all |
| 378 | * events. |
| 379 | * |
| 380 | * @param callback An instance of the |IWifiStaIfaceEventCallback| AIDL |
| 381 | * interface object. |
| 382 | * @throws ServiceSpecificException with one of the following values: |
| 383 | * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID| |
| 384 | */ |
| 385 | void registerEventCallback(in IWifiStaIfaceEventCallback callback); |
| 386 | |
| 387 | /** |
| 388 | * Changes the MAC address of the STA Interface to the given |
| 389 | * MAC address. |
| 390 | * |
| 391 | * @param mac MAC address to change to. |
| 392 | * @throws ServiceSpecificException with one of the following values: |
| 393 | * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, |
| 394 | * |WifiStatusCode.ERROR_UNKNOWN| |
| 395 | */ |
| 396 | void setMacAddress(in byte[6] mac); |
| 397 | |
| 398 | /** |
| 399 | * Set the roaming control state with the parameters configured |
| 400 | * using |configureRoaming|. Depending on the roaming state set, the |
| 401 | * driver/firmware would enable/disable control over roaming decisions. |
| 402 | * Must fail if |StaIfaceCapabilityMask.CONTROL_ROAMING| is not set. |
| 403 | * |
| 404 | * @param state State of the roaming control. |
| 405 | * @throws ServiceSpecificException with one of the following values: |
| 406 | * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, |
| 407 | * |WifiStatusCode.ERROR_NOT_SUPPORTED|, |
| 408 | * |WifiStatusCode.ERROR_BUSY|, |
| 409 | * |WifiStatusCode.ERROR_UNKNOWN| |
| 410 | */ |
| 411 | void setRoamingState(in StaRoamingState state); |
| 412 | |
| 413 | /** |
| 414 | * Turn on/off scan only mode for the interface. |
| 415 | * |
| 416 | * @param enable True to enable scan only mode, false to disable. |
| 417 | * @throws ServiceSpecificException with one of the following values: |
| 418 | * |WifiStatusCode.ERROR_NOT_SUPPORTED|, |
| 419 | * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, |
| 420 | * |WifiStatusCode.FAILURE_UNKNOWN| |
| 421 | */ |
| 422 | void setScanMode(in boolean enable); |
| 423 | |
| 424 | /** |
| 425 | * Start a background scan using the given cmdId as an identifier. Only one |
| 426 | * active background scan need be supported. |
| 427 | * Must fail if |StaIfaceCapabilityMask.BACKGROUND_SCAN| is not set. |
| 428 | * |
| 429 | * When this is called all requested buckets must be scanned, starting the |
| 430 | * beginning of the cycle. |
| 431 | * |
| 432 | * For example: |
| 433 | * If there are two buckets specified |
| 434 | * - Bucket 1: period=10s |
| 435 | * - Bucket 2: period=20s |
| 436 | * - Bucket 3: period=30s |
| 437 | * Then the following scans must occur |
| 438 | * - t=0 buckets 1, 2, and 3 are scanned |
| 439 | * - t=10 bucket 1 is scanned |
| 440 | * - t=20 bucket 1 and 2 are scanned |
| 441 | * - t=30 bucket 1 and 3 are scanned |
| 442 | * - t=40 bucket 1 and 2 are scanned |
| 443 | * - t=50 bucket 1 is scanned |
| 444 | * - t=60 buckets 1, 2, and 3 are scanned |
| 445 | * - and the pattern repeats |
| 446 | * |
| 447 | * If any scan does not occur or is incomplete (error, interrupted, etc), |
| 448 | * then a cached scan result must still be recorded with the |
| 449 | * WIFI_SCAN_FLAG_INTERRUPTED flag set. |
| 450 | * |
| 451 | * @param cmdId Command Id to use for this invocation. |
| 452 | * @param params Background scan parameters. |
| 453 | * @throws ServiceSpecificException with one of the following values: |
| 454 | * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, |
| 455 | * |WifiStatusCode.ERROR_INVALID_ARGS|, |
| 456 | * |WifiStatusCode.ERROR_NOT_SUPPORTED|, |
| 457 | * |WifiStatusCode.ERROR_NOT_AVAILABLE|, |
| 458 | * |WifiStatusCode.ERROR_UNKNOWN| |
| 459 | */ |
| 460 | void startBackgroundScan(in int cmdId, in StaBackgroundScanParameters params); |
| 461 | |
| 462 | /** |
| 463 | * API to start packet fate monitoring. |
| 464 | * - Once started, monitoring must remain active until HAL is stopped or the |
| 465 | * chip is reconfigured. |
| 466 | * - When HAL is unloaded, all packet fate buffers must be cleared. |
| 467 | * - The packet fates are used to monitor the state of packets transmitted/ |
| 468 | * received during association. |
| 469 | * |
| 470 | * @throws ServiceSpecificException with one of the following values: |
| 471 | * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, |
| 472 | * |WifiStatusCode.ERROR_NOT_SUPPORTED|, |
| 473 | * |WifiStatusCode.ERROR_NOT_AVAILABLE|, |
| 474 | * |WifiStatusCode.ERROR_UNKNOWN| |
| 475 | */ |
| 476 | void startDebugPacketFateMonitoring(); |
| 477 | |
| 478 | /** |
| 479 | * Start RSSI monitoring on the currently connected access point. |
| 480 | * Once the monitoring is enabled, the |
| 481 | * |IWifiStaIfaceEventCallback.onRssiThresholdBreached| callback must be |
| 482 | * invoked to indicate if the RSSI goes above |maxRssi| or below |minRssi|. |
| 483 | * Must fail if |StaIfaceCapabilityMask.RSSI_MONITOR| is not set. |
| 484 | * |
| 485 | * @param cmdId Command Id to use for this invocation. |
| 486 | * @param maxRssi Maximum RSSI threshold. |
| 487 | * @param minRssi Minimum RSSI threshold. |
| 488 | * @throws ServiceSpecificException with one of the following values: |
| 489 | * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, |
| 490 | * |WifiStatusCode.ERROR_ARGS_INVALID|, |
| 491 | * |WifiStatusCode.ERROR_NOT_SUPPORTED|, |
| 492 | * |WifiStatusCode.ERROR_NOT_AVAILABLE|, |
| 493 | * |WifiStatusCode.ERROR_UNKNOWN| |
| 494 | */ |
| 495 | void startRssiMonitoring(in int cmdId, in int maxRssi, in int minRssi); |
| 496 | |
| 497 | /** |
| 498 | * Start sending the specified keep alive packets periodically. |
| 499 | * |
| 500 | * @param cmdId Command Id to use for this invocation. |
| 501 | * @param ipPacketData IP packet contents to be transmitted. |
| 502 | * @param etherType 16 bit ether type to be set in the ethernet frame |
| 503 | * transmitted. |
| 504 | * @param srcAddress Source MAC address of the packet. |
| 505 | * @param dstAddress Destination MAC address of the packet. |
| 506 | * @param periodInMs Interval at which this packet must be transmitted. |
| 507 | * @throws ServiceSpecificException with one of the following values: |
| 508 | * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, |
| 509 | * |WifiStatusCode.ERROR_NOT_SUPPORTED|, |
| 510 | * |WifiStatusCode.ERROR_NOT_AVAILABLE|, |
| 511 | * |WifiStatusCode.ERROR_UNKNOWN| |
| 512 | */ |
| 513 | void startSendingKeepAlivePackets(in int cmdId, in byte[] ipPacketData, in char etherType, |
| 514 | in byte[6] srcAddress, in byte[6] dstAddress, in int periodInMs); |
| 515 | |
| 516 | /** |
| 517 | * Stop the current background scan. |
| 518 | * Must fail if |StaIfaceCapabilityMask.BACKGROUND_SCAN| is not set. |
| 519 | * |
| 520 | * @param cmdId Command Id corresponding to the request. |
| 521 | * @throws ServiceSpecificException with one of the following values: |
| 522 | * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, |
| 523 | * |WifiStatusCode.ERROR_NOT_SUPPORTED|, |
| 524 | * |WifiStatusCode.ERROR_NOT_STARTED|, |
| 525 | * |WifiStatusCode.ERROR_NOT_AVAILABLE|, |
| 526 | * |WifiStatusCode.ERROR_UNKNOWN| |
| 527 | */ |
| 528 | void stopBackgroundScan(in int cmdId); |
| 529 | |
| 530 | /** |
| 531 | * Stop RSSI monitoring. |
| 532 | * Must fail if |StaIfaceCapabilityMask.RSSI_MONITOR| is not set. |
| 533 | * |
| 534 | * @param cmdId Command Id corresponding to the request. |
| 535 | * @throws ServiceSpecificException with one of the following values: |
| 536 | * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, |
| 537 | * |WifiStatusCode.ERROR_NOT_SUPPORTED|, |
| 538 | * |WifiStatusCode.ERROR_NOT_STARTED|, |
| 539 | * |WifiStatusCode.ERROR_NOT_AVAILABLE|, |
| 540 | * |WifiStatusCode.ERROR_UNKNOWN| |
| 541 | */ |
| 542 | void stopRssiMonitoring(in int cmdId); |
| 543 | |
| 544 | /** |
| 545 | * Stop sending the specified keep alive packets. |
| 546 | * |
| 547 | * @param cmdId Command Id corresponding to the request. |
| 548 | * @throws ServiceSpecificException with one of the following values: |
| 549 | * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, |
| 550 | * |WifiStatusCode.ERROR_NOT_SUPPORTED|, |
| 551 | * |WifiStatusCode.ERROR_NOT_AVAILABLE|, |
| 552 | * |WifiStatusCode.ERROR_UNKNOWN| |
| 553 | */ |
| 554 | void stopSendingKeepAlivePackets(in int cmdId); |
| 555 | } |