diff --git a/blessed/src/main/java/com/welie/blessed/BluetoothCentralManager.kt b/blessed/src/main/java/com/welie/blessed/BluetoothCentralManager.kt index 10b29e8..b3ce34c 100644 --- a/blessed/src/main/java/com/welie/blessed/BluetoothCentralManager.kt +++ b/blessed/src/main/java/com/welie/blessed/BluetoothCentralManager.kt @@ -73,7 +73,7 @@ class BluetoothCentralManager(private val context: Context, private val bluetoot private var currentCallback: ScanCallback? = null private var currentFilters: List? = null private var scanSettings: ScanSettings - private val autoConnectScanSettings: ScanSettings + private var autoConnectScanSettings: ScanSettings private val connectionRetries: MutableMap = ConcurrentHashMap() internal val pinCodes: MutableMap = ConcurrentHashMap() private var transport = DEFAULT_TRANSPORT @@ -260,6 +260,24 @@ class BluetoothCentralManager(private val context: Context, private val bluetoot scanSettings = getScanSettings(scanMode) } + /** + * Set the default ScanSettings + * + * @param scanSettings the ScanSettings to set + */ + fun setScanSettings(scanSettings: ScanSettings) { + this.scanSettings = scanSettings + } + + /** + * Set autoconnect ScanSettings, used when scanning to autoconnect + * + * @param scanSettings the ScanSettings to set + */ + fun setAutoConnectScanSettings(scanSettings: ScanSettings) { + this.autoConnectScanSettings = scanSettings + } + /** * Get the transport to be used during connection phase. *