ScanRecord
public
final
class
ScanRecord
extends Object
java.lang.Object | |
↳ | android.bluetooth.le.ScanRecord |
Represents a scan record from Bluetooth LE scan.
Summary
Constants | |
---|---|
int |
DATA_TYPE_3D_INFORMATION_DATA
Data type is 3D Information Data, see the Bluetooth Generic Access Profile for more details. |
int |
DATA_TYPE_ADVERTISING_INTERVAL
Data type is Advertising Interval, see the Bluetooth Generic Access Profile for more details. |
int |
DATA_TYPE_ADVERTISING_INTERVAL_LONG
Data type is Advertising Interval - long, see the Bluetooth Generic Access Profile for more details. |
int |
DATA_TYPE_APPEARANCE
Data type is Appearance, see the Bluetooth Generic Access Profile for more details. |
int |
DATA_TYPE_BIG_INFO
Data type is BIGInfo, see the Bluetooth Generic Access Profile for more details. |
int |
DATA_TYPE_BROADCAST_CODE
Data type is Broadcast_Code, see the Bluetooth Generic Access Profile for more details. |
int |
DATA_TYPE_CHANNEL_MAP_UPDATE_INDICATION
Data type is Channel Map Update Indication, see the Bluetooth Generic Access Profile for more details. |
int |
DATA_TYPE_CLASS_OF_DEVICE
Data type is Class of Device, see the Bluetooth Generic Access Profile for more details. |
int |
DATA_TYPE_DEVICE_ID
Data type is Device ID, see the Bluetooth Generic Access Profile for more details. |
int |
DATA_TYPE_FLAGS
Data type is Flags, see the Bluetooth Generic Access Profile for more details. |
int |
DATA_TYPE_INDOOR_POSITIONING
Data type is Indoor Positioning, see the Bluetooth Generic Access Profile for more details. |
int |
DATA_TYPE_LE_BLUETOOTH_DEVICE_ADDRESS
Data type is LE Bluetooth Device Address, see the Bluetooth Generic Access Profile for more details. |
int |
DATA_TYPE_LE_ROLE
Data type is LE Role, see the Bluetooth Generic Access Profile for more details. |
int |
DATA_TYPE_LE_SECURE_CONNECTIONS_CONFIRMATION_VALUE
Data type is LE Secure Connections Confirmation Value, see the Bluetooth Generic Access Profile for more details. |
int |
DATA_TYPE_LE_SECURE_CONNECTIONS_RANDOM_VALUE
Data type is LE Secure Connections Random Value, see the Bluetooth Generic Access Profile for more details. |
int |
DATA_TYPE_LE_SUPPORTED_FEATURES
Data type is LE Supported Features, see the Bluetooth Generic Access Profile for more details. |
int |
DATA_TYPE_LOCAL_NAME_COMPLETE
Data type is Complete Local Name, see the Bluetooth Generic Access Profile for more details. |
int |
DATA_TYPE_LOCAL_NAME_SHORT
Data type is Shortened Local Name, see the Bluetooth Generic Access Profile for more details. |
int |
DATA_TYPE_MANUFACTURER_SPECIFIC_DATA
Data type is Manufacturer Specific Data, see the Bluetooth Generic Access Profile for more details. |
int |
DATA_TYPE_MESH_BEACON
Data type is Mesh Beacon, see the Bluetooth Generic Access Profile for more details. |
int |
DATA_TYPE_MESH_MESSAGE
Data type is Mesh Message, see the Bluetooth Generic Access Profile for more details. |
int |
DATA_TYPE_NONE
Data type is not set for the filter. |
int |
DATA_TYPE_PB_ADV
Data type is PB-ADV, see the Bluetooth Generic Access Profile for more details. |
int |
DATA_TYPE_PUBLIC_TARGET_ADDRESS
Data type is Public Target Address, see the Bluetooth Generic Access Profile for more details. |
int |
DATA_TYPE_RANDOM_TARGET_ADDRESS
Data type is Random Target Address, see the Bluetooth Generic Access Profile for more details. |
int |
DATA_TYPE_RESOLVABLE_SET_IDENTIFIER
Data type is Resolvable Set Identifier, see the Bluetooth Generic Access Profile for more details. |
int |
DATA_TYPE_SECURITY_MANAGER_OUT_OF_BAND_FLAGS
Data type is Security Manager Out of Band Flags, see the Bluetooth Generic Access Profile for more details. |
int |
DATA_TYPE_SERVICE_DATA_128_BIT
Data type is Service Data - 128-bit UUID, see the Bluetooth Generic Access Profile for more details. |
int |
DATA_TYPE_SERVICE_DATA_16_BIT
Data type is Service Data - 16-bit UUID, see the Bluetooth Generic Access Profile for more details. |
int |
DATA_TYPE_SERVICE_DATA_32_BIT
Data type is Service Data - 32-bit UUID, see the Bluetooth Generic Access Profile for more details. |
int |
DATA_TYPE_SERVICE_SOLICITATION_UUIDS_128_BIT
Data type is List of 128-bit Service Solicitation UUIDs, see the Bluetooth Generic Access Profile for more details. |
int |
DATA_TYPE_SERVICE_SOLICITATION_UUIDS_16_BIT
Data type is List of 16-bit Service Solicitation UUIDs, see the Bluetooth Generic Access Profile for more details. |
int |
DATA_TYPE_SERVICE_SOLICITATION_UUIDS_32_BIT
Data type is List of 32-bit Service Solicitation UUIDs, see the Bluetooth Generic Access Profile for more details. |
int |
DATA_TYPE_SERVICE_UUIDS_128_BIT_COMPLETE
Data type is Complete List of 128-bit Service Class UUIDs, see the Bluetooth Generic Access Profile for more details. |
int |
DATA_TYPE_SERVICE_UUIDS_128_BIT_PARTIAL
Data type is Incomplete List of 128-bit Service Class UUIDs, see the Bluetooth Generic Access Profile for the details. |
int |
DATA_TYPE_SERVICE_UUIDS_16_BIT_COMPLETE
Data type is Complete List of 16-bit Service Class UUIDs, see the Bluetooth Generic Access Profile for more details. |
int |
DATA_TYPE_SERVICE_UUIDS_16_BIT_PARTIAL
Data type is Incomplete List of 16-bit Service Class UUIDs, see the Bluetooth Generic Access Profile for the details. |
int |
DATA_TYPE_SERVICE_UUIDS_32_BIT_COMPLETE
Data type is Complete List of 32-bit Service Class UUIDs, see the Bluetooth Generic Access Profile for more details. |
int |
DATA_TYPE_SERVICE_UUIDS_32_BIT_PARTIAL
Data type is Incomplete List of 32-bit Service Class UUIDs, see the Bluetooth Generic Access Profile for the details. |
int |
DATA_TYPE_SIMPLE_PAIRING_HASH_C
Data type is Simple Pairing Hash C, see the Bluetooth Generic Access Profile for more details. |
int |
DATA_TYPE_SIMPLE_PAIRING_HASH_C_256
Data type is Simple Pairing Hash C-256, see the Bluetooth Generic Access Profile for more details. |
int |
DATA_TYPE_SIMPLE_PAIRING_RANDOMIZER_R
Data type is Simple Pairing Randomizer R, see the Bluetooth Generic Access Profile for more details. |
int |
DATA_TYPE_SIMPLE_PAIRING_RANDOMIZER_R_256
Data type is Simple Pairing Randomizer R-256, see the Bluetooth Generic Access Profile for more details. |
int |
DATA_TYPE_SLAVE_CONNECTION_INTERVAL_RANGE
Data type is Slave Connection Interval Range, see the Bluetooth Generic Access Profile for more details. |
int |
DATA_TYPE_TRANSPORT_DISCOVERY_DATA
Data type is Transport Discovery Data, see the Bluetooth Generic Access Profile for more details. |
int |
DATA_TYPE_TX_POWER_LEVEL
Data type is Tx Power Level, see the Bluetooth Generic Access Profile for more details. |
int |
DATA_TYPE_URI
Data type is URI, see the Bluetooth Generic Access Profile for more details. |
Public methods | |
---|---|
int
|
getAdvertiseFlags()
Returns the advertising flags indicating the discoverable mode and capability of the device. |
Map<Integer, byte[]>
|
getAdvertisingDataMap()
Returns a map of advertising data type and its corresponding advertising data. |
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 |
Map<ParcelUuid, byte[]>
|
getServiceData()
Returns a map of service UUID and its corresponding service data. |
List<ParcelUuid>
|
getServiceSolicitationUuids()
Returns a list of service solicitation UUIDs within the advertisement that are used to identify the Bluetooth GATT services. |
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 | |
---|---|
Constants
DATA_TYPE_3D_INFORMATION_DATA
public static final int DATA_TYPE_3D_INFORMATION_DATA
Data type is 3D Information Data, see the Bluetooth Generic Access Profile for more details.
Constant Value: 61 (0x0000003d)
DATA_TYPE_ADVERTISING_INTERVAL
public static final int DATA_TYPE_ADVERTISING_INTERVAL
Data type is Advertising Interval, see the Bluetooth Generic Access Profile for more details.
Constant Value: 26 (0x0000001a)
DATA_TYPE_ADVERTISING_INTERVAL_LONG
public static final int DATA_TYPE_ADVERTISING_INTERVAL_LONG
Data type is Advertising Interval - long, see the Bluetooth Generic Access Profile for more details.
Constant Value: 47 (0x0000002f)
DATA_TYPE_APPEARANCE
public static final int DATA_TYPE_APPEARANCE
Data type is Appearance, see the Bluetooth Generic Access Profile for more details.
Constant Value: 25 (0x00000019)
DATA_TYPE_BIG_INFO
public static final int DATA_TYPE_BIG_INFO
Data type is BIGInfo, see the Bluetooth Generic Access Profile for more details.
Constant Value: 44 (0x0000002c)
DATA_TYPE_BROADCAST_CODE
public static final int DATA_TYPE_BROADCAST_CODE
Data type is Broadcast_Code, see the Bluetooth Generic Access Profile for more details.
Constant Value: 45 (0x0000002d)
DATA_TYPE_CHANNEL_MAP_UPDATE_INDICATION
public static final int DATA_TYPE_CHANNEL_MAP_UPDATE_INDICATION
Data type is Channel Map Update Indication, see the Bluetooth Generic Access Profile for more details.
Constant Value: 40 (0x00000028)
DATA_TYPE_CLASS_OF_DEVICE
public static final int DATA_TYPE_CLASS_OF_DEVICE
Data type is Class of Device, see the Bluetooth Generic Access Profile for more details.
Constant Value: 13 (0x0000000d)
DATA_TYPE_DEVICE_ID
public static final int DATA_TYPE_DEVICE_ID
Data type is Device ID, see the Bluetooth Generic Access Profile for more details.
Constant Value: 16 (0x00000010)
DATA_TYPE_FLAGS
public static final int DATA_TYPE_FLAGS
Data type is Flags, see the Bluetooth Generic Access Profile for more details.
Constant Value: 1 (0x00000001)
DATA_TYPE_INDOOR_POSITIONING
public static final int DATA_TYPE_INDOOR_POSITIONING
Data type is Indoor Positioning, see the Bluetooth Generic Access Profile for more details.
Constant Value: 37 (0x00000025)
DATA_TYPE_LE_BLUETOOTH_DEVICE_ADDRESS
public static final int DATA_TYPE_LE_BLUETOOTH_DEVICE_ADDRESS
Data type is LE Bluetooth Device Address, see the Bluetooth Generic Access Profile for more details.
Constant Value: 27 (0x0000001b)
DATA_TYPE_LE_ROLE
public static final int DATA_TYPE_LE_ROLE
Data type is LE Role, see the Bluetooth Generic Access Profile for more details.
Constant Value: 28 (0x0000001c)
DATA_TYPE_LE_SECURE_CONNECTIONS_CONFIRMATION_VALUE
public static final int DATA_TYPE_LE_SECURE_CONNECTIONS_CONFIRMATION_VALUE
Data type is LE Secure Connections Confirmation Value, see the Bluetooth Generic Access Profile for more details.
Constant Value: 34 (0x00000022)
DATA_TYPE_LE_SECURE_CONNECTIONS_RANDOM_VALUE
public static final int DATA_TYPE_LE_SECURE_CONNECTIONS_RANDOM_VALUE
Data type is LE Secure Connections Random Value, see the Bluetooth Generic Access Profile for more details.
Constant Value: 35 (0x00000023)
DATA_TYPE_LE_SUPPORTED_FEATURES
public static final int DATA_TYPE_LE_SUPPORTED_FEATURES
Data type is LE Supported Features, see the Bluetooth Generic Access Profile for more details.
Constant Value: 39 (0x00000027)
DATA_TYPE_LOCAL_NAME_COMPLETE
public static final int DATA_TYPE_LOCAL_NAME_COMPLETE
Data type is Complete Local Name, see the Bluetooth Generic Access Profile for more details.
Constant Value: 9 (0x00000009)
DATA_TYPE_LOCAL_NAME_SHORT
public static final int DATA_TYPE_LOCAL_NAME_SHORT
Data type is Shortened Local Name, see the Bluetooth Generic Access Profile for more details.
Constant Value: 8 (0x00000008)
DATA_TYPE_MANUFACTURER_SPECIFIC_DATA
public static final int DATA_TYPE_MANUFACTURER_SPECIFIC_DATA
Data type is Manufacturer Specific Data, see the Bluetooth Generic Access Profile for more details.
Constant Value: 255 (0x000000ff)
DATA_TYPE_MESH_BEACON
public static final int DATA_TYPE_MESH_BEACON
Data type is Mesh Beacon, see the Bluetooth Generic Access Profile for more details.
Constant Value: 43 (0x0000002b)
DATA_TYPE_MESH_MESSAGE
public static final int DATA_TYPE_MESH_MESSAGE
Data type is Mesh Message, see the Bluetooth Generic Access Profile for more details.
Constant Value: 42 (0x0000002a)
DATA_TYPE_NONE
public static final int DATA_TYPE_NONE
Data type is not set for the filter. Will not filter advertising data type.
Constant Value: -1 (0xffffffff)
DATA_TYPE_PB_ADV
public static final int DATA_TYPE_PB_ADV
Data type is PB-ADV, see the Bluetooth Generic Access Profile for more details.
Constant Value: 41 (0x00000029)
DATA_TYPE_PUBLIC_TARGET_ADDRESS
public static final int DATA_TYPE_PUBLIC_TARGET_ADDRESS
Data type is Public Target Address, see the Bluetooth Generic Access Profile for more details.
Constant Value: 23 (0x00000017)
DATA_TYPE_RANDOM_TARGET_ADDRESS
public static final int DATA_TYPE_RANDOM_TARGET_ADDRESS
Data type is Random Target Address, see the Bluetooth Generic Access Profile for more details.
Constant Value: 24 (0x00000018)
DATA_TYPE_RESOLVABLE_SET_IDENTIFIER
public static final int DATA_TYPE_RESOLVABLE_SET_IDENTIFIER
Data type is Resolvable Set Identifier, see the Bluetooth Generic Access Profile for more details.
Constant Value: 46 (0x0000002e)
DATA_TYPE_SECURITY_MANAGER_OUT_OF_BAND_FLAGS
public static final int DATA_TYPE_SECURITY_MANAGER_OUT_OF_BAND_FLAGS
Data type is Security Manager Out of Band Flags, see the Bluetooth Generic Access Profile for more details.
Constant Value: 17 (0x00000011)
DATA_TYPE_SERVICE_DATA_128_BIT
public static final int DATA_TYPE_SERVICE_DATA_128_BIT
Data type is Service Data - 128-bit UUID, see the Bluetooth Generic Access Profile for more details.
Constant Value: 33 (0x00000021)
DATA_TYPE_SERVICE_DATA_16_BIT
public static final int DATA_TYPE_SERVICE_DATA_16_BIT
Data type is Service Data - 16-bit UUID, see the Bluetooth Generic Access Profile for more details.
Constant Value: 22 (0x00000016)
DATA_TYPE_SERVICE_DATA_32_BIT
public static final int DATA_TYPE_SERVICE_DATA_32_BIT
Data type is Service Data - 32-bit UUID, see the Bluetooth Generic Access Profile for more details.
Constant Value: 32 (0x00000020)
DATA_TYPE_SERVICE_SOLICITATION_UUIDS_128_BIT
public static final int DATA_TYPE_SERVICE_SOLICITATION_UUIDS_128_BIT
Data type is List of 128-bit Service Solicitation UUIDs, see the Bluetooth Generic Access Profile for more details.
Constant Value: 21 (0x00000015)
DATA_TYPE_SERVICE_SOLICITATION_UUIDS_16_BIT
public static final int DATA_TYPE_SERVICE_SOLICITATION_UUIDS_16_BIT
Data type is List of 16-bit Service Solicitation UUIDs, see the Bluetooth Generic Access Profile for more details.
Constant Value: 20 (0x00000014)
DATA_TYPE_SERVICE_SOLICITATION_UUIDS_32_BIT
public static final int DATA_TYPE_SERVICE_SOLICITATION_UUIDS_32_BIT
Data type is List of 32-bit Service Solicitation UUIDs, see the Bluetooth Generic Access Profile for more details.
Constant Value: 31 (0x0000001f)
DATA_TYPE_SERVICE_UUIDS_128_BIT_COMPLETE
public static final int DATA_TYPE_SERVICE_UUIDS_128_BIT_COMPLETE
Data type is Complete List of 128-bit Service Class UUIDs, see the Bluetooth Generic Access Profile for more details.
Constant Value: 7 (0x00000007)
DATA_TYPE_SERVICE_UUIDS_128_BIT_PARTIAL
public static final int DATA_TYPE_SERVICE_UUIDS_128_BIT_PARTIAL
Data type is Incomplete List of 128-bit Service Class UUIDs, see the Bluetooth Generic Access Profile for the details.
Constant Value: 6 (0x00000006)
DATA_TYPE_SERVICE_UUIDS_16_BIT_COMPLETE
public static final int DATA_TYPE_SERVICE_UUIDS_16_BIT_COMPLETE
Data type is Complete List of 16-bit Service Class UUIDs, see the Bluetooth Generic Access Profile for more details.
Constant Value: 3 (0x00000003)
DATA_TYPE_SERVICE_UUIDS_16_BIT_PARTIAL
public static final int DATA_TYPE_SERVICE_UUIDS_16_BIT_PARTIAL
Data type is Incomplete List of 16-bit Service Class UUIDs, see the Bluetooth Generic Access Profile for the details.
Constant Value: 2 (0x00000002)
DATA_TYPE_SERVICE_UUIDS_32_BIT_COMPLETE
public static final int DATA_TYPE_SERVICE_UUIDS_32_BIT_COMPLETE
Data type is Complete List of 32-bit Service Class UUIDs, see the Bluetooth Generic Access Profile for more details.
Constant Value: 5 (0x00000005)
DATA_TYPE_SERVICE_UUIDS_32_BIT_PARTIAL
public static final int DATA_TYPE_SERVICE_UUIDS_32_BIT_PARTIAL
Data type is Incomplete List of 32-bit Service Class UUIDs, see the Bluetooth Generic Access Profile for the details.
Constant Value: 4 (0x00000004)
DATA_TYPE_SIMPLE_PAIRING_HASH_C
public static final int DATA_TYPE_SIMPLE_PAIRING_HASH_C
Data type is Simple Pairing Hash C, see the Bluetooth Generic Access Profile for more details.
Constant Value: 14 (0x0000000e)
DATA_TYPE_SIMPLE_PAIRING_HASH_C_256
public static final int DATA_TYPE_SIMPLE_PAIRING_HASH_C_256
Data type is Simple Pairing Hash C-256, see the Bluetooth Generic Access Profile for more details.
Constant Value: 29 (0x0000001d)
DATA_TYPE_SIMPLE_PAIRING_RANDOMIZER_R
public static final int DATA_TYPE_SIMPLE_PAIRING_RANDOMIZER_R
Data type is Simple Pairing Randomizer R, see the Bluetooth Generic Access Profile for more details.
Constant Value: 15 (0x0000000f)
DATA_TYPE_SIMPLE_PAIRING_RANDOMIZER_R_256
public static final int DATA_TYPE_SIMPLE_PAIRING_RANDOMIZER_R_256
Data type is Simple Pairing Randomizer R-256, see the Bluetooth Generic Access Profile for more details.
Constant Value: 30 (0x0000001e)
DATA_TYPE_SLAVE_CONNECTION_INTERVAL_RANGE
public static final int DATA_TYPE_SLAVE_CONNECTION_INTERVAL_RANGE
Data type is Slave Connection Interval Range, see the Bluetooth Generic Access Profile for more details.
Constant Value: 18 (0x00000012)
DATA_TYPE_TRANSPORT_DISCOVERY_DATA
public static final int DATA_TYPE_TRANSPORT_DISCOVERY_DATA
Data type is Transport Discovery Data, see the Bluetooth Generic Access Profile for more details.
Constant Value: 38 (0x00000026)
DATA_TYPE_TX_POWER_LEVEL
public static final int DATA_TYPE_TX_POWER_LEVEL
Data type is Tx Power Level, see the Bluetooth Generic Access Profile for more details.
Constant Value: 10 (0x0000000a)
DATA_TYPE_URI
public static final int DATA_TYPE_URI
Data type is URI, see the Bluetooth Generic Access Profile for more details.
Constant Value: 36 (0x00000024)
Public methods
getAdvertiseFlags
public 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 |
getAdvertisingDataMap
public Map<Integer, byte[]> getAdvertisingDataMap ()
Returns a map of advertising data type and its corresponding advertising data. The values of advertising data type are defined in the Bluetooth Generic Access Profile (https://www.bluetooth.com/specifications/assigned-numbers/)
Returns | |
---|---|
Map<Integer, byte[]> |
This value cannot be null . |
getBytes
public byte[] getBytes ()
Returns raw bytes of scan record.
Returns | |
---|---|
byte[] |
getDeviceName
public String getDeviceName ()
Returns the local name of the BLE device. This is a UTF-8 encoded string.
Returns | |
---|---|
String |
This value may be null . |
getManufacturerSpecificData
public SparseArray<byte[]> getManufacturerSpecificData ()
Returns a sparse array of manufacturer identifier and its corresponding manufacturer specific data.
Returns | |
---|---|
SparseArray<byte[]> |
getManufacturerSpecificData
public 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[] |
getServiceData
public 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[] |
getServiceData
public Map<ParcelUuid, byte[]> getServiceData ()
Returns a map of service UUID and its corresponding service data.
Returns | |
---|---|
Map<ParcelUuid, byte[]> |
getServiceSolicitationUuids
public List<ParcelUuid> getServiceSolicitationUuids ()
Returns a list of service solicitation UUIDs within the advertisement that are used to identify the Bluetooth GATT services.
Returns | |
---|---|
List<ParcelUuid> |
This value cannot be null . |
getServiceUuids
public 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
public int getTxPowerLevel ()
Returns the transmission power level of the packet in dBm. Returns Integer.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
public String toString ()
Returns a string representation of the object.
Returns | |
---|---|
String |
a string representation of the object. |