Builder


class Builder

Builder class to create BleCsRangingParams instances.

Summary

Public constructors
Builder(peerBluetoothAddress: String)

Constructs a new Builder for creating a channel sounding ranging session.

Public methods
BleCsRangingParams

Builds and returns a BleCsRangingParams instance.

BleCsRangingParams.Builder
setLocationType(locationType: Int)

Sets the location type for the ranging session.

BleCsRangingParams.Builder

Sets the update rate for the CS ranging session.

BleCsRangingParams.Builder
setSecurityLevel(securityLevel: Int)

Sets the security level for the ranging session.

BleCsRangingParams.Builder
setSightType(sightType: Int)

Sets the sight type for the ranging session.

Public constructors

Builder

Builder(peerBluetoothAddress: String)

Constructs a new Builder for creating a channel sounding ranging session.

Valid Bluetooth hardware addresses must be upper case, in big endian byte order, and in a format such as "00:11:22:33:AA:BB". The helper android.bluetooth.BluetoothAdapter#checkBluetoothAddress is available to validate a Bluetooth address.

Parameters
peerBluetoothAddress String: The address of the peer device must be non-null Bluetooth address.
Exceptions
java.lang.IllegalArgumentException if peerBluetoothAddress is null or does not conform to "00:11:22:33:AA:BB" format.

Public methods

build

fun build(): BleCsRangingParams

Builds and returns a BleCsRangingParams instance.

Return
BleCsRangingParams a new BleCsRangingParams. This value cannot be null.

setLocationType

fun setLocationType(locationType: Int): BleCsRangingParams.Builder

Sets the location type for the ranging session.

Defaults to LOCATION_TYPE_UNKNOWN

Return
BleCsRangingParams.Builder this Builder instance. This value cannot be null.

setRangingUpdateRate

fun setRangingUpdateRate(updateRate: Int): BleCsRangingParams.Builder

Sets the update rate for the CS ranging session.

Defaults to android.ranging.raw.RawRangingDevice.RangingUpdateRate#UPDATE_RATE_NORMAL

Return
BleCsRangingParams.Builder this Builder instance. This value cannot be null.

setSecurityLevel

fun setSecurityLevel(securityLevel: Int): BleCsRangingParams.Builder

Sets the security level for the ranging session.

Defaults to BleCsRangingCapabilities.CS_SECURITY_LEVEL_ONE

Return
BleCsRangingParams.Builder this Builder instance. This value cannot be null.

setSightType

fun setSightType(sightType: Int): BleCsRangingParams.Builder

Sets the sight type for the ranging session.

Defaults to SIGHT_TYPE_UNKNOWN

Return
BleCsRangingParams.Builder this Builder instance. This value cannot be null.