public final class AdvertiseSettings extends Object implements Parcelable
AdvertiseSettings
provide a way to adjust advertising preferences for each
Bluetooth LE advertisement instance. Use AdvertiseSettings.Builder
to create an
instance of this class.Modifier and Type | Class and Description |
---|---|
static class |
AdvertiseSettings.Builder
Builder class for
AdvertiseSettings . |
Parcelable.ClassLoaderCreator<T>, Parcelable.Creator<T>
Modifier and Type | Field and Description |
---|---|
static int |
ADVERTISE_MODE_BALANCED
Perform Bluetooth LE advertising in balanced power mode.
|
static int |
ADVERTISE_MODE_LOW_LATENCY
Perform Bluetooth LE advertising in low latency, high power mode.
|
static int |
ADVERTISE_MODE_LOW_POWER
Perform Bluetooth LE advertising in low power mode.
|
static int |
ADVERTISE_TX_POWER_HIGH
Advertise using high TX power level.
|
static int |
ADVERTISE_TX_POWER_LOW
Advertise using low TX power level.
|
static int |
ADVERTISE_TX_POWER_MEDIUM
Advertise using medium TX power level.
|
static int |
ADVERTISE_TX_POWER_ULTRA_LOW
Advertise using the lowest transmission (TX) power level.
|
static Parcelable.Creator<AdvertiseSettings> |
CREATOR |
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_ELIDE_DUPLICATES, PARCELABLE_WRITE_RETURN_VALUE
Modifier and Type | Method and Description |
---|---|
int |
describeContents()
Describe the kinds of special objects contained in this Parcelable
instance's marshaled representation.
|
int |
getMode()
Returns the advertise mode.
|
int |
getTimeout()
Returns the advertising time limit in milliseconds.
|
int |
getTxPowerLevel()
Returns the TX power level for advertising.
|
boolean |
isConnectable()
Returns whether the advertisement will indicate connectable.
|
String |
toString()
Returns a string representation of the object.
|
void |
writeToParcel(Parcel dest,
int flags)
Flatten this object in to a Parcel.
|
public static final int ADVERTISE_MODE_LOW_POWER
public static final int ADVERTISE_MODE_BALANCED
public static final int ADVERTISE_MODE_LOW_LATENCY
public static final int ADVERTISE_TX_POWER_ULTRA_LOW
public static final int ADVERTISE_TX_POWER_LOW
public static final int ADVERTISE_TX_POWER_MEDIUM
public static final int ADVERTISE_TX_POWER_HIGH
public static final Parcelable.Creator<AdvertiseSettings> CREATOR
public int getMode()
public int getTxPowerLevel()
public boolean isConnectable()
public int getTimeout()
public String toString()
Object
toString
method returns a string that
"textually represents" this object. The result should
be a concise but informative representation that is easy for a
person to read.
It is recommended that all subclasses override this method.
The toString
method for class Object
returns a string consisting of the name of the class of which the
object is an instance, the at-sign character `@
', and
the unsigned hexadecimal representation of the hash code of the
object. In other words, this method returns a string equal to the
value of:
getClass().getName() + '@' + Integer.toHexString(hashCode())
public int describeContents()
Parcelable
Parcelable.writeToParcel(Parcel, int)
,
the return value of this method must include the
Parcelable.CONTENTS_FILE_DESCRIPTOR
bit.describeContents
in interface Parcelable
Parcelable.CONTENTS_FILE_DESCRIPTOR
public void writeToParcel(Parcel dest, int flags)
Parcelable
writeToParcel
in interface Parcelable
dest
- The Parcel in which the object should be written.flags
- Additional flags about how the object should be written.
May be 0 or Parcelable.PARCELABLE_WRITE_RETURN_VALUE
.