Builder
class Builder
kotlin.Any | |
↳ | android.ranging.wifi.rtt.RttRangingParams.Builder |
Builder class for RttRangingParams
.
Summary
Public constructors | |
---|---|
Constructs a new |
Public methods | |
---|---|
RttRangingParams |
build() Builds and returns a new |
RttRangingParams.Builder |
setMatchFilter(matchFilter: ByteArray) Sets the match filter to identify specific devices or services for RTT. |
RttRangingParams.Builder |
setPeriodicRangingHwFeatureEnabled(periodicRangingHwFeatureEnabled: Boolean) Sets whether to use hardware supported periodic ranging feature in WiFi Nan-RTT. |
RttRangingParams.Builder |
setRangingUpdateRate(updateRate: Int) Sets the update rate for the RTT ranging session. |
Public constructors
Builder
Builder(serviceName: String)
Constructs a new Builder
for creating a Wifi NAN-RTT ranging session.
Parameters | |
---|---|
serviceName |
String: The service name associated with this session This value cannot be null . |
Exceptions | |
---|---|
java.lang.IllegalArgumentException |
if serviceName is null. |
Public methods
build
fun build(): RttRangingParams
Builds and returns a new RttRangingParams
instance.
Return | |
---|---|
RttRangingParams |
a new RttRangingParams object configured with the provided parameters. This value cannot be null . |
setMatchFilter
fun setMatchFilter(matchFilter: ByteArray): RttRangingParams.Builder
Sets the match filter to identify specific devices or services for RTT.
Parameters | |
---|---|
matchFilter |
ByteArray: a byte array representing the filter. This value cannot be null . |
Return | |
---|---|
RttRangingParams.Builder |
this Builder instance. This value cannot be null . |
Exceptions | |
---|---|
java.lang.NullPointerException |
if either parameter is matchFilter is null. |
setPeriodicRangingHwFeatureEnabled
fun setPeriodicRangingHwFeatureEnabled(periodicRangingHwFeatureEnabled: Boolean): RttRangingParams.Builder
Sets whether to use hardware supported periodic ranging feature in WiFi Nan-RTT.
Parameters | |
---|---|
periodicRangingHwFeatureEnabled |
Boolean: true to enable periodic ranging; false otherwise. |
Return | |
---|---|
RttRangingParams.Builder |
this Builder instance. This value cannot be null . |
setRangingUpdateRate
fun setRangingUpdateRate(updateRate: Int): RttRangingParams.Builder
Sets the update rate for the RTT ranging session.
Defaults to android.ranging.raw.RawRangingDevice.RangingUpdateRate#UPDATE_RATE_NORMAL
Parameters | |
---|---|
updateRate |
Int: the reporting frequency.
Possible values: android.ranging.raw.RawRangingDevice.RangingUpdateRate#UPDATE_RATE_NORMAL android.ranging.raw.RawRangingDevice.RangingUpdateRate#UPDATE_RATE_INFREQUENT android.ranging.raw.RawRangingDevice.RangingUpdateRate#UPDATE_RATE_FREQUENT Value is |
Return | |
---|---|
RttRangingParams.Builder |
this Builder instance. This value cannot be null . |