public static final class ScanSettings.Builder
extends java.lang.Object
ScanSettings
.Constructor and Description |
---|
ScanSettings.Builder() |
Modifier and Type | Method and Description |
---|---|
ScanSettings |
build()
Build
ScanSettings . |
ScanSettings.Builder |
setCallbackType(int callbackType)
Set callback type for Bluetooth LE scan.
|
ScanSettings.Builder |
setReportDelayMillis(long reportDelayMillis)
Set report delay timestamp for Bluetooth LE scan.
|
ScanSettings.Builder |
setScanMode(int scanMode)
Set scan mode for Bluetooth LE scan.
|
ScanSettings.Builder |
setScanResultType(int scanResultType)
Set scan result type for Bluetooth LE scan.
|
public ScanSettings.Builder setScanMode(int scanMode)
scanMode
- The scan mode can be one of ScanSettings.SCAN_MODE_LOW_POWER
,
ScanSettings.SCAN_MODE_BALANCED
or
ScanSettings.SCAN_MODE_LOW_LATENCY
.java.lang.IllegalArgumentException
- If the scanMode
is invalid.public ScanSettings.Builder setCallbackType(int callbackType)
callbackType
- The callback type flags for the scan.java.lang.IllegalArgumentException
- If the callbackType
is invalid.public ScanSettings.Builder setScanResultType(int scanResultType)
scanResultType
- Type for scan result, could be either
ScanSettings.SCAN_RESULT_TYPE_FULL
or
ScanSettings.SCAN_RESULT_TYPE_ABBREVIATED
.java.lang.IllegalArgumentException
- If the scanResultType
is invalid.public ScanSettings.Builder setReportDelayMillis(long reportDelayMillis)
reportDelayMillis
- Set to 0 to be notified of results immediately. Values > 0
causes the scan results to be queued up and delivered after the requested
delay or when the internal buffers fill up.java.lang.IllegalArgumentException
- If reportDelayMillis
< 0.public ScanSettings build()
ScanSettings
.