Added in API level 21

AdvertiseSettings


class AdvertiseSettings : Parcelable
kotlin.Any
   ↳ android.bluetooth.le.AdvertiseSettings

The AdvertiseSettings provide a way to adjust advertising preferences for each Bluetooth LE advertisement instance. Use AdvertiseSettings.Builder to create an instance of this class.

Summary

Nested classes

Builder class for AdvertiseSettings.

Constants
static Int

Perform Bluetooth LE advertising in balanced power mode.

static Int

Perform Bluetooth LE advertising in low latency, high power mode.

static Int

Perform Bluetooth LE advertising in low power mode.

static Int

Advertise using high TX power level.

static Int

Advertise using low TX power level.

static Int

Advertise using medium TX power level.

static Int

Advertise using the lowest transmission (TX) power level.

Inherited constants
Public methods
Int

Int

Returns the advertise mode.

Int

Returns the advertising time limit in milliseconds.

Int

Returns the TX power level for advertising.

Boolean

Returns whether the advertisement will indicate connectable.

Boolean

Returns whether the advertisement will be discoverable.

String

Unit
writeToParcel(dest: Parcel, flags: Int)

Properties
static Parcelable.Creator<AdvertiseSettings!>

Constants

Added in API level 21
static val ADVERTISE_MODE_BALANCED: Int

Perform Bluetooth LE advertising in balanced power mode. This is balanced between advertising frequency and power consumption.

Value: 1
Added in API level 21
static val ADVERTISE_MODE_LOW_LATENCY: Int

Perform Bluetooth LE advertising in low latency, high power mode. This has the highest power consumption and should not be used for continuous background advertising.

Value: 2
Added in API level 21
static val ADVERTISE_MODE_LOW_POWER: Int

Perform Bluetooth LE advertising in low power mode. This is the default and preferred advertising mode as it consumes the least power.

Value: 0
Added in API level 21
static val ADVERTISE_TX_POWER_HIGH: Int

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

Value: 3
Added in API level 21
static val ADVERTISE_TX_POWER_LOW: Int

Advertise using low TX power level.

Value: 1
Added in API level 21
static val ADVERTISE_TX_POWER_MEDIUM: Int

Advertise using medium TX power level.

Value: 2
Added in API level 21
static val ADVERTISE_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: 0

Public methods

describeContents

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

getMode

Added in API level 21
fun getMode(): Int

Returns the advertise mode.

getTimeout

Added in API level 21
fun getTimeout(): Int

Returns the advertising time limit in milliseconds.

getTxPowerLevel

Added in API level 21
fun getTxPowerLevel(): Int

Returns the TX power level for advertising.

isConnectable

Added in API level 21
fun isConnectable(): Boolean

Returns whether the advertisement will indicate connectable.

isDiscoverable

Added in API level 34
fun isDiscoverable(): Boolean

Returns whether the advertisement will be discoverable.

toString

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

writeToParcel

Added in API level 21
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 21
static val CREATOR: Parcelable.Creator<AdvertiseSettings!>