From 61519e43f29e379923a54ecd59e3bc42733128c0 Mon Sep 17 00:00:00 2001 From: Carlos Rafael Giani Date: Sun, 20 Nov 2022 23:05:24 +0100 Subject: [PATCH] combov2: Disable internal Pump.connect() connection attempt limiter QueueThread already has a timeout; the limiter is redundant. Signed-off-by: Carlos Rafael Giani --- .../androidaps/plugins/pump/combov2/ComboV2Plugin.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pump/combov2/src/main/kotlin/info/nightscout/androidaps/plugins/pump/combov2/ComboV2Plugin.kt b/pump/combov2/src/main/kotlin/info/nightscout/androidaps/plugins/pump/combov2/ComboV2Plugin.kt index 8d251704c9..6553d3758e 100644 --- a/pump/combov2/src/main/kotlin/info/nightscout/androidaps/plugins/pump/combov2/ComboV2Plugin.kt +++ b/pump/combov2/src/main/kotlin/info/nightscout/androidaps/plugins/pump/combov2/ComboV2Plugin.kt @@ -498,7 +498,10 @@ class ComboV2Plugin @Inject constructor ( var forciblyDisconnectDueToError = false try { - pump?.connect() + // Set maxNumAttempts to null to turn off the connection attempt limit inside the connect() call. + // The AAPS queue thread will anyway cause the connectionSetupJob to be canceled when its + // connection timeout expires, so the Pump class' own connection attempt limiter is redundant. + pump?.connect(maxNumAttempts = null) // No need to set the driver state here, since the pump's stateFlow will announce that.