diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/comm/message/response/podinfo/PodInfoDataLog.java b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/comm/message/response/podinfo/PodInfoDataLog.java index b8e28169d3..a8eebc7696 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/comm/message/response/podinfo/PodInfoDataLog.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/comm/message/response/podinfo/PodInfoDataLog.java @@ -7,12 +7,12 @@ import java.util.Collections; import java.util.List; import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil; -import info.nightscout.androidaps.plugins.pump.omnipod.defs.FaultEventCode; +import info.nightscout.androidaps.plugins.pump.omnipod.defs.FaultEventType; import info.nightscout.androidaps.plugins.pump.omnipod.defs.PodInfoType; public class PodInfoDataLog extends PodInfo { private static final int MINIMUM_MESSAGE_LENGTH = 8; - private final FaultEventCode faultEventCode; + private final FaultEventType faultEventType; private final Duration timeFaultEvent; private final Duration timeSinceActivation; private final byte dataChunkSize; @@ -26,7 +26,7 @@ public class PodInfoDataLog extends PodInfo { throw new IllegalArgumentException("Not enough data"); } - faultEventCode = FaultEventCode.fromByte(encodedData[1]); + faultEventType = FaultEventType.fromByte(encodedData[1]); timeFaultEvent = Duration.standardMinutes(ByteUtil.toInt(encodedData[2], encodedData[3])); timeSinceActivation = Duration.standardMinutes(ByteUtil.toInt(encodedData[4], encodedData[5])); dataChunkSize = encodedData[6]; @@ -45,8 +45,8 @@ public class PodInfoDataLog extends PodInfo { return PodInfoType.DATA_LOG; } - public FaultEventCode getFaultEventCode() { - return faultEventCode; + public FaultEventType getFaultEventType() { + return faultEventType; } public Duration getTimeFaultEvent() { @@ -72,7 +72,7 @@ public class PodInfoDataLog extends PodInfo { @Override public String toString() { return "PodInfoDataLog{" + - "faultEventCode=" + faultEventCode + + "faultEventType=" + faultEventType + ", timeFaultEvent=" + timeFaultEvent + ", timeSinceActivation=" + timeSinceActivation + ", dataChunkSize=" + dataChunkSize + diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/comm/message/response/podinfo/PodInfoFaultAndInitializationTime.java b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/comm/message/response/podinfo/PodInfoFaultAndInitializationTime.java index 2fd1d90406..747b5e821b 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/comm/message/response/podinfo/PodInfoFaultAndInitializationTime.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/comm/message/response/podinfo/PodInfoFaultAndInitializationTime.java @@ -3,12 +3,12 @@ package info.nightscout.androidaps.plugins.pump.omnipod.comm.message.response.po import org.joda.time.DateTime; import org.joda.time.Duration; -import info.nightscout.androidaps.plugins.pump.omnipod.defs.FaultEventCode; +import info.nightscout.androidaps.plugins.pump.omnipod.defs.FaultEventType; import info.nightscout.androidaps.plugins.pump.omnipod.defs.PodInfoType; public class PodInfoFaultAndInitializationTime extends PodInfo { private static final int MINIMUM_MESSAGE_LENGTH = 17; - private final FaultEventCode faultEventCode; + private final FaultEventType faultEventType; private final Duration timeFaultEvent; private final DateTime initializationTime; @@ -19,7 +19,7 @@ public class PodInfoFaultAndInitializationTime extends PodInfo { throw new IllegalArgumentException("Not enough data"); } - faultEventCode = FaultEventCode.fromByte(encodedData[1]); + faultEventType = FaultEventType.fromByte(encodedData[1]); timeFaultEvent = Duration.standardMinutes(((encodedData[2] & 0b1) << 8) + encodedData[3]); // We ignore time zones here because we don't keep the time zone in which the pod was initially set up // Which is fine because we don't use the initialization time for anything important anyway @@ -31,8 +31,8 @@ public class PodInfoFaultAndInitializationTime extends PodInfo { return PodInfoType.FAULT_AND_INITIALIZATION_TIME; } - public FaultEventCode getFaultEventCode() { - return faultEventCode; + public FaultEventType getFaultEventType() { + return faultEventType; } public Duration getTimeFaultEvent() { @@ -46,7 +46,7 @@ public class PodInfoFaultAndInitializationTime extends PodInfo { @Override public String toString() { return "PodInfoFaultAndInitializationTime{" + - "faultEventCode=" + faultEventCode + + "faultEventType=" + faultEventType + ", timeFaultEvent=" + timeFaultEvent + ", initializationTime=" + initializationTime + '}'; diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/comm/message/response/podinfo/PodInfoFaultEvent.java b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/comm/message/response/podinfo/PodInfoFaultEvent.java index 129ef989bb..9db41a12f7 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/comm/message/response/podinfo/PodInfoFaultEvent.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/comm/message/response/podinfo/PodInfoFaultEvent.java @@ -5,7 +5,7 @@ import org.joda.time.Duration; import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil; import info.nightscout.androidaps.plugins.pump.omnipod.defs.AlertSet; import info.nightscout.androidaps.plugins.pump.omnipod.defs.DeliveryStatus; -import info.nightscout.androidaps.plugins.pump.omnipod.defs.FaultEventCode; +import info.nightscout.androidaps.plugins.pump.omnipod.defs.FaultEventType; import info.nightscout.androidaps.plugins.pump.omnipod.defs.LogEventErrorCode; import info.nightscout.androidaps.plugins.pump.omnipod.defs.PodInfoType; import info.nightscout.androidaps.plugins.pump.omnipod.defs.PodProgressStatus; @@ -19,7 +19,7 @@ public class PodInfoFaultEvent extends PodInfo { private final double insulinNotDelivered; private final byte podMessageCounter; private final double totalInsulinDelivered; - private final FaultEventCode faultEventCode; + private final FaultEventType faultEventType; private final Duration faultEventTime; private final Double reservoirLevel; private final Duration timeSinceActivation; @@ -44,7 +44,7 @@ public class PodInfoFaultEvent extends PodInfo { insulinNotDelivered = OmnipodConst.POD_PULSE_SIZE * ByteUtil.toInt(encodedData[3], encodedData[4]); podMessageCounter = encodedData[5]; totalInsulinDelivered = OmnipodConst.POD_PULSE_SIZE * ByteUtil.toInt(encodedData[6], encodedData[7]); - faultEventCode = FaultEventCode.fromByte(encodedData[8]); + faultEventType = FaultEventType.fromByte(encodedData[8]); int minutesSinceActivation = ByteUtil.toInt(encodedData[9], encodedData[10]); if (minutesSinceActivation == 0xffff) { @@ -99,8 +99,8 @@ public class PodInfoFaultEvent extends PodInfo { return totalInsulinDelivered; } - public FaultEventCode getFaultEventCode() { - return faultEventCode; + public FaultEventType getFaultEventType() { + return faultEventType; } public Duration getFaultEventTime() { @@ -155,7 +155,7 @@ public class PodInfoFaultEvent extends PodInfo { ", insulinNotDelivered=" + insulinNotDelivered + ", podMessageCounter=" + podMessageCounter + ", totalInsulinDelivered=" + totalInsulinDelivered + - ", faultEventCode=" + faultEventCode + + ", faultEventType=" + faultEventType + ", faultEventTime=" + faultEventTime + ", reservoirLevel=" + reservoirLevel + ", timeSinceActivation=" + timeSinceActivation + diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/defs/FaultEventCode.java b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/defs/FaultEventType.java similarity index 95% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/defs/FaultEventCode.java rename to app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/defs/FaultEventType.java index df17fd0b5c..69a74aa4c4 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/defs/FaultEventCode.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/defs/FaultEventType.java @@ -2,7 +2,7 @@ package info.nightscout.androidaps.plugins.pump.omnipod.defs; import java.util.Locale; -public enum FaultEventCode { +public enum FaultEventType { NO_FAULTS((byte) 0x00), FAILED_FLASH_ERASE((byte) 0x01), FAILED_FLASH_STORE((byte) 0x02), @@ -124,17 +124,17 @@ public enum FaultEventCode { private byte value; - FaultEventCode(byte value) { + FaultEventType(byte value) { this.value = value; } - public static FaultEventCode fromByte(byte value) { - for (FaultEventCode type : values()) { + public static FaultEventType fromByte(byte value) { + for (FaultEventType type : values()) { if (type.value == value) { return type; } } - throw new IllegalArgumentException("Unknown FaultEventCode: " + value); + throw new IllegalArgumentException("Unknown FaultEventType: " + value); } public byte getValue() { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/defs/state/PodSessionState.java b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/defs/state/PodSessionState.java index 28069ae393..5e7446f0b3 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/defs/state/PodSessionState.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/defs/state/PodSessionState.java @@ -10,6 +10,7 @@ import java.util.HashMap; import java.util.Map; import info.nightscout.androidaps.plugins.pump.omnipod.comm.message.response.StatusResponse; +import info.nightscout.androidaps.plugins.pump.omnipod.comm.message.response.podinfo.PodInfoFaultEvent; import info.nightscout.androidaps.plugins.pump.omnipod.defs.AlertSet; import info.nightscout.androidaps.plugins.pump.omnipod.defs.AlertSlot; import info.nightscout.androidaps.plugins.pump.omnipod.defs.AlertType; @@ -215,6 +216,13 @@ public class PodSessionState extends PodState { return lastDeliveryStatus; } + @Override + public void setFaultEvent(PodInfoFaultEvent faultEvent) { + super.setFaultEvent(faultEvent); + suspended = true; + store(); + } + @Override public void updateFromStatusResponse(StatusResponse statusResponse) { DateTime activatedAtCalculated = getTime().minus(statusResponse.getTimeActive()); @@ -244,11 +252,7 @@ public class PodSessionState extends PodState { @Override public String toString() { return "PodSessionState{" + - "address=" + address + - ", packetNumber=" + packetNumber + - ", messageNumber=" + messageNumber + - ", faultEvent=" + faultEvent + - ", configuredAlerts=" + configuredAlerts + + "configuredAlerts=" + configuredAlerts + ", stateChangedHandler=" + stateChangedHandler + ", activatedAt=" + activatedAt + ", expiresAt=" + expiresAt + @@ -264,6 +268,10 @@ public class PodSessionState extends PodState { ", activeAlerts=" + activeAlerts + ", basalSchedule=" + basalSchedule + ", lastDeliveryStatus=" + lastDeliveryStatus + + ", address=" + address + + ", packetNumber=" + packetNumber + + ", messageNumber=" + messageNumber + + ", faultEvent=" + faultEvent + '}'; } } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/driver/comm/AapsOmnipodManager.java b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/driver/comm/AapsOmnipodManager.java index 5544d94ffa..3e70c7061a 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/driver/comm/AapsOmnipodManager.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/driver/comm/AapsOmnipodManager.java @@ -3,7 +3,6 @@ package info.nightscout.androidaps.plugins.pump.omnipod.driver.comm; import android.text.TextUtils; import org.apache.commons.lang3.StringUtils; -import org.jetbrains.annotations.NotNull; import org.joda.time.DateTime; import org.joda.time.Duration; import org.slf4j.Logger; @@ -18,7 +17,6 @@ import info.nightscout.androidaps.MainApp; import info.nightscout.androidaps.R; import info.nightscout.androidaps.data.Profile; import info.nightscout.androidaps.data.PumpEnactResult; -import info.nightscout.androidaps.db.DatabaseHelper; import info.nightscout.androidaps.db.Source; import info.nightscout.androidaps.db.TemporaryBasal; import info.nightscout.androidaps.events.Event; @@ -35,7 +33,7 @@ import info.nightscout.androidaps.plugins.pump.omnipod.comm.message.response.Sta import info.nightscout.androidaps.plugins.pump.omnipod.comm.message.response.podinfo.PodInfoResponse; import info.nightscout.androidaps.plugins.pump.omnipod.defs.AlertSlot; import info.nightscout.androidaps.plugins.pump.omnipod.defs.AlertType; -import info.nightscout.androidaps.plugins.pump.omnipod.defs.FaultEventCode; +import info.nightscout.androidaps.plugins.pump.omnipod.defs.FaultEventType; import info.nightscout.androidaps.plugins.pump.omnipod.defs.OmnipodCommunicationManagerInterface; import info.nightscout.androidaps.plugins.pump.omnipod.defs.PodInfoType; import info.nightscout.androidaps.plugins.pump.omnipod.defs.PodInitActionType; @@ -131,7 +129,7 @@ public class AapsOmnipodManager implements OmnipodCommunicationManagerInterface pumpStatus.lastBolusTime = lastBolusTime; pumpStatus.lastBolusAmount = lastBolusUnits; pumpStatus.reservoirRemainingUnits = podSessionState.getReservoirLevel() == null ? 75.0 : podSessionState.getReservoirLevel(); - pumpStatus.pumpStatusType = (podSessionState.hasFaultEvent() || podSessionState.isSuspended()) ? PumpStatusType.Suspended : PumpStatusType.Running; + pumpStatus.pumpStatusType = podSessionState.isSuspended() ? PumpStatusType.Suspended : PumpStatusType.Running; sendEvent(new EventOmnipodPumpValuesChanged()); } } @@ -143,7 +141,6 @@ public class AapsOmnipodManager implements OmnipodCommunicationManagerInterface return Math.abs(expectedUnitsRemaining - pumpStatus.reservoirRemainingUnits) < 0.000001; } - @NotNull private List translateActiveAlerts(PodSessionState podSessionState) { List alerts = new ArrayList<>(); for (AlertSlot alertSlot : podSessionState.getActiveAlerts().getAlertSlots()) { @@ -425,9 +422,9 @@ public class AapsOmnipodManager implements OmnipodCommunicationManagerInterface PodHistory podHistory = new PodHistory(requestTime, entryType); - if (data!=null) { + if (data != null) { if (data instanceof String) { - podHistory.setData((String)data); + podHistory.setData((String) data); } else { podHistory.setData(OmnipodUtil.getGsonInstance().toJson(data)); } @@ -487,9 +484,9 @@ public class AapsOmnipodManager implements OmnipodCommunicationManagerInterface comment = getStringResource(R.string.omnipod_driver_error_not_enough_data); } else if (ex instanceof PodFaultException) { // TODO handle pod fault with some kind of dialog that has a button to start pod deactivation - FaultEventCode faultEventCode = ((PodFaultException) ex).getFaultEvent().getFaultEventCode(); + FaultEventType faultEventType = ((PodFaultException) ex).getFaultEvent().getFaultEventType(); comment = getStringResource(R.string.omnipod_driver_error_pod_fault, - ByteUtil.convertUnsignedByteToInt(faultEventCode.getValue()), faultEventCode.name()); + ByteUtil.convertUnsignedByteToInt(faultEventType.getValue()), faultEventType.name()); } else if (ex instanceof PodReturnedErrorResponseException) { comment = getStringResource(R.string.omnipod_driver_error_pod_returned_error_response); } else { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/exception/PodFaultException.java b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/exception/PodFaultException.java index 0a90b5d092..77e6a9c900 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/exception/PodFaultException.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/exception/PodFaultException.java @@ -6,7 +6,7 @@ public class PodFaultException extends OmnipodException { private final PodInfoFaultEvent faultEvent; public PodFaultException(PodInfoFaultEvent faultEvent) { - super(faultEvent.getFaultEventCode().toString(), true); + super(faultEvent.getFaultEventType().toString(), true); this.faultEvent = faultEvent; } diff --git a/app/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/comm/message/response/podinfo/PodInfoDataLogTest.java b/app/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/comm/message/response/podinfo/PodInfoDataLogTest.java index 5db87003bc..522aec3f48 100644 --- a/app/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/comm/message/response/podinfo/PodInfoDataLogTest.java +++ b/app/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/comm/message/response/podinfo/PodInfoDataLogTest.java @@ -4,7 +4,7 @@ import org.joda.time.Duration; import org.junit.Test; import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil; -import info.nightscout.androidaps.plugins.pump.omnipod.defs.FaultEventCode; +import info.nightscout.androidaps.plugins.pump.omnipod.defs.FaultEventType; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; @@ -14,7 +14,7 @@ public class PodInfoDataLogTest { public void testDecoding() { PodInfoDataLog podInfoDataLog = new PodInfoDataLog(ByteUtil.fromHexString("030100010001043c"), 8); // From https://github.com/ps2/rileylink_ios/blob/omnipod-testing/OmniKitTests/PodInfoTests.swift - assertEquals(FaultEventCode.FAILED_FLASH_ERASE, podInfoDataLog.getFaultEventCode()); + assertEquals(FaultEventType.FAILED_FLASH_ERASE, podInfoDataLog.getFaultEventType()); assertTrue(Duration.standardMinutes(1).isEqual(podInfoDataLog.getTimeFaultEvent())); assertTrue(Duration.standardMinutes(1).isEqual(podInfoDataLog.getTimeSinceActivation())); assertEquals(4, podInfoDataLog.getDataChunkSize()); diff --git a/app/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/comm/message/response/podinfo/PodInfoFaultAndInitializationTimeTest.java b/app/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/comm/message/response/podinfo/PodInfoFaultAndInitializationTimeTest.java index a7baff4f06..a7288689a3 100644 --- a/app/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/comm/message/response/podinfo/PodInfoFaultAndInitializationTimeTest.java +++ b/app/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/comm/message/response/podinfo/PodInfoFaultAndInitializationTimeTest.java @@ -5,7 +5,7 @@ import org.joda.time.Duration; import org.junit.Test; import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil; -import info.nightscout.androidaps.plugins.pump.omnipod.defs.FaultEventCode; +import info.nightscout.androidaps.plugins.pump.omnipod.defs.FaultEventType; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; @@ -15,7 +15,7 @@ public class PodInfoFaultAndInitializationTimeTest { public void testDecoding() { PodInfoFaultAndInitializationTime podInfoFaultAndInitializationTime = new PodInfoFaultAndInitializationTime(ByteUtil.fromHexString("059200010000000000000000091912170e")); // From https://github.com/ps2/rileylink_ios/blob/omnipod-testing/OmniKitTests/PodInfoTests.swift - assertEquals(FaultEventCode.BAD_PUMP_REQ_2_STATE, podInfoFaultAndInitializationTime.getFaultEventCode()); + assertEquals(FaultEventType.BAD_PUMP_REQ_2_STATE, podInfoFaultAndInitializationTime.getFaultEventType()); assertTrue(Duration.standardMinutes(1).isEqual(podInfoFaultAndInitializationTime.getTimeFaultEvent())); DateTime dateTime = podInfoFaultAndInitializationTime.getInitializationTime(); diff --git a/app/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/comm/message/response/podinfo/PodInfoFaultEventTest.java b/app/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/comm/message/response/podinfo/PodInfoFaultEventTest.java index a754937ef7..4acd7f9ac4 100644 --- a/app/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/comm/message/response/podinfo/PodInfoFaultEventTest.java +++ b/app/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/comm/message/response/podinfo/PodInfoFaultEventTest.java @@ -5,7 +5,7 @@ import org.junit.Test; import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil; import info.nightscout.androidaps.plugins.pump.omnipod.defs.DeliveryStatus; -import info.nightscout.androidaps.plugins.pump.omnipod.defs.FaultEventCode; +import info.nightscout.androidaps.plugins.pump.omnipod.defs.FaultEventType; import info.nightscout.androidaps.plugins.pump.omnipod.defs.LogEventErrorCode; import info.nightscout.androidaps.plugins.pump.omnipod.defs.PodProgressStatus; @@ -24,7 +24,7 @@ public class PodInfoFaultEventTest { assertEquals(DeliveryStatus.NORMAL, podInfoFaultEvent.getDeliveryStatus()); assertEquals(0, podInfoFaultEvent.getInsulinNotDelivered(), 0.000001); assertEquals(0x0a, podInfoFaultEvent.getPodMessageCounter()); - assertEquals(FaultEventCode.NO_FAULTS, podInfoFaultEvent.getFaultEventCode()); + assertEquals(FaultEventType.NO_FAULTS, podInfoFaultEvent.getFaultEventType()); assertTrue(Duration.ZERO.isEqual(podInfoFaultEvent.getFaultEventTime())); assertNull(podInfoFaultEvent.getReservoirLevel()); assertTrue(Duration.standardSeconds(8100).isEqual(podInfoFaultEvent.getTimeSinceActivation())); @@ -44,7 +44,7 @@ public class PodInfoFaultEventTest { assertEquals(DeliveryStatus.SUSPENDED, podInfoFaultEvent.getDeliveryStatus()); assertEquals(0, podInfoFaultEvent.getInsulinNotDelivered(), 0.000001); assertEquals(0x09, podInfoFaultEvent.getPodMessageCounter()); - assertEquals(FaultEventCode.PRIME_OPEN_COUNT_TOO_LOW, podInfoFaultEvent.getFaultEventCode()); + assertEquals(FaultEventType.PRIME_OPEN_COUNT_TOO_LOW, podInfoFaultEvent.getFaultEventType()); assertTrue(Duration.standardSeconds(60).isEqual(podInfoFaultEvent.getFaultEventTime())); assertNull(podInfoFaultEvent.getReservoirLevel()); assertTrue(Duration.standardSeconds(60).isEqual(podInfoFaultEvent.getTimeSinceActivation())); @@ -65,7 +65,7 @@ public class PodInfoFaultEventTest { assertEquals(101.7, podInfoFaultEvent.getTotalInsulinDelivered(), 0.000001); assertEquals(0, podInfoFaultEvent.getInsulinNotDelivered(), 0.000001); assertEquals(0x04, podInfoFaultEvent.getPodMessageCounter()); - assertEquals(FaultEventCode.BASAL_OVER_INFUSION_PULSE, podInfoFaultEvent.getFaultEventCode()); + assertEquals(FaultEventType.BASAL_OVER_INFUSION_PULSE, podInfoFaultEvent.getFaultEventType()); assertTrue(Duration.standardMinutes(2559).isEqual(podInfoFaultEvent.getFaultEventTime())); assertNull(podInfoFaultEvent.getReservoirLevel()); assertEquals(0, podInfoFaultEvent.getUnacknowledgedAlerts().getRawValue()); @@ -85,7 +85,7 @@ public class PodInfoFaultEventTest { assertEquals(11.8, podInfoFaultEvent.getTotalInsulinDelivered(), 0.000001); assertEquals(0.05, podInfoFaultEvent.getInsulinNotDelivered(), 0.000001); assertEquals(0x02, podInfoFaultEvent.getPodMessageCounter()); - assertEquals(FaultEventCode.OCCLUSION_CHECK_ABOVE_THRESHOLD, podInfoFaultEvent.getFaultEventCode()); + assertEquals(FaultEventType.OCCLUSION_CHECK_ABOVE_THRESHOLD, podInfoFaultEvent.getFaultEventType()); assertTrue(Duration.standardMinutes(616).isEqual(podInfoFaultEvent.getFaultEventTime())); assertNull(podInfoFaultEvent.getReservoirLevel()); assertEquals(0, podInfoFaultEvent.getUnacknowledgedAlerts().getRawValue());