Skip to content

Most visited

Recently visited

navigation

ScanRecord

public final class ScanRecord
extends Object

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


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 representation of the object.

Inherited methods

From class java.lang.Object

Public methods

getAdvertiseFlags

added in API level 21
int getAdvertiseFlags ()

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

Returns
int

getBytes

added in API level 21
byte[] getBytes ()

Returns raw bytes of scan record.

Returns
byte[]

getDeviceName

added in API level 21
String getDeviceName ()

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

Returns
String

This value may be null.

getManufacturerSpecificData

added in API level 21
SparseArray<byte[]> getManufacturerSpecificData ()

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

Returns
SparseArray<byte[]>

getManufacturerSpecificData

added in API level 21
byte[] getManufacturerSpecificData (int manufacturerId)

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

Parameters
manufacturerId int

Returns
byte[]

This value may be null.

getServiceData

added in API level 21
byte[] getServiceData (ParcelUuid serviceDataUuid)

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

Parameters
serviceDataUuid ParcelUuid

Returns
byte[]

This value may be null.

getServiceData

added in API level 21
Map<ParcelUuid, byte[]> getServiceData ()

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

Returns
Map<ParcelUuid, byte[]>

getServiceUuids

added in API level 21
List<ParcelUuid> getServiceUuids ()

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

Returns
List<ParcelUuid>

getTxPowerLevel

added in API level 21
int getTxPowerLevel ()

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

Returns
int

toString

added in API level 21
String toString ()

Returns a string representation of the object. In general, the 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())
 

Returns
String a string representation of the object.

This site uses cookies to store your preferences for site-specific language and display options.

Get the latest Android developer news and tips that will help you find success on Google Play.

* Required Fields

Hooray!

Browse this site in ?

You requested a page in , but your language preference for this site is .

Would you like to change your language preference and browse this site in ? If you want to change your language preference later, use the language menu at the bottom of each page.

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a short survey?
Help us improve the Android developer experience.
(Sep 2017 survey)