TransportBlock


public final class TransportBlock
extends Object implements Parcelable

java.lang.Object
   ↳ android.bluetooth.le.TransportBlock


Wrapper for Transport Discovery Data Transport Blocks. This class represents a Transport Block from a Transport Discovery Data.

Summary

Inherited constants

Fields

public static final Creator<TransportBlock> CREATOR

Public constructors

TransportBlock(int orgId, int tdsFlags, int transportDataLength, byte[] transportData)

Creates an instance of TransportBlock from raw data.

Public methods

int getOrgId()

Gets the Organization ID of the Transport Block which corresponds to one of the Bluetooth SIG Assigned Numbers.

int getTdsFlags()

Gets the TDS flags of the Transport Block which represents the role of the device and information about its state and supported features.

byte[] getTransportData()

Gets the Transport Data of the Transport Block which contains organization-specific data.

int getTransportDataLength()

Gets the total number of octets in the Transport Data field in this Transport Block.

byte[] toByteArray()

Converts this TransportBlock to byte array

int totalBytes()
void writeToParcel(Parcel dest, int flags)

Flatten this object in to a Parcel.

Inherited methods

Fields

CREATOR

Added in API level 33
public static final Creator<TransportBlock> CREATOR

Public constructors

TransportBlock

Added in API level 33
public TransportBlock (int orgId, 
                int tdsFlags, 
                int transportDataLength, 
                byte[] transportData)

Creates an instance of TransportBlock from raw data.

Parameters
orgId int: the Organization ID

tdsFlags int: the TDS flags

transportDataLength int: the total length of the Transport Data

transportData byte: the Transport Data This value may be null.

Public methods

getOrgId

Added in API level 33
public int getOrgId ()

Gets the Organization ID of the Transport Block which corresponds to one of the Bluetooth SIG Assigned Numbers.

Returns
int

getTdsFlags

Added in API level 33
public int getTdsFlags ()

Gets the TDS flags of the Transport Block which represents the role of the device and information about its state and supported features.

Returns
int

getTransportData

Added in API level 33
public byte[] getTransportData ()

Gets the Transport Data of the Transport Block which contains organization-specific data.

Returns
byte[] This value may be null.

getTransportDataLength

Added in API level 33
public int getTransportDataLength ()

Gets the total number of octets in the Transport Data field in this Transport Block.

Returns
int

toByteArray

Added in API level 33
public byte[] toByteArray ()

Converts this TransportBlock to byte array

Returns
byte[] byte array representation of this Transport Block or null if the conversion failed

totalBytes

Added in API level 33
public int totalBytes ()

Returns
int total byte count of this TransportBlock

writeToParcel

Added in API level 33
public void writeToParcel (Parcel dest, 
                int flags)

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.PARCELABLE_WRITE_RETURN_VALUE. Value is either 0 or a combination of Parcelable.PARCELABLE_WRITE_RETURN_VALUE, and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES