Android APIs
public final class

ScanRecord

extends Object
java.lang.Object
   ↳ android.bluetooth.le.ScanRecord

Class Overview

Represents a scan record from Bluetooth LE scan.

Summary

Public Methods
int getAdvertiseFlags()
Returns the advertising flags indicating the discoverable mode and capability of the device.
byte[] getBytes()
Returns raw bytes of scan record.
String getDeviceName()
Returns the local name of the BLE device.
SparseArray<byte[]> getManufacturerSpecificData()
Returns a sparse array of manufacturer identifier and its corresponding manufacturer specific data.
byte[] getManufacturerSpecificData(int manufacturerId)
Returns the manufacturer specific data associated with the manufacturer id.
byte[] getServiceData(ParcelUuid serviceDataUuid)
Returns the service data byte array associated with the serviceUuid.
Map<ParcelUuid, byte[]> getServiceData()
Returns a map of service UUID and its corresponding service data.
List<ParcelUuid> getServiceUuids()
Returns a list of service UUIDs within the advertisement that are used to identify the bluetooth GATT services.
int getTxPowerLevel()
Returns the transmission power level of the packet in dBm.
String toString()
Returns a string containing a concise, human-readable description of this object.
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public int getAdvertiseFlags ()

Added in API level 21

Returns the advertising flags indicating the discoverable mode and capability of the device. Returns -1 if the flag field is not set.

public byte[] getBytes ()

Added in API level 21

Returns raw bytes of scan record.

public String getDeviceName ()

Added in API level 21

Returns the local name of the BLE device. The is a UTF-8 encoded string.

public SparseArray<byte[]> getManufacturerSpecificData ()

Added in API level 21

Returns a sparse array of manufacturer identifier and its corresponding manufacturer specific data.

public byte[] getManufacturerSpecificData (int manufacturerId)

Added in API level 21

Returns the manufacturer specific data associated with the manufacturer id. Returns null if the manufacturerId is not found.

public byte[] getServiceData (ParcelUuid serviceDataUuid)

Added in API level 21

Returns the service data byte array associated with the serviceUuid. Returns null if the serviceDataUuid is not found.

public Map<ParcelUuid, byte[]> getServiceData ()

Added in API level 21

Returns a map of service UUID and its corresponding service data.

public List<ParcelUuid> getServiceUuids ()

Added in API level 21

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

public int getTxPowerLevel ()

Added in API level 21

Returns the transmission power level of the packet in dBm. Returns MIN_VALUE if the field is not set. This value can be used to calculate the path loss of a received packet using the following equation:

pathloss = txPowerLevel - rssi

public String toString ()

Added in API level 21

Returns a string containing a concise, human-readable description of this object. Subclasses are encouraged to override this method and provide an implementation that takes into account the object's type and data. The default implementation is equivalent to the following expression:

   getClass().getName() + '@' + Integer.toHexString(hashCode())

See Writing a useful toString method if you intend implementing your own toString method.

Returns
  • a printable representation of this object.