Added in API level 33

Builder


class Builder
kotlin.Any
   ↳ android.net.wifi.rtt.ResponderConfig.Builder

Builder class used to construct ResponderConfig objects.

Summary

Public constructors

Default constructor for the Builder.

Creates a new Builder instance, initializing it with the values from an existing ResponderConfig object.

Public methods
ResponderConfig

Build ResponderConfig given the current configurations made on the builder.

ResponderConfig.Builder
set80211azNtbSupported(supports80211azNtb: Boolean)

Sets an indication the access point can to respond to the IEEE 802.

ResponderConfig.Builder
set80211mcSupported(supports80211mc: Boolean)

Sets an indication the access point can to respond to the two-sided Wi-Fi RTT protocol, but, if false, indicates only one-sided Wi-Fi RTT is possible.

ResponderConfig.Builder
setCenterFreq0Mhz(centerFreq0: Int)

Sets the center frequency in MHz of the first segment of the channel.

ResponderConfig.Builder
setCenterFreq1Mhz(centerFreq1: Int)

Sets the center frequency in MHz of the second segment of the channel, if used.

ResponderConfig.Builder
setChannelWidth(channelWidth: Int)

Sets the channel bandwidth in MHz.

ResponderConfig.Builder
setFrequencyMhz(frequency: Int)

Sets the frequency of the channel in MHz.

ResponderConfig.Builder
setMacAddress(macAddress: MacAddress?)

Sets the Responder MAC Address.

ResponderConfig.Builder
setPeerHandle(peerHandle: PeerHandle?)

Sets the Responder Aware Peer handle.

ResponderConfig.Builder
setPreamble(preamble: Int)

Sets the preamble encoding for the protocol.

ResponderConfig.Builder
setResponderType(responderType: Int)

Sets the responder type, can be RESPONDER_AP or RESPONDER_STA or #RESPONDER_AWARE

ResponderConfig.Builder

Set secure ranging configuration.

ResponderConfig.Builder
setUsdPeerId(peerId: Int)

Sets the USD peer ID.

Public constructors

Builder

Added in API level 33
Builder()

Default constructor for the Builder.

Builder

Added in API level 33
Builder(config: ResponderConfig)

Creates a new Builder instance, initializing it with the values from an existing ResponderConfig object. This allows for easy modification of an existing configuration.

Parameters
config ResponderConfig: The ResponderConfig instance to copy values from.
This value cannot be null.

Public methods

build

Added in API level 33
fun build(): ResponderConfig

Build ResponderConfig given the current configurations made on the builder.

Return
ResponderConfig an instance of ResponderConfig
This value cannot be null.

set80211azNtbSupported

Added in API level 35
fun set80211azNtbSupported(supports80211azNtb: Boolean): ResponderConfig.Builder

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.

Parameters
supports80211azNtb Boolean: the ability to support the IEEE 802.11az non-trigger based ranging protocol
Return
ResponderConfig.Builder the builder to facilitate chaining builder.setXXX(..).setXXX(..).
This value cannot be null.

set80211mcSupported

Added in API level 33
fun set80211mcSupported(supports80211mc: Boolean): ResponderConfig.Builder

Sets an indication the access point can to respond to the two-sided Wi-Fi RTT protocol, but, if false, indicates only one-sided Wi-Fi RTT is possible.

Parameters
supports80211mc Boolean: the ability to support the Wi-Fi RTT protocol
Return
ResponderConfig.Builder the builder to facilitate chaining builder.setXXX(..).setXXX(..).
This value cannot be null.

setCenterFreq0Mhz

Added in API level 33
fun setCenterFreq0Mhz(centerFreq0: Int): ResponderConfig.Builder

Sets the center frequency in MHz of the first segment of the channel.

Note: The frequency is used as a hint, and the underlying WiFi subsystem may use it, or select an alternate if its own connectivity scans have determined the frequency of the access point has changed.

Parameters
centerFreq0 Int: the center frequency in MHz of first channel segment.
Value is 0 or greater
Return
ResponderConfig.Builder the builder to facilitate chaining builder.setXXX(..).setXXX(..).
This value cannot be null.

setCenterFreq1Mhz

Added in API level 33
fun setCenterFreq1Mhz(centerFreq1: Int): ResponderConfig.Builder

Sets the center frequency in MHz of the second segment of the channel, if used.

Note: The frequency is used as a hint, and the underlying WiFi subsystem may use it, or select an alternate if its own connectivity scans have determined the frequency of the access point has changed.

Parameters
centerFreq1 Int: the center frequency in MHz of second channel segment.
Value is 0 or greater
Return
ResponderConfig.Builder the builder to facilitate chaining builder.setXXX(..).setXXX(..).
This value cannot be null.

setChannelWidth

Added in API level 33
fun setChannelWidth(channelWidth: Int): ResponderConfig.Builder

Sets the channel bandwidth in MHz.

Parameters
channelWidth Int: the bandwidth of the channel in MHz.
Value is one of the following:
Return
ResponderConfig.Builder the builder to facilitate chaining builder.setXXX(..).setXXX(..).
This value cannot be null.

setFrequencyMhz

Added in API level 33
fun setFrequencyMhz(frequency: Int): ResponderConfig.Builder

Sets the frequency of the channel in MHz.

Note: The frequency is used as a hint, and the underlying WiFi subsystem may use it, or select an alternate if its own connectivity scans have determined the frequency of the access point has changed.

Parameters
frequency Int: the frequency of the channel in MHz.
Value is 0 or greater
Return
ResponderConfig.Builder the builder to facilitate chaining builder.setXXX(..).setXXX(..).
This value cannot be null.

setMacAddress

Added in API level 33
fun setMacAddress(macAddress: MacAddress?): ResponderConfig.Builder

Sets the Responder MAC Address.

A responder must be identified by either a MacAddress or a PeerHandle (for Aware peers, set via setPeerHandle(android.net.wifi.aware.PeerHandle)), but not both.

Note: This method sets the MAC address. If a PeerHandle was previously set using setPeerHandle(android.net.wifi.aware.PeerHandle), both identifiers might be temporarily present within the builder. The final validation ensuring that only one of these identifiers is exclusively set occurs during the build() operation. If build() is called when both a MAC address and a PeerHandle are configured or when neither is set, it will result in an IllegalArgumentException.

Parameters
macAddress MacAddress?: the physical address of the responder.
This value may be null.
Return
ResponderConfig.Builder the builder to facilitate chaining builder.setXXX(..).setXXX(..).
This value cannot be null.

setPeerHandle

Added in API level 33
fun setPeerHandle(peerHandle: PeerHandle?): ResponderConfig.Builder

Sets the Responder Aware Peer handle.

Use this method to identify the responder when it is a Wi-Fi Aware peer. The PeerHandle is a unique identifier for an Aware peer obtained through Wi-Fi Aware discovery processes.

A responder must be identified by either a PeerHandle (for Aware peers) or a MacAddress (for non-Aware peers like Access Points or Wi-Fi Direct devices), but not both.

Note: This method sets the peer handle. If a MAC address was previously set using setMacAddress(android.net.MacAddress), both identifiers might be temporarily present within the builder. The final validation ensuring that only one of these identifiers is exclusively set occurs during the build() operation. If build() is called when both a MAC address and a PeerHandle are configured or when neither is set, it will result in an IllegalArgumentException.

Parameters
peerHandle PeerHandle?: Peer handle of the responder.
This value may be null.
Return
ResponderConfig.Builder the builder to facilitate chaining builder.setXXX(..).setXXX(..).
This value cannot be null.

setPreamble

Added in API level 33
fun setPreamble(preamble: Int): ResponderConfig.Builder

Sets the preamble encoding for the protocol.

Parameters
preamble Int: the preamble encoding.
Value is one of the following:
Return
ResponderConfig.Builder the builder to facilitate chaining builder.setXXX(..).setXXX(..).
This value cannot be null.

setResponderType

Added in API level 34
fun setResponderType(responderType: Int): ResponderConfig.Builder

Sets the responder type, can be RESPONDER_AP or RESPONDER_STA or #RESPONDER_AWARE

Parameters
responderType Int: the type of the responder, if not set defaults to RESPONDER_AP
Value is one of the following:
Return
ResponderConfig.Builder the builder to facilitate chaining builder.setXXX(..).setXXX(..).
This value cannot be null.

setSecureRangingConfig

Added in API level 36
fun setSecureRangingConfig(secureRangingConfig: SecureRangingConfig): ResponderConfig.Builder

Set secure ranging configuration. See SecureRangingConfig for more details.

Note: Secure ranging will get enabled only if the device and responder support. For device support see WifiRttManager.getRttCharacteristics(). Following capabilities needs to be enabled,

For the responder support (from scan result),
Parameters
secureRangingConfig SecureRangingConfig: Secure ranging configuration.
This value cannot be null.
Return
ResponderConfig.Builder the builder to facilitate chaining builder.setXXX(..).setXXX(..).
This value cannot be null.

setUsdPeerId

Added in API level 33
fun setUsdPeerId(peerId: Int): ResponderConfig.Builder

Sets the USD peer ID.

Use this method to identify the peer when the peer is discovered over USD channel. The peer id is a unique identifier for an USD peer obtained through Wi-Fi USD discovery processes (See obtained from DiscoveryResult.getPeerId().

Parameters
peerId Int: Peer ID of the USD peer
Return
ResponderConfig.Builder the builder to facilitate chaining builder.setXXX(..).setXXX(..).
This value cannot be null.