feat: add api configuration settings
This commit is contained in:
@@ -212,8 +212,6 @@ class ConnectionManager(val context: Context, bleAdapter: BluetoothAdapter) {
|
||||
.setScanMode(ScanSettings.SCAN_MODE_LOW_LATENCY)
|
||||
.build()
|
||||
|
||||
private val scanFilters = listOf( ScanFilter.Builder().setServiceUuid(ParcelUuid.fromString(BuildConfig.SERVICE_UUID)).build())
|
||||
|
||||
private val bleScanner by lazy {
|
||||
bleAdapter.bluetoothLeScanner
|
||||
}
|
||||
@@ -353,6 +351,9 @@ class ConnectionManager(val context: Context, bleAdapter: BluetoothAdapter) {
|
||||
}
|
||||
|
||||
fun discoverServices(device: BluetoothDevice) {
|
||||
if(operationQueue.any { it.device.address === device.address && it is DiscoverServicesRequest }) {
|
||||
return
|
||||
}
|
||||
enqueueOperation(DiscoverServicesRequest(device))
|
||||
}
|
||||
|
||||
@@ -377,6 +378,9 @@ class ConnectionManager(val context: Context, bleAdapter: BluetoothAdapter) {
|
||||
}
|
||||
|
||||
fun readRemoteRssi(device: BluetoothDevice) {
|
||||
if(operationQueue.any { it.device.address === device.address && it is ReadRemoteRssi }) {
|
||||
return
|
||||
}
|
||||
enqueueOperation(ReadRemoteRssi(device))
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user