From 2109f705f35999374d5e3519d0782f38c87adb99 Mon Sep 17 00:00:00 2001 From: Etan Cohen Date: Tue, 28 Nov 2017 07:27:08 -0800 Subject: [PATCH] [RTT2] Direct Aware Responder configuration Direct Aware Responder configuration set to the basic rates (discovery channel 6, 20MHz bandwidth). It is expected that these will be ignored and that (with a Ranging enabled Responder Publisher) enabled on the peer a high accuracy RTT will be negotiated. Bug: 67678464 Test: unit test & integration test (non-functional at this point) Change-Id: I240cfef91a968cd1eb75a71b5ead96ae4eccb32d --- .../android/net/wifi/rtt/ResponderConfig.java | 22 ++++++++++++++----- 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/wifi/java/android/net/wifi/rtt/ResponderConfig.java b/wifi/java/android/net/wifi/rtt/ResponderConfig.java index 3d96bfd1c640a..b503769d09b06 100644 --- a/wifi/java/android/net/wifi/rtt/ResponderConfig.java +++ b/wifi/java/android/net/wifi/rtt/ResponderConfig.java @@ -41,6 +41,8 @@ import java.util.Objects; * @hide (@SystemApi) */ public class ResponderConfig implements Parcelable { + private static final int AWARE_BAND_2_DISCOVERY_CHANNEL = 2437; + /** @hide */ @IntDef({RESPONDER_AP, RESPONDER_STA, RESPONDER_P2P_GO, RESPONDER_P2P_CLIENT, RESPONDER_AWARE}) @Retention(RetentionPolicy.SOURCE) @@ -271,9 +273,13 @@ public class ResponderConfig implements Parcelable { * Responder. The Responder parameters are set to defaults. */ public static ResponderConfig fromWifiAwarePeerMacAddressWithDefaults(byte[] macAddress) { - // TODO b/67678464: determine "right" parameters or - return new ResponderConfig(macAddress, RESPONDER_AWARE, true, CHANNEL_WIDTH_80MHZ, - 5200, 5210, 0, PREAMBLE_VHT); + /* Note: the parameters are those of the Aware discovery channel (channel 6). A Responder + * is expected to be brought up and available to negotiate a maximum accuracy channel + * (i.e. Band 5 @ 80MHz). A Responder is brought up on the peer by starting an Aware + * Unsolicited Publisher with Ranging enabled. + */ + return new ResponderConfig(macAddress, RESPONDER_AWARE, true, CHANNEL_WIDTH_20MHZ, + AWARE_BAND_2_DISCOVERY_CHANNEL, 0, 0, PREAMBLE_HT); } /** @@ -281,9 +287,13 @@ public class ResponderConfig implements Parcelable { * Responder. The Responder parameters are set to defaults. */ public static ResponderConfig fromWifiAwarePeerHandleWithDefaults(PeerHandle peerHandle) { - // TODO b/67678464: determine "right" parameters or - return new ResponderConfig(peerHandle, RESPONDER_AWARE, true, CHANNEL_WIDTH_80MHZ, - 5200, 5210, 0, PREAMBLE_VHT); + /* Note: the parameters are those of the Aware discovery channel (channel 6). A Responder + * is expected to be brought up and available to negotiate a maximum accuracy channel + * (i.e. Band 5 @ 80MHz). A Responder is brought up on the peer by starting an Aware + * Unsolicited Publisher with Ranging enabled. + */ + return new ResponderConfig(peerHandle, RESPONDER_AWARE, true, CHANNEL_WIDTH_20MHZ, + AWARE_BAND_2_DISCOVERY_CHANNEL, 0, 0, PREAMBLE_HT); } /**