Merge pull request #2419 from andyrozman/mdt_decodeInsulin

- added change for remainingInsulin where we get too liitle data in s…
This commit is contained in:
Milos Kozak 2023-02-18 20:03:38 +01:00 committed by GitHub
commit bea3215ebc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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) {