public static final class ScanSettings.Builder extends Object
ScanSettings
.Constructor and Description |
---|
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 |
setMatchMode(int matchMode)
Set match mode for Bluetooth LE scan filters hardware match
|
ScanSettings.Builder |
setNumOfMatches(int numOfMatches)
Set the number of matches for Bluetooth LE scan filters hardware match
|
ScanSettings.Builder |
setReportDelay(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
.IllegalArgumentException
- If the scanMode
is invalid.public ScanSettings.Builder setCallbackType(int callbackType)
callbackType
- The callback type flags for the scan.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
.IllegalArgumentException
- If the scanResultType
is invalid.public ScanSettings.Builder setReportDelay(long reportDelayMillis)
reportDelayMillis
- Delay of report in milliseconds. 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.IllegalArgumentException
- If reportDelayMillis
< 0.public ScanSettings.Builder setNumOfMatches(int numOfMatches)
numOfMatches
- The num of matches can be one of
ScanSettings.MATCH_NUM_ONE_ADVERTISEMENT
or
ScanSettings.MATCH_NUM_FEW_ADVERTISEMENT
or
ScanSettings.MATCH_NUM_MAX_ADVERTISEMENT
IllegalArgumentException
- If the matchMode
is invalid.public ScanSettings.Builder setMatchMode(int matchMode)
matchMode
- The match mode can be one of
ScanSettings.MATCH_MODE_AGGRESSIVE
or
ScanSettings.MATCH_MODE_STICKY
IllegalArgumentException
- If the matchMode
is invalid.public ScanSettings build()
ScanSettings
.