make it compile
This commit is contained in:
parent
8d23df61bd
commit
bf889793f0
1 changed files with 7 additions and 3 deletions
|
@ -27,9 +27,13 @@ class ServiceDiscoverer(
|
|||
fun discoverServices(connectionWaitCond: ConnectionWaitCondition): Map<CharacteristicType, BluetoothGattCharacteristic> {
|
||||
logger.debug(LTag.PUMPBTCOMM, "Discovering services")
|
||||
bleCallbacks.startServiceDiscovery()
|
||||
val discover = gatt.discoverServices()
|
||||
if (!discover) {
|
||||
throw ConnectException("Could not start discovering services`")
|
||||
try {
|
||||
val discover = gatt.discoverServices()
|
||||
if (!discover) {
|
||||
throw ConnectException("Could not start discovering services`")
|
||||
}
|
||||
} catch (ex: SecurityException) {
|
||||
throw ConnectException("Missing bluetooth permission")
|
||||
}
|
||||
connectionWaitCond.timeoutMs?.let {
|
||||
bleCallbacks.waitForServiceDiscovery(it)
|
||||
|
|
Loading…
Reference in a new issue