From 6cee6c0f51c66aa9eb1dd97e3920efa0b6e46aac Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Mon, 18 Sep 2017 12:59:56 +0200 Subject: [PATCH] RS extended disabled warning --- .../comm/DanaRS_Packet_Bolus_Get_Bolus_Option.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaRS/comm/DanaRS_Packet_Bolus_Get_Bolus_Option.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaRS/comm/DanaRS_Packet_Bolus_Get_Bolus_Option.java index 068d672646..61296f42ed 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaRS/comm/DanaRS_Packet_Bolus_Get_Bolus_Option.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaRS/comm/DanaRS_Packet_Bolus_Get_Bolus_Option.java @@ -5,6 +5,12 @@ import org.slf4j.LoggerFactory; import info.nightscout.androidaps.Config; import com.cozmo.danar.util.BleCommandUtil; + +import info.nightscout.androidaps.MainApp; +import info.nightscout.androidaps.R; +import info.nightscout.androidaps.plugins.Overview.Notification; +import info.nightscout.androidaps.plugins.Overview.events.EventDismissNotification; +import info.nightscout.androidaps.plugins.Overview.events.EventNewNotification; import info.nightscout.androidaps.plugins.PumpDanaR.DanaRPump; public class DanaRS_Packet_Bolus_Get_Bolus_Option extends DanaRS_Packet { @@ -95,6 +101,13 @@ public class DanaRS_Packet_Bolus_Get_Bolus_Option extends DanaRS_Packet { dataSize = 1; int missedBolus04EndMin = byteArrayToInt(getBytes(data, dataIndex, dataSize)); + if (!pump.isExtendedBolusEnabled) { + Notification notification = new Notification(Notification.EXTENDED_BOLUS_DISABLED, MainApp.sResources.getString(R.string.danar_enableextendedbolus), Notification.URGENT); + MainApp.bus().post(new EventNewNotification(notification)); + } else { + MainApp.bus().post(new EventDismissNotification(Notification.EXTENDED_BOLUS_DISABLED)); + } + if (Config.logDanaMessageDetail) { log.debug("Extended bolus enabled: " + pump.isExtendedBolusEnabled); log.debug("Missed bolus config: " + pump.missedBolusConfig);