From 87a297c36dbda105cac4ccabd54c4560c9ef6fa3 Mon Sep 17 00:00:00 2001 From: Andrei Vereha Date: Sun, 11 Jul 2021 11:55:20 +0200 Subject: [PATCH] constant --- .../pump/omnipod/dash/driver/comm/OmnipodDashBleManagerImpl.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/OmnipodDashBleManagerImpl.kt b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/OmnipodDashBleManagerImpl.kt index f675065776..24885e70e2 100644 --- a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/OmnipodDashBleManagerImpl.kt +++ b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/OmnipodDashBleManagerImpl.kt @@ -125,7 +125,7 @@ class OmnipodDashBleManagerImpl @Inject constructor( for (i in 1..MAX_NUMBER_OF_CONNECTION_ATTEMPTS) { try { // wait i * CONNECTION_TIMEOUT - conn.connect(4) + conn.connect(CONNECT_TIMEOUT_MULTIPLIER) break } catch (e: Exception) { aapsLogger.warn(LTag.PUMPBTCOMM, "connect error=$e") @@ -242,5 +242,6 @@ class OmnipodDashBleManagerImpl @Inject constructor( companion object { const val MAX_NUMBER_OF_CONNECTION_ATTEMPTS = 2 const val CONTROLLER_ID = 4242 // TODO read from preferences or somewhere else. + private const val CONNECT_TIMEOUT_MULTIPLIER = 4 } }