public enum BleScanApi extends java.lang.Enum<BleScanApi>
ScanSettingsand a way to force pre-Lollipop scanning mode. Provide an option to
|Enum Constant and Description|
This option is recommended and will let SweetBlue automatically choose what scanning api to use based on whether the app is backgrounded, if we're doing a long-term scan, polling scan, etc.
Will force SweetBlue to use
This will tell SweetBlue to use the newer scanning API introduced in Lollipop (
This forces the use of the pre-Lollipop scanning API
|Modifier and Type||Method and Description|
Returns the enum constant of this type with the specified name.
Returns an array containing the constants of this enum type, in the order they are declared.
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
public static final BleScanApi AUTO
public static final BleScanApi CLASSIC
BluetoothAdapter.startDiscovery(), which is so-called "Bluetooth Classic" discovery. This is the scanning mode used on the Android Bluetooth Settings screen. It only returns the mac address and name of your device through a
ScanFilter.ScanEvent, as opposed to full LE scanning packets which usually have a service
UUID(at the least) as well.
public static final BleScanApi PRE_LOLLIPOP
BluetoothAdapter.startLeScan(BluetoothAdapter.LeScanCallback), which was deprecated in Lollipop. This is the default API that SweetBlue uses, as it was found to be more effective at discovering devices than the API introduced in Lollipop.
public static final BleScanApi POST_LOLLIPOP
BluetoothLeScanner.startScan(List, ScanSettings, ScanCallback)) . We've found that this API is not yet as good as it's predecessor. It may be better for battery life, as you have more control over the scanning power (using
BleScanPower), however, even at
BleScanPower.HIGH_POWER, we've found that it doesn't discover devices as reliably as the pre-lollipop scan API.
public static BleScanApi values()
for (BleScanApi c : BleScanApi.values()) System.out.println(c);
public static BleScanApi valueOf(java.lang.String name)
name- the name of the enum constant to be returned.
java.lang.IllegalArgumentException- if this enum type has no constant with the specified name
java.lang.NullPointerException- if the argument is null