Add ieee80211.az APIs
Updated-Overlayable: TRUE
Bug: 295619650
Test: atest FrameworksWifiApiTests
BYPASS_INCLUSIVE_LANGUAGE_REASON=HE refers to High Efficiency.
Change-Id: I069cb245de85e9f20d69a6163934c18f0abf621f
diff --git a/flags/wifi_flags.aconfig b/flags/wifi_flags.aconfig
index 76a2645..1fb14cc 100644
--- a/flags/wifi_flags.aconfig
+++ b/flags/wifi_flags.aconfig
@@ -86,6 +86,13 @@
}
flag {
+ name: "rtt_11az_ntb_ranging_support"
+ namespace: "wifi"
+ description: "Control the IEEE802.11az NTB ranging support for RTT"
+ bug: "305067231"
+}
+
+flag {
name: "anqp_request_wait_for_response"
namespace: "wifi"
description: "Make the ANQP request in a queue and wait for the previous response before trigger the next request"
diff --git a/framework/api/current.txt b/framework/api/current.txt
index d53c7c8..de6ba73 100644
--- a/framework/api/current.txt
+++ b/framework/api/current.txt
@@ -52,6 +52,7 @@
method @NonNull public int[] getSecurityTypes();
method @Nullable public android.net.wifi.WifiSsid getWifiSsid();
method public int getWifiStandard();
+ method @FlaggedApi("com.android.wifi.flags.rtt_11az_ntb_ranging_support") public boolean is80211azNtbResponder();
method public boolean is80211mcResponder();
method public boolean isPasspointNetwork();
method public void writeToParcel(android.os.Parcel, int);
@@ -1645,13 +1646,19 @@
public final class RangingResult implements android.os.Parcelable {
method public int describeContents();
+ method @FlaggedApi("com.android.wifi.flags.rtt_11az_ntb_ranging_support") public int get80211azInitiatorTxLtfRepetitionsCount();
+ method @FlaggedApi("com.android.wifi.flags.rtt_11az_ntb_ranging_support") public int get80211azNumberOfRxSpatialStreams();
+ method @FlaggedApi("com.android.wifi.flags.rtt_11az_ntb_ranging_support") public int get80211azNumberOfTxSpatialStreams();
+ method @FlaggedApi("com.android.wifi.flags.rtt_11az_ntb_ranging_support") public int get80211azResponderTxLtfRepetitionsCount();
method public int getDistanceMm();
method public int getDistanceStdDevMm();
method @FlaggedApi("com.android.wifi.flags.ranging_result_builder") @NonNull public byte[] getLci();
method @FlaggedApi("com.android.wifi.flags.ranging_result_builder") @NonNull public byte[] getLcr();
method @Nullable public android.net.MacAddress getMacAddress();
+ method @FlaggedApi("com.android.wifi.flags.rtt_11az_ntb_ranging_support") public long getMaxTimeBetweenNtbMeasurementsMicros();
method public int getMeasurementBandwidth();
method public int getMeasurementChannelFrequencyMHz();
+ method @FlaggedApi("com.android.wifi.flags.rtt_11az_ntb_ranging_support") public long getMinTimeBetweenNtbMeasurementsMicros();
method public int getNumAttemptedMeasurements();
method public int getNumSuccessfulMeasurements();
method @Nullable public android.net.wifi.aware.PeerHandle getPeerHandle();
@@ -1659,6 +1666,7 @@
method public int getRssi();
method public int getStatus();
method @Nullable public android.net.wifi.rtt.ResponderLocation getUnverifiedResponderLocation();
+ method @FlaggedApi("com.android.wifi.flags.rtt_11az_ntb_ranging_support") public boolean is80211azNtbMeasurement();
method public boolean is80211mcMeasurement();
method public void writeToParcel(android.os.Parcel, int);
field @NonNull public static final android.os.Parcelable.Creator<android.net.wifi.rtt.RangingResult> CREATOR;
@@ -1671,14 +1679,21 @@
@FlaggedApi("com.android.wifi.flags.ranging_result_builder") public static final class RangingResult.Builder {
ctor public RangingResult.Builder();
method @FlaggedApi("com.android.wifi.flags.ranging_result_builder") @NonNull public android.net.wifi.rtt.RangingResult build();
+ method @FlaggedApi("com.android.wifi.flags.rtt_11az_ntb_ranging_support") @NonNull public android.net.wifi.rtt.RangingResult.Builder set80211azInitiatorTxLtfRepetitionsCount(int);
+ method @FlaggedApi("com.android.wifi.flags.rtt_11az_ntb_ranging_support") @NonNull public android.net.wifi.rtt.RangingResult.Builder set80211azNtbMeasurement(boolean);
+ method @FlaggedApi("com.android.wifi.flags.rtt_11az_ntb_ranging_support") @NonNull public android.net.wifi.rtt.RangingResult.Builder set80211azNumberOfRxSpatialStreams(int);
+ method @FlaggedApi("com.android.wifi.flags.rtt_11az_ntb_ranging_support") @NonNull public android.net.wifi.rtt.RangingResult.Builder set80211azNumberOfTxSpatialStreams(int);
+ method @FlaggedApi("com.android.wifi.flags.rtt_11az_ntb_ranging_support") @NonNull public android.net.wifi.rtt.RangingResult.Builder set80211azResponderTxLtfRepetitionsCount(int);
method @FlaggedApi("com.android.wifi.flags.ranging_result_builder") @NonNull public android.net.wifi.rtt.RangingResult.Builder set80211mcMeasurement(boolean);
method @FlaggedApi("com.android.wifi.flags.ranging_result_builder") @NonNull public android.net.wifi.rtt.RangingResult.Builder setDistanceMm(int);
method @FlaggedApi("com.android.wifi.flags.ranging_result_builder") @NonNull public android.net.wifi.rtt.RangingResult.Builder setDistanceStdDevMm(int);
method @FlaggedApi("com.android.wifi.flags.ranging_result_builder") @NonNull public android.net.wifi.rtt.RangingResult.Builder setLci(@Nullable byte[]);
method @FlaggedApi("com.android.wifi.flags.ranging_result_builder") @NonNull public android.net.wifi.rtt.RangingResult.Builder setLcr(@Nullable byte[]);
method @FlaggedApi("com.android.wifi.flags.ranging_result_builder") @NonNull public android.net.wifi.rtt.RangingResult.Builder setMacAddress(@Nullable android.net.MacAddress);
+ method @FlaggedApi("com.android.wifi.flags.rtt_11az_ntb_ranging_support") @NonNull public android.net.wifi.rtt.RangingResult.Builder setMaxTimeBetweenNtbMeasurementsMicros(long);
method @FlaggedApi("com.android.wifi.flags.ranging_result_builder") @NonNull public android.net.wifi.rtt.RangingResult.Builder setMeasurementBandwidth(int);
method @FlaggedApi("com.android.wifi.flags.ranging_result_builder") @NonNull public android.net.wifi.rtt.RangingResult.Builder setMeasurementChannelFrequencyMHz(int);
+ method @FlaggedApi("com.android.wifi.flags.rtt_11az_ntb_ranging_support") @NonNull public android.net.wifi.rtt.RangingResult.Builder setMinTimeBetweenNtbMeasurementsMicros(long);
method @FlaggedApi("com.android.wifi.flags.ranging_result_builder") @NonNull public android.net.wifi.rtt.RangingResult.Builder setNumAttemptedMeasurements(int);
method @FlaggedApi("com.android.wifi.flags.ranging_result_builder") @NonNull public android.net.wifi.rtt.RangingResult.Builder setNumSuccessfulMeasurements(int);
method @FlaggedApi("com.android.wifi.flags.ranging_result_builder") @NonNull public android.net.wifi.rtt.RangingResult.Builder setPeerHandle(@Nullable android.net.wifi.aware.PeerHandle);
@@ -1706,6 +1721,7 @@
method @Nullable public android.net.MacAddress getMacAddress();
method public int getPreamble();
method public int getResponderType();
+ method @FlaggedApi("com.android.wifi.flags.rtt_11az_ntb_ranging_support") public boolean is80211azNtbSupported();
method public boolean is80211mcSupported();
method public void writeToParcel(@NonNull android.os.Parcel, int);
field @NonNull public static final android.os.Parcelable.Creator<android.net.wifi.rtt.ResponderConfig> CREATOR;
@@ -1716,6 +1732,7 @@
public static final class ResponderConfig.Builder {
ctor public ResponderConfig.Builder();
method @NonNull public android.net.wifi.rtt.ResponderConfig build();
+ method @FlaggedApi("com.android.wifi.flags.rtt_11az_ntb_ranging_support") @NonNull public android.net.wifi.rtt.ResponderConfig.Builder set80211azNtbSupported(boolean);
method @NonNull public android.net.wifi.rtt.ResponderConfig.Builder set80211mcSupported(boolean);
method @NonNull public android.net.wifi.rtt.ResponderConfig.Builder setCenterFreq0Mhz(@IntRange(from=0) int);
method @NonNull public android.net.wifi.rtt.ResponderConfig.Builder setCenterFreq1Mhz(@IntRange(from=0) int);
@@ -1773,6 +1790,7 @@
field public static final String ACTION_WIFI_RTT_STATE_CHANGED = "android.net.wifi.rtt.action.WIFI_RTT_STATE_CHANGED";
field public static final String CHARACTERISTICS_KEY_BOOLEAN_LCI = "key_lci";
field public static final String CHARACTERISTICS_KEY_BOOLEAN_LCR = "key_lcr";
+ field @FlaggedApi("com.android.wifi.flags.rtt_11az_ntb_ranging_support") public static final String CHARACTERISTICS_KEY_BOOLEAN_NTB_INITIATOR = "key_ntb_initiator";
field public static final String CHARACTERISTICS_KEY_BOOLEAN_ONE_SIDED_RTT = "key_one_sided_rtt";
field public static final String CHARACTERISTICS_KEY_BOOLEAN_STA_RESPONDER = "key_sta_responder";
}
diff --git a/framework/api/system-current.txt b/framework/api/system-current.txt
index dd54a2b..acece6a 100644
--- a/framework/api/system-current.txt
+++ b/framework/api/system-current.txt
@@ -1615,6 +1615,7 @@
field @Nullable public final android.net.wifi.aware.PeerHandle peerHandle;
field public final int preamble;
field public final int responderType;
+ field @FlaggedApi("com.android.wifi.flags.rtt_11az_ntb_ranging_support") public final boolean supports80211azNtb;
field public final boolean supports80211mc;
}
diff --git a/framework/java/android/net/wifi/ScanResult.java b/framework/java/android/net/wifi/ScanResult.java
index 27a5163..251e5e4 100644
--- a/framework/java/android/net/wifi/ScanResult.java
+++ b/framework/java/android/net/wifi/ScanResult.java
@@ -16,6 +16,7 @@
package android.net.wifi;
+import android.annotation.FlaggedApi;
import android.annotation.IntDef;
import android.annotation.IntRange;
import android.annotation.NonNull;
@@ -729,6 +730,9 @@
/** {@hide} */
public static final long FLAG_80211mc_RESPONDER = 0x0000000000000002;
+ /** @hide */
+ public static final long FLAG_80211az_NTB_RESPONDER = 0x0000000000000004;
+
/*
* These flags are specific to the ScanResult class, and are not related to the |flags|
* field of the per-BSS scan results from WPA supplicant.
@@ -762,6 +766,14 @@
return (flags & FLAG_80211mc_RESPONDER) != 0;
}
+ /**
+ * @return whether AP is a IEEE802.11az Non-Trigger based Ranging Responder.
+ */
+ @FlaggedApi("com.android.wifi.flags.rtt_11az_ntb_ranging_support")
+ public boolean is80211azNtbResponder() {
+ return (flags & FLAG_80211az_NTB_RESPONDER) != 0;
+ }
+
public boolean isPasspointNetwork() {
return (flags & FLAG_PASSPOINT_NETWORK) != 0;
}
@@ -1431,6 +1443,7 @@
private int mCenterFreq0 = UNSPECIFIED;
private int mCenterFreq1 = UNSPECIFIED;
private boolean mIs80211McRTTResponder = false;
+ private boolean mIs80211azNtbRTTResponder = false;
/** @hide */
@NonNull
@@ -1524,6 +1537,13 @@
}
/** @hide */
+ @NonNull
+ public Builder setIs80211azNtbRTTResponder(boolean is80211azNtbRTTResponder) {
+ mIs80211azNtbRTTResponder = is80211azNtbRTTResponder;
+ return this;
+ }
+
+ /** @hide */
public Builder(WifiSsid wifiSsid, String bssid) {
mWifiSsid = wifiSsid;
mBssid = bssid;
@@ -1567,6 +1587,7 @@
this.centerFreq1 = builder.mCenterFreq1;
this.flags = 0;
this.flags |= (builder.mIs80211McRTTResponder) ? FLAG_80211mc_RESPONDER : 0;
+ this.flags |= (builder.mIs80211azNtbRTTResponder) ? FLAG_80211az_NTB_RESPONDER : 0;
this.radioChainInfos = null;
this.mApMldMacAddress = null;
}
@@ -1749,6 +1770,9 @@
sb.append(", standard: ").append(wifiStandardToString(mWifiStandard));
sb.append(", 80211mcResponder: ");
sb.append(((flags & FLAG_80211mc_RESPONDER) != 0) ? "is supported" : "is not supported");
+ sb.append(", 80211azNtbResponder: ");
+ sb.append(
+ ((flags & FLAG_80211az_NTB_RESPONDER) != 0) ? "is supported" : "is not supported");
sb.append(", Radio Chain Infos: ").append(Arrays.toString(radioChainInfos));
sb.append(", interface name: ").append(ifaceName);
diff --git a/framework/java/android/net/wifi/rtt/RangingRequest.java b/framework/java/android/net/wifi/rtt/RangingRequest.java
index aebe0d3..303a484 100644
--- a/framework/java/android/net/wifi/rtt/RangingRequest.java
+++ b/framework/java/android/net/wifi/rtt/RangingRequest.java
@@ -190,6 +190,8 @@
* {@link #getMaxRttBurstSize()} inclusively, or a
* {@link java.lang.IllegalArgumentException} will be thrown.
*
+ * Note: RTT burst size is only applicable for IEEE 802.11mc based ranging request.
+ *
* @param rttBurstSize The number of FTM packets used to estimate a range.
* @return The builder to facilitate chaining
* {@code builder.setXXX(..).setXXX(..)}.
@@ -208,10 +210,15 @@
* which to measure range. The total number of peers added to a request cannot exceed the
* limit specified by {@link #getMaxPeers()}.
* <p>
- * Two-sided Ranging will be supported if the Access Point supports IEEE 802.11mc, also
- * known as two-sided RTT, and this is determined by the method
- * {@link ScanResult#is80211mcResponder()}. If not supported, one-sided RTT will be
- * performed with no correction for the AP packet turnaround time.
+ * Two-sided Ranging will be performed if the local device and the AP support IEEE 802.11az
+ * (non-trigger based ranging) or IEEE 802.11mc. AP capability is determined by the method
+ * {@link ScanResult#is80211azNtbResponder()} or {@link ScanResult#is80211mcResponder()}.
+ *
+ * If both 11az and 11mc are supported by the local device and the AP, 11az non-trigger
+ * based ranging will be performed.
+ *
+ * If two-sided ranging is not supported, one-sided RTT will be performed with no
+ * correction for the AP packet turnaround time.
*
* @param apInfo Information about an Access Point (AP) obtained in a Scan Result.
* @return The builder to facilitate chaining
@@ -230,10 +237,15 @@
* which to measure range. The total number of peers added to a request cannot exceed the
* limit specified by {@link #getMaxPeers()}.
* <p>
- * Two-sided Ranging will be supported if the Access Point supports IEEE 802.11mc, also
- * known as two-sided RTT, and this is determined by the method
- * {@link ScanResult#is80211mcResponder()}. If not supported, one-sided RTT will be
- * performed with no correction for the AP packet turnaround time.
+ * Two-sided Ranging will be performed if the local device and the AP support IEEE 802.11az
+ * (non-trigger based ranging) or IEEE 802.11mc. AP capability is determined by the method
+ * {@link ScanResult#is80211azNtbResponder()} or {@link ScanResult#is80211mcResponder()}.
+ *
+ * If both 11az and 11mc are supported by the local device and the AP, 11az non-trigger
+ * based ranging will be performed.
+ *
+ * If two-sided ranging is not supported, one-sided RTT will be performed with no
+ * correction for the AP packet turnaround time.
*
* @param apInfos Information about Access Points (APs) obtained in a Scan Result.
* @return The builder to facilitate chaining
@@ -255,10 +267,15 @@
* with which to measure range. The total number of peers added to the request cannot exceed
* the limit specified by {@link #getMaxPeers()}.
* <p>
- * Two-sided Ranging will be supported if an Access Point supports IEEE 802.11mc, also
- * known as two-sided RTT, and this is specified in the {@link ResponderConfig} builder.
- * If not supported, one-sided RTT will be performed with no correction for
- * the AP packet turnaround time.
+ * Two-sided Ranging will be performed if the local device and the AP support IEEE 802.11az
+ * (non-trigger based ranging) or IEEE 802.11mc. AP capability is determined by the method
+ * {@link ScanResult#is80211azNtbResponder()} or {@link ScanResult#is80211mcResponder()}.
+ *
+ * If both 11az and 11mc are supported by the local device and the AP, 11az non-trigger
+ * based ranging will be performed.
+ *
+ * If two-sided ranging is not supported, one-sided RTT will be performed with no
+ * correction for the AP packet turnaround time.
*
* @param responder Information on the RTT Responder.
* @return The builder, to facilitate chaining {@code builder.setXXX(..).setXXX(..)}.
@@ -278,10 +295,15 @@
* which to measure range. The total number of peers added to a request cannot exceed the
* limit specified by {@link #getMaxPeers()}.
* <p>
- * Two-sided Ranging will be supported if an Access Point supports IEEE 802.11mc, also
- * known as two-sided RTT, and this is specified in the {@link ResponderConfig} builder.
- * If not supported, one-sided RTT will be performed with no correction for the AP packet
- * turnaround time.
+ * Two-sided Ranging will be performed if the local device and the AP support IEEE 802.11az
+ * (non-trigger based ranging) or IEEE 802.11mc. AP capability is determined by the method
+ * {@link ScanResult#is80211azNtbResponder()} or {@link ScanResult#is80211mcResponder()}.
+ *
+ * If both 11az and 11mc are supported by the local device and the AP, 11az non-trigger
+ * based ranging will be performed.
+ *
+ * If two-sided ranging is not supported, one-sided RTT will be performed with no
+ * correction for the AP packet turnaround time.
*
* @param responders Information representing the set of access points to be ranged
* @return The builder to facilitate chaining
@@ -299,17 +321,18 @@
}
/**
- * Add the non-802.11mc capable device specified by the {@link ScanResult} to the list of
- * devices with which to measure range. The total number of peers added to a request cannot
- * exceed the limit specified by {@link #getMaxPeers()}.
+ * Add the non-802.11mc and non-802.11az capable device specified by the {@link ScanResult}
+ * to the list of devices with which to measure range. The total number of peers added to a
+ * request cannot exceed the limit specified by {@link #getMaxPeers()}.
* <p>
- * Accurate ranging cannot be supported if the Access Point does not support IEEE 802.11mc,
- * and instead an alternate protocol called one-sided RTT will be used with lower
- * accuracy. Use {@link ScanResult#is80211mcResponder()} to verify the Access Point)s) are
- * not 802.11mc capable.
+ * Accurate ranging cannot be supported if the Access Point does not support IEEE 802.11mc
+ * and IEEE 802.11az, and instead an alternate protocol called one-sided RTT will be used
+ * with lower accuracy. Use {@link ScanResult#is80211mcResponder()} to verify the Access
+ * Point(s) are not 802.11mc capable. Use {@link ScanResult#is80211azNtbResponder()} ()} to
+ * verify the Access Point)s) are not 802.11az capable.
* <p>
* One-sided RTT does not subtract the RTT turnaround time at the Access Point, which can
- * add hundreds of meters to the estimate. With experimentation it is possible to use this
+ * add hundreds of meters to the estimate. With experimentation, it is possible to use this
* information to make a statistical estimate of the range by taking multiple measurements
* to several Access Points and normalizing the result. For some applications this can be
* used to improve range estimates based on Receive Signal Strength Indication (RSSI), but
@@ -327,24 +350,26 @@
if (apInfo == null) {
throw new IllegalArgumentException("Null ScanResult!");
}
- if (apInfo.is80211mcResponder()) {
- throw new IllegalArgumentException("AP supports the 802.11mc protocol.");
+ if (apInfo.is80211mcResponder() || apInfo.is80211azNtbResponder()) {
+ throw new IllegalArgumentException(
+ "AP supports the 802.11mc or 8022.11az protocol.");
}
return addResponder(ResponderConfig.fromScanResult(apInfo));
}
/**
- * Add the non-802.11mc capable devices specified by the {@link ScanResult} to the list of
- * devices with which to measure range. The total number of peers added to a request cannot
- * exceed the limit specified by {@link #getMaxPeers()}.
+ * Add the non-802.11mc and non-802.11az capable devices specified by the {@link ScanResult}
+ * to the list of devices with which to measure range. The total number of peers added to a
+ * request cannot exceed the limit specified by {@link #getMaxPeers()}.
* <p>
- * Accurate ranging cannot be supported if the Access Point does not support IEEE 802.11mc,
- * and instead an alternate protocol called one-sided RTT will be used with lower
- * accuracy. Use {@link ScanResult#is80211mcResponder()} to verify the Access Point)s) are
- * not 802.11mc capable.
+ * Accurate ranging cannot be supported if the Access Point does not support IEEE 802.11mc
+ * and IEEE 802.11az, and instead an alternate protocol called one-sided RTT will be used
+ * with lower accuracy. Use {@link ScanResult#is80211mcResponder()} to verify the Access
+ * Point(s) are not 802.11mc capable. Use {@link ScanResult#is80211azNtbResponder()} ()} to
+ * verify the Access Point(s) are not 802.11az capable.
* <p>
* One-sided RTT does not subtract the RTT turnaround time at the Access Point, which can
- * add hundreds of meters to the estimate. With experimentation it is possible to use this
+ * add hundreds of meters to the estimate. With experimentation, it is possible to use this
* information to make a statistical estimate of the range by taking multiple measurements
* to several Access Points and normalizing the result. For some applications this can be
* used to improve range estimates based on Receive Signal Strength Indication (RSSI), but
@@ -363,9 +388,9 @@
throw new IllegalArgumentException("Null list of ScanResults!");
}
for (ScanResult scanResult : apInfos) {
- if (scanResult.is80211mcResponder()) {
+ if (scanResult.is80211mcResponder() || scanResult.is80211azNtbResponder()) {
throw new IllegalArgumentException(
- "At least one AP supports the 802.11mc protocol.");
+ "At least one AP supports the 802.11mc or 802.11az protocol.");
}
addAccessPoint(scanResult);
}
diff --git a/framework/java/android/net/wifi/rtt/RangingResult.java b/framework/java/android/net/wifi/rtt/RangingResult.java
index 550b21d..5744c6d 100644
--- a/framework/java/android/net/wifi/rtt/RangingResult.java
+++ b/framework/java/android/net/wifi/rtt/RangingResult.java
@@ -27,6 +27,8 @@
import android.os.Parcel;
import android.os.Parcelable;
+import com.android.wifi.flags.Flags;
+
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.util.Arrays;
@@ -94,6 +96,13 @@
private final boolean mIs80211mcMeasurement;
private final int mFrequencyMHz;
private final int mPacketBw;
+ private final boolean mIs80211azNtbMeasurement;
+ private final long mNtbMinMeasurementTime;
+ private final long mNtbMaxMeasurementTime;
+ private final int mI2rTxLtfRepetitions;
+ private final int mR2iTxLtfRepetitions;
+ private final int mNumTxSpatialStreams;
+ private final int mNumRxSpatialStreams;
/**
* Builder class used to construct {@link RangingResult} objects.
@@ -115,6 +124,13 @@
private boolean mIs80211mcMeasurement = false;
private int mFrequencyMHz = UNSPECIFIED;
private int mPacketBw = UNSPECIFIED;
+ private boolean mIs80211azNtbMeasurement = false;
+ private long mNtbMinMeasurementTime = UNSPECIFIED;
+ private long mNtbMaxMeasurementTime = UNSPECIFIED;
+ private int mI2rTxLtfRepetitions = UNSPECIFIED;
+ private int mR2iTxLtfRepetitions = UNSPECIFIED;
+ private int mNumTxSpatialStreams = UNSPECIFIED;
+ private int mNumRxSpatialStreams = UNSPECIFIED;
/**
* Sets the Range result status from {@link RangeResultStatus}.
@@ -299,10 +315,12 @@
/**
- * Sets whether IEEE 802.11mc measurement or not.
+ * Sets whether the ranging measurement was performed using IEEE 802.11mc ranging method.
+ * If {@link #set80211mcMeasurement(boolean)} is set as false and
+ * {@link #set80211azNtbMeasurement(boolean)} is also set as false, ranging measurement was
+ * performed using one-side RTT. If not set, default to false.
*
- * @param is80211mcMeasurement true for IEEE 802.11mc measure, otherwise false. If not set
- * defaults to false.
+ * @param is80211mcMeasurement true for IEEE 802.11mc measure, otherwise false.
* @return The builder to facilitate chaining.
*/
@FlaggedApi("com.android.wifi.flags.ranging_result_builder")
@@ -314,9 +332,10 @@
/**
* Sets the center frequency of the primary 20 MHz frequency (in MHz) of the channel over
- * which the measurement frames are sent.
+ * which the measurement frames are sent. If not set, default to
+ * {@link RangingResult#UNSPECIFIED}
*
- * @param frequencyMHz Frequency. If not set, default to {@link RangingResult#UNSPECIFIED}
+ * @param frequencyMHz Frequency.
* @return The builder to facilitate chaining.
*/
@FlaggedApi("com.android.wifi.flags.ranging_result_builder")
@@ -327,10 +346,10 @@
}
/**
- * Sets the bandwidth used to transmit the RTT measurement frame.
+ * Sets the bandwidth used to transmit the RTT measurement frame. If not set, default to
+ * {@link RangingResult#UNSPECIFIED}.
*
- * @param measurementBandwidth Measurement bandwidth. If not set, default to
- * {@link RangingResult#UNSPECIFIED}
+ * @param measurementBandwidth Measurement bandwidth.
* @return The builder to facilitate chaining.
*/
@FlaggedApi("com.android.wifi.flags.ranging_result_builder")
@@ -341,6 +360,107 @@
}
/**
+ * Sets whether the ranging measurement was performed using IEEE 802.11az non-trigger
+ * ranging method. If {@link #set80211azNtbMeasurement(boolean)} is set as false and
+ * {@link #set80211mcMeasurement(boolean)} is also set as false, ranging measurement was
+ * performed using one-side RTT. If not set defaults to false.
+ *
+ * @param is80211azNtbMeasurement true for IEEE 802.11az non-trigger based measurement,
+ * otherwise false.
+ * @return The builder to facilitate chaining.
+ */
+ @FlaggedApi(Flags.FLAG_RTT_11AZ_NTB_RANGING_SUPPORT)
+ @NonNull
+ public Builder set80211azNtbMeasurement(boolean is80211azNtbMeasurement) {
+ mIs80211azNtbMeasurement = is80211azNtbMeasurement;
+ return this;
+ }
+
+ /**
+ * Sets minimum time between measurements in microseconds for IEEE 802.11az non-trigger
+ * based ranging. If not set, defaults to {@link RangingResult#UNSPECIFIED}.
+ *
+ * @param ntbMinMeasurementTime non-trigger based ranging minimum measurement time.
+ * @return The builder to facilitate chaining.
+ */
+ @FlaggedApi(Flags.FLAG_RTT_11AZ_NTB_RANGING_SUPPORT)
+ @NonNull
+ public Builder setMinTimeBetweenNtbMeasurementsMicros(long ntbMinMeasurementTime) {
+ mNtbMinMeasurementTime = ntbMinMeasurementTime;
+ return this;
+ }
+
+ /**
+ * Sets maximum time between measurements in microseconds for IEEE 802.11az non-trigger
+ * based ranging. If not set, defaults to {@link RangingResult#UNSPECIFIED}.
+ *
+ * @param ntbMaxMeasurementTime non-trigger based ranging maximum measurement time.
+ * @return The builder to facilitate chaining.
+ */
+ @FlaggedApi(Flags.FLAG_RTT_11AZ_NTB_RANGING_SUPPORT)
+ @NonNull
+ public Builder setMaxTimeBetweenNtbMeasurementsMicros(long ntbMaxMeasurementTime) {
+ mNtbMaxMeasurementTime = ntbMaxMeasurementTime;
+ return this;
+ }
+
+ /**
+ * Sets LTF repetitions that the initiator station used in the preamble. If not set,
+ * defaults to {@link RangingResult#UNSPECIFIED}.
+ *
+ * @param i2rTxLtfRepetitions LFT repetition count.
+ * @return The builder to facilitate chaining.
+ */
+ @FlaggedApi(Flags.FLAG_RTT_11AZ_NTB_RANGING_SUPPORT)
+ @NonNull
+ public Builder set80211azInitiatorTxLtfRepetitionsCount(int i2rTxLtfRepetitions) {
+ mI2rTxLtfRepetitions = i2rTxLtfRepetitions;
+ return this;
+ }
+
+ /**
+ * Sets LTF repetitions that the responder station used in the preamble. If not set,
+ * defaults to {@link RangingResult#UNSPECIFIED}.
+ *
+ * @param r2iTxLtfRepetitions LFT repetition count.
+ * @return The builder to facilitate chaining.
+ */
+ @FlaggedApi(Flags.FLAG_RTT_11AZ_NTB_RANGING_SUPPORT)
+ @NonNull
+ public Builder set80211azResponderTxLtfRepetitionsCount(int r2iTxLtfRepetitions) {
+ mR2iTxLtfRepetitions = r2iTxLtfRepetitions;
+ return this;
+ }
+
+ /**
+ * Sets number of transmit spatial streams that the initiator station used for the
+ * ranging result. If not set, defaults to {@link RangingResult#UNSPECIFIED}.
+ *
+ * @param numTxSpatialStreams Number of transmit spatial streams.
+ * @return The builder to facilitate chaining.
+ */
+ @FlaggedApi(Flags.FLAG_RTT_11AZ_NTB_RANGING_SUPPORT)
+ @NonNull
+ public Builder set80211azNumberOfTxSpatialStreams(int numTxSpatialStreams) {
+ mNumTxSpatialStreams = numTxSpatialStreams;
+ return this;
+ }
+
+ /**
+ * Sets number of receive spatial streams that the initiator station used for the ranging
+ * result. If not set, defaults to {@link RangingResult#UNSPECIFIED}.
+ *
+ * @param numRxSpatialStreams Number of receive spatial streams.
+ * @return The builder to facilitate chaining.
+ */
+ @FlaggedApi(Flags.FLAG_RTT_11AZ_NTB_RANGING_SUPPORT)
+ @NonNull
+ public Builder set80211azNumberOfRxSpatialStreams(int numRxSpatialStreams) {
+ mNumRxSpatialStreams = numRxSpatialStreams;
+ return this;
+ }
+
+ /**
* Build {@link RangingResult}
* @return an instance of {@link RangingResult}
*/
@@ -350,6 +470,11 @@
if (mMac == null && mPeerHandle == null) {
throw new IllegalArgumentException("Either MAC address or Peer handle is needed");
}
+ if (mIs80211azNtbMeasurement && mIs80211mcMeasurement) {
+ throw new IllegalArgumentException(
+ "A ranging result cannot use both IEEE 802.11mc and IEEE 802.11az "
+ + "measurements simultaneously");
+ }
return new RangingResult(this);
}
}
@@ -371,6 +496,13 @@
mIs80211mcMeasurement = builder.mIs80211mcMeasurement;
mFrequencyMHz = builder.mFrequencyMHz;
mPacketBw = builder.mPacketBw;
+ mIs80211azNtbMeasurement = builder.mIs80211azNtbMeasurement;
+ mNtbMinMeasurementTime = builder.mNtbMinMeasurementTime;
+ mNtbMaxMeasurementTime = builder.mNtbMaxMeasurementTime;
+ mI2rTxLtfRepetitions = builder.mI2rTxLtfRepetitions;
+ mR2iTxLtfRepetitions = builder.mR2iTxLtfRepetitions;
+ mNumRxSpatialStreams = builder.mNumRxSpatialStreams;
+ mNumTxSpatialStreams = builder.mNumTxSpatialStreams;
}
/**
@@ -570,9 +702,9 @@
}
/**
- * @return The result is true if the IEEE 802.11mc protocol was used (also known as
- * two-sided RTT). If the result is false, a one-side RTT result is provided which does not
- * subtract the turnaround time at the responder.
+ * @return The result is true if the IEEE 802.11mc protocol was used. If the result is false,
+ * and {@link #is80211azNtbMeasurement()} is also false a one-side RTT result is provided
+ * which does not subtract the turnaround time at the responder.
* <p>
* Only valid if {@link #getStatus()} returns {@link #STATUS_SUCCESS}, otherwise will throw an
* exception.
@@ -587,6 +719,101 @@
}
/**
+ * @return The result is true if the IEEE 802.11az non-trigger based protocol was used. If the
+ * result is false, and {@link #is80211mcMeasurement()} is also false a one-side RTT result
+ * is provided which does not subtract the turnaround time at the responder.
+ * <p>.
+ * Only valid if {@link #getStatus()} returns {@link #STATUS_SUCCESS}, otherwise will throw an
+ * exception.
+ */
+ @FlaggedApi(Flags.FLAG_RTT_11AZ_NTB_RANGING_SUPPORT)
+ public boolean is80211azNtbMeasurement() {
+ if (mStatus != STATUS_SUCCESS) {
+ throw new IllegalStateException(
+ "is80211azNtbMeasurement(): invoked on an invalid result: getStatus()="
+ + mStatus);
+ }
+ return mIs80211azNtbMeasurement;
+ }
+
+ /**
+ * Gets minimum time between measurements in microseconds for IEEE 802.11az non-trigger based
+ * ranging.
+ *
+ * The next 11az ranging measurement request must be invoked after the minimum time from the
+ * last measurement time {@link #getRangingTimestampMillis()} for the peer. Otherwise, cached
+ * ranging result will be returned for the peer.
+ */
+ @FlaggedApi(Flags.FLAG_RTT_11AZ_NTB_RANGING_SUPPORT)
+ public long getMinTimeBetweenNtbMeasurementsMicros() {
+ return mNtbMinMeasurementTime;
+ }
+
+ /**
+ * Gets maximum time between measurements in microseconds for IEEE 802.11az non-trigger based
+ * ranging.
+ *
+ * The next 11az ranging request needs to be invoked before the maximum time from the last
+ * measurement time {@link #getRangingTimestampMillis()}. Otherwise, the non-trigger based
+ * ranging session will be terminated and a new ranging negotiation will happen with
+ * the responding station.
+ */
+ @FlaggedApi(Flags.FLAG_RTT_11AZ_NTB_RANGING_SUPPORT)
+ public long getMaxTimeBetweenNtbMeasurementsMicros() {
+ return mNtbMaxMeasurementTime;
+ }
+
+ /**
+ * Gets LTF repetitions that the responder station (RSTA) used in the preamble of the
+ * responder to initiator (I2R) null data PPDU (NDP) for this result.
+ *
+ * LTF repetitions is the multiple transmissions of HE-LTF symbols in an HE ranging NDP. An
+ * HE-LTF repetition value of 1 indicates no repetitions.
+ *
+ * @return LTF repetitions count
+ */
+ @FlaggedApi(Flags.FLAG_RTT_11AZ_NTB_RANGING_SUPPORT)
+ public int get80211azResponderTxLtfRepetitionsCount() {
+ return mR2iTxLtfRepetitions;
+ }
+
+ /**
+ * Gets LTF repetitions that the initiator station (ISTA) used in the preamble of the
+ * initiator to responder (I2R) null data PPDU (NDP) for this result.
+ *
+ * LTF repetitions is the multiple transmissions of HE-LTF symbols in an HE ranging NDP. An
+ * HE-LTF repetition value of 1 indicates no repetitions.
+ *
+ * @return LTF repetitions count
+ */
+ @FlaggedApi(Flags.FLAG_RTT_11AZ_NTB_RANGING_SUPPORT)
+ public int get80211azInitiatorTxLtfRepetitionsCount() {
+ return mI2rTxLtfRepetitions;
+ }
+
+ /**
+ * Gets number of transmit spatial streams that the initiator station (ISTA) used for the
+ * initiator to responder (I2R) null data PPDU (NDP) for this result.
+ *
+ * @return Number of spatial streams
+ */
+ @FlaggedApi(Flags.FLAG_RTT_11AZ_NTB_RANGING_SUPPORT)
+ public int get80211azNumberOfTxSpatialStreams() {
+ return mNumTxSpatialStreams;
+ }
+
+ /**
+ * Gets number of receive spatial streams that the initiator station (ISTA) used for the
+ * initiator to responder (I2R) null data PPDU (NDP) for this result.
+ *
+ * @return Number of spatial streams
+ */
+ @FlaggedApi(Flags.FLAG_RTT_11AZ_NTB_RANGING_SUPPORT)
+ public int get80211azNumberOfRxSpatialStreams() {
+ return mNumRxSpatialStreams;
+ }
+
+ /**
* The center frequency of the primary 20 MHz frequency (in MHz) of the channel over
* which the measurement frames are sent.
* @return center frequency in Mhz of the channel if available, otherwise {@link #UNSPECIFIED}
@@ -656,6 +883,13 @@
dest.writeBoolean(mIs80211mcMeasurement);
dest.writeInt(mFrequencyMHz);
dest.writeInt(mPacketBw);
+ dest.writeBoolean(mIs80211azNtbMeasurement);
+ dest.writeLong(mNtbMinMeasurementTime);
+ dest.writeLong(mNtbMaxMeasurementTime);
+ dest.writeInt(mI2rTxLtfRepetitions);
+ dest.writeInt(mR2iTxLtfRepetitions);
+ dest.writeInt(mNumTxSpatialStreams);
+ dest.writeInt(mNumRxSpatialStreams);
}
public static final @android.annotation.NonNull Creator<RangingResult> CREATOR =
@@ -686,6 +920,13 @@
.set80211mcMeasurement(in.readBoolean())
.setMeasurementChannelFrequencyMHz(in.readInt())
.setMeasurementBandwidth(in.readInt())
+ .set80211azNtbMeasurement(in.readBoolean())
+ .setMinTimeBetweenNtbMeasurementsMicros(in.readLong())
+ .setMaxTimeBetweenNtbMeasurementsMicros(in.readLong())
+ .set80211azInitiatorTxLtfRepetitionsCount(in.readInt())
+ .set80211azResponderTxLtfRepetitionsCount(in.readInt())
+ .set80211azNumberOfTxSpatialStreams(in.readInt())
+ .set80211azNumberOfRxSpatialStreams(in.readInt())
.build();
}
};
@@ -709,6 +950,13 @@
.append(mIs80211mcMeasurement)
.append(", frequencyMHz=").append(mFrequencyMHz)
.append(", packetBw=").append(mPacketBw)
+ .append("is80211azNtbMeasurement").append(mIs80211azNtbMeasurement)
+ .append("ntbMinMeasurementTime").append(mNtbMinMeasurementTime)
+ .append("ntbMaxMeasurementTime").append(mNtbMaxMeasurementTime)
+ .append("i2rTxLtfRepetitions").append(mI2rTxLtfRepetitions)
+ .append("r2iTxLtfRepetitions").append(mR2iTxLtfRepetitions)
+ .append("txSpatialStreams").append(mNumTxSpatialStreams)
+ .append("rxSpatialStreams").append(mNumRxSpatialStreams)
.append("]").toString();
}
@@ -734,7 +982,14 @@
&& mIs80211mcMeasurement == lhs.mIs80211mcMeasurement
&& Objects.equals(mResponderLocation, lhs.mResponderLocation)
&& mFrequencyMHz == lhs.mFrequencyMHz
- && mPacketBw == lhs.mPacketBw;
+ && mPacketBw == lhs.mPacketBw
+ && mIs80211azNtbMeasurement == lhs.mIs80211azNtbMeasurement
+ && mNtbMinMeasurementTime == lhs.mNtbMinMeasurementTime
+ && mNtbMaxMeasurementTime == lhs.mNtbMaxMeasurementTime
+ && mI2rTxLtfRepetitions == lhs.mI2rTxLtfRepetitions
+ && mR2iTxLtfRepetitions == lhs.mR2iTxLtfRepetitions
+ && mNumTxSpatialStreams == lhs.mNumTxSpatialStreams
+ && mNumRxSpatialStreams == lhs.mNumRxSpatialStreams;
}
@Override
@@ -742,6 +997,8 @@
return Objects.hash(mStatus, mMac, mPeerHandle, mDistanceMm, mDistanceStdDevMm, mRssi,
mNumAttemptedMeasurements, mNumSuccessfulMeasurements, Arrays.hashCode(mLci),
Arrays.hashCode(mLcr), mResponderLocation, mTimestamp, mIs80211mcMeasurement,
- mFrequencyMHz, mPacketBw);
+ mFrequencyMHz, mPacketBw, mIs80211azNtbMeasurement, mNtbMinMeasurementTime,
+ mNtbMaxMeasurementTime, mI2rTxLtfRepetitions, mR2iTxLtfRepetitions,
+ mNumTxSpatialStreams, mR2iTxLtfRepetitions);
}
}
diff --git a/framework/java/android/net/wifi/rtt/ResponderConfig.java b/framework/java/android/net/wifi/rtt/ResponderConfig.java
index 1bf4b3d..a40bda1 100644
--- a/framework/java/android/net/wifi/rtt/ResponderConfig.java
+++ b/framework/java/android/net/wifi/rtt/ResponderConfig.java
@@ -22,6 +22,7 @@
import static android.net.wifi.ScanResult.InformationElement.EID_HT_CAPABILITIES;
import static android.net.wifi.ScanResult.InformationElement.EID_VHT_CAPABILITIES;
+import android.annotation.FlaggedApi;
import android.annotation.IntDef;
import android.annotation.IntRange;
import android.annotation.NonNull;
@@ -35,6 +36,8 @@
import android.os.Parcelable;
import android.util.Log;
+import com.android.wifi.flags.Flags;
+
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.util.Objects;
@@ -180,6 +183,9 @@
@SystemApi
public static final int PREAMBLE_EHT = 4;
+ private static final long DEFAULT_NTB_MIN_TIME_BETWEEN_MEASUREMENTS_MICROS = 250000;
+ private static final long DEFAULT_NTB_MAX_TIME_BETWEEN_MEASUREMENTS_MICROS = 15000000;
+
/**
* The MAC address of the Responder. Will be null if a Wi-Fi Aware peer identifier (the
* peerHandle field) ise used to identify the Responder.
@@ -211,6 +217,14 @@
public final boolean supports80211mc;
/**
+ * Indicates whether the Responder device supports IEEE 802.11az non-trigger based ranging.
+ * @hide
+ */
+ @SystemApi
+ @FlaggedApi(Flags.FLAG_RTT_11AZ_NTB_RANGING_SUPPORT)
+ public final boolean supports80211azNtb;
+
+ /**
* Responder channel bandwidth, specified using {@link ChannelWidth}.
* @hide
*/
@@ -248,6 +262,9 @@
@SystemApi
public final int preamble;
+ private long mNtbMinMeasurementTime = DEFAULT_NTB_MIN_TIME_BETWEEN_MEASUREMENTS_MICROS;
+ private long mNtbMaxMeasurementTime = DEFAULT_NTB_MAX_TIME_BETWEEN_MEASUREMENTS_MICROS;
+
/**
* Constructs Responder configuration from the builder
* @param builder See {@link Builder}
@@ -262,11 +279,14 @@
this.peerHandle = builder.mPeerHandle;
this.responderType = builder.mResponderType;
this.supports80211mc = builder.mSupports80211Mc;
+ this.supports80211azNtb = builder.mSupports80211azNtb;
this.channelWidth = builder.mChannelWidth;
this.frequency = builder.mFrequency;
this.centerFreq0 = builder.mCenterFreq0;
this.centerFreq1 = builder.mCenterFreq1;
this.preamble = builder.mPreamble;
+ this.mNtbMinMeasurementTime = builder.mNtbMinMeasurementTime;
+ this.mNtbMaxMeasurementTime = builder.mNtbMaxMeasurementTime;
}
/**
@@ -309,6 +329,9 @@
this.centerFreq0 = centerFreq0;
this.centerFreq1 = centerFreq1;
this.preamble = preamble;
+ this.supports80211azNtb = false;
+ this.mNtbMinMeasurementTime = DEFAULT_NTB_MIN_TIME_BETWEEN_MEASUREMENTS_MICROS;
+ this.mNtbMaxMeasurementTime = DEFAULT_NTB_MAX_TIME_BETWEEN_MEASUREMENTS_MICROS;
}
/**
@@ -346,6 +369,9 @@
this.centerFreq0 = centerFreq0;
this.centerFreq1 = centerFreq1;
this.preamble = preamble;
+ this.supports80211azNtb = false;
+ this.mNtbMinMeasurementTime = DEFAULT_NTB_MIN_TIME_BETWEEN_MEASUREMENTS_MICROS;
+ this.mNtbMaxMeasurementTime = DEFAULT_NTB_MAX_TIME_BETWEEN_MEASUREMENTS_MICROS;
}
/**
@@ -387,6 +413,9 @@
this.centerFreq0 = centerFreq0;
this.centerFreq1 = centerFreq1;
this.preamble = preamble;
+ this.supports80211azNtb = false;
+ this.mNtbMinMeasurementTime = DEFAULT_NTB_MIN_TIME_BETWEEN_MEASUREMENTS_MICROS;
+ this.mNtbMaxMeasurementTime = DEFAULT_NTB_MAX_TIME_BETWEEN_MEASUREMENTS_MICROS;
}
/**
@@ -398,6 +427,7 @@
MacAddress macAddress = MacAddress.fromString(scanResult.BSSID);
int responderType = RESPONDER_AP;
boolean supports80211mc = scanResult.is80211mcResponder();
+ boolean supports80211azNtbRanging = scanResult.is80211azNtbResponder();
int channelWidth = scanResult.channelWidth;
int frequency = scanResult.frequency;
int centerFreq0 = scanResult.centerFreq0;
@@ -449,6 +479,7 @@
.setMacAddress(macAddress)
.setResponderType(responderType)
.set80211mcSupported(supports80211mc)
+ .set80211azNtbSupported(supports80211azNtbRanging)
.setChannelWidth(channelWidth)
.setFrequencyMhz(frequency)
.setCenterFreq0Mhz(centerFreq0)
@@ -555,6 +586,15 @@
}
/**
+ * @return true if the Responder supports the 802.11az non-trigger based ranging protocol,
+ * false otherwise.
+ */
+ @FlaggedApi(Flags.FLAG_RTT_11AZ_NTB_RANGING_SUPPORT)
+ public boolean is80211azNtbSupported() {
+ return supports80211azNtb;
+ }
+
+ /**
* AP Channel bandwidth; one of {@link ScanResult#CHANNEL_WIDTH_20MHZ},
* {@link ScanResult#CHANNEL_WIDTH_40MHZ},
* {@link ScanResult#CHANNEL_WIDTH_80MHZ}, {@link ScanResult#CHANNEL_WIDTH_160MHZ},
@@ -616,6 +656,40 @@
}
/**
+ * Gets the minimum time between IEEE 802.11az non-trigger based ranging measurements in
+ * microseconds for the responder.
+ *
+ * @hide
+ */
+ public long getNtbMinTimeBetweenMeasurementsMicros() {
+ return mNtbMinMeasurementTime;
+ }
+
+ /**
+ * Gets the maximum time between IEEE 802.11az non-trigger based ranging measurements in
+ * microseconds for the responder.
+ *
+ * @hide
+ */
+ public long getNtbMaxTimeBetweenMeasurementsMicros() {
+ return mNtbMaxMeasurementTime;
+ }
+
+ /**
+ * @hide
+ */
+ public void setNtbMinTimeBetweenMeasurementsMicros(long ntbMinMeasurementTime) {
+ this.mNtbMinMeasurementTime = ntbMinMeasurementTime;
+ }
+
+ /**
+ * @hide
+ */
+ public void setNtbMaxTimeBetweenMeasurementsMicros(long ntbMaxMeasurementTime) {
+ this.mNtbMaxMeasurementTime = ntbMaxMeasurementTime;
+ }
+
+ /**
* Builder class used to construct {@link ResponderConfig} objects.
*/
public static final class Builder {
@@ -623,11 +697,14 @@
private PeerHandle mPeerHandle;
private @ResponderType int mResponderType = RESPONDER_AP;
private boolean mSupports80211Mc = true;
+ private boolean mSupports80211azNtb = false;
private @ChannelWidth int mChannelWidth = CHANNEL_WIDTH_20MHZ;
private int mFrequency = 0;
private int mCenterFreq0 = 0;
private int mCenterFreq1 = 0;
private @PreambleType int mPreamble = PREAMBLE_LEGACY;
+ private long mNtbMinMeasurementTime = DEFAULT_NTB_MIN_TIME_BETWEEN_MEASUREMENTS_MICROS;
+ private long mNtbMaxMeasurementTime = DEFAULT_NTB_MAX_TIME_BETWEEN_MEASUREMENTS_MICROS;
/**
* Sets the Responder MAC Address.
@@ -671,6 +748,23 @@
}
/**
+ * Sets an indication the access point can to respond to the IEEE 802.11az non-trigger
+ * based ranging protocol, but, if false, indicates only IEEE 802.11mc or one-sided Wi-Fi
+ * RTT is possible.
+ *
+ * @param supports80211azNtb the ability to support the IEEE 802.11az non-trigger based
+ * ranging protocol
+ * @return the builder to facilitate chaining
+ * {@code builder.setXXX(..).setXXX(..)}.
+ */
+ @FlaggedApi(Flags.FLAG_RTT_11AZ_NTB_RANGING_SUPPORT)
+ @NonNull
+ public Builder set80211azNtbSupported(boolean supports80211azNtb) {
+ this.mSupports80211azNtb = supports80211azNtb;
+ return this;
+ }
+
+ /**
* Sets the channel bandwidth in MHz.
*
* @param channelWidth the bandwidth of the channel in MHz
@@ -768,6 +862,53 @@
}
/**
+ * Sets the minimum time between IEEE 802.11az non-trigger based ranging measurements in
+ * microseconds for the responder.
+ *
+ * Note: This should be a multiple of 100 microseconds as per IEEE 802.11 az standard.
+ *
+ * @param ntbMinMeasurementTime Minimum time between non-trigger based IEEE 802.11az
+ * ranging measurements in units of 100 microseconds. Range of
+ * values (0, 419430400).
+ * @hide
+ */
+ public Builder setNtbMinTimeBetweenMeasurementsMicros(long ntbMinMeasurementTime) {
+ if (mNtbMinMeasurementTime == 0 || mNtbMinMeasurementTime >= 419430400) {
+ throw new IllegalArgumentException(
+ "Should be a non-zero number less than 419430400 microseconds");
+ }
+ if (mNtbMinMeasurementTime % 100 != 0) {
+ throw new IllegalArgumentException("Should be a multiple of 100 microseconds");
+ }
+ mNtbMinMeasurementTime = ntbMinMeasurementTime;
+ return this;
+ }
+
+ /**
+ * Sets the maximum time between IEEE 802.11az non-trigger based ranging measurements in
+ * microseconds for the responder.
+ *
+ * Note: This should be a multiple of 10000 microseconds (10 milliseconds) as per
+ * IEEE 802.11 az standard.
+ *
+ * @param ntbMaxMeasurementTime Maximum time between non-trigger based IEEE 802.11az
+ * ranging measurements in units of 10000 microseconds. Range
+ * of values (0, 5242880000).
+ * @hide
+ */
+ public Builder setNtbMaxTimeBetweenMeasurementsMicros(long ntbMaxMeasurementTime) {
+ if (mNtbMaxMeasurementTime % 10000 != 0) {
+ throw new IllegalArgumentException("Should be a multiple of 10000 microseconds");
+ }
+ if (mNtbMaxMeasurementTime == 0 || mNtbMaxMeasurementTime >= 5242880000L) {
+ throw new IllegalArgumentException(
+ "Should be a non-zero number less than 5242880000 microseconds");
+ }
+ mNtbMaxMeasurementTime = ntbMaxMeasurementTime;
+ return this;
+ }
+
+ /**
* Build {@link ResponderConfig} given the current configurations made on the builder.
* @return an instance of {@link ResponderConfig}
*/
@@ -811,11 +952,14 @@
}
dest.writeInt(responderType);
dest.writeBoolean(supports80211mc);
+ dest.writeBoolean(supports80211azNtb);
dest.writeInt(channelWidth);
dest.writeInt(frequency);
dest.writeInt(centerFreq0);
dest.writeInt(centerFreq1);
dest.writeInt(preamble);
+ dest.writeLong(mNtbMinMeasurementTime);
+ dest.writeLong(mNtbMaxMeasurementTime);
}
public static final @android.annotation.NonNull Creator<ResponderConfig> CREATOR = new Creator<ResponderConfig>() {
@@ -836,24 +980,20 @@
if (peerHandlePresent) {
peerHandle = new PeerHandle(in.readInt());
}
- int responderType = in.readInt();
- boolean supports80211mc = in.readBoolean();
- int channelWidth = in.readInt();
- int frequency = in.readInt();
- int centerFreq0 = in.readInt();
- int centerFreq1 = in.readInt();
- int preamble = in.readInt();
return new ResponderConfig.Builder()
.setMacAddress(macAddress)
.setPeerHandle(peerHandle)
- .setResponderType(responderType)
- .set80211mcSupported(supports80211mc)
- .setChannelWidth(channelWidth)
- .setFrequencyMhz(frequency)
- .setCenterFreq0Mhz(centerFreq0)
- .setCenterFreq1Mhz(centerFreq1)
- .setPreamble(preamble)
+ .setResponderType(in.readInt())
+ .set80211mcSupported(in.readBoolean())
+ .set80211azNtbSupported(in.readBoolean())
+ .setChannelWidth(in.readInt())
+ .setFrequencyMhz(in.readInt())
+ .setCenterFreq0Mhz(in.readInt())
+ .setCenterFreq1Mhz(in.readInt())
+ .setPreamble(in.readInt())
+ .setNtbMinTimeBetweenMeasurementsMicros(in.readLong())
+ .setNtbMaxTimeBetweenMeasurementsMicros(in.readLong())
.build();
}
};
@@ -874,24 +1014,34 @@
lhs.peerHandle) && responderType == lhs.responderType
&& supports80211mc == lhs.supports80211mc && channelWidth == lhs.channelWidth
&& frequency == lhs.frequency && centerFreq0 == lhs.centerFreq0
- && centerFreq1 == lhs.centerFreq1 && preamble == lhs.preamble;
+ && centerFreq1 == lhs.centerFreq1 && preamble == lhs.preamble
+ && supports80211azNtb == lhs.supports80211azNtb
+ && mNtbMinMeasurementTime == lhs.mNtbMinMeasurementTime
+ && mNtbMaxMeasurementTime == lhs.mNtbMaxMeasurementTime;
}
@Override
public int hashCode() {
return Objects.hash(macAddress, peerHandle, responderType, supports80211mc, channelWidth,
- frequency, centerFreq0, centerFreq1, preamble);
+ frequency, centerFreq0, centerFreq1, preamble, supports80211azNtb,
+ mNtbMinMeasurementTime, mNtbMaxMeasurementTime);
}
@Override
public String toString() {
- return new StringBuffer("ResponderConfig: macAddress=").append(macAddress).append(
- ", peerHandle=").append(peerHandle == null ? "<null>" : peerHandle.peerId).append(
- ", responderType=").append(responderType).append(", supports80211mc=").append(
- supports80211mc).append(", channelWidth=").append(channelWidth).append(
- ", frequency=").append(frequency).append(", centerFreq0=").append(
- centerFreq0).append(", centerFreq1=").append(centerFreq1).append(
- ", preamble=").append(preamble).toString();
+ return new StringBuffer("ResponderConfig: macAddress=").append(macAddress)
+ .append(", peerHandle=").append(peerHandle == null ? "<null>" : peerHandle.peerId)
+ .append(", responderType=").append(responderType)
+ .append(", supports80211mc=").append(supports80211mc)
+ .append(", channelWidth=").append(channelWidth)
+ .append(", frequency=").append(frequency)
+ .append(", centerFreq0=").append(centerFreq0)
+ .append(", centerFreq1=").append(centerFreq1)
+ .append(", preamble=").append(preamble)
+ .append(", supports80211azNtb=").append(supports80211azNtb)
+ .append(", mNtbMinMeasurementTime ").append(mNtbMinMeasurementTime)
+ .append(", mNtbMaxMeasurementTime ").append(mNtbMaxMeasurementTime)
+ .toString();
}
/**
diff --git a/framework/java/android/net/wifi/rtt/WifiRttManager.java b/framework/java/android/net/wifi/rtt/WifiRttManager.java
index 69bf608..7ac1f91 100644
--- a/framework/java/android/net/wifi/rtt/WifiRttManager.java
+++ b/framework/java/android/net/wifi/rtt/WifiRttManager.java
@@ -23,6 +23,7 @@
import static android.Manifest.permission.NEARBY_WIFI_DEVICES;
import android.annotation.CallbackExecutor;
+import android.annotation.FlaggedApi;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.RequiresPermission;
@@ -108,12 +109,19 @@
*/
public static final String CHARACTERISTICS_KEY_BOOLEAN_STA_RESPONDER = "key_sta_responder";
+ /**
+ * Bundle key to access if device supports to be a IEEE 802.11az non-trigger based initiator
+ */
+ @FlaggedApi("com.android.wifi.flags.rtt_11az_ntb_ranging_support")
+ public static final String CHARACTERISTICS_KEY_BOOLEAN_NTB_INITIATOR = "key_ntb_initiator";
+
/** @hide */
@StringDef(prefix = { "CHARACTERISTICS_KEY_"}, value = {
CHARACTERISTICS_KEY_BOOLEAN_ONE_SIDED_RTT,
CHARACTERISTICS_KEY_BOOLEAN_LCI,
CHARACTERISTICS_KEY_BOOLEAN_LCR,
CHARACTERISTICS_KEY_BOOLEAN_STA_RESPONDER,
+ CHARACTERISTICS_KEY_BOOLEAN_NTB_INITIATOR,
})
@Retention(RetentionPolicy.SOURCE)
public @interface RttCharacteristicsKey {}
diff --git a/framework/tests/src/android/net/wifi/ScanResultTest.java b/framework/tests/src/android/net/wifi/ScanResultTest.java
index 14a9aef..e4af45e 100644
--- a/framework/tests/src/android/net/wifi/ScanResultTest.java
+++ b/framework/tests/src/android/net/wifi/ScanResultTest.java
@@ -262,6 +262,7 @@
+ "passpoint: no, ChannelBandwidth: 0, centerFreq0: 0, centerFreq1: 0, "
+ "standard: 11ac, "
+ "80211mcResponder: is not supported, "
+ + "80211azNtbResponder: is not supported, "
+ "Radio Chain Infos: null, interface name: test_ifname", scanResult.toString());
}
@@ -284,6 +285,7 @@
+ "passpoint: no, ChannelBandwidth: 0, centerFreq0: 0, centerFreq1: 0, "
+ "standard: 11ac, "
+ "80211mcResponder: is not supported, "
+ + "80211azNtbResponder: is not supported, "
+ "Radio Chain Infos: [RadioChainInfo: id=0, level=-45, "
+ "RadioChainInfo: id=1, level=-54], interface name: test_ifname",
scanResult.toString());
@@ -302,6 +304,7 @@
+ "passpoint: no, ChannelBandwidth: 0, centerFreq0: 0, centerFreq1: 0, "
+ "standard: 11ac, "
+ "80211mcResponder: is not supported, "
+ + "80211azNtbResponder: is not supported, "
+ "Radio Chain Infos: null, interface name: test_ifname", scanResult.toString());
}
diff --git a/service/ServiceWifiResources/res/values/config.xml b/service/ServiceWifiResources/res/values/config.xml
index 4898674..2453080 100644
--- a/service/ServiceWifiResources/res/values/config.xml
+++ b/service/ServiceWifiResources/res/values/config.xml
@@ -1300,4 +1300,16 @@
<item>unknownAkm2,knownAkm</item>
-->
</string-array>
+ <!-- Integer for minimum time between IEEE 802.11az non-trigger based ranging measurements in
+ microseconds. Note that ranging request converts this to units of 100 microseconds. So the
+ value should be a multiple of 100 microseconds. Non-zero values in this setting take
+ precedence over individual responder settings, effectively enforcing a system-wide minimum
+ measurement interval for non-trigger based ranging operations.. -->
+ <integer translatable="false" name="config_wifi80211azMinTimeBetweenNtbMeasurementsMicros">250000</integer>
+ <!-- Integer for maximum time between IEEE 802.11az non-trigger based ranging measurements in
+ microseconds. Note that ranging request converts this to units of 10 milliseconds. So the
+ value should be a multiple of 10000 microseconds. Non-zero values in this setting take
+ precedence over individual responder settings, effectively enforcing a system-wide maximum
+ measurement interval for non-trigger based ranging operations. -->
+ <integer translatable="false" name="config_wifi80211azMaxTimeBetweenNtbMeasurementsMicros">15000000</integer>
</resources>
diff --git a/service/ServiceWifiResources/res/values/overlayable.xml b/service/ServiceWifiResources/res/values/overlayable.xml
index f250816..e8238d5 100644
--- a/service/ServiceWifiResources/res/values/overlayable.xml
+++ b/service/ServiceWifiResources/res/values/overlayable.xml
@@ -338,6 +338,8 @@
<item type="bool" name ="config_wifiRemainConnectedAfterIpProvisionTimeout" />
<item type="bool" name ="config_wifiDisableNudDisconnectsForWapiInSpecificCc" />
<item type="array" name="config_wifiUnknownAkmToKnownAkmMapping" />
+ <item type="integer" name="config_wifi80211azMinTimeBetweenNtbMeasurementsMicros"/>
+ <item type="integer" name="config_wifi80211azMaxTimeBetweenNtbMeasurementsMicros"/>
<!-- Params from config.xml that can be overlayed -->
diff --git a/service/java/com/android/server/wifi/hal/WifiRttController.java b/service/java/com/android/server/wifi/hal/WifiRttController.java
index 2a0f7a6..9061a01 100644
--- a/service/java/com/android/server/wifi/hal/WifiRttController.java
+++ b/service/java/com/android/server/wifi/hal/WifiRttController.java
@@ -108,6 +108,14 @@
public byte mcVersion;
// Whether ftm rtt data collection is supported.
public boolean rttFtmSupported;
+ // IEEE 802.11az preamble supported, see bit mask definition above.
+ public int azPreambleSupported;
+ // IEE 802.11az RTT bandwidth supported.
+ public int azBwSupported;
+ // Whether IEEE 802.11az Non-Trigger-based (non-TB) responder mode is supported.
+ public boolean ntbInitiatorSupported;
+ // Whether IEEE 802.11az Non-Trigger-based (non-TB) responder mode is supported.
+ public boolean ntbResponderSupported;
public Capabilities() {
}
@@ -154,6 +162,10 @@
mcVersion = rttHalCapabilities.mcVersion;
bwSupported = rttHalCapabilities.bwSupport;
rttFtmSupported = rttHalCapabilities.rttFtmSupported;
+ azPreambleSupported = rttHalCapabilities.azPreambleSupport;
+ azBwSupported = rttHalCapabilities.azBwSupport;
+ ntbInitiatorSupported = rttHalCapabilities.ntbInitiatorSupported;
+ ntbResponderSupported = rttHalCapabilities.ntbResponderSupported;
}
}
diff --git a/service/java/com/android/server/wifi/hal/WifiRttControllerAidlImpl.java b/service/java/com/android/server/wifi/hal/WifiRttControllerAidlImpl.java
index 9b39c3e..e2e983b 100644
--- a/service/java/com/android/server/wifi/hal/WifiRttControllerAidlImpl.java
+++ b/service/java/com/android/server/wifi/hal/WifiRttControllerAidlImpl.java
@@ -287,6 +287,13 @@
.set80211mcMeasurement(rttResult.type == RttType.TWO_SIDED_11MC)
.setMeasurementChannelFrequencyMHz(rttResult.channelFreqMHz)
.setMeasurementBandwidth(halToFrameworkChannelBandwidth(rttResult.packetBw))
+ .set80211azNtbMeasurement(rttResult.type == RttType.TWO_SIDED_11AZ_NTB)
+ .setMinTimeBetweenNtbMeasurementsMicros(rttResult.ntbMinMeasurementTime)
+ .setMaxTimeBetweenNtbMeasurementsMicros(rttResult.ntbMaxMeasurementTime)
+ .set80211azInitiatorTxLtfRepetitionsCount(rttResult.i2rTxLtfRepetitionCount)
+ .set80211azResponderTxLtfRepetitionsCount(rttResult.r2iTxLtfRepetitionCount)
+ .set80211azNumberOfTxSpatialStreams(rttResult.numTxSpatialStreams)
+ .set80211azNumberOfRxSpatialStreams(rttResult.numRxSpatialStreams)
.build());
}
return rangingResults;
@@ -382,10 +389,25 @@
config.addr = responder.macAddress.toByteArray();
try {
- config.type = responder.supports80211mc ? RttType.TWO_SIDED : RttType.ONE_SIDED;
- if (config.type == RttType.ONE_SIDED && cap != null && !cap.oneSidedRttSupported) {
- Log.w(TAG, "Device does not support one-sided RTT");
- continue;
+ if (cap != null) {
+ if (responder.supports80211azNtb && cap.ntbInitiatorSupported) {
+ config.type = RttType.TWO_SIDED_11AZ_NTB;
+ } else if (responder.supports80211mc) {
+ // IEEE 802.11mc is supported by the device
+ config.type = RttType.TWO_SIDED_11MC;
+ } else if (cap.oneSidedRttSupported) {
+ config.type = RttType.ONE_SIDED;
+ } else {
+ Log.w(TAG, "Device does not support one-sided RTT");
+ continue;
+ }
+ } else {
+ if (responder.supports80211mc) {
+ // IEEE 802.11mc is supported by the device
+ config.type = RttType.TWO_SIDED_11MC;
+ } else {
+ config.type = RttType.ONE_SIDED;
+ }
}
config.peer = frameworkToHalRttPeerType(responder.responderType);
@@ -398,6 +420,12 @@
config.bw = frameworkToHalChannelBandwidth(responder.channelWidth);
config.preamble = frameworkToHalResponderPreamble(responder.preamble);
validateBwAndPreambleCombination(config.bw, config.preamble);
+ // ResponderConfig#ntbMaxMeasurementTime is in units of 10 milliseconds
+ config.ntbMaxMeasurementTime =
+ responder.getNtbMaxTimeBetweenMeasurementsMicros() / 10000;
+ // ResponderConfig#ntbMinMeasurementTime is in units of 100 microseconds
+ config.ntbMinMeasurementTime =
+ responder.getNtbMinTimeBetweenMeasurementsMicros() / 100;
if (config.peer == RttPeerType.NAN_TYPE) {
config.mustRequestLci = false;
@@ -421,8 +449,10 @@
if (cap != null) { // constrain parameters per device capabilities
config.mustRequestLci = config.mustRequestLci && cap.lciSupported;
config.mustRequestLcr = config.mustRequestLcr && cap.lcrSupported;
- config.bw = halRttChannelBandwidthCapabilityLimiter(config.bw, cap);
- config.preamble = halRttPreambleCapabilityLimiter(config.preamble, cap);
+ config.bw = halRttChannelBandwidthCapabilityLimiter(config.bw, cap,
+ config.type);
+ config.preamble = halRttPreambleCapabilityLimiter(config.preamble, cap,
+ config.type);
}
}
} catch (IllegalArgumentException e) {
@@ -543,9 +573,12 @@
* Note: the halRttChannelBandwidth is a single bit flag from the HAL RttBw type.
*/
private static int halRttChannelBandwidthCapabilityLimiter(int halRttChannelBandwidth,
- WifiRttController.Capabilities cap) throws IllegalArgumentException {
+ WifiRttController.Capabilities cap, @RttType int rttType)
+ throws IllegalArgumentException {
int requestedBandwidth = halRttChannelBandwidth;
- while ((halRttChannelBandwidth != 0) && ((halRttChannelBandwidth & cap.bwSupported) == 0)) {
+ int bwSupported =
+ (rttType == RttType.TWO_SIDED_11AZ_NTB) ? cap.azBwSupported : cap.bwSupported;
+ while ((halRttChannelBandwidth != 0) && ((halRttChannelBandwidth & bwSupported) == 0)) {
halRttChannelBandwidth >>= 1;
}
@@ -567,9 +600,12 @@
* Note: the halRttPreamble is a single bit flag from the HAL RttPreamble type.
*/
private static int halRttPreambleCapabilityLimiter(int halRttPreamble,
- WifiRttController.Capabilities cap) throws IllegalArgumentException {
+ WifiRttController.Capabilities cap, @RttType int rttType)
+ throws IllegalArgumentException {
int requestedPreamble = halRttPreamble;
- while ((halRttPreamble != 0) && ((halRttPreamble & cap.preambleSupported) == 0)) {
+ int preambleSupported = (rttType == RttType.TWO_SIDED_11AZ_NTB) ? cap.azPreambleSupported
+ : cap.preambleSupported;
+ while ((halRttPreamble != 0) && ((halRttPreamble & preambleSupported) == 0)) {
halRttPreamble >>= 1;
}
diff --git a/service/java/com/android/server/wifi/rtt/RttServiceImpl.java b/service/java/com/android/server/wifi/rtt/RttServiceImpl.java
index 1abef71..ebab16f 100644
--- a/service/java/com/android/server/wifi/rtt/RttServiceImpl.java
+++ b/service/java/com/android/server/wifi/rtt/RttServiceImpl.java
@@ -19,6 +19,7 @@
import static android.app.ActivityManager.RunningAppProcessInfo.IMPORTANCE_FOREGROUND_SERVICE;
import static android.net.wifi.rtt.WifiRttManager.CHARACTERISTICS_KEY_BOOLEAN_LCI;
import static android.net.wifi.rtt.WifiRttManager.CHARACTERISTICS_KEY_BOOLEAN_LCR;
+import static android.net.wifi.rtt.WifiRttManager.CHARACTERISTICS_KEY_BOOLEAN_NTB_INITIATOR;
import static android.net.wifi.rtt.WifiRttManager.CHARACTERISTICS_KEY_BOOLEAN_ONE_SIDED_RTT;
import static android.net.wifi.rtt.WifiRttManager.CHARACTERISTICS_KEY_BOOLEAN_STA_RESPONDER;
@@ -237,6 +238,8 @@
j.put("lcrSupported", mCapabilities.lcrSupported);
j.put("responderSupported", mCapabilities.responderSupported);
j.put("mcVersion", mCapabilities.mcVersion);
+ j.put("ntbInitiatorSupported", mCapabilities.ntbInitiatorSupported);
+ j.put("ntbResponderSupported", mCapabilities.ntbResponderSupported);
} catch (JSONException e) {
Log.e(TAG, "onCommand: get_capabilities e=" + e);
}
@@ -478,10 +481,30 @@
characteristics.putBoolean(CHARACTERISTICS_KEY_BOOLEAN_LCR, capabilities.lcrSupported);
characteristics.putBoolean(CHARACTERISTICS_KEY_BOOLEAN_STA_RESPONDER,
capabilities.responderSupported);
+ characteristics.putBoolean(CHARACTERISTICS_KEY_BOOLEAN_NTB_INITIATOR,
+ capabilities.ntbInitiatorSupported);
return characteristics;
}
/**
+ * Override IEEE 802.11az parameters with overlay values.
+ */
+ private void override11azOverlays(RangingRequest rangingRequest) {
+ int minNtbTime = mContext.getResources().getInteger(
+ R.integer.config_wifi80211azMinTimeBetweenNtbMeasurementsMicros);
+ int maxNtbTime = mContext.getResources().getInteger(
+ R.integer.config_wifi80211azMaxTimeBetweenNtbMeasurementsMicros);
+ if (minNtbTime > 0 || maxNtbTime > 0) {
+ for (ResponderConfig peer : rangingRequest.mRttPeers) {
+ if (peer.is80211azNtbSupported()) {
+ if (maxNtbTime > 0) peer.setNtbMaxTimeBetweenMeasurementsMicros(maxNtbTime);
+ if (minNtbTime > 0) peer.setNtbMinTimeBetweenMeasurementsMicros(minNtbTime);
+ }
+ }
+ }
+ }
+
+ /**
* Binder interface API to start a ranging operation. Called on binder thread, operations needs
* to be posted to handler thread.
*/
@@ -584,6 +607,8 @@
return;
}
+ override11azOverlays(request);
+
mRttServiceSynchronized.mHandler.post(() -> {
WorkSource sourceToUse = ws;
if (ws == null || ws.isEmpty()) {
@@ -1177,6 +1202,7 @@
.setPeerHandle(rttPeer.peerHandle)
.setResponderType(rttPeer.getResponderType())
.set80211mcSupported(rttPeer.is80211mcSupported())
+ .set80211azNtbSupported(rttPeer.is80211azNtbSupported())
.setChannelWidth(rttPeer.getChannelWidth())
.setFrequencyMhz(rttPeer.getFrequencyMhz())
.setCenterFreq1Mhz(rttPeer.getCenterFreq1Mhz())
@@ -1320,7 +1346,20 @@
.set80211mcMeasurement(resultForRequest.is80211mcMeasurement())
.setMeasurementChannelFrequencyMHz(
resultForRequest.getMeasurementChannelFrequencyMHz())
- .setMeasurementBandwidth(resultForRequest.getMeasurementBandwidth());
+ .setMeasurementBandwidth(resultForRequest.getMeasurementBandwidth())
+ .set80211azNtbMeasurement(resultForRequest.is80211azNtbMeasurement())
+ .setMinTimeBetweenNtbMeasurementsMicros(
+ resultForRequest.getMinTimeBetweenNtbMeasurementsMicros())
+ .setMaxTimeBetweenNtbMeasurementsMicros(
+ resultForRequest.getMaxTimeBetweenNtbMeasurementsMicros())
+ .set80211azInitiatorTxLtfRepetitionsCount(
+ resultForRequest.get80211azInitiatorTxLtfRepetitionsCount())
+ .set80211azResponderTxLtfRepetitionsCount(
+ resultForRequest.get80211azResponderTxLtfRepetitionsCount())
+ .set80211azNumberOfTxSpatialStreams(
+ resultForRequest.get80211azNumberOfTxSpatialStreams())
+ .set80211azNumberOfRxSpatialStreams(
+ resultForRequest.get80211azNumberOfRxSpatialStreams());
if (peer.peerHandle == null) {
builder.setMacAddress(peer.getMacAddress());
} else {