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 |
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 |
getMode() 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 |
toString() |
Unit |
writeToParcel(dest: Parcel, flags: Int) |
Properties | |
---|---|
static Parcelable.Creator<AdvertiseSettings!> |
Constants
ADVERTISE_MODE_BALANCED
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
ADVERTISE_MODE_LOW_LATENCY
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
ADVERTISE_MODE_LOW_POWER
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
ADVERTISE_TX_POWER_HIGH
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
ADVERTISE_TX_POWER_LOW
static val ADVERTISE_TX_POWER_LOW: Int
Advertise using low TX power level.
Value: 1
ADVERTISE_TX_POWER_MEDIUM
static val ADVERTISE_TX_POWER_MEDIUM: Int
Advertise using medium TX power level.
Value: 2
ADVERTISE_TX_POWER_ULTRA_LOW
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
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 |
getTimeout
fun getTimeout(): Int
Returns the advertising time limit in milliseconds.
getTxPowerLevel
fun getTxPowerLevel(): Int
Returns the TX power level for advertising.
isConnectable
fun isConnectable(): Boolean
Returns whether the advertisement will indicate connectable.
isDiscoverable
fun isDiscoverable(): Boolean
Returns whether the advertisement will be discoverable.
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 |