public static final class Advertisement.Builder extends Object
Advertisement
.Constructor and Description |
---|
Builder() |
Modifier and Type | Method and Description |
---|---|
Advertisement |
build()
Build the
Advertisement object. |
Advertisement.Builder |
setAdvertiseMode(int advertiseMode)
Set advertise mode to control the advertising power and latency.
|
Advertisement.Builder |
setIdentifiers(List ids)
Set ID strings for advertisement.
|
Advertisement.Builder |
setLayout(Advertisement.BeaconLayout layout)
Set beacon layout.
|
Advertisement.Builder |
setTxPower(int txPower)
Set the calibrated measured Tx power of the Beacon in RSSI
This value is baked into an Beacon when it is manufactured, and
it is transmitted with each packet to aid in the mDistance estimate
|
Advertisement.Builder |
setTxPowerLevel(int txPowerLevel)
Set advertise TX power level to control the transmission power level for the advertising.
|
public Advertisement.Builder setLayout(Advertisement.BeaconLayout layout)
layout
- beacon layout BeaconLayout
NullPointerException
- If the layout
are null
.public Advertisement.Builder setIdentifiers(List ids)
ids
- list of beacon's idsNullPointerException
- If the ids
are null
.public Advertisement.Builder setAdvertiseMode(int advertiseMode)
advertiseMode
- Bluetooth LE Advertising mode, can only be one of
AdvertiseSettings.ADVERTISE_MODE_LOW_POWER
,
AdvertiseSettings.ADVERTISE_MODE_BALANCED
, or
AdvertiseSettings.ADVERTISE_MODE_LOW_LATENCY
.IllegalArgumentException
- If the advertiseMode is invalid.public Advertisement.Builder setTxPower(int txPower)
txPower
- calibrated measured Tx power of the Beacon in RSSI.
The valid range is from -128 to 0IllegalArgumentException
- If the txPower
is invalid.public Advertisement.Builder setTxPowerLevel(int txPowerLevel)
txPowerLevel
- Transmission power of Bluetooth LE Advertising, can only be one of
AdvertiseSettings.ADVERTISE_TX_POWER_ULTRA_LOW
,
AdvertiseSettings.ADVERTISE_TX_POWER_LOW
,
AdvertiseSettings.ADVERTISE_TX_POWER_MEDIUM
or
AdvertiseSettings.ADVERTISE_TX_POWER_HIGH
.IllegalArgumentException
- If the txPowerLevel
is invalid.public Advertisement build()
Advertisement
object.