AdvertisingSetParameters
class AdvertisingSetParameters : Parcelable
| kotlin.Any | |
| ↳ | android.bluetooth.le.AdvertisingSetParameters |
The AdvertisingSetParameters provide a way to adjust advertising preferences for each Bluetooth LE advertising set. Use AdvertisingSetParameters.Builder to create an instance of this class.
Summary
| Nested classes | |
|---|---|
|
Builder class for |
|
| Constants | |
|---|---|
| static Int |
Advertise on low frequency, around every 1000ms. |
| static Int |
Perform high frequency, low latency advertising, around every 100ms. |
| static Int |
Maximum value for advertising interval. |
| static Int |
Advertise on medium frequency, around every 250ms. |
| static Int |
Minimum value for advertising interval. |
| static Int |
Advertise using high TX power level. |
| static Int |
Advertise using low TX power level. |
| static Int |
Maximum value for TX power. |
| static Int |
Advertise using medium TX power level. |
| static Int |
Minimum value for TX power. |
| static Int |
Advertise using the lowest transmission (TX) power level. |
| Inherited constants | |
|---|---|
| Public methods | |
|---|---|
| Int | |
| Int |
Returns the advertising interval. |
| Int |
Returns the primary advertising phy. |
| Int |
Returns the secondary advertising phy. |
| Int |
Returns the TX power level for advertising. |
| Boolean |
Returns whether the TX Power will be included. |
| Boolean |
Returns whether the advertisement will be anonymous. |
| Boolean |
Returns whether the advertisement will be connectable. |
| Boolean |
Returns whether the advertisement will be discoverable. |
| Boolean |
isLegacy()Returns whether the legacy advertisement will be used. |
| Boolean |
Returns whether the advertisement will be scannable. |
| String |
toString() |
| Unit |
writeToParcel(dest: Parcel, flags: Int) |
| Properties | |
|---|---|
| static Parcelable.Creator<AdvertisingSetParameters!> | |
Constants
INTERVAL_HIGH
static val INTERVAL_HIGH: Int
Advertise on low frequency, around every 1000ms. This is the default and preferred advertising mode as it consumes the least power.
Value: 1600INTERVAL_LOW
static val INTERVAL_LOW: Int
Perform high frequency, low latency advertising, around every 100ms. This has the highest power consumption and should not be used for continuous background advertising.
Value: 160INTERVAL_MAX
static val INTERVAL_MAX: Int
Maximum value for advertising interval.
Value: 16777215INTERVAL_MEDIUM
static val INTERVAL_MEDIUM: Int
Advertise on medium frequency, around every 250ms. This is balanced between advertising frequency and power consumption.
Value: 400INTERVAL_MIN
static val INTERVAL_MIN: Int
Minimum value for advertising interval.
Value: 160TX_POWER_HIGH
static val TX_POWER_HIGH: Int
Advertise using high TX power level. This corresponds to largest visibility range of the advertising packet.
Value: 1TX_POWER_LOW
static val TX_POWER_LOW: Int
Advertise using low TX power level.
Value: -15TX_POWER_MAX
static val TX_POWER_MAX: Int
Maximum value for TX power.
Value: 1TX_POWER_MEDIUM
static val TX_POWER_MEDIUM: Int
Advertise using medium TX power level.
Value: -7TX_POWER_MIN
static val TX_POWER_MIN: Int
Minimum value for TX power.
Value: -127TX_POWER_ULTRA_LOW
static val TX_POWER_ULTRA_LOW: Int
Advertise using the lowest transmission (TX) power level. Low transmission power can be used to restrict the visibility range of advertising packets.
Value: -21Public methods
describeContents
fun describeContents(): Int
| Return | |
|---|---|
Int |
a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either 0 or android.os.Parcelable#CONTENTS_FILE_DESCRIPTOR |
getSecondaryPhy
fun getSecondaryPhy(): Int
Returns the secondary advertising phy.
getTxPowerLevel
fun getTxPowerLevel(): Int
Returns the TX power level for advertising.
includeTxPower
fun includeTxPower(): Boolean
Returns whether the TX Power will be included.
isAnonymous
fun isAnonymous(): Boolean
Returns whether the advertisement will be anonymous.
isConnectable
fun isConnectable(): Boolean
Returns whether the advertisement will be connectable.
isDiscoverable
fun isDiscoverable(): Boolean
Returns whether the advertisement will be discoverable.
isLegacy
fun isLegacy(): Boolean
Returns whether the legacy advertisement will be used.
isScannable
fun isScannable(): Boolean
Returns whether the advertisement will be scannable.
toString
fun toString(): String
| Return | |
|---|---|
String |
a string representation of the object. |
writeToParcel
fun writeToParcel(
dest: Parcel,
flags: Int
): Unit
| Parameters | |
|---|---|
dest |
Parcel: The Parcel in which the object should be written. This value cannot be null. |
flags |
Int: Additional flags about how the object should be written. May be 0 or PARCELABLE_WRITE_RETURN_VALUE. Value is either 0 or a combination of android.os.Parcelable#PARCELABLE_WRITE_RETURN_VALUE, and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES |