-
- All Implemented Interfaces:
-
com.polidea.rxandroidble2.internal.scan.ExternalScanSettingsExtension.Builder
public final class ScanSettings.Builder implements ExternalScanSettingsExtension.Builder
Builder for ScanSettings.
-
-
Method Summary
Modifier and Type Method Description ScanSettings.BuildersetScanMode(int scanMode)Set scan mode for Bluetooth LE scan. ScanSettings.BuildersetCallbackType(int callbackType)Set callback type for Bluetooth LE scan. ScanSettings.BuildersetShouldCheckLocationServicesState(boolean shouldCheck)Set whether a check if Location Services are (any Location Provider is) turned on before scheduling a BLE scan start.Some Android devices will not return any if Location Services aredisabled. ScanSettings.BuildersetLegacy(boolean legacy)ScanSettingsbuild()Build ScanSettings. -
-
Method Detail
-
setScanMode
ScanSettings.Builder setScanMode(int scanMode)
Set scan mode for Bluetooth LE scan.
- Parameters:
scanMode- The scan mode can be one of SCAN_MODE_LOW_POWER,SCAN_MODE_BALANCED orSCAN_MODE_LOW_LATENCY.
-
setCallbackType
ScanSettings.Builder setCallbackType(int callbackType)
Set callback type for Bluetooth LE scan.
- Parameters:
callbackType- The callback type flags for the scan.
-
setShouldCheckLocationServicesState
ScanSettings.Builder setShouldCheckLocationServicesState(boolean shouldCheck)
Set whether a check if Location Services are (any Location Provider is) turned on before scheduling a BLE scan start.Some Android devices will not return any if Location Services aredisabled. If set to true and Location Services are off a com.polidea.rxandroidble2.exceptions.BleScanException will be emitted.
Default: true.
-
setLegacy
ScanSettings.Builder setLegacy(boolean legacy)
-
build
ScanSettings build()
Build ScanSettings.
-
-
-
-