public final class Utils_ScanRecord extends Utils
ScanRecord
and android.bluetooth.BluetoothUuid.
Why not use these classes directly? So that the same code can be used if you're targeting < 21.Modifier and Type | Method and Description |
---|---|
static byte[] |
getUuidBytes(java.util.UUID id,
BleUuid.UuidSize size)
Returns a byte[] from the given
UUID , the size of which is controlled by BleUuid.UuidSize . |
static byte[] |
newScanRecord(java.lang.Byte advFlags,
java.util.Map<BleUuid,byte[]> serviceMap,
boolean completeList,
java.lang.String name,
boolean shortName,
java.lang.Byte txPowerLevel,
java.util.List<ManufacturerData> mfgData) |
static byte[] |
newScanRecord(java.lang.Byte advFlags,
java.util.Map<BleUuid,byte[]> serviceMap,
boolean completeList,
java.lang.String name,
boolean shortName,
java.lang.Byte txPowerLevel,
java.lang.Short manufacturerId,
byte[] manufacturerData)
Create the byte[] scanRecord from the given advertising flags, serviceUuid, serviceData, device name, txPower level, manufacturerID, and manufacturerData
|
static byte[] |
newScanRecord(java.lang.Byte advFlags,
java.util.Map<BleUuid,byte[]> serviceMap,
java.lang.String name,
boolean shortName,
java.lang.Byte txPowerLevel,
java.lang.Short manufacturerId,
byte[] manufacturerData)
Create the byte[] scanRecord from the given advertising flags, serviceUuid, serviceData, device name, txPower level, manufacturerID, and manufacturerData
|
static byte[] |
newScanRecord(java.lang.String name)
Create the byte[] scanRecord from the given name (the record will only contain the name you provide here).
|
static byte[] |
newScanRecord(java.lang.String name,
java.util.UUID serviceUuid)
Create the byte[] scanRecord from the given name, and serviceUuid.
|
static byte[] |
newScanRecord(java.lang.String name,
java.util.UUID serviceUuid,
byte[] serviceData)
Create the byte[] scanRecord from the given name, serviceUuid, and serviceData.
|
static byte[] |
newScanRecord(java.lang.String name,
java.util.UUID serviceUuid,
byte[] serviceData,
java.lang.Short manufacturerId,
byte[] manufacturerData)
Create the byte[] scanRecord from the given name, serviceUuid, serviceData, manufacturerId, and manufacturerData
|
static java.lang.String |
parseName(byte[] scanRecord) |
static BleScanRecord |
parseScanRecord(byte[] scanRecord) |
contains, doForEach_break, doForEach_break, hasManifestPermission, hasPermission, haveMatchingIds, haveMatchingName, isAndroid10, isKitKat, isLocationEnabledForScanning_byManifestPermissions, isLocationEnabledForScanning_byOsServices, isLocationEnabledForScanning_byRuntimePermissions, isLocationEnabledForScanning, isLollipop, isManufacturer, isMarshmallow, isNougat, isOnMainThread, isOreo, isProduct, isSuccess, phoneHasBondingIssues, refreshGatt
public static BleScanRecord parseScanRecord(byte[] scanRecord)
public static java.lang.String parseName(byte[] scanRecord)
public static byte[] newScanRecord(java.lang.String name)
public static byte[] newScanRecord(java.lang.String name, java.util.UUID serviceUuid)
public static byte[] newScanRecord(java.lang.String name, java.util.UUID serviceUuid, byte[] serviceData)
public static byte[] newScanRecord(java.lang.String name, java.util.UUID serviceUuid, byte[] serviceData, java.lang.Short manufacturerId, byte[] manufacturerData)
public static byte[] newScanRecord(java.lang.Byte advFlags, java.util.Map<BleUuid,byte[]> serviceMap, java.lang.String name, boolean shortName, java.lang.Byte txPowerLevel, java.lang.Short manufacturerId, byte[] manufacturerData)
public static byte[] newScanRecord(java.lang.Byte advFlags, java.util.Map<BleUuid,byte[]> serviceMap, boolean completeList, java.lang.String name, boolean shortName, java.lang.Byte txPowerLevel, java.util.List<ManufacturerData> mfgData)
public static byte[] newScanRecord(java.lang.Byte advFlags, java.util.Map<BleUuid,byte[]> serviceMap, boolean completeList, java.lang.String name, boolean shortName, java.lang.Byte txPowerLevel, java.lang.Short manufacturerId, byte[] manufacturerData)
public static byte[] getUuidBytes(java.util.UUID id, BleUuid.UuidSize size)
UUID
, the size of which is controlled by BleUuid.UuidSize
.