From dac2241baa9dc3b804d6c9f97458718ef36b92e8 Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Fri, 6 Nov 2020 19:08:13 +0100 Subject: [PATCH] RS: handle error state --- .../java/info/nightscout/androidaps/danars/DanaRSPlugin.kt | 2 +- .../comm/DanaRS_Packet_General_Initial_Screen_Information.kt | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/danars/src/main/java/info/nightscout/androidaps/danars/DanaRSPlugin.kt b/danars/src/main/java/info/nightscout/androidaps/danars/DanaRSPlugin.kt index 2979ab605a..cc20b91d22 100644 --- a/danars/src/main/java/info/nightscout/androidaps/danars/DanaRSPlugin.kt +++ b/danars/src/main/java/info/nightscout/androidaps/danars/DanaRSPlugin.kt @@ -210,7 +210,7 @@ class DanaRSPlugin @Inject constructor( } override fun isSuspended(): Boolean { - return danaPump.pumpSuspended + return danaPump.pumpSuspended || danaPump.errorState != DanaPump.ErrorState.NONE } override fun isBusy(): Boolean { diff --git a/danars/src/main/java/info/nightscout/androidaps/danars/comm/DanaRS_Packet_General_Initial_Screen_Information.kt b/danars/src/main/java/info/nightscout/androidaps/danars/comm/DanaRS_Packet_General_Initial_Screen_Information.kt index e077e30fe9..8eeb017ebb 100644 --- a/danars/src/main/java/info/nightscout/androidaps/danars/comm/DanaRS_Packet_General_Initial_Screen_Information.kt +++ b/danars/src/main/java/info/nightscout/androidaps/danars/comm/DanaRS_Packet_General_Initial_Screen_Information.kt @@ -57,8 +57,8 @@ class DanaRS_Packet_General_Initial_Screen_Information( //protocol 10+ dataIndex += dataSize dataSize = 1 - danaPump.errorState = info.nightscout.androidaps.dana.DanaPump.ErrorState[byteArrayToInt(getBytes(data, dataIndex, dataSize))] - ?: info.nightscout.androidaps.dana.DanaPump.ErrorState.NONE + danaPump.errorState = DanaPump.ErrorState[byteArrayToInt(getBytes(data, dataIndex, dataSize))] + ?: DanaPump.ErrorState.NONE aapsLogger.debug(LTag.PUMPCOMM, "ErrorState: " + danaPump.errorState.name) } aapsLogger.debug(LTag.PUMPCOMM, "Pump suspended: " + danaPump.pumpSuspended)