public final class ScanSettings extends Object implements Parcelable
BluetoothLeScanner.startScan(android.bluetooth.le.ScanCallback)
to define the
parameters for the scan.Modifier and Type | Class and Description |
---|---|
static class |
ScanSettings.Builder
Builder for
ScanSettings . |
Parcelable.ClassLoaderCreator<T>, Parcelable.Creator<T>
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 Parcelable.Creator<ScanSettings> |
CREATOR |
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 availibility 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 availibility of the resources in hw
|
static int |
MATCH_NUM_ONE_ADVERTISEMENT
Match one advertisement per filter
|
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.
|
static int |
SCAN_RESULT_TYPE_ABBREVIATED
Request abbreviated scan results which contain the device, rssi and scan timestamp.
|
static int |
SCAN_RESULT_TYPE_FULL
Request full scan results which contain the device, rssi, advertising data, scan response
as well as the scan timestamp.
|
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_ELIDE_DUPLICATES, PARCELABLE_WRITE_RETURN_VALUE
Modifier and Type | Method and Description |
---|---|
int |
describeContents()
Describe the kinds of special objects contained in this Parcelable
instance's marshaled representation.
|
int |
getCallbackType() |
int |
getMatchMode() |
int |
getNumOfMatches() |
long |
getReportDelayMillis()
Returns report delay timestamp based on the device clock.
|
int |
getScanMode() |
int |
getScanResultType() |
void |
writeToParcel(Parcel dest,
int flags)
Flatten this object in to a Parcel.
|
public static final int SCAN_MODE_OPPORTUNISTIC
public static final int SCAN_MODE_LOW_POWER
public static final int SCAN_MODE_BALANCED
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 SCAN_RESULT_TYPE_FULL
public static final int SCAN_RESULT_TYPE_ABBREVIATED
Note: It is possible for an application to get more scan results than it asked for, if there are multiple apps using this type.
public static final Parcelable.Creator<ScanSettings> CREATOR
public int getScanMode()
public int getCallbackType()
public int getScanResultType()
public int getMatchMode()
public int getNumOfMatches()
public long getReportDelayMillis()
public void writeToParcel(Parcel dest, int flags)
Parcelable
writeToParcel
in interface Parcelable
dest
- The Parcel in which the object should be written.flags
- Additional flags about how the object should be written.
May be 0 or Parcelable.PARCELABLE_WRITE_RETURN_VALUE
.public int describeContents()
Parcelable
Parcelable.writeToParcel(Parcel, int)
,
the return value of this method must include the
Parcelable.CONTENTS_FILE_DESCRIPTOR
bit.describeContents
in interface Parcelable
Parcelable.CONTENTS_FILE_DESCRIPTOR