constant
This commit is contained in:
parent
3a4001a1a6
commit
87a297c36d
1 changed files with 2 additions and 1 deletions
|
@ -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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue