From 260729bf6d3382f2826fc63e0cab468a488215f2 Mon Sep 17 00:00:00 2001 From: Andy Rozman Date: Sat, 18 Feb 2023 17:32:28 +0000 Subject: [PATCH] - added change for remainingInsulin where we get too liitle data in some cases --- .../plugins/pump/medtronic/comm/MedtronicConverter.kt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/MedtronicConverter.kt b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/MedtronicConverter.kt index 91a08ae3e5..2474bdd7e9 100644 --- a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/MedtronicConverter.kt +++ b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/MedtronicConverter.kt @@ -82,6 +82,10 @@ class MedtronicConverter @Inject constructor( if (strokes == 40) { startIdx = 2 } + if (rawData.size==2 && strokes == 40) { + aapsLogger.error(LTag.PUMPCOMM, "It seems configuration is not correct, detected model $pumpModel should have length bigger than 2, but it doesn't (data: $rawData)") + startIdx = 0 + } val reqLength = startIdx + 1 val value: Double value = if (reqLength >= rawData.size) {