Added in API level 33

TransportDiscoveryData


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

Wrapper for Transport Discovery Data AD Type. This class contains the Transport Discovery Data AD Type Code as well as a list of potential Transport Blocks.

Summary

Inherited constants
Public constructors
TransportDiscoveryData(transportDiscoveryData: ByteArray)

Creates a TransportDiscoveryData instance from byte arrays.

TransportDiscoveryData(transportDataType: Int, transportBlocks: MutableList<TransportBlock!>)

Creates a TransportDiscoveryData instance.

Public methods
MutableList<TransportBlock!>

Int

Gets the transport data type.

ByteArray?

Converts this TransportDiscoveryData to byte array

String

Int

Unit
writeToParcel(dest: Parcel, flags: Int)

Flatten this object in to a Parcel.

Properties
static Parcelable.Creator<TransportDiscoveryData!>

Public constructors

TransportDiscoveryData

Added in API level 33
TransportDiscoveryData(transportDiscoveryData: ByteArray)

Creates a TransportDiscoveryData instance from byte arrays.

Uses the transport discovery data bytes and parses them into an usable class.

Parameters
transportDiscoveryData ByteArray: the raw discovery data This value cannot be null.

TransportDiscoveryData

Added in API level 33
TransportDiscoveryData(
    transportDataType: Int,
    transportBlocks: MutableList<TransportBlock!>)

Creates a TransportDiscoveryData instance.

Parameters
transportDataType Int: the Transport Discovery Data AD Type
transportBlocks MutableList<TransportBlock!>: the list of Transport Blocks This value cannot be null.

Public methods

getTransportBlocks

Added in API level 33
fun getTransportBlocks(): MutableList<TransportBlock!>
Return
MutableList<TransportBlock!> the list of TransportBlock in this TransportDiscoveryData or an empty list if there are no Transport Blocks This value cannot be null.

getTransportDataType

Added in API level 33
fun getTransportDataType(): Int

Gets the transport data type.

toByteArray

Added in API level 33
fun toByteArray(): ByteArray?

Converts this TransportDiscoveryData to byte array

Return
ByteArray? byte array representation of this Transport Discovery Data or null if the conversion failed

toString

Added in API level 33
fun toString(): String
Return
String a string representation of the object.

totalBytes

Added in API level 33
fun totalBytes(): Int
Return
Int total byte count of this TransportDataDiscovery

writeToParcel

Added in API level 33
fun writeToParcel(
    dest: Parcel,
    flags: Int
): Unit

Flatten this object in to a Parcel.

Parameters
dest Parcel: 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 33
static val CREATOR: Parcelable.Creator<TransportDiscoveryData!>