From f651f721e00b71fd2c5a1bec7f92f4a21a5a12d7 Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Fri, 3 Mar 2023 22:20:02 +0100 Subject: [PATCH] DanaRS: do not send another packet if previous failed --- .../java/info/nightscout/pump/danars/services/DanaRSService.kt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pump/danars/src/main/java/info/nightscout/pump/danars/services/DanaRSService.kt b/pump/danars/src/main/java/info/nightscout/pump/danars/services/DanaRSService.kt index 88a5ea63df..1a63f6433c 100644 --- a/pump/danars/src/main/java/info/nightscout/pump/danars/services/DanaRSService.kt +++ b/pump/danars/src/main/java/info/nightscout/pump/danars/services/DanaRSService.kt @@ -371,6 +371,7 @@ class DanaRSService : DaggerService() { if (!isConnected) return false val status = DanaRSPacketGeneralInitialScreenInformation(injector) sendMessage(status) + if (status.failed) return false if (status.isTempBasalInProgress) { rxBus.send(EventPumpStatusChanged(rh.gs(info.nightscout.pump.dana.R.string.stoppingtempbasal))) sendMessage(DanaRSPacketBasalSetCancelTemporaryBasal(injector)) @@ -391,6 +392,7 @@ class DanaRSService : DaggerService() { fun highTempBasal(percent: Int): Boolean { val status = DanaRSPacketGeneralInitialScreenInformation(injector) sendMessage(status) + if (status.failed) return false if (status.isTempBasalInProgress) { rxBus.send(EventPumpStatusChanged(rh.gs(info.nightscout.pump.dana.R.string.stoppingtempbasal))) sendMessage(DanaRSPacketBasalSetCancelTemporaryBasal(injector)) @@ -414,6 +416,7 @@ class DanaRSService : DaggerService() { } val status = DanaRSPacketGeneralInitialScreenInformation(injector) sendMessage(status) + if (status.failed) return false if (status.isTempBasalInProgress) { rxBus.send(EventPumpStatusChanged(rh.gs(info.nightscout.pump.dana.R.string.stoppingtempbasal))) sendMessage(DanaRSPacketBasalSetCancelTemporaryBasal(injector))