Android APIs
public static final class

AdvertiseSettings.Builder

extends Object
java.lang.Object
   ↳ android.bluetooth.le.AdvertiseSettings.Builder

Class Overview

Builder class for AdvertiseSettings.

Summary

Public Constructors
AdvertiseSettings.Builder()
Public Methods
AdvertiseSettings build()
Build the AdvertiseSettings object.
AdvertiseSettings.Builder setAdvertiseMode(int advertiseMode)
Set advertise mode to control the advertising power and latency.
AdvertiseSettings.Builder setTxPowerLevel(int txPowerLevel)
Set advertise tx power level to control the transmission power level for the advertising.
AdvertiseSettings.Builder setType(int type)
Set advertise type to control the event type of advertising.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public AdvertiseSettings.Builder ()

Public Methods

public AdvertiseSettings build ()

Build the AdvertiseSettings object.

public AdvertiseSettings.Builder setAdvertiseMode (int advertiseMode)

Set advertise mode to control the advertising power and latency.

Parameters
advertiseMode Bluetooth LE Advertising mode, can only be one of ADVERTISE_MODE_LOW_POWER, ADVERTISE_MODE_BALANCED, or ADVERTISE_MODE_LOW_LATENCY.
Throws
IllegalArgumentException If the advertiseMode is invalid.

public AdvertiseSettings.Builder setTxPowerLevel (int txPowerLevel)

Set advertise tx power level to control the transmission power level for the advertising.

Parameters
txPowerLevel Transmission power of Bluetooth LE Advertising, can only be one of ADVERTISE_TX_POWER_ULTRA_LOW, ADVERTISE_TX_POWER_LOW, ADVERTISE_TX_POWER_MEDIUM or ADVERTISE_TX_POWER_HIGH.
Throws
IllegalArgumentException If the txPowerLevel is invalid.

public AdvertiseSettings.Builder setType (int type)

Set advertise type to control the event type of advertising.

Parameters
type Bluetooth LE Advertising type, can be either ADVERTISE_TYPE_NON_CONNECTABLE, ADVERTISE_TYPE_SCANNABLE or ADVERTISE_TYPE_CONNECTABLE.
Throws
IllegalArgumentException If the type is invalid.