FileDocCategorySizeDatePackage
ScanSettings.javaAPI DocAndroid 5.1 API8708Thu Mar 12 22:22:10 GMT 2015android.bluetooth.le

ScanSettings

public final class ScanSettings extends Object implements android.os.Parcelable
Bluetooth LE scan settings are passed to {@link BluetoothLeScanner#startScan} to define the parameters for the scan.

Fields Summary
public static final int
SCAN_MODE_LOW_POWER
Perform Bluetooth LE scan in low power mode. This is the default scan mode as it consumes the least power.
public static final int
SCAN_MODE_BALANCED
Perform Bluetooth LE scan in balanced power mode. Scan results are returned at a rate that provides a good trade-off between scan frequency and power consumption.
public static final int
SCAN_MODE_LOW_LATENCY
Scan using highest duty cycle. It's recommended to only use this mode when the application is running in the foreground.
public static final int
CALLBACK_TYPE_ALL_MATCHES
Trigger a callback for every Bluetooth advertisement found that matches the filter criteria. If no filter is active, all advertisement packets are reported.
public static final int
CALLBACK_TYPE_FIRST_MATCH
A result callback is only triggered for the first advertisement packet received that matches the filter criteria.
public static final 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.
public static final int
SCAN_RESULT_TYPE_FULL
Request full scan results which contain the device, rssi, advertising data, scan response as well as the scan timestamp.
public static final int
SCAN_RESULT_TYPE_ABBREVIATED
Request abbreviated scan results which contain the device, rssi and scan timestamp.

Note: It is possible for an application to get more scan results than it asked for, if there are multiple apps using this type.

private int
mScanMode
private int
mCallbackType
private int
mScanResultType
private long
mReportDelayMillis
public static final Parcelable.Creator
CREATOR
Constructors Summary
private ScanSettings(int scanMode, int callbackType, int scanResultType, long reportDelayMillis)

        mScanMode = scanMode;
        mCallbackType = callbackType;
        mScanResultType = scanResultType;
        mReportDelayMillis = reportDelayMillis;
    
private ScanSettings(android.os.Parcel in)

        mScanMode = in.readInt();
        mCallbackType = in.readInt();
        mScanResultType = in.readInt();
        mReportDelayMillis = in.readLong();
    
Methods Summary
public intdescribeContents()

        return 0;
    
public intgetCallbackType()

        return mCallbackType;
    
public longgetReportDelayMillis()
Returns report delay timestamp based on the device clock.

        return mReportDelayMillis;
    
public intgetScanMode()


       
        return mScanMode;
    
public intgetScanResultType()

        return mScanResultType;
    
public voidwriteToParcel(android.os.Parcel dest, int flags)

        dest.writeInt(mScanMode);
        dest.writeInt(mCallbackType);
        dest.writeInt(mScanResultType);
        dest.writeLong(mReportDelayMillis);