This commit is contained in:
Andrei Vereha 2021-07-11 11:55:20 +02:00
parent 3a4001a1a6
commit 87a297c36d

View file

@ -125,7 +125,7 @@ class OmnipodDashBleManagerImpl @Inject constructor(
for (i in 1..MAX_NUMBER_OF_CONNECTION_ATTEMPTS) { for (i in 1..MAX_NUMBER_OF_CONNECTION_ATTEMPTS) {
try { try {
// wait i * CONNECTION_TIMEOUT // wait i * CONNECTION_TIMEOUT
conn.connect(4) conn.connect(CONNECT_TIMEOUT_MULTIPLIER)
break break
} catch (e: Exception) { } catch (e: Exception) {
aapsLogger.warn(LTag.PUMPBTCOMM, "connect error=$e") aapsLogger.warn(LTag.PUMPBTCOMM, "connect error=$e")
@ -242,5 +242,6 @@ class OmnipodDashBleManagerImpl @Inject constructor(
companion object { companion object {
const val MAX_NUMBER_OF_CONNECTION_ATTEMPTS = 2 const val MAX_NUMBER_OF_CONNECTION_ATTEMPTS = 2
const val CONTROLLER_ID = 4242 // TODO read from preferences or somewhere else. const val CONTROLLER_ID = 4242 // TODO read from preferences or somewhere else.
private const val CONNECT_TIMEOUT_MULTIPLIER = 4
} }
} }