Builder
class Builder
| kotlin.Any | |
| ↳ | android.ranging.ble.cs.BleCsRangingParams.Builder |
Builder class to create BleCsRangingParams instances.
Summary
| Public constructors | |
|---|---|
|
Constructs a new |
|
| Public methods | |
|---|---|
| BleCsRangingParams |
build()Builds and returns a |
| BleCsRangingParams.Builder |
setLocationType(locationType: Int)Sets the location type for the ranging session. |
| BleCsRangingParams.Builder |
setRangingUpdateRate(updateRate: Int)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
| Parameters | |
|---|---|
locationType |
Int: the location type. Value is android.ranging.ble.cs.BleCsRangingParams#LOCATION_TYPE_UNKNOWN, android.ranging.ble.cs.BleCsRangingParams#LOCATION_TYPE_INDOOR, or android.ranging.ble.cs.BleCsRangingParams#LOCATION_TYPE_OUTDOOR |
| 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
| Parameters | |
|---|---|
updateRate |
Int: the reporting frequency. Value is android.ranging.raw.RawRangingDevice#UPDATE_RATE_NORMAL, android.ranging.raw.RawRangingDevice#UPDATE_RATE_INFREQUENT, or android.ranging.raw.RawRangingDevice#UPDATE_RATE_FREQUENT |
| 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
| Parameters | |
|---|---|
securityLevel |
Int: the security level. Value is android.ranging.ble.cs.BleCsRangingCapabilities#CS_SECURITY_LEVEL_ONE, or android.ranging.ble.cs.BleCsRangingCapabilities#CS_SECURITY_LEVEL_FOUR |
| 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
| Parameters | |
|---|---|
sightType |
Int: the sight type. Value is android.ranging.ble.cs.BleCsRangingParams#SIGHT_TYPE_UNKNOWN, android.ranging.ble.cs.BleCsRangingParams#SIGHT_TYPE_LINE_OF_SIGHT, or android.ranging.ble.cs.BleCsRangingParams#SIGHT_TYPE_NON_LINE_OF_SIGHT |
| Return | |
|---|---|
BleCsRangingParams.Builder |
this Builder instance. This value cannot be null. |