diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/driver/ui/OmnipodUIPostprocessor.java b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/driver/ui/OmnipodUIPostprocessor.java index 12c2e5d427..4f5ba5d896 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/driver/ui/OmnipodUIPostprocessor.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/driver/ui/OmnipodUIPostprocessor.java @@ -9,6 +9,7 @@ import info.nightscout.androidaps.data.PumpEnactResult; import info.nightscout.androidaps.logging.L; import info.nightscout.androidaps.plugins.pump.omnipod.OmnipodPumpPlugin; import info.nightscout.androidaps.plugins.pump.omnipod.defs.OmnipodCustomActionType; +import info.nightscout.androidaps.plugins.pump.omnipod.defs.PodResponseType; import info.nightscout.androidaps.plugins.pump.omnipod.driver.OmnipodPumpStatus; /** @@ -51,6 +52,14 @@ public class OmnipodUIPostprocessor { } } break; + case CancelTemporaryBasal: { + pumpStatus.tempBasalStart = 0; + pumpStatus.tempBasalEnd = 0; + pumpStatus.tempBasalAmount = null; + pumpStatus.tempBasalLength = null; + } + break; + // case PairAndPrimePod: { // if (uiTask.returnData.success) { // omnipodPumpPlugin.setEnableCustomAction(OmnipodCustomActionType.PairAndPrime, false); @@ -82,6 +91,10 @@ public class OmnipodUIPostprocessor { } + + + + } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/driver/ui/OmnipodUITask.java b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/driver/ui/OmnipodUITask.java index 0617ac4a88..aafd5e960c 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/driver/ui/OmnipodUITask.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/driver/ui/OmnipodUITask.java @@ -30,7 +30,7 @@ public class OmnipodUITask { public PumpEnactResult returnData; private String errorDescription; private Object[] parameters; - private PodResponseType responseType; + public PodResponseType responseType; public Object returnDataObject; @@ -51,15 +51,9 @@ public class OmnipodUITask { LOG.debug("OmnipodUITask: @@@ In execute. {}", commandType); switch (commandType) { - // TODO add commands this is just sample -// case PumpModel: { -// returnData = communicationManager.getPumpModel(); -// } -// break; case PairAndPrimePod: returnData = communicationManager.initPod((PodInitActionType) parameters[0], (PodInitReceiver) parameters[1], null); -// TODO returnData = communicationManager.pairAndPrime(); break; case FillCanulaAndSetBasalProfile: @@ -72,7 +66,6 @@ public class OmnipodUITask { case ResetPodStatus: returnData = communicationManager.resetPodStatus(); -// TODO returnData = communicationManager.resetPodState(); break; case SetBasalProfile: @@ -85,7 +78,6 @@ public class OmnipodUITask { if (amount != null) returnData = communicationManager.setBolus(amount, isSmb); -// TODO returnData = communicationManager.bolus(amount); } break; @@ -96,12 +88,14 @@ public class OmnipodUITask { for(int i = 0; 3 > i; i++) { try { returnDataObject = communicationManager.readPulseLog(); + responseType = PodResponseType.Acknowledgment; break; } catch (Exception ex) { if (isLogEnabled()) { LOG.warn("Failed to retrieve pulse log", ex); } returnDataObject = null; + responseType = PodResponseType.Error; } } break; @@ -136,11 +130,14 @@ public class OmnipodUITask { default: { LOG.warn("This commandType is not supported (yet) - {}.", commandType); + responseType = PodResponseType.Error; } } - // TODO response + if (returnData!=null) { + responseType = returnData.success ? PodResponseType.Acknowledgment : PodResponseType.Error; + } }