Added in API level 26

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 AdvertisingSetParameters.

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

Returns whether the legacy advertisement will be used.

Boolean

Returns whether the advertisement will be scannable.

String

Unit
writeToParcel(dest: Parcel, flags: Int)

Properties
static Parcelable.Creator<AdvertisingSetParameters!>

Constants

INTERVAL_HIGH

Added in API level 26
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: 1600

INTERVAL_LOW

Added in API level 26
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: 160

INTERVAL_MAX

Added in API level 26
static val INTERVAL_MAX: Int

Maximum value for advertising interval.

Value: 16777215

INTERVAL_MEDIUM

Added in API level 26
static val INTERVAL_MEDIUM: Int

Advertise on medium frequency, around every 250ms. This is balanced between advertising frequency and power consumption.

Value: 400

INTERVAL_MIN

Added in API level 26
static val INTERVAL_MIN: Int

Minimum value for advertising interval.

Value: 160

TX_POWER_HIGH

Added in API level 26
static val TX_POWER_HIGH: Int

Advertise using high TX power level. This corresponds to largest visibility range of the advertising packet.

Value: 1

TX_POWER_LOW

Added in API level 26
static val TX_POWER_LOW: Int

Advertise using low TX power level.

Value: -15

TX_POWER_MAX

Added in API level 26
static val TX_POWER_MAX: Int

Maximum value for TX power.

Value: 1

TX_POWER_MEDIUM

Added in API level 26
static val TX_POWER_MEDIUM: Int

Advertise using medium TX power level.

Value: -7

TX_POWER_MIN

Added in API level 26
static val TX_POWER_MIN: Int

Minimum value for TX power.

Value: -127

TX_POWER_ULTRA_LOW

Added in API level 26
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: -21

Public methods

describeContents

Added in API level 26
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

getInterval

Added in API level 26
fun getInterval(): Int

Returns the advertising interval.

getPrimaryPhy

Added in API level 26
fun getPrimaryPhy(): Int

Returns the primary advertising phy.

getSecondaryPhy

Added in API level 26
fun getSecondaryPhy(): Int

Returns the secondary advertising phy.

getTxPowerLevel

Added in API level 26
fun getTxPowerLevel(): Int

Returns the TX power level for advertising.

includeTxPower

Added in API level 26
fun includeTxPower(): Boolean

Returns whether the TX Power will be included.

isAnonymous

Added in API level 26
fun isAnonymous(): Boolean

Returns whether the advertisement will be anonymous.

isConnectable

Added in API level 26
fun isConnectable(): Boolean

Returns whether the advertisement will be connectable.

isDiscoverable

Added in API level 34
fun isDiscoverable(): Boolean

Returns whether the advertisement will be discoverable.

isLegacy

Added in API level 26
fun isLegacy(): Boolean

Returns whether the legacy advertisement will be used.

isScannable

Added in API level 26
fun isScannable(): Boolean

Returns whether the advertisement will be scannable.

toString

Added in API level 26
fun toString(): String
Return
String a string representation of the object.

writeToParcel

Added in API level 26
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

Properties

CREATOR

Added in API level 26
static val CREATOR: Parcelable.Creator<AdvertisingSetParameters!>