Added in API level 21

AdvertiseData


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

Advertise data packet container for Bluetooth LE advertising. This represents the data to be advertised as well as the scan response data for active scans.

Use AdvertiseData.Builder to create an instance of AdvertiseData to be advertised.

Summary

Nested classes

Builder for AdvertiseData.

Inherited constants
Public methods
Int

Boolean

Whether the device name will be included in the advertisement packet.

Boolean

Whether the transmission power level will be included in the advertisement packet.

SparseArray<ByteArray!>!

Returns an array of manufacturer Id and the corresponding manufacturer specific data.

MutableMap<ParcelUuid!, ByteArray!>!

Returns a map of 16-bit UUID and its corresponding service data.

MutableList<ParcelUuid!>

Returns a list of service solicitation UUIDs within the advertisement that we invite to connect.

MutableList<ParcelUuid!>!

Returns a list of service UUIDs within the advertisement that are used to identify the Bluetooth GATT services.

MutableList<TransportDiscoveryData!>

Returns a list of TransportDiscoveryData within the advertisement.

String

Unit
writeToParcel(dest: Parcel, flags: Int)

Properties
static Parcelable.Creator<AdvertiseData!>

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

getIncludeDeviceName

Added in API level 21
fun getIncludeDeviceName(): Boolean

Whether the device name will be included in the advertisement packet.

getIncludeTxPowerLevel

Added in API level 21
fun getIncludeTxPowerLevel(): Boolean

Whether the transmission power level will be included in the advertisement packet.

getManufacturerSpecificData

Added in API level 21
fun getManufacturerSpecificData(): SparseArray<ByteArray!>!

Returns an array of manufacturer Id and the corresponding manufacturer specific data. The manufacturer id is a non-negative number assigned by Bluetooth SIG.

getServiceData

Added in API level 21
fun getServiceData(): MutableMap<ParcelUuid!, ByteArray!>!

Returns a map of 16-bit UUID and its corresponding service data.

getServiceSolicitationUuids

Added in API level 31
fun getServiceSolicitationUuids(): MutableList<ParcelUuid!>

Returns a list of service solicitation UUIDs within the advertisement that we invite to connect.

Return
MutableList<ParcelUuid!> This value cannot be null.

getServiceUuids

Added in API level 21
fun getServiceUuids(): MutableList<ParcelUuid!>!

Returns a list of service UUIDs within the advertisement that are used to identify the Bluetooth GATT services.

getTransportDiscoveryData

Added in API level 33
fun getTransportDiscoveryData(): MutableList<TransportDiscoveryData!>

Returns a list of TransportDiscoveryData within the advertisement.

Return
MutableList<TransportDiscoveryData!> This value cannot be null.

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<AdvertiseData!>