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.RttBw; |
| 20 | import android.hardware.wifi.RttPeerType; |
| 21 | import android.hardware.wifi.RttPreamble; |
| 22 | import android.hardware.wifi.RttType; |
| 23 | import android.hardware.wifi.WifiChannelInfo; |
| 24 | |
| 25 | /** |
| 26 | * RTT configuration. |
| 27 | */ |
| 28 | @VintfStability |
| 29 | parcelable RttConfig { |
| 30 | /** |
| 31 | * Peer device mac address. |
| 32 | */ |
| 33 | byte[6] addr; |
| 34 | /** |
| 35 | * 1-sided or 2-sided RTT. |
| 36 | */ |
| 37 | RttType type; |
| 38 | /** |
| 39 | * Optional peer device hint (STA, P2P, AP). |
| 40 | */ |
| 41 | RttPeerType peer; |
| 42 | /** |
| 43 | * Required for STA-AP mode, optional for P2P, NBD etc. |
| 44 | */ |
| 45 | WifiChannelInfo channel; |
| 46 | /** |
| 47 | * Time interval between bursts (units: 100 ms). |
| 48 | * Applies to 1-sided and 2-sided RTT multi-burst requests. |
| 49 | * Range: 0-31, 0: no preference by initiator (2-sided RTT). |
| 50 | */ |
| 51 | int burstPeriod; |
| 52 | /** |
| 53 | * Total number of RTT bursts to be executed. Will be |
| 54 | * specified in the same way as the parameter "Number of |
| 55 | * Burst Exponent" found in the FTM frame format. This |
| 56 | * applies to both 1-sided RTT and 2-sided RTT. Valid |
| 57 | * values are 0 to 15 as defined in 802.11mc std. |
| 58 | * 0 means single shot. |
| 59 | * The implication of this parameter on the maximum |
| 60 | * number of RTT results is the following: |
| 61 | * for 1-sided RTT: max num of RTT results = (2^num_burst)*(num_frames_per_burst) |
| 62 | * for 2-sided RTT: max num of RTT results = (2^num_burst)*(num_frames_per_burst - 1) |
| 63 | */ |
| 64 | int numBurst; |
| 65 | /** |
| 66 | * Number of frames per burst. |
| 67 | * Minimum value = 1, Maximum value = 31 |
| 68 | * For 2-sided, this equals the number of FTM frames |
| 69 | * to be attempted in a single burst. This also |
| 70 | * equals the number of FTM frames that the |
| 71 | * initiator will request that the responder sends |
| 72 | * in a single frame. |
| 73 | */ |
| 74 | int numFramesPerBurst; |
| 75 | /** |
| 76 | * Number of retries for a failed RTT frame. |
| 77 | * Applies to 1-sided RTT only. Minimum value = 0, Maximum value = 3 |
| 78 | */ |
| 79 | int numRetriesPerRttFrame; |
| 80 | /** |
| 81 | * The following fields are only valid for 2-side RTT. |
| 82 | * |
| 83 | * |
| 84 | * Maximum number of retries that the initiator can |
| 85 | * retry an FTMR frame. |
| 86 | * Minimum value = 0, Maximum value = 3 |
| 87 | */ |
| 88 | int numRetriesPerFtmr; |
| 89 | /** |
| 90 | * Whether to request location civic info or not. |
| 91 | */ |
| 92 | boolean mustRequestLci; |
| 93 | /** |
| 94 | * Whether to request location civic records or not. |
| 95 | */ |
| 96 | boolean mustRequestLcr; |
| 97 | /** |
| 98 | * Applies to 1-sided and 2-sided RTT. Valid values will |
| 99 | * be 2-11 and 15 as specified by the 802.11mc std for |
| 100 | * the FTM parameter burst duration. In a multi-burst |
| 101 | * request, if responder overrides with larger value, |
| 102 | * the initiator will return failure. In a single-burst |
| 103 | * request, if responder overrides with larger value, |
| 104 | * the initiator will send TMR_STOP to terminate RTT |
| 105 | * at the end of the burst_duration it requested. |
| 106 | */ |
| 107 | int burstDuration; |
| 108 | /** |
| 109 | * RTT preamble to be used in the RTT frames. |
| 110 | */ |
| 111 | RttPreamble preamble; |
| 112 | /** |
| 113 | * RTT BW to be used in the RTT frames. |
| 114 | */ |
| 115 | RttBw bw; |
| 116 | } |