public ScanSettings.Builder setScanMode(@ScanMode int scanMode) {
            if (scanMode < SCAN_MODE_OPPORTUNISTIC || scanMode > SCAN_MODE_LOW_LATENCY) {
                throw new IllegalArgumentException("invalid scan mode " + scanMode);
            }
            mScanMode = scanMode;
            return this;
        }
Set scan mode for Bluetooth LE scan.

@param scanMode The scan mode can be one of {@link ScanSettings#SCAN_MODE_LOW_POWER},
                {@link ScanSettings#SCAN_MODE_BALANCED} or
                {@link ScanSettings#SCAN_MODE_LOW_LATENCY}.
@throws IllegalArgumentException If the {@code scanMode} is invalid.
rxandroidble/src/main/java/com/polidea/rxandroidble2/scan/ScanSettings.java