-
public final class CompatScanRecord
Represents a scan record from Bluetooth LE scan. Copied from the 5.0 sdk for use with 4.4.
-
-
Method Summary
Modifier and Type Method Description static CompatScanRecord
parseFromBytes(Array<byte> scanRecord)
Parse scan record bytes to CompatScanRecord. int
getAdvertiseFlags()
Returns the advertising flags indicating the discoverable mode and capability of the device. List<ParcelUuid>
getServiceUuids()
Returns a list of service UUIDs within the advertisement that are used to identify the bluetooth GATT services. SparseArray<Array<byte>>
getManufacturerSpecificData()
Returns a sparse array of manufacturer identifier and its corresponding manufacturer specific data. Array<byte>
getManufacturerSpecificData(int manufacturerId)
Returns the manufacturer specific data associated with the manufacturer id. Map<ParcelUuid, Array<byte>>
getServiceData()
Returns a map of service UUID and its corresponding service data. Array<byte>
getServiceData(ParcelUuid serviceDataUuid)
Returns the service data byte array associated with the {@code serviceUuid}
.int
getTxPowerLevel()
Returns the transmission power level of the packet in dBm. String
getDeviceName()
Returns the local name of the BLE device. Array<byte>
getBytes()
Returns raw bytes of scan record. -
-
Method Detail
-
parseFromBytes
static CompatScanRecord parseFromBytes(Array<byte> scanRecord)
Parse scan record bytes to CompatScanRecord.
The format is defined in Bluetooth 4.1 specification, Volume 3, Part C, Section 11 and 18.
All numerical multi-byte entities and values shall use little-endian byte order.
- Parameters:
scanRecord
- The scan record of Bluetooth LE advertisement and/or scan response.
-
getAdvertiseFlags
int getAdvertiseFlags()
Returns the advertising flags indicating the discoverable mode and capability of the device. Returns -1 if the flag field is not set.
-
getServiceUuids
List<ParcelUuid> getServiceUuids()
Returns a list of service UUIDs within the advertisement that are used to identify the bluetooth GATT services.
-
getManufacturerSpecificData
SparseArray<Array<byte>> getManufacturerSpecificData()
Returns a sparse array of manufacturer identifier and its corresponding manufacturer specific data.
-
getManufacturerSpecificData
@Nullable() Array<byte> getManufacturerSpecificData(int manufacturerId)
Returns the manufacturer specific data associated with the manufacturer id. Returns
{@code null}
if the{@code manufacturerId}
is not found.
-
getServiceData
Map<ParcelUuid, Array<byte>> getServiceData()
Returns a map of service UUID and its corresponding service data.
-
getServiceData
@Nullable() Array<byte> getServiceData(ParcelUuid serviceDataUuid)
Returns the service data byte array associated with the
{@code serviceUuid}
. Returns{@code null}
if the{@code serviceDataUuid}
is not found.
-
getTxPowerLevel
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
-
getDeviceName
@Nullable() String getDeviceName()
Returns the local name of the BLE device. The is a UTF-8 encoded string.
-
-
-
-