public final class ScanSettings extends Object implements android.os.Parcelable
BluetoothLeScannerCompat.startScan(no.nordicsemi.android.support.v18.scanner.ScanCallback) to define the
parameters for the scan.| Modifier and Type | Class and Description |
|---|---|
static class |
ScanSettings.Builder
Builder for
ScanSettings. |
| Modifier and Type | Field and Description |
|---|---|
static int |
CALLBACK_TYPE_ALL_MATCHES
Trigger a callback for every Bluetooth advertisement found that matches the filter criteria.
|
static int |
CALLBACK_TYPE_FIRST_MATCH
A result callback is only triggered for the first advertisement packet received that matches
the filter criteria.
|
static int |
CALLBACK_TYPE_MATCH_LOST
Receive a callback when advertisements are no longer received from a device that has been
previously reported by a first match callback.
|
static android.os.Parcelable.Creator<ScanSettings> |
CREATOR |
static long |
MATCH_LOST_DEVICE_TIMEOUT_DEFAULT
The default value of the maximum time for the device not to be discoverable before it will be
assumed lost.
|
static long |
MATCH_LOST_TASK_INTERVAL_DEFAULT
The default interval of the task that calls match lost events.
|
static int |
MATCH_MODE_AGGRESSIVE
In Aggressive mode, hw will determine a match sooner even with feeble signal strength
and few number of sightings/match in a duration.
|
static int |
MATCH_MODE_STICKY
For sticky mode, higher threshold of signal strength and sightings is required
before reporting by hw
|
static int |
MATCH_NUM_FEW_ADVERTISEMENT
Match few advertisement per filter, depends on current capability and availability of
the resources in hw
|
static int |
MATCH_NUM_MAX_ADVERTISEMENT
Match as many advertisement per filter as hw could allow, depends on current
capability and availability of the resources in hw
|
static int |
MATCH_NUM_ONE_ADVERTISEMENT
Match one advertisement per filter
|
static int |
PHY_LE_ALL_SUPPORTED
Use all supported PHYs for scanning.
|
static int |
SCAN_MODE_BALANCED
Perform Bluetooth LE scan in balanced power mode.
|
static int |
SCAN_MODE_LOW_LATENCY
Scan using highest duty cycle.
|
static int |
SCAN_MODE_LOW_POWER
Perform Bluetooth LE scan in low power mode.
|
static int |
SCAN_MODE_OPPORTUNISTIC
A special Bluetooth LE scan mode.
|
| Modifier and Type | Method and Description |
|---|---|
int |
describeContents() |
int |
getCallbackType() |
boolean |
getLegacy()
Returns whether only legacy advertisements will be returned.
|
long |
getMatchLostDeviceTimeout() |
long |
getMatchLostTaskInterval() |
int |
getMatchMode() |
int |
getNumOfMatches() |
int |
getPhy()
Returns the physical layer used during a scan.
|
long |
getPowerSaveRest() |
long |
getPowerSaveScan() |
long |
getReportDelayMillis()
Returns report delay timestamp based on the device clock.
|
int |
getScanMode() |
boolean |
getUseHardwareBatchingIfSupported() |
boolean |
getUseHardwareCallbackTypesIfSupported() |
boolean |
getUseHardwareFilteringIfSupported() |
boolean |
hasPowerSaveMode()
Determine if we should do power-saving sleep on pre-Lollipop
|
void |
writeToParcel(android.os.Parcel dest,
int flags) |
public static final long MATCH_LOST_DEVICE_TIMEOUT_DEFAULT
public static final long MATCH_LOST_TASK_INTERVAL_DEFAULT
public static final int SCAN_MODE_OPPORTUNISTIC
On Android Lollipop SCAN_MODE_LOW_POWER will be used instead, as opportunistic
mode was not yet supported.
On pre-Lollipop devices it is possible to override the default intervals
using ScanSettings.Builder.setPowerSave(long, long).
public static final int SCAN_MODE_LOW_POWER
On pre-Lollipop devices this mode will be emulated by scanning for 0.5 second followed by 4.5 second of idle, which corresponds to the low power intervals on Lollipop or newer.
public static final int SCAN_MODE_BALANCED
On pre-Lollipop devices this mode will be emulated by scanning for 2 second followed by 3 seconds of idle, which corresponds to the low power intervals on Lollipop or newer.
public static final int SCAN_MODE_LOW_LATENCY
public static final int CALLBACK_TYPE_ALL_MATCHES
public static final int CALLBACK_TYPE_FIRST_MATCH
public static final int CALLBACK_TYPE_MATCH_LOST
public static final int MATCH_NUM_ONE_ADVERTISEMENT
public static final int MATCH_NUM_FEW_ADVERTISEMENT
public static final int MATCH_NUM_MAX_ADVERTISEMENT
public static final int MATCH_MODE_AGGRESSIVE
public static final int MATCH_MODE_STICKY
public static final int PHY_LE_ALL_SUPPORTED
public static final android.os.Parcelable.Creator<ScanSettings> CREATOR
public int getScanMode()
public int getCallbackType()
public int getMatchMode()
public int getNumOfMatches()
public boolean getUseHardwareFilteringIfSupported()
public boolean getUseHardwareBatchingIfSupported()
public boolean getUseHardwareCallbackTypesIfSupported()
public long getMatchLostDeviceTimeout()
public long getMatchLostTaskInterval()
public boolean getLegacy()
public int getPhy()
public long getReportDelayMillis()
public void writeToParcel(android.os.Parcel dest,
int flags)
writeToParcel in interface android.os.Parcelablepublic int describeContents()
describeContents in interface android.os.Parcelablepublic boolean hasPowerSaveMode()
public long getPowerSaveRest()
public long getPowerSaveScan()